LIB_DIR=./src/ecp5u
-python3 src/ls2.py isim
+# create the build_simsoc/top.il file with firmware baked-in
+python3 src/ls2.py isim ./coldboot/coldboot.bin
+
+# do some voodoo magic to get icarus to be happy with the ilang file
yosys simsoc.ys
+
+# fix a bug in Lattice ECP5 models
cp ${LIB_DIR}/DDRDLLA.v DDRDLLA.v
patch DDRDLLA.v < DDRDLLA.patch
+
+# string together the icarus verilog files and start runnin
iverilog -Wall -g2012 -s simsoctb -o simsoc \
src/simsoctb.v ./top.v dram_model/ddr3.v \
${LIB_DIR}/ECLKSYNCB.v ${LIB_DIR}/EHXPLLL.v \