From 647669010b4c4c30b64d4c74f4728f2c8244c560 Mon Sep 17 00:00:00 2001 From: Jiuyang Liu Date: Thu, 22 Aug 2024 11:06:06 +0800 Subject: [PATCH] [nix] fix generated filelist --- nix/t1/rtl.nix | 10 ++++------ nix/t1/verilated.nix | 4 +++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nix/t1/rtl.nix b/nix/t1/rtl.nix index 5b9d43369..56c02af19 100644 --- a/nix/t1/rtl.nix +++ b/nix/t1/rtl.nix @@ -22,13 +22,11 @@ stdenvNoCC.mkDerivation { firtool ${mlirbc}/${mlirbc.elaborateTarget}-${mlirbc.elaborateConfig}-lowered.mlirbc \ -o $out ${mfcArgs} '' + lib.optionalString fixupFilelist '' - # For ipemu, there are also some manually generated system verilog file for test bench. - # Those files are now recorded in a individual file list. - # However, verilator still expect on "filelist.f" file to record all the system verilog file. - # Below is a fix that concat them into one file to make verilator happy. + # FIXME: https://github.com/llvm/circt/pull/7543 echo "Fixing generated filelist.f" - cp $out/filelist.f original.f - cat $out/firrtl_black_box_resource_files.f original.f > $out/filelist.f + pushd $out + find . -mindepth 1 -name '*.sv' -type f > $out/filelist.f + popd ''; meta.description = "All the elaborated system verilog files for ${mlirbc.elaborateTarget} with ${mlirbc.elaborateConfig} config."; diff --git a/nix/t1/verilated.nix b/nix/t1/verilated.nix index 498c2ea9b..95e828566 100644 --- a/nix/t1/verilated.nix +++ b/nix/t1/verilated.nix @@ -22,10 +22,12 @@ stdenv.mkDerivation { echo "[nix] running verilator" verilator \ ${lib.optionalString enable-trace "--trace-fst"} \ + --cc \ --timing \ --threads 8 \ -O1 \ - --cc TestBench + -F filelist.f \ + --top TestBench echo "[nix] building verilated C lib"