Skip to content

Commit 1b92418

Browse files
ajelinskikgugala
authored andcommitted
cocotb: Add cm.cfg
1 parent 8dedcb7 commit 1b92418

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

verification/cm.cfg.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@
5151
-node *.HW_STATUS.RESERVED_7_3*
5252
-node *.INDIRECT_FIFO_RESERVED*
5353
-node *.SOC_MGMT_RSVD*
54-
-node *.__rsvd*
54+
-node *.__rsvd*

verification/cocotb/common.mk

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,19 @@ ifeq ($(SIM), vcs)
8282

8383
ifneq ($(COVERAGE_TYPE),)
8484
EXTRA_ARGS += -cm line+cond+fsm+tgl+branch
85+
86+
# Generate cm.cfg file based on cm.cfg.tmpl with `+tree $(TOPLEVEL)` and `-module $(TOPLEVEL)` on top.
87+
ifeq ($(TOPLEVEL),)
88+
$(error TOPLEVEL undefined!)
89+
endif
90+
CM_FILE := $(TEST_DIR)/sim_build/cm.cfg
91+
CM_FILE_TMPL := $(I3C_ROOT)/verification/cm.cfg.tmpl
92+
$(shell mkdir -p $(TEST_DIR)/sim_build)
93+
$(shell echo "+tree $(TOPLEVEL)" >$(CM_FILE))
94+
$(shell echo "-module $(TOPLEVEL)" >>$(CM_FILE))
95+
$(shell echo "$$(cat $(CM_FILE_TMPL))" >>$(CM_FILE))
96+
97+
COMPILE_ARGS += -cm_hier $(CM_FILE)
8598
endif
8699
endif
87100

0 commit comments

Comments
 (0)