LIB_DIR=./src/ecp5u
-HYPERRAM_DIR=./s27kl0641/model
+HYPERRAM_DIR=./hyperram_model/s27kl0641/model
# create the build_simsoc/top.il file with firmware baked-in
python3 src/ls2.py isim ./coldboot/coldboot.bin
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 \
+iverilog -Wall -g2012 -s simsoc_hyperram_tb -o simsoc \
+ src/simsoc_hyperram_tb.v ./top.v \
${HYPERRAM_DIR}/s27kl0641.v \
${LIB_DIR}/ECLKSYNCB.v ${LIB_DIR}/EHXPLLL.v \
${LIB_DIR}/PUR.v ${LIB_DIR}/GSR.v \
else:
platform = None
+ print ("platform", fpga, firmware, platform)
+
# set clock frequency
clk_freq = 70e6
if fpga == 'sim':
clk_freq = 100e6
+ if fpga == 'isim':
+ clk_freq = 50e6 # below 50 mhz, stops DRAM being enabled
if fpga == 'versa_ecp5':
clk_freq = 50e6 # crank right down to test hyperram
if fpga == 'versa_ecp5_85':
# Get HyperRAM pins
hyperram_pins = None
- if platform is None or platform in ['isim']:
+ if platform is None:
hyperram_pins = HyperRAMPads()
+ elif fpga in ['isim']:
+ hyperram_ios = HyperRAMResource(0, cs_n="B11",
+ dq="D4 D3 F4 F3 G2 H2 D2 E2",
+ rwds="U13", rst_n="T13", ck_p="V10",
+ # ck_n="D12" - for later (DDR)
+ attrs=Attrs(IOSTANDARD="LVCMOS33"))
+ platform.add_resources(hyperram_ios)
+ hyperram_pins = platform.request("hyperram")
+ print ("isim a7 hyperram", hyperram_ios)
# Digilent Arty A7-100t
elif platform is not None and fpga in ['arty_a7']:
hyperram_ios = HyperRAMResource(0, cs_n="B11",
platform.add_resources(hyperram_ios)
hyperram_pins = platform.request("hyperram")
print ("versa ecp5 hyperram", hyperram_ios)
+ print ("hyperram pins", hyperram_pins)
# set up the SOC
soc = DDR3SoC(fpga=fpga, dram_cls=dram_cls,