Move verilog-src to src, src/alu.v to src/alu/alu.v

This commit is contained in:
xenia 2024-01-17 13:37:02 +01:00
parent 69c367c344
commit fb65ccc713
7 changed files with 4 additions and 4 deletions

View File

@ -15,9 +15,9 @@
vflags = ''-Wpedantic -Wwarn-lint -Wwarn-style -Wno-PINCONNECTEMPTY -CFLAGS "-Wpedantic -std=c++20"''; vflags = ''-Wpedantic -Wwarn-lint -Wwarn-style -Wno-PINCONNECTEMPTY -CFLAGS "-Wpedantic -std=c++20"'';
verilate-src = cmd: '' verilate-src = cmd: ''
cp -r ${./verilog-src} ./verilog-src cp -r ${./src} ./src
cp -r ${./simulation} ./simulation cp -r ${./simulation} ./simulation
find ./verilog-src/ -name '*.v' -exec ${verilator}/bin/verilator ${vflags} ${cmd} {} + find ./src/ -name '*.v' -exec ${verilator}/bin/verilator ${vflags} ${cmd} {} +
''; '';
lint = pkgs.runCommand "lint" {} '' lint = pkgs.runCommand "lint" {} ''
@ -27,14 +27,14 @@
''; '';
alu-sim = pkgs.runCommandCC "alu-sim" {} '' alu-sim = pkgs.runCommandCC "alu-sim" {} ''
${verilate-src "--cc --build --exe ./simulation/tester.cpp ./simulation/test_alu.cpp"} ${verilate-src "--cc --build --exe ./simulation/tester.cpp ./simulation/test_alu.cpp -top alu"}
mv obj_dir "$out" mv obj_dir "$out"
mkdir "$out/bin" && cp "$out/Valu" "$out/bin/alu-sim" mkdir "$out/bin" && cp "$out/Valu" "$out/bin/alu-sim"
''; '';
alu-synth = pkgs.runCommandCC "alu-synth" {} '' alu-synth = pkgs.runCommandCC "alu-synth" {} ''
mkdir -p "$out" mkdir -p "$out"
find ${./verilog-src} -name '*.v' -exec ${yosys}/bin/yosys -Q -p "synth_ice40 -top topmost -json $out/synth.json -dsp" {} + find ${./src} -name '*.v' -exec ${yosys}/bin/yosys -Q -p "synth_ice40 -top topmost -json $out/synth.json -dsp" {} +
''; '';
alu-synth-view = pkgs.writeScriptBin "alu-synth-view" '' alu-synth-view = pkgs.writeScriptBin "alu-synth-view" ''