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..0404a77 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,21 +279,25 @@ 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 > $@ +$(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 @@ -311,6 +315,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 #