.PHONY: sim
sim: mkdir $(OBJS_SIM)
- verilator -Wno-fatal -O3 --cc dut.v --exe \
+ verilator -Wno-fatal -O3 --cc dut.v --top-module dut --exe \
$(SRCS_SIM_CPP) $(OBJS_SIM) \
-CFLAGS "$(CFLAGS) -I$(SRC_DIR)" \
-LDFLAGS "$(LDFLAGS)" \
class SimVerilatorToolchain:
- def build(self, platform, fragment, build_dir="build", build_name="top",
+ def build(self, platform, fragment, build_dir="build", build_name="dut",
toolchain_path=None, serial="console", run=True, verbose=True,
sim_config=None):
os.makedirs(build_dir, exist_ok=True)
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")
+ v_output.write(build_name + ".v")
include_paths = []
for source in platform.sources: