diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-07-11 12:55:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-11 12:55:35 -0700 |
commit | 19c1c3cfa351eb818065054ca6358006f38acb9c (patch) | |
tree | 117b9185aa8de17a107d05060aef2885f9cea678 /techlibs/xilinx/brams_init.py | |
parent | 931adbaf74a2e489e1adfe202ce583e979384e55 (diff) | |
parent | ce250b341c912a3357b13259c1b0b6ed0a7b95a6 (diff) | |
download | yosys-19c1c3cfa351eb818065054ca6358006f38acb9c.tar.gz yosys-19c1c3cfa351eb818065054ca6358006f38acb9c.tar.bz2 yosys-19c1c3cfa351eb818065054ca6358006f38acb9c.zip |
Merge pull request #1182 from koriakin/xc6s-bram
synth_xilinx: Initial Spartan 6 block RAM inference support.
Diffstat (limited to 'techlibs/xilinx/brams_init.py')
-rw-r--r-- | techlibs/xilinx/brams_init.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/techlibs/xilinx/brams_init.py b/techlibs/xilinx/brams_init.py index d46a2b4f7..10057a0cb 100644 --- a/techlibs/xilinx/brams_init.py +++ b/techlibs/xilinx/brams_init.py @@ -1,5 +1,17 @@ #!/usr/bin/env python3 +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) + with open("techlibs/xilinx/brams_init_18.vh", "w") as f: for i in range(8): init_snippets = [" INIT[%3d*9+8]" % (k+256*i,) for k in range(255, -1, -1)] @@ -24,6 +36,10 @@ with open("techlibs/xilinx/brams_init_36.vh", "w") as f: init_snippets[k] = "\n " + init_snippets[k] print(".INIT_%02X({%s})," % (i, ",".join(init_snippets)), file=f) +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) + with open("techlibs/xilinx/brams_init_16.vh", "w") as f: for i in range(64): print(".INIT_%02X(INIT[%3d*256 +: 256])," % (i, i), file=f) |