Skip to content

Commit 18e4ef2

Browse files
committed
build: generate seperate sv files
1 parent 8366c09 commit 18e4ef2

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ VFLAGS += -I$(pwd)/utils/src/axi2apb/inner
2929
VFLAGS += -I$(pwd)/peripheral/src/spi/rtl -j $(cpuNum) -O3
3030
VFLAGS += -I$(simSrcDir)/peripheral/spiFlash
3131
VFLAGS += -I$(simSrcDir)/peripheral/sdcard
32-
VFLAGS += -cc TestTop.v
32+
VFLAGS += -cc TestTop.sv
3333

3434
ifeq ($(TRACE),1)
3535
VFLAGS += --trace-fst --trace-threads 2
@@ -72,8 +72,7 @@ test:
7272

7373
verilog:
7474
mill -i cpu.runMain cpu.top.Elaborate args -td $(BUILD_DIR)/cpu $(PRETTY)
75-
@$(pwd)/tools/split_blackbox.sh $(BUILD_DIR)/cpu ysyx_210153.v
76-
@sed -i -e 's/_\(aw\|ar\|w\|r\|b\)_\(\|bits_\)/_\1/g' $(BUILD_DIR)/cpu/ysyx_210153.v
75+
@sed -i -e 's/_\(aw\|ar\|w\|r\|b\)_\(\|bits_\)/_\1/g' $(BUILD_DIR)/cpu/*
7776

7877
help:
7978
mill -i sim.runMain sim.top.Elaborate --help
@@ -107,7 +106,6 @@ clean-all: clean
107106

108107
verilate:
109108
mill -i sim.runMain sim.top.Elaborate args -td $(BUILD_DIR)/sim $(GENNAME) $(param)
110-
@$(pwd)/tools/split_blackbox.sh $(BUILD_DIR)/sim TestTop.v
111109
@cd $(BUILD_DIR)/sim && \
112110
verilator $(VFLAGS) --build $(CSRCS) -CFLAGS "$(CFLAGS)" -LDFLAGS "$(LDFLAGS)" >/dev/null
113111

@@ -126,11 +124,9 @@ simall: $(LIB_SPIKE) verilate
126124

127125
zmb:
128126
mill -i cpu.runMain cpu.top.Elaborate args -td $(BUILD_DIR)/zmb zmb $(PRETTY)
129-
@$(pwd)/tools/split_blackbox.sh $(BUILD_DIR)/zmb zmb.v
130127

131128
lxb:
132129
mill -i cpu.runMain cpu.top.Elaborate args -td $(BUILD_DIR)/lxb lxb $(PRETTY)
133-
@$(pwd)/tools/split_blackbox.sh $(BUILD_DIR)/lxb lxb.v
134130

135131
rv64: verilog
136132

cpu/src/Elaborate.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ object Elaborate extends App {
1010
}).alter(cpu.YQConfig()).alter(cpu.cache.CacheConfig.f)
1111

1212
(new circt.stage.ChiselStage).execute(
13-
Array("--target", "verilog") ++ args,
13+
Array("--target", "systemverilog", "--split-verilog") ++ args,
1414
Seq(chisel3.stage.ChiselGeneratorAnnotation(() => new cpu.CPU)) :+
1515
circt.stage.FirtoolOption("--disable-all-randomization") :+
1616
circt.stage.FirtoolOption("--default-layer-specialization=enable")

sim/src/Elaborate.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ object Elaborate extends App {
88
if (args.contains("FLASH")) p = p.alterPartial({ case cpu.USEFLASH => true })
99

1010
(new circt.stage.ChiselStage).execute(
11-
Array("--target", "verilog") ++ args,
11+
Array("--target", "systemverilog", "--split-verilog") ++ args,
1212
Seq(chisel3.stage.ChiselGeneratorAnnotation(() => new sim.cpu.TestTop)) :+
1313
circt.stage.FirtoolOption("--default-layer-specialization=enable")
1414
)

0 commit comments

Comments
 (0)