litex-buildenv icon indicating copy to clipboard operation
litex-buildenv copied to clipboard

WIP: litex: sim: Get sim working in litex-buildenv

Open stffrdhrn opened this issue 7 years ago • 6 comments

Changes needed to get PLATFORM=sim to work again.

The platforms/sim was basically copied from litex.boards.platforms.sim but then updated to properly handle sending the SimConfig details to the toolchain needed during building and running of the verilog backend.

For some reason I need to build 2 times to pick up the firmware, there seems to be some race condition in the build, on the first run of make gateware it complains that firmware.fbi is missing.

stffrdhrn avatar Oct 04 '18 09:10 stffrdhrn

Do you think we could add a Travis target which tests this config?

mithro avatar Oct 04 '18 20:10 mithro

Build of sim failed because we are missing libevent and json-c dev libs. Will add to travis and try again.

stffrdhrn avatar Oct 06 '18 06:10 stffrdhrn

Now build is failing because verilator on travis doesnt have --threads option.

verilator -Wno-fatal -O3 --cc dut.v --top-module dut --exe \
		dut_init.cpp /home/travis/build/timvideos/litex-buildenv/third_party/litex/litex/build/sim/core/veril.cpp libdylib.o modules.o pads.o parse.o sim.o \
		--top-module dut \
		--threads 1 \
		-CFLAGS "-Wall -O3 -ggdb -I/home/travis/build/timvideos/litex-buildenv/third_party/litex/litex/build/sim/core" \
		-LDFLAGS "-lpthread -ljson-c -lm -lstdc++ -ldl -levent" \
		-trace -I/home/travis/build/timvideos/litex-buildenv/third_party/litex/litex/soc/cores/cpu/mor1kx/verilog/rtl/verilog -I/home/travis/build/timvideos/litex-buildenv/third_party/litex/litex/soc/cores/cpu/mor1kx/verilog/rtl/verilog/pfpu32 
%Error: Invalid Option: --threads

stffrdhrn avatar Oct 07 '18 01:10 stffrdhrn

@mateusz-holenko - It would be great to get this stuff merged. Can you work with @stffrdhrn to make that happen?

mithro avatar Jul 03 '20 18:07 mithro

I had it working. I think the problem was I had to manually/hard code csrs I can remember exactly what was outstanding.

stffrdhrn avatar Jul 20 '20 23:07 stffrdhrn

Ok I remember, the ci passed for some platforms but not all.

stffrdhrn avatar Jul 20 '20 23:07 stffrdhrn