From e8b182e54baeb55f91c00ed89021df56e1668ee5 Mon Sep 17 00:00:00 2001 From: xtof Date: Thu, 12 Jun 2025 16:35:07 +0200 Subject: [PATCH 01/10] set path --- benchs/vexriscv/synth.ys | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/benchs/vexriscv/synth.ys b/benchs/vexriscv/synth.ys index 8638ba9..d7976e8 100644 --- a/benchs/vexriscv/synth.ys +++ b/benchs/vexriscv/synth.ys @@ -1,4 +1,5 @@ +set design "$::env(DESIGN_HOME)/vexriscv.demo.GenFull.v" yosys -import -read_verilog vexriscv.demo.GenFull.v -synth_xilinx -top vexriscv.demo.GenFull +read_verilog +synth_xilinx -top "$design" write_verilog naja_netlist.v From 128ec622950cd86ed9d04759c40000dabce3e966 Mon Sep 17 00:00:00 2001 From: xtof Date: Thu, 12 Jun 2025 16:38:38 +0200 Subject: [PATCH 02/10] fix path --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index ad87b52..9a12afc 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,11 +7,11 @@ DESIGN_HOME="$2" DESIGN_CONFIG="$3" export YOSYS_EXE="/yosys/bin/yosys" +export DESIGN_HOME="$ROOT/$DESIGN_HOME" export DESIGN_CONFIG="$ROOT/$DESIGN_CONFIG" if [ "$MODE" == "orfs" ]; then echo "Running in ORFS mode" - export DESIGN_HOME="$ROOT/$DESIGN_HOME" LIBERTY_FILE="/najaeda-or/flow/objects/nangate45/bp/base/lib/*.lib" VERILOG_FILE="/najaeda-or/flow/results/nangate45/bp/base/1_synth.v" cd /najaeda-or/flow && make synth From 1198b1b0b64d1e4cd83ed028284c5740ad3c57d5 Mon Sep 17 00:00:00 2001 From: xtof Date: Thu, 12 Jun 2025 16:45:37 +0200 Subject: [PATCH 03/10] fix --- benchs/vexriscv/synth.ys | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchs/vexriscv/synth.ys b/benchs/vexriscv/synth.ys index d7976e8..8051d2a 100644 --- a/benchs/vexriscv/synth.ys +++ b/benchs/vexriscv/synth.ys @@ -1,5 +1,5 @@ set design "$::env(DESIGN_HOME)/vexriscv.demo.GenFull.v" yosys -import -read_verilog -synth_xilinx -top "$design" +read_verilog "$design" +synth_xilinx -top vexriscv.demo.GenFull write_verilog naja_netlist.v From 4ba7c0e18e66678e8db7dabd11b7ef9530de9135 Mon Sep 17 00:00:00 2001 From: xtof Date: Thu, 12 Jun 2025 18:39:31 +0200 Subject: [PATCH 04/10] fix log --- entrypoint.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 9a12afc..0003e6b 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -10,18 +10,27 @@ export YOSYS_EXE="/yosys/bin/yosys" export DESIGN_HOME="$ROOT/$DESIGN_HOME" export DESIGN_CONFIG="$ROOT/$DESIGN_CONFIG" +echo "Installing tools..." +apk add curl +echo "::endgroup::" + if [ "$MODE" == "orfs" ]; then - echo "Running in ORFS mode" + echo "::group::Naja-ORFS" + echo "Naja ORFS mode selected" LIBERTY_FILE="/najaeda-or/flow/objects/nangate45/bp/base/lib/*.lib" VERILOG_FILE="/najaeda-or/flow/results/nangate45/bp/base/1_synth.v" cd /najaeda-or/flow && make synth echo "Liberty file: $LIBERTY_FILE" echo "$(ls /najaeda-or/flow/objects/nangate45/bp/base/lib)" echo "Verilog file: $VERILOG_FILE" + echo "::endgroup::" + echo "::group::Launching-Najaeda" python3 /najaeda_scripts/count_leaves.py --primitives_mode="liberty" --liberty "$LIBERTY_FILE" --verilog "$VERILOG_FILE" + echo "::endgroup::" else - echo "Running in direct yosys mode" + echo "::group::Naja-Direct-Yosys" + echo "Naja Direct Yosys mode selected" echo "Yosys executable: $YOSYS_EXE" echo "Yosys version: $($YOSYS_EXE -V)" echo "Design config: $DESIGN_CONFIG" @@ -32,6 +41,9 @@ else $YOSYS_EXE -c "$DESIGN_CONFIG" VERILOG_FILE="naja_netlist.v" echo "Verilog file: $VERILOG_FILE" + echo "::endgroup::" + echo "::group::Launching-Najaeda" python3 /najaeda_scripts/count_leaves.py --primitives_mode="xilinx" --verilog "$VERILOG_FILE" + echo "::endgroup::" fi From 6f56c06cbad21693e2f90599795e63b9f8a82c33 Mon Sep 17 00:00:00 2001 From: xtof Date: Thu, 12 Jun 2025 18:41:28 +0200 Subject: [PATCH 05/10] typo --- entrypoint.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 0003e6b..623b669 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -10,10 +10,6 @@ export YOSYS_EXE="/yosys/bin/yosys" export DESIGN_HOME="$ROOT/$DESIGN_HOME" export DESIGN_CONFIG="$ROOT/$DESIGN_CONFIG" -echo "Installing tools..." -apk add curl -echo "::endgroup::" - if [ "$MODE" == "orfs" ]; then echo "::group::Naja-ORFS" echo "Naja ORFS mode selected" From d14960504a774e4c3adbdf59588af59de24b6b41 Mon Sep 17 00:00:00 2001 From: xtof Date: Tue, 17 Jun 2025 13:22:05 +0200 Subject: [PATCH 06/10] test upload of design stats --- .github/workflows/test_direct.yml | 8 +++++++- entrypoint.sh | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_direct.yml b/.github/workflows/test_direct.yml index 4fc0cfb..dc540b7 100644 --- a/.github/workflows/test_direct.yml +++ b/.github/workflows/test_direct.yml @@ -30,4 +30,10 @@ jobs: with: mode: "direct" design_home: "benchs/vexriscv" - design_config: "benchs/vexriscv/synth.ys" \ No newline at end of file + design_config: "benchs/vexriscv/synth.ys" + + - name: Upload design.stats + uses: actions/upload-artifact@v4 + with: + name: design-stats + path: design.stats \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 623b669..0131aa1 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -23,7 +23,10 @@ if [ "$MODE" == "orfs" ]; then echo "::group::Launching-Najaeda" python3 /najaeda_scripts/count_leaves.py --primitives_mode="liberty" --liberty "$LIBERTY_FILE" --verilog "$VERILOG_FILE" + cp /najaeda_scripts/output/design.stats /github/workspace/design.stats echo "::endgroup::" + + echo "Done!" else echo "::group::Naja-Direct-Yosys" echo "Naja Direct Yosys mode selected" @@ -41,5 +44,8 @@ else echo "::group::Launching-Najaeda" python3 /najaeda_scripts/count_leaves.py --primitives_mode="xilinx" --verilog "$VERILOG_FILE" + cp /najaeda_scripts/output/design.stats /github/workspace/design.stats echo "::endgroup::" + + echo "Done!" fi From 47d1c9355b1d8c59b12462444eb2159ad44a556c Mon Sep 17 00:00:00 2001 From: xtof Date: Tue, 17 Jun 2025 13:23:47 +0200 Subject: [PATCH 07/10] fix path --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 0131aa1..d25407a 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -23,7 +23,7 @@ if [ "$MODE" == "orfs" ]; then echo "::group::Launching-Najaeda" python3 /najaeda_scripts/count_leaves.py --primitives_mode="liberty" --liberty "$LIBERTY_FILE" --verilog "$VERILOG_FILE" - cp /najaeda_scripts/output/design.stats /github/workspace/design.stats + cp /najaeda_scripts/design.stats /github/workspace/design.stats echo "::endgroup::" echo "Done!" @@ -44,7 +44,7 @@ else echo "::group::Launching-Najaeda" python3 /najaeda_scripts/count_leaves.py --primitives_mode="xilinx" --verilog "$VERILOG_FILE" - cp /najaeda_scripts/output/design.stats /github/workspace/design.stats + cp /najaeda_scripts/design.stats /github/workspace/design.stats echo "::endgroup::" echo "Done!" From da265a7da3c118463b2ec3d844b9e1829efc1ae6 Mon Sep 17 00:00:00 2001 From: xtof Date: Tue, 17 Jun 2025 13:26:54 +0200 Subject: [PATCH 08/10] fix path --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index d25407a..19a9503 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -23,7 +23,7 @@ if [ "$MODE" == "orfs" ]; then echo "::group::Launching-Najaeda" python3 /najaeda_scripts/count_leaves.py --primitives_mode="liberty" --liberty "$LIBERTY_FILE" --verilog "$VERILOG_FILE" - cp /najaeda_scripts/design.stats /github/workspace/design.stats + cp /naja-run/design.stats /github/workspace/design.stats echo "::endgroup::" echo "Done!" @@ -44,7 +44,7 @@ else echo "::group::Launching-Najaeda" python3 /najaeda_scripts/count_leaves.py --primitives_mode="xilinx" --verilog "$VERILOG_FILE" - cp /najaeda_scripts/design.stats /github/workspace/design.stats + cp /naja-run/design.stats /github/workspace/design.stats echo "::endgroup::" echo "Done!" From cd468bad74fcfc56da083ec8856d2826241e3eb6 Mon Sep 17 00:00:00 2001 From: xtof Date: Tue, 17 Jun 2025 13:31:05 +0200 Subject: [PATCH 09/10] fix path again --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 19a9503..ff6fd30 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -23,7 +23,7 @@ if [ "$MODE" == "orfs" ]; then echo "::group::Launching-Najaeda" python3 /najaeda_scripts/count_leaves.py --primitives_mode="liberty" --liberty "$LIBERTY_FILE" --verilog "$VERILOG_FILE" - cp /naja-run/design.stats /github/workspace/design.stats + cp design.stats /github/workspace/design.stats echo "::endgroup::" echo "Done!" @@ -44,7 +44,7 @@ else echo "::group::Launching-Najaeda" python3 /najaeda_scripts/count_leaves.py --primitives_mode="xilinx" --verilog "$VERILOG_FILE" - cp /naja-run/design.stats /github/workspace/design.stats + cp design.stats /github/workspace/design.stats echo "::endgroup::" echo "Done!" From 04811f154a9e18cb53c4500fdf1bf0cc6b864c77 Mon Sep 17 00:00:00 2001 From: Christophe Alexandre Date: Fri, 27 Jun 2025 12:20:07 +0200 Subject: [PATCH 10/10] Update count_leaves.py --- najaeda_scripts/count_leaves.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/najaeda_scripts/count_leaves.py b/najaeda_scripts/count_leaves.py index 8ddf703..b3c7ca1 100644 --- a/najaeda_scripts/count_leaves.py +++ b/najaeda_scripts/count_leaves.py @@ -63,6 +63,7 @@ def parse(s): netlist.load_liberty(liberty_files) top = netlist.load_verilog([args.verilog]) +netlist.apply_dle() def count_leaves(instance, leaves): if instance.is_leaf(): @@ -92,4 +93,4 @@ def count_leaves(instance, leaves): design_stats_file.close() end_time = time.time() logging.info(f"Design stats dumped to design.stats in {end_time - start_time:.2f} seconds") -sys.exit(0) \ No newline at end of file +sys.exit(0)