2015-08-22 02:59:25 -05:00
|
|
|
#!/usr/bin/env python3
|
2015-04-06 10:07:10 -05:00
|
|
|
|
2019-07-02 07:28:35 -05:00
|
|
|
with open("techlibs/xilinx/brams_init_9.vh", "w") as f:
|
|
|
|
for i in range(4):
|
|
|
|
init_snippets = [" INIT[%3d*9+8]" % (k+256*i,) for k in range(255, -1, -1)]
|
|
|
|
for k in range(4, 256, 4):
|
|
|
|
init_snippets[k] = "\n " + init_snippets[k]
|
|
|
|
print(".INITP_%02X({%s})," % (i, ",".join(init_snippets)), file=f)
|
|
|
|
for i in range(32):
|
|
|
|
init_snippets = [" INIT[%3d*9 +: 8]" % (k+32*i,) for k in range(31, -1, -1)]
|
|
|
|
for k in range(4, 32, 4):
|
|
|
|
init_snippets[k] = "\n " + init_snippets[k]
|
|
|
|
print(".INIT_%02X({%s})," % (i, ",".join(init_snippets)), file=f)
|
|
|
|
|
2015-08-16 14:39:34 -05:00
|
|
|
with open("techlibs/xilinx/brams_init_18.vh", "w") as f:
|
2015-04-06 10:07:10 -05:00
|
|
|
for i in range(8):
|
2018-03-10 11:59:06 -06:00
|
|
|
init_snippets = [" INIT[%3d*9+8]" % (k+256*i,) for k in range(255, -1, -1)]
|
2015-04-06 10:07:10 -05:00
|
|
|
for k in range(4, 256, 4):
|
|
|
|
init_snippets[k] = "\n " + init_snippets[k]
|
2018-03-10 11:59:06 -06:00
|
|
|
print(".INITP_%02X({%s})," % (i, ",".join(init_snippets)), file=f)
|
2015-04-06 10:07:10 -05:00
|
|
|
for i in range(64):
|
2018-03-10 11:59:06 -06:00
|
|
|
init_snippets = [" INIT[%3d*9 +: 8]" % (k+32*i,) for k in range(31, -1, -1)]
|
2015-04-06 10:07:10 -05:00
|
|
|
for k in range(4, 32, 4):
|
|
|
|
init_snippets[k] = "\n " + init_snippets[k]
|
2018-03-10 11:59:06 -06:00
|
|
|
print(".INIT_%02X({%s})," % (i, ",".join(init_snippets)), file=f)
|
2015-04-06 10:07:10 -05:00
|
|
|
|
2015-08-16 14:39:34 -05:00
|
|
|
with open("techlibs/xilinx/brams_init_36.vh", "w") as f:
|
2015-04-06 10:07:10 -05:00
|
|
|
for i in range(16):
|
2018-03-10 11:59:06 -06:00
|
|
|
init_snippets = [" INIT[%3d*9+8]" % (k+256*i,) for k in range(255, -1, -1)]
|
2015-04-06 10:07:10 -05:00
|
|
|
for k in range(4, 256, 4):
|
|
|
|
init_snippets[k] = "\n " + init_snippets[k]
|
2018-03-10 11:59:06 -06:00
|
|
|
print(".INITP_%02X({%s})," % (i, ",".join(init_snippets)), file=f)
|
2015-04-06 10:07:10 -05:00
|
|
|
for i in range(128):
|
2018-03-10 11:59:06 -06:00
|
|
|
init_snippets = [" INIT[%3d*9 +: 8]" % (k+32*i,) for k in range(31, -1, -1)]
|
2015-04-06 10:07:10 -05:00
|
|
|
for k in range(4, 32, 4):
|
|
|
|
init_snippets[k] = "\n " + init_snippets[k]
|
2018-03-10 11:59:06 -06:00
|
|
|
print(".INIT_%02X({%s})," % (i, ",".join(init_snippets)), file=f)
|
2015-04-06 10:07:10 -05:00
|
|
|
|
2019-07-02 07:28:35 -05:00
|
|
|
with open("techlibs/xilinx/brams_init_8.vh", "w") as f:
|
|
|
|
for i in range(32):
|
|
|
|
print(".INIT_%02X(INIT[%3d*256 +: 256])," % (i, i), file=f)
|
|
|
|
|
2015-08-16 14:39:34 -05:00
|
|
|
with open("techlibs/xilinx/brams_init_16.vh", "w") as f:
|
2015-04-06 10:07:10 -05:00
|
|
|
for i in range(64):
|
|
|
|
print(".INIT_%02X(INIT[%3d*256 +: 256])," % (i, i), file=f)
|
|
|
|
|
2015-08-16 14:39:34 -05:00
|
|
|
with open("techlibs/xilinx/brams_init_32.vh", "w") as f:
|
2015-04-06 10:07:10 -05:00
|
|
|
for i in range(128):
|
|
|
|
print(".INIT_%02X(INIT[%3d*256 +: 256])," % (i, i), file=f)
|
|
|
|
|