WIP: litex: sim: Get sim working in litex-buildenv
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.
Do you think we could add a Travis target which tests this config?
Build of sim failed because we are missing libevent and json-c dev libs. Will add to travis and try again.
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
@mateusz-holenko - It would be great to get this stuff merged. Can you work with @stffrdhrn to make that happen?
I had it working. I think the problem was I had to manually/hard code csrs I can remember exactly what was outstanding.
Ok I remember, the ci passed for some platforms but not all.