yosys/techlibs/gowin/brams_init.py

9 lines
263 B
Python
Raw Normal View History

2019-09-05 10:25:51 -05:00
#!/usr/bin/env python3
with open("techlibs/gowin/bram_init_16.vh", "w") as f:
for i in range(0, 0x40):
low = i << 8
hi = ((i+1) << 8)-1
snippet = "INIT[%d:%d]" % (hi, low)
print(".INIT_RAM_%02X({%s})," % (i, snippet), file=f)