From d4488748799613738de99f5948bf700678c9897c Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 23 Jan 2018 10:28:16 +0100 Subject: [PATCH 1/3] sim: rename top module to dut and use --top-module parameter (needed for picorv32 simulation) --- litex/build/sim/core/Makefile | 2 +- litex/build/sim/verilator.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/litex/build/sim/core/Makefile b/litex/build/sim/core/Makefile index 0388cdda0..782ac46b3 100644 --- a/litex/build/sim/core/Makefile +++ b/litex/build/sim/core/Makefile @@ -24,7 +24,7 @@ $(OBJS_SIM): %.o: $(SRC_DIR)/%.c .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)" \ diff --git a/litex/build/sim/verilator.py b/litex/build/sim/verilator.py index 312d51e3f..a2e39b47a 100644 --- a/litex/build/sim/verilator.py +++ b/litex/build/sim/verilator.py @@ -136,7 +136,7 @@ sudo obj_dir/Vdut 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) @@ -146,9 +146,9 @@ class SimVerilatorToolchain: 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: From 4e168221d8c856dad994253794fd2d081b81cebe Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 23 Jan 2018 10:33:05 +0100 Subject: [PATCH 2/3] bios: fix riscv processor print --- litex/soc/software/bios/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litex/soc/software/bios/main.c b/litex/soc/software/bios/main.c index 082aa62fb..614eacc2a 100644 --- a/litex/soc/software/bios/main.c +++ b/litex/soc/software/bios/main.c @@ -498,7 +498,7 @@ int main(int i, char **c) #elif __or1k__ printf("\e[1mOR1K\e[0m\n"); #elif __riscv - printf("\e[1mRISC-V\n"); + printf("\e[1mRISC-V\e[0m\n"); #else printf("\e[1mUnknown\e[0m\n"); #endif From 4f2725809e0b9b6cee94cb569c1878f48ab52a15 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 23 Jan 2018 10:39:13 +0100 Subject: [PATCH 3/3] software/common: revert PYTHON to python3 (since breaking things) --- litex/soc/software/common.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litex/soc/software/common.mak b/litex/soc/software/common.mak index 82cb37c0c..11e8fc385 100644 --- a/litex/soc/software/common.mak +++ b/litex/soc/software/common.mak @@ -1,7 +1,7 @@ TARGET_PREFIX=$(TRIPLE)- RM ?= rm -f -PYTHON ?= python +PYTHON ?= python3 ifeq ($(CLANG),1) CC_normal := clang -target $(TRIPLE) -integrated-as