When building a design with PicoRV32 we end up with multiple top-level
modules and Verilator becomes confused as to which is the right one.
This change ensures the dut.v generated by the sim build process has
it's top-level name set to 'dut' and that verilator is invoked with this
name.
sim: mkdir $(OBJS_SIM)
verilator -Wno-fatal -O3 --cc dut.v --exe \
$(SRCS_SIM_CPP) $(OBJS_SIM) \
+ --top-module dut \
-CFLAGS "$(CFLAGS) -I$(SRC_DIR)" \
-LDFLAGS "$(LDFLAGS)" \
-trace $(INC_DIR)
fragment = fragment.get_fragment()
platform.finalize(fragment)
- v_output = platform.get_verilog(fragment)
+ v_output = platform.get_verilog(fragment, name=build_name)
named_sc, named_pc = platform.resolve_signals(v_output.ns)
v_output.write("dut.v")