From 949523b1ee095674b2cd5dcdfc8145c19fd18a28 Mon Sep 17 00:00:00 2001 From: Simone Manoni Date: Thu, 6 Nov 2025 18:15:51 +0100 Subject: [PATCH 1/3] Fix flist generation for slang lint --- .gitlab-ci.yml | 2 +- Bender.yml | 19 ++++++++++++++++++- Makefile | 19 +++++++++++++++++-- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 061035f..403a538 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -66,7 +66,7 @@ slang: stage: lint script: - make cp-slang-all - - (! grep -n "error:" sim/gen/elab.log) + - (! grep -n "error:" lint/elab.log) artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA" diff --git a/Bender.yml b/Bender.yml index 55fb110..79a2e36 100644 --- a/Bender.yml +++ b/Bender.yml @@ -71,6 +71,23 @@ sources: - hw/pulp/control_pulp.sv - hw/pulp/control_pulp_fpga.sv + - target: all(lint_pms) + files: + - hw/ips/tech_cells_generic/src/rtl/tc_sram.sv + - hw/ips/tech_cells_generic/src/rtl/tc_sram_impl.sv + - hw/ips/tech_cells_generic/src/rtl/tc_clk.sv + - hw/ips/tech_cells_generic/src/deprecated/cluster_pwr_cells.sv + - hw/ips/tech_cells_generic/src/deprecated/generic_memory.sv + - hw/ips/tech_cells_generic/src/deprecated/generic_rom.sv + - hw/ips/tech_cells_generic/src/deprecated/pad_functional.sv + - hw/ips/tech_cells_generic/src/deprecated/pulp_buffer.sv + - hw/ips/tech_cells_generic/src/deprecated/pulp_pwr_cells.sv + - hw/ips/tech_cells_generic/src/tc_pwr.sv + - hw/ips/tech_cells_generic/test/tb_tc_sram.sv + - hw/ips/tech_cells_generic/src/deprecated/pulp_clock_gating_async.sv + - hw/ips/tech_cells_generic/src/deprecated/cluster_clk_cells.sv + - hw/ips/tech_cells_generic/src/deprecated/pulp_clk_cells.sv + # TB sources - target: any(test,simulation) files: @@ -133,7 +150,7 @@ sources: - tb/vip/i2c_eeprom/24FC1025.v # tech (gf22) - - target: gf22 + - target: all(gf22, not(lint_pms)) files: - nonfree/synth/gf22/sourcecode/tech_cells_gf22/pulp_power_gating.sv - nonfree/synth/gf22/sourcecode/tech_cells_gf22/cluster_clock_inverter.sv diff --git a/Makefile b/Makefile index c495a06..036048f 100644 --- a/Makefile +++ b/Makefile @@ -269,7 +269,7 @@ vcs-simc: # Slang # SLANG ?= oseda slang -SLANG_DIR ?= $(ROOT_DIR)/sim/gen +SLANG_DIR ?= $(ROOT_DIR)/lint SLANG_PARSE_LOG ?= $(SLANG_DIR)/parse.log SLANG_LINT_LOG ?= $(SLANG_DIR)/lint.log SLANG_ELAB_LOG ?= $(SLANG_DIR)/elab.log @@ -279,10 +279,13 @@ SLANG_FLAGS := -f cp.flist --timescale=1ns/1ns --top pms_top SLANG_FLAGS += -G SIM_STDOUT=0 -G USE_CLUSTER=1 -G CORE_TYPE=0 -G RISCY_FPU=1 SLANG_FLAGS += --relax-enum-conversions --allow-use-before-declare -Wno-error=duplicate-definition +BENDER_LINT_TARGETS += -t lint_pms + FORCE: $(SV_FLIST): FORCE $(ROOT_DIR)/Bender.yml $(ROOT_DIR)/Bender.lock - $(BENDER) script flist-plus $(BENDER_BASE_TARGETS) -D SYNTHESIS > $@ + mkdir lint + $(BENDER) script flist-plus $(BENDER_LINT_TARGETS) $(BENDER_SYNTH_TARGETS) $(BENDER_BASE_TARGETS) -D SYNTHESIS > $@ $(SLANG_PARSE_LOG): FORCE $(SV_FLIST) @cd $(SLANG_DIR) && $(SLANG) $(SLANG_FLAGS) --parse-only 2>&1 | tee $@ @@ -311,6 +314,18 @@ cp-slang-elaborate: FORCE $(SLANG_ELAB_LOG) ## All cp-slang-all: cp-slang-flist cp-slang-parse cp-slang-lint cp-slang-elaborate +# +# Spyglass +# +SNPS_SG ?= spyglass-2022.06 + +gen_sg_script: + mkdir -p spyglass/tmp + $(BENDER) script verilator $(BENDER_BASE_TARGETS) -D SYNTHESIS > lint/files + +cp-sg-lint: gen_sg_script lint/func.sgdc lint/run_lint.tcl + cd lint; $(SNPS_SG) sg_shell -tcl run_lint.tcl + # DPI libraries # From 901f965a7629778c76cdc60c177e27498204fc01 Mon Sep 17 00:00:00 2001 From: Simone Manoni Date: Fri, 7 Nov 2025 11:42:57 +0100 Subject: [PATCH 2/3] Avoid force on flist creation --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 036048f..bcd56cf 100644 --- a/Makefile +++ b/Makefile @@ -283,8 +283,8 @@ BENDER_LINT_TARGETS += -t lint_pms FORCE: -$(SV_FLIST): FORCE $(ROOT_DIR)/Bender.yml $(ROOT_DIR)/Bender.lock - mkdir lint +$(SV_FLIST): $(ROOT_DIR)/Bender.yml $(ROOT_DIR)/Bender.lock + mkdir -p lint $(BENDER) script flist-plus $(BENDER_LINT_TARGETS) $(BENDER_SYNTH_TARGETS) $(BENDER_BASE_TARGETS) -D SYNTHESIS > $@ $(SLANG_PARSE_LOG): FORCE $(SV_FLIST) From 03071a4298e28df9d8700d4a0847022437985276 Mon Sep 17 00:00:00 2001 From: Simone Manoni Date: Tue, 18 Nov 2025 13:02:31 +0100 Subject: [PATCH 3/3] Fix Makefile with filelist generation with abs path --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index bcd56cf..0404a77 100644 --- a/Makefile +++ b/Makefile @@ -286,17 +286,18 @@ FORCE: $(SV_FLIST): $(ROOT_DIR)/Bender.yml $(ROOT_DIR)/Bender.lock mkdir -p lint $(BENDER) script flist-plus $(BENDER_LINT_TARGETS) $(BENDER_SYNTH_TARGETS) $(BENDER_BASE_TARGETS) -D SYNTHESIS > $@ + sed -i 's?$(ROOT_DIR)?\$$CPROOT?g' $@ $(SLANG_PARSE_LOG): FORCE $(SV_FLIST) - @cd $(SLANG_DIR) && $(SLANG) $(SLANG_FLAGS) --parse-only 2>&1 | tee $@ + @cd $(SLANG_DIR) && CPROOT=$(ROOT_DIR) $(SLANG) $(SLANG_FLAGS) --parse-only 2>&1 | tee $@ @echo "Slang parsing logged at: $@" $(SLANG_LINT_LOG): FORCE $(SV_FLIST) - @cd $(SLANG_DIR) && $(SLANG) $(SLANG_FLAGS) --lint-only 2>&1 | tee $@ + @cd $(SLANG_DIR) && CPROOT=$(ROOT_DIR) $(SLANG) $(SLANG_FLAGS) --lint-only 2>&1 | tee $@ @echo "Slang linting logged at: $@" $(SLANG_ELAB_LOG): FORCE $(SV_FLIST) - @cd $(SLANG_DIR) && $(SLANG) $(SLANG_FLAGS) 2>&1 | tee $@ + @cd $(SLANG_DIR) && CPROOT=$(ROOT_DIR) $(SLANG) $(SLANG_FLAGS) 2>&1 | tee $@ @echo "Slang elaboration logged at: $@" ## Generate Control Pulp .flist