Compare commits
2 Commits
65a0dccb33
...
3d09ba0dbd
Author | SHA1 | Date | |
---|---|---|---|
3d09ba0dbd | |||
f475483803 |
30
flake.nix
30
flake.nix
|
@ -26,28 +26,28 @@
|
|||
: 3 > $out
|
||||
'';
|
||||
|
||||
alu-sim = pkgs.runCommandCC "alu-sim" {} ''
|
||||
alu-test = pkgs.runCommandCC "alu-test" {} ''
|
||||
${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"
|
||||
mkdir "$out/bin" && cp "$out/Valu" "$out/bin/alu-test"
|
||||
'';
|
||||
|
||||
alu-sim-trace = pkgs.runCommandCC "alu-sim-trace" {} ''
|
||||
alu-test-trace = pkgs.runCommandCC "alu-test-trace" {} ''
|
||||
${verilate-src "--cc --build --exe --trace -CFLAGS -DTRACE=1 ./simulation/tester.cpp ./simulation/test_alu.cpp -top alu"}
|
||||
mv obj_dir "$out"
|
||||
mkdir "$out/bin" && cp "$out/Valu" "$out/bin/alu-sim"
|
||||
$out/bin/alu-sim $out/trace.vcd
|
||||
echo "${pkgs.gtkwave}/bin/gtkwave $out/trace.vcd" > $out/bin/alu-sim-trace
|
||||
chmod u+x $out/bin/alu-sim-trace
|
||||
echo "${pkgs.gtkwave}/bin/gtkwave $out/trace.vcd" > $out/bin/alu-test-trace
|
||||
chmod u+x $out/bin/alu-test-trace
|
||||
'';
|
||||
|
||||
alu-synth = pkgs.runCommandCC "alu-synth" {} ''
|
||||
synth = pkgs.runCommandCC "synth" {} ''
|
||||
mkdir -p "$out"
|
||||
find ${./src} -name '*.v' -exec ${yosys}/bin/yosys -f ' -sv' -Q -p "synth_ice40 -top topmost -json $out/synth.json -dsp" {} +
|
||||
find ${./src} -name '*.v' -exec ${yosys}/bin/yosys -f ' -sv' -Q -p "synth_ice40 -top topmost -json $out/synth.json" {} +
|
||||
'';
|
||||
|
||||
alu-synth-view = pkgs.writeScriptBin "alu-synth-view" ''
|
||||
${pkgs.nextpnrWithGui}/bin/nextpnr-ice40 --up5k --package sg48 --pcf ${./fpga-files/rot.pcf} --json ${alu-synth}/synth.json --gui
|
||||
pnr-interactive = pkgs.writeScriptBin "pnr-interactive" ''
|
||||
${pkgs.nextpnrWithGui}/bin/nextpnr-ice40 --up5k --package sg48 --pcf ${./fpga-files/rot.pcf} --json ${synth}/synth.json --gui
|
||||
'';
|
||||
|
||||
deps = [
|
||||
|
@ -58,15 +58,13 @@
|
|||
|
||||
packages.lint = lint;
|
||||
|
||||
packages.alu-sim = alu-sim;
|
||||
packages.alu-sim-trace = alu-sim-trace;
|
||||
packages.alu-test = alu-test;
|
||||
packages.alu-test-trace = alu-test-trace;
|
||||
|
||||
packages.alu-synth = alu-synth;
|
||||
packages.alu-synth-view = alu-synth-view;
|
||||
packages.synth = synth;
|
||||
packages.pnr-interactive = pnr-interactive;
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = deps;
|
||||
};
|
||||
devShells.default = pkgs.mkShell { packages = deps; };
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user