From fb65ccc7139240df70b0abc0d49f1c20dc0705a4 Mon Sep 17 00:00:00 2001 From: xenia Date: Wed, 17 Jan 2024 13:37:02 +0100 Subject: [PATCH] Move verilog-src to src, src/alu.v to src/alu/alu.v --- flake.nix | 8 ++++---- {verilog-src => src/alu}/alu.v | 0 {verilog-src => src}/alu/carry_select_adder.v | 0 {verilog-src => src}/alu/carry_select_block.v | 0 {verilog-src => src}/alu/fa.v | 0 {verilog-src => src}/alu/multiplier.v | 0 {verilog-src => src}/topmost.v | 0 7 files changed, 4 insertions(+), 4 deletions(-) rename {verilog-src => src/alu}/alu.v (100%) rename {verilog-src => src}/alu/carry_select_adder.v (100%) rename {verilog-src => src}/alu/carry_select_block.v (100%) rename {verilog-src => src}/alu/fa.v (100%) rename {verilog-src => src}/alu/multiplier.v (100%) rename {verilog-src => src}/topmost.v (100%) diff --git a/flake.nix b/flake.nix index 0561e2b..8a9b2f0 100644 --- a/flake.nix +++ b/flake.nix @@ -15,9 +15,9 @@ vflags = ''-Wpedantic -Wwarn-lint -Wwarn-style -Wno-PINCONNECTEMPTY -CFLAGS "-Wpedantic -std=c++20"''; verilate-src = cmd: '' - cp -r ${./verilog-src} ./verilog-src + cp -r ${./src} ./src 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" {} '' @@ -27,14 +27,14 @@ ''; 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" mkdir "$out/bin" && cp "$out/Valu" "$out/bin/alu-sim" ''; alu-synth = pkgs.runCommandCC "alu-synth" {} '' 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" '' diff --git a/verilog-src/alu.v b/src/alu/alu.v similarity index 100% rename from verilog-src/alu.v rename to src/alu/alu.v diff --git a/verilog-src/alu/carry_select_adder.v b/src/alu/carry_select_adder.v similarity index 100% rename from verilog-src/alu/carry_select_adder.v rename to src/alu/carry_select_adder.v diff --git a/verilog-src/alu/carry_select_block.v b/src/alu/carry_select_block.v similarity index 100% rename from verilog-src/alu/carry_select_block.v rename to src/alu/carry_select_block.v diff --git a/verilog-src/alu/fa.v b/src/alu/fa.v similarity index 100% rename from verilog-src/alu/fa.v rename to src/alu/fa.v diff --git a/verilog-src/alu/multiplier.v b/src/alu/multiplier.v similarity index 100% rename from verilog-src/alu/multiplier.v rename to src/alu/multiplier.v diff --git a/verilog-src/topmost.v b/src/topmost.v similarity index 100% rename from verilog-src/topmost.v rename to src/topmost.v