1
0
mirror of synced 2026-01-18 17:27:06 +00:00
YosysHQ.yosys/techlibs/gowin/brams_init.py
2019-09-05 17:25:51 +02:00

9 lines
263 B
Python
Executable File

#!/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)