3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-06 06:03:23 +00:00

support bram initialisation

This commit is contained in:
Pepijn de Vos 2019-09-05 17:25:51 +02:00
parent 7a43be5e43
commit 47374a495d
5 changed files with 25 additions and 3 deletions

8
techlibs/gowin/brams_init.py Executable file
View file

@ -0,0 +1,8 @@
#!/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)