QSPI_DIR=./qspi_model/Cy15b104qs/model/
+FIRMWARE=./coldboot/coldboot.bin
+
+# convert firmware to 32-bit hex
+python3 scripts/bin2hex.py ${FIRMWARE} 32 > ${QSPI_DIR}/firmware.hex
+
# create the build_simsoc/top.il file with firmware baked-in
-python3 src/ls2.py isim ./coldboot/coldboot.bin
+#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
+#yosys simsoc.ys
# fix a bug in Lattice ECP5 models
cp ${LIB_DIR}/DDRDLLA.v DDRDLLA.v
${LIB_DIR}/ODDRX2DQSB.v ${LIB_DIR}/IDDRX2DQA.v \
DDRDLLA.v \
-I ${QSPI_DIR} -DN25Q128A13E \
+ -Dmem_file_name=firmware.hex \
${QSPI_DIR}/cy15b104qs.v \
${LIB_DIR}/CLKDIVF.v
vvp -n simsoc -fst-speed
read_verilog ../uart16550/rtl/verilog/uart_wb.v
read_verilog ../tercel-qspi/tercel/phy.v
read_verilog ../tercel-qspi/tercel/wishbone_spi_master.v
-read_verilog ../ethmac/rtl/verilog
-read_verilog ../ethmac/rtl/verilog/eth_clockgen.v
-read_verilog ../ethmac/rtl/verilog/eth_cop.v
-read_verilog ../ethmac/rtl/verilog/eth_crc.v
-read_verilog ../ethmac/rtl/verilog/eth_fifo.v
-read_verilog ../ethmac/rtl/verilog/eth_maccontrol.v
-read_verilog ../ethmac/rtl/verilog/ethmac_defines.v
-read_verilog ../ethmac/rtl/verilog/eth_macstatus.v
-read_verilog ../ethmac/rtl/verilog/ethmac.v
-read_verilog ../ethmac/rtl/verilog/eth_miim.v
-read_verilog ../ethmac/rtl/verilog/eth_outputcontrol.v
-read_verilog ../ethmac/rtl/verilog/eth_random.v
-read_verilog ../ethmac/rtl/verilog/eth_receivecontrol.v
-read_verilog ../ethmac/rtl/verilog/eth_registers.v
-read_verilog ../ethmac/rtl/verilog/eth_register.v
-read_verilog ../ethmac/rtl/verilog/eth_rxaddrcheck.v
-read_verilog ../ethmac/rtl/verilog/eth_rxcounters.v
-read_verilog ../ethmac/rtl/verilog/eth_rxethmac.v
-read_verilog ../ethmac/rtl/verilog/eth_rxstatem.v
-read_verilog ../ethmac/rtl/verilog/eth_shiftreg.v
-read_verilog ../ethmac/rtl/verilog/eth_spram_256x32.v
-read_verilog ../ethmac/rtl/verilog/eth_top.v
-read_verilog ../ethmac/rtl/verilog/eth_transmitcontrol.v
-read_verilog ../ethmac/rtl/verilog/eth_txcounters.v
-read_verilog ../ethmac/rtl/verilog/eth_txethmac.v
-read_verilog ../ethmac/rtl/verilog/eth_txstatem.v
-read_verilog ../ethmac/rtl/verilog/eth_wishbone.v
-read_verilog ../ethmac/rtl/verilog/timescale.v
+# errors in the ethmac rtl, comment out for now
+#read_verilog ../ethmac/rtl/verilog/eth_clockgen.v
+#read_verilog ../ethmac/rtl/verilog/eth_cop.v
+#read_verilog ../ethmac/rtl/verilog/eth_crc.v
+#read_verilog ../ethmac/rtl/verilog/eth_fifo.v
+#read_verilog ../ethmac/rtl/verilog/eth_maccontrol.v
+#read_verilog ../ethmac/rtl/verilog/ethmac_defines.v
+#read_verilog ../ethmac/rtl/verilog/eth_macstatus.v
+#read_verilog ../ethmac/rtl/verilog/ethmac.v
+#read_verilog ../ethmac/rtl/verilog/eth_miim.v
+#read_verilog ../ethmac/rtl/verilog/eth_outputcontrol.v
+#read_verilog ../ethmac/rtl/verilog/eth_random.v
+#read_verilog ../ethmac/rtl/verilog/eth_receivecontrol.v
+#read_verilog ../ethmac/rtl/verilog/eth_registers.v
+#read_verilog ../ethmac/rtl/verilog/eth_register.v
+#read_verilog ../ethmac/rtl/verilog/eth_rxaddrcheck.v
+#read_verilog ../ethmac/rtl/verilog/eth_rxcounters.v
+#read_verilog ../ethmac/rtl/verilog/eth_rxethmac.v
+#read_verilog ../ethmac/rtl/verilog/eth_rxstatem.v
+#read_verilog ../ethmac/rtl/verilog/eth_shiftreg.v
+#read_verilog ../ethmac/rtl/verilog/eth_spram_256x32.v
+#read_verilog ../ethmac/rtl/verilog/eth_top.v
+#read_verilog ../ethmac/rtl/verilog/eth_transmitcontrol.v
+#read_verilog ../ethmac/rtl/verilog/eth_txcounters.v
+#read_verilog ../ethmac/rtl/verilog/eth_txethmac.v
+#read_verilog ../ethmac/rtl/verilog/eth_txstatem.v
+#read_verilog ../ethmac/rtl/verilog/eth_wishbone.v
+#read_verilog ../ethmac/rtl/verilog/timescale.v
read_verilog ./external_core_top.v