najaeda 0.1.3__cp313-cp313t-macosx_11_0_arm64.whl → 0.1.4__cp313-cp313t-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of najaeda might be problematic. Click here for more details.
- najaeda/libnaja_snl_python.dylib +0 -0
- najaeda/netlist.py +16 -0
- najaeda/primitives/__init__.py +0 -0
- najaeda/primitives/xilinx.py +452 -0
- najaeda/snl.so +0 -0
- {najaeda-0.1.3.dist-info → najaeda-0.1.4.dist-info}/METADATA +19 -5
- najaeda-0.1.4.dist-info/RECORD +12 -0
- {najaeda-0.1.3.dist-info → najaeda-0.1.4.dist-info}/licenses/AUTHORS +2 -1
- najaeda/.dylibs/PythonT +0 -0
- najaeda-0.1.3.dist-info/RECORD +0 -11
- {najaeda-0.1.3.dist-info → najaeda-0.1.4.dist-info}/WHEEL +0 -0
- {najaeda-0.1.3.dist-info → najaeda-0.1.4.dist-info}/licenses/LICENSE +0 -0
najaeda/libnaja_snl_python.dylib
CHANGED
|
Binary file
|
najaeda/netlist.py
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
6
6
|
import itertools
|
|
7
|
+
import time
|
|
7
8
|
import logging
|
|
8
9
|
|
|
9
10
|
from najaeda import snl
|
|
@@ -700,14 +701,29 @@ def create_top(name: str) -> Instance:
|
|
|
700
701
|
|
|
701
702
|
|
|
702
703
|
def load_verilog(files: list):
|
|
704
|
+
start_time = time.time()
|
|
705
|
+
logging.info(f"Loading verilog: {', '.join(files)}")
|
|
703
706
|
get_top_db().loadVerilog(files)
|
|
707
|
+
execution_time = time.time() - start_time
|
|
708
|
+
logging.info(f"Loading done in {execution_time:.2f} seconds")
|
|
704
709
|
return get_top()
|
|
705
710
|
|
|
706
711
|
|
|
707
712
|
def load_liberty(files: list):
|
|
713
|
+
logging.info(f"Loading liberty: {', '.join(files)}")
|
|
708
714
|
get_top_db().loadLibertyPrimitives(files)
|
|
709
715
|
|
|
710
716
|
|
|
717
|
+
def load_primitives(name: str):
|
|
718
|
+
if name == "xilinx":
|
|
719
|
+
logging.info("Loading xilinx primitives")
|
|
720
|
+
from najaeda.primitives import xilinx
|
|
721
|
+
|
|
722
|
+
xilinx.load(get_top_db())
|
|
723
|
+
else:
|
|
724
|
+
raise ValueError(f"Unknown primitives library: {name}")
|
|
725
|
+
|
|
726
|
+
|
|
711
727
|
def get_primitives_library() -> snl.SNLLibrary:
|
|
712
728
|
lib = get_top_db().getLibrary("PRIMS")
|
|
713
729
|
if lib is None:
|
|
File without changes
|
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2024 The Naja authors <https://github.com/najaeda/naja/blob/main/AUTHORS>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
from najaeda import snl
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def constructIBUF(lib):
|
|
9
|
+
ibuf = snl.SNLDesign.createPrimitive(lib, "IBUF")
|
|
10
|
+
i = snl.SNLScalarTerm.create(ibuf, snl.SNLTerm.Direction.Input, "I")
|
|
11
|
+
o = snl.SNLScalarTerm.create(ibuf, snl.SNLTerm.Direction.Output, "O")
|
|
12
|
+
ibuf.addCombinatorialArcs(i, o)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def constructOBUF(lib):
|
|
16
|
+
obuf = snl.SNLDesign.createPrimitive(lib, "OBUF")
|
|
17
|
+
i = snl.SNLScalarTerm.create(obuf, snl.SNLTerm.Direction.Input, "I")
|
|
18
|
+
o = snl.SNLScalarTerm.create(obuf, snl.SNLTerm.Direction.Output, "O")
|
|
19
|
+
obuf.addCombinatorialArcs(i, o)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def constructBUFG(lib):
|
|
23
|
+
bufg = snl.SNLDesign.createPrimitive(lib, "BUFG")
|
|
24
|
+
i = snl.SNLScalarTerm.create(bufg, snl.SNLTerm.Direction.Input, "I")
|
|
25
|
+
o = snl.SNLScalarTerm.create(bufg, snl.SNLTerm.Direction.Output, "O")
|
|
26
|
+
bufg.addCombinatorialArcs(i, o)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def constructDSP48E1(lib):
|
|
30
|
+
dsp48e1 = snl.SNLDesign.createPrimitive(lib, "DSP48E1")
|
|
31
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Output, 29, 0, "ACOUT")
|
|
32
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Output, 17, 0, "BCOUT")
|
|
33
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Output, "CARRYCASCOUT")
|
|
34
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "MULTSIGNOUT")
|
|
35
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, 47, 0, "PCOUT")
|
|
36
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Output, "OVERFLOW")
|
|
37
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Output, "PATTERNBDETECT")
|
|
38
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Output, "PATTERNDETECT")
|
|
39
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Output, "UNDERFLOW")
|
|
40
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Output, 3, 0, "CARRYOUT")
|
|
41
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Output, 47, 0, "P")
|
|
42
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, 29, 0, "ACIN")
|
|
43
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, 17, 0, "BCIN")
|
|
44
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CARRYCASCIN")
|
|
45
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "MULTSIGNIN")
|
|
46
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, 47, 0, "PCIN")
|
|
47
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, 3, 0, "ALUMODE")
|
|
48
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, 2, 0, "CARRYINSEL")
|
|
49
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CLK")
|
|
50
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, 4, 0, "INMODE")
|
|
51
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, 6, 0, "OPMODE")
|
|
52
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, 29, 0, "A")
|
|
53
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, 17, 0, "B")
|
|
54
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, 47, 0, "C")
|
|
55
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CARRYIN")
|
|
56
|
+
snl.SNLBusTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, 24, 0, "D")
|
|
57
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CEA1")
|
|
58
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CEA2")
|
|
59
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CEAD")
|
|
60
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CEALUMODE")
|
|
61
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CEB1")
|
|
62
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CEB2")
|
|
63
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CEC")
|
|
64
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CECARRYIN")
|
|
65
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CECTRL")
|
|
66
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CED")
|
|
67
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CEINMODE")
|
|
68
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CEM")
|
|
69
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "CEP")
|
|
70
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "RSTA")
|
|
71
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "RSTALLCARRYIN")
|
|
72
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "RSTALUMODE")
|
|
73
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "RSTB")
|
|
74
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "RSTC")
|
|
75
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "RSTCTRL")
|
|
76
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "RSTD")
|
|
77
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "RSTINMODE")
|
|
78
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "RSTM")
|
|
79
|
+
snl.SNLScalarTerm.create(dsp48e1, snl.SNLTerm.Direction.Input, "RSTP")
|
|
80
|
+
snl.SNLParameter.create_decimal(dsp48e1, "ACASCREG", 1)
|
|
81
|
+
snl.SNLParameter.create_decimal(dsp48e1, "ADREG", 1)
|
|
82
|
+
snl.SNLParameter.create_string(dsp48e1, "A_INPUT", "DIRECT")
|
|
83
|
+
snl.SNLParameter.create_decimal(dsp48e1, "ALUMODEREG", 1)
|
|
84
|
+
snl.SNLParameter.create_decimal(dsp48e1, "AREG", 1)
|
|
85
|
+
snl.SNLParameter.create_decimal(dsp48e1, "BCASCREG", 1)
|
|
86
|
+
snl.SNLParameter.create_string(dsp48e1, "B_INPUT", "DIRECT")
|
|
87
|
+
snl.SNLParameter.create_decimal(dsp48e1, "BREG", 1)
|
|
88
|
+
snl.SNLParameter.create_decimal(dsp48e1, "CARRYINREG", 1)
|
|
89
|
+
snl.SNLParameter.create_decimal(dsp48e1, "CARRYINSELREG", 1)
|
|
90
|
+
snl.SNLParameter.create_decimal(dsp48e1, "CREG", 1)
|
|
91
|
+
snl.SNLParameter.create_decimal(dsp48e1, "DREG", 1)
|
|
92
|
+
snl.SNLParameter.create_decimal(dsp48e1, "INMODEREG", 1)
|
|
93
|
+
snl.SNLParameter.create_decimal(dsp48e1, "MREG", 1)
|
|
94
|
+
snl.SNLParameter.create_decimal(dsp48e1, "OPMODEREG", 1)
|
|
95
|
+
snl.SNLParameter.create_decimal(dsp48e1, "PREG", 1)
|
|
96
|
+
snl.SNLParameter.create_boolean(dsp48e1, "USE_DPORT", False)
|
|
97
|
+
snl.SNLParameter.create_string(dsp48e1, "USE_MULT", "MULTIPLY")
|
|
98
|
+
snl.SNLParameter.create_string(dsp48e1, "USE_SIMD", "ONE48")
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def constructINV(lib):
|
|
102
|
+
inv = snl.SNLDesign.createPrimitive(lib, "INV")
|
|
103
|
+
i = snl.SNLScalarTerm.create(inv, snl.SNLTerm.Direction.Input, "I")
|
|
104
|
+
o = snl.SNLScalarTerm.create(inv, snl.SNLTerm.Direction.Output, "O")
|
|
105
|
+
snl.SNLDesign.addCombinatorialArcs(i, o)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def constructCARRY4(lib):
|
|
109
|
+
carry4 = snl.SNLDesign.createPrimitive(lib, "CARRY4")
|
|
110
|
+
o = snl.SNLBusTerm.create(carry4, snl.SNLTerm.Direction.Output, 3, 0, "O")
|
|
111
|
+
co = snl.SNLBusTerm.create(carry4, snl.SNLTerm.Direction.Output, 3, 0, "CO")
|
|
112
|
+
di = snl.SNLBusTerm.create(carry4, snl.SNLTerm.Direction.Input, 3, 0, "DI")
|
|
113
|
+
s = snl.SNLBusTerm.create(carry4, snl.SNLTerm.Direction.Input, 3, 0, "S")
|
|
114
|
+
cyinit = snl.SNLScalarTerm.create(carry4, snl.SNLTerm.Direction.Input, "CYINIT")
|
|
115
|
+
ci = snl.SNLScalarTerm.create(carry4, snl.SNLTerm.Direction.Input, "CI")
|
|
116
|
+
o_bits = [b for b in o.getBits()]
|
|
117
|
+
co_bits = [b for b in co.getBits()]
|
|
118
|
+
di_bits = [b for b in di.getBits()]
|
|
119
|
+
s_bits = [b for b in s.getBits()]
|
|
120
|
+
# cyinit and ci are in combinatorial dependency with o and co outputs
|
|
121
|
+
snl.SNLDesign.addCombinatorialArcs([cyinit, ci], [o, co])
|
|
122
|
+
snl.SNLDesign.addCombinatorialArcs(s_bits[0], [o, co])
|
|
123
|
+
snl.SNLDesign.addCombinatorialArcs(s_bits[1], [o_bits[1], o_bits[2], o_bits[3]])
|
|
124
|
+
snl.SNLDesign.addCombinatorialArcs(s_bits[1], [co_bits[1], co_bits[2], co_bits[3]])
|
|
125
|
+
snl.SNLDesign.addCombinatorialArcs(s_bits[2], [o_bits[2], o_bits[3]])
|
|
126
|
+
snl.SNLDesign.addCombinatorialArcs(s_bits[2], [co_bits[2], co_bits[3]])
|
|
127
|
+
snl.SNLDesign.addCombinatorialArcs(s_bits[3], o_bits[3])
|
|
128
|
+
snl.SNLDesign.addCombinatorialArcs(s_bits[3], co_bits[3])
|
|
129
|
+
snl.SNLDesign.addCombinatorialArcs(di_bits[0], [o_bits[1], o_bits[2], o_bits[3]])
|
|
130
|
+
snl.SNLDesign.addCombinatorialArcs(di_bits[0], co)
|
|
131
|
+
snl.SNLDesign.addCombinatorialArcs(di_bits[1], [o_bits[2], o_bits[3]])
|
|
132
|
+
snl.SNLDesign.addCombinatorialArcs(di_bits[1], [co_bits[1], co_bits[2], co_bits[3]])
|
|
133
|
+
snl.SNLDesign.addCombinatorialArcs(di_bits[2], o_bits[3])
|
|
134
|
+
snl.SNLDesign.addCombinatorialArcs(di_bits[2], [co_bits[2], co_bits[3]])
|
|
135
|
+
snl.SNLDesign.addCombinatorialArcs(di_bits[3], co_bits[3])
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def constructLUT1(lib):
|
|
139
|
+
lut1 = snl.SNLDesign.createPrimitive(lib, "LUT1")
|
|
140
|
+
i0 = snl.SNLScalarTerm.create(lut1, snl.SNLTerm.Direction.Input, "I0")
|
|
141
|
+
o = snl.SNLScalarTerm.create(lut1, snl.SNLTerm.Direction.Output, "O")
|
|
142
|
+
snl.SNLDesign.addCombinatorialArcs(i0, o)
|
|
143
|
+
snl.SNLParameter.create_binary(lut1, "INIT", 2, 0b00)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def constructLUT2(lib):
|
|
147
|
+
lut2 = snl.SNLDesign.createPrimitive(lib, "LUT2")
|
|
148
|
+
i0 = snl.SNLScalarTerm.create(lut2, snl.SNLTerm.Direction.Input, "I0")
|
|
149
|
+
i1 = snl.SNLScalarTerm.create(lut2, snl.SNLTerm.Direction.Input, "I1")
|
|
150
|
+
o = snl.SNLScalarTerm.create(lut2, snl.SNLTerm.Direction.Output, "O")
|
|
151
|
+
snl.SNLDesign.addCombinatorialArcs([i0, i1], o)
|
|
152
|
+
snl.SNLParameter.create_binary(lut2, "INIT", 4, 0x0)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def constructLUT3(lib):
|
|
156
|
+
lut3 = snl.SNLDesign.createPrimitive(lib, "LUT3")
|
|
157
|
+
i0 = snl.SNLScalarTerm.create(lut3, snl.SNLTerm.Direction.Input, "I0")
|
|
158
|
+
i1 = snl.SNLScalarTerm.create(lut3, snl.SNLTerm.Direction.Input, "I1")
|
|
159
|
+
i2 = snl.SNLScalarTerm.create(lut3, snl.SNLTerm.Direction.Input, "I2")
|
|
160
|
+
o = snl.SNLScalarTerm.create(lut3, snl.SNLTerm.Direction.Output, "O")
|
|
161
|
+
snl.SNLDesign.addCombinatorialArcs([i0, i1, i2], o)
|
|
162
|
+
snl.SNLParameter.create_binary(lut3, "INIT", 8, 0x00)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def constructLUT4(lib):
|
|
166
|
+
lut4 = snl.SNLDesign.createPrimitive(lib, "LUT4")
|
|
167
|
+
i0 = snl.SNLScalarTerm.create(lut4, snl.SNLTerm.Direction.Input, "I0")
|
|
168
|
+
i1 = snl.SNLScalarTerm.create(lut4, snl.SNLTerm.Direction.Input, "I1")
|
|
169
|
+
i2 = snl.SNLScalarTerm.create(lut4, snl.SNLTerm.Direction.Input, "I2")
|
|
170
|
+
i3 = snl.SNLScalarTerm.create(lut4, snl.SNLTerm.Direction.Input, "I3")
|
|
171
|
+
o = snl.SNLScalarTerm.create(lut4, snl.SNLTerm.Direction.Output, "O")
|
|
172
|
+
snl.SNLDesign.addCombinatorialArcs([i0, i1, i2, i3], o)
|
|
173
|
+
snl.SNLParameter.create_binary(lut4, "INIT", 16, 0x0000)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def constructLUT5(lib):
|
|
177
|
+
lut5 = snl.SNLDesign.createPrimitive(lib, "LUT5")
|
|
178
|
+
i0 = snl.SNLScalarTerm.create(lut5, snl.SNLTerm.Direction.Input, "I0")
|
|
179
|
+
i1 = snl.SNLScalarTerm.create(lut5, snl.SNLTerm.Direction.Input, "I1")
|
|
180
|
+
i2 = snl.SNLScalarTerm.create(lut5, snl.SNLTerm.Direction.Input, "I2")
|
|
181
|
+
i3 = snl.SNLScalarTerm.create(lut5, snl.SNLTerm.Direction.Input, "I3")
|
|
182
|
+
i4 = snl.SNLScalarTerm.create(lut5, snl.SNLTerm.Direction.Input, "I4")
|
|
183
|
+
o = snl.SNLScalarTerm.create(lut5, snl.SNLTerm.Direction.Output, "O")
|
|
184
|
+
snl.SNLDesign.addCombinatorialArcs([i0, i1, i2, i3, i4], o)
|
|
185
|
+
snl.SNLParameter.create_binary(lut5, "INIT", 32, 0x00000000)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def constructLUT6(lib):
|
|
189
|
+
lut6 = snl.SNLDesign.createPrimitive(lib, "LUT6")
|
|
190
|
+
i0 = snl.SNLScalarTerm.create(lut6, snl.SNLTerm.Direction.Input, "I0")
|
|
191
|
+
i1 = snl.SNLScalarTerm.create(lut6, snl.SNLTerm.Direction.Input, "I1")
|
|
192
|
+
i2 = snl.SNLScalarTerm.create(lut6, snl.SNLTerm.Direction.Input, "I2")
|
|
193
|
+
i3 = snl.SNLScalarTerm.create(lut6, snl.SNLTerm.Direction.Input, "I3")
|
|
194
|
+
i4 = snl.SNLScalarTerm.create(lut6, snl.SNLTerm.Direction.Input, "I4")
|
|
195
|
+
i5 = snl.SNLScalarTerm.create(lut6, snl.SNLTerm.Direction.Input, "I5")
|
|
196
|
+
o = snl.SNLScalarTerm.create(lut6, snl.SNLTerm.Direction.Output, "O")
|
|
197
|
+
snl.SNLDesign.addCombinatorialArcs([i0, i1, i2, i3, i4, i5], o)
|
|
198
|
+
snl.SNLParameter.create_binary(lut6, "INIT", 64, 0x0000000000000000)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def constructMUXF7(lib):
|
|
202
|
+
muxf7 = snl.SNLDesign.createPrimitive(lib, "MUXF7")
|
|
203
|
+
i0 = snl.SNLScalarTerm.create(muxf7, snl.SNLTerm.Direction.Input, "I0")
|
|
204
|
+
i1 = snl.SNLScalarTerm.create(muxf7, snl.SNLTerm.Direction.Input, "I1")
|
|
205
|
+
o = snl.SNLScalarTerm.create(muxf7, snl.SNLTerm.Direction.Output, "O")
|
|
206
|
+
s = snl.SNLScalarTerm.create(muxf7, snl.SNLTerm.Direction.Input, "S")
|
|
207
|
+
snl.SNLDesign.addCombinatorialArcs([i0, i1, s], o)
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def constructMUXF8(lib):
|
|
211
|
+
muxf8 = snl.SNLDesign.createPrimitive(lib, "MUXF8")
|
|
212
|
+
i0 = snl.SNLScalarTerm.create(muxf8, snl.SNLTerm.Direction.Input, "I0")
|
|
213
|
+
i1 = snl.SNLScalarTerm.create(muxf8, snl.SNLTerm.Direction.Input, "I1")
|
|
214
|
+
o = snl.SNLScalarTerm.create(muxf8, snl.SNLTerm.Direction.Output, "O")
|
|
215
|
+
s = snl.SNLScalarTerm.create(muxf8, snl.SNLTerm.Direction.Input, "S")
|
|
216
|
+
snl.SNLDesign.addCombinatorialArcs([i0, i1, s], o)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def constructSRL16E(lib):
|
|
220
|
+
srl16e = snl.SNLDesign.createPrimitive(lib, "SRL16E")
|
|
221
|
+
snl.SNLScalarTerm.create(srl16e, snl.SNLTerm.Direction.Input, "CE")
|
|
222
|
+
snl.SNLScalarTerm.create(srl16e, snl.SNLTerm.Direction.Input, "CLK")
|
|
223
|
+
snl.SNLScalarTerm.create(srl16e, snl.SNLTerm.Direction.Input, "D")
|
|
224
|
+
snl.SNLScalarTerm.create(srl16e, snl.SNLTerm.Direction.Output, "Q")
|
|
225
|
+
snl.SNLScalarTerm.create(srl16e, snl.SNLTerm.Direction.Input, "A0")
|
|
226
|
+
snl.SNLScalarTerm.create(srl16e, snl.SNLTerm.Direction.Input, "A1")
|
|
227
|
+
snl.SNLScalarTerm.create(srl16e, snl.SNLTerm.Direction.Input, "A2")
|
|
228
|
+
snl.SNLScalarTerm.create(srl16e, snl.SNLTerm.Direction.Input, "A3")
|
|
229
|
+
snl.SNLParameter.create_binary(srl16e, "INIT", 16, 0x0000)
|
|
230
|
+
snl.SNLParameter.create_binary(srl16e, "IS_CLK_INVERTED", 1, 0)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
def constructFDCE(lib):
|
|
234
|
+
fdce = snl.SNLDesign.createPrimitive(lib, "FDCE")
|
|
235
|
+
q = snl.SNLScalarTerm.create(fdce, snl.SNLTerm.Direction.Output, "Q")
|
|
236
|
+
c = snl.SNLScalarTerm.create(fdce, snl.SNLTerm.Direction.Input, "C")
|
|
237
|
+
ce = snl.SNLScalarTerm.create(fdce, snl.SNLTerm.Direction.Input, "CE")
|
|
238
|
+
clr = snl.SNLScalarTerm.create(fdce, snl.SNLTerm.Direction.Input, "CLR")
|
|
239
|
+
d = snl.SNLScalarTerm.create(fdce, snl.SNLTerm.Direction.Input, "D")
|
|
240
|
+
snl.SNLParameter.create_binary(fdce, "INIT", 1, 0b0)
|
|
241
|
+
snl.SNLDesign.addInputsToClockArcs([ce, clr, d], c)
|
|
242
|
+
snl.SNLDesign.addClockToOutputsArcs(c, q)
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
def constructFDPE(lib):
|
|
246
|
+
fdpe = snl.SNLDesign.createPrimitive(lib, "FDPE")
|
|
247
|
+
q = snl.SNLScalarTerm.create(fdpe, snl.SNLTerm.Direction.Output, "Q")
|
|
248
|
+
c = snl.SNLScalarTerm.create(fdpe, snl.SNLTerm.Direction.Input, "C")
|
|
249
|
+
ce = snl.SNLScalarTerm.create(fdpe, snl.SNLTerm.Direction.Input, "CE")
|
|
250
|
+
pre = snl.SNLScalarTerm.create(fdpe, snl.SNLTerm.Direction.Input, "PRE")
|
|
251
|
+
d = snl.SNLScalarTerm.create(fdpe, snl.SNLTerm.Direction.Input, "D")
|
|
252
|
+
snl.SNLParameter.create_binary(fdpe, "INIT", 1, 0b1)
|
|
253
|
+
snl.SNLDesign.addInputsToClockArcs([ce, pre, d], c)
|
|
254
|
+
snl.SNLDesign.addClockToOutputsArcs(c, q)
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def constructFDRE(lib):
|
|
258
|
+
fdre = snl.SNLDesign.createPrimitive(lib, "FDRE")
|
|
259
|
+
q = snl.SNLScalarTerm.create(fdre, snl.SNLTerm.Direction.Output, "Q")
|
|
260
|
+
c = snl.SNLScalarTerm.create(fdre, snl.SNLTerm.Direction.Input, "C")
|
|
261
|
+
ce = snl.SNLScalarTerm.create(fdre, snl.SNLTerm.Direction.Input, "CE")
|
|
262
|
+
r = snl.SNLScalarTerm.create(fdre, snl.SNLTerm.Direction.Input, "R")
|
|
263
|
+
d = snl.SNLScalarTerm.create(fdre, snl.SNLTerm.Direction.Input, "D")
|
|
264
|
+
snl.SNLParameter.create_binary(fdre, "INIT", 1, 0b0)
|
|
265
|
+
snl.SNLDesign.addInputsToClockArcs([ce, r, d], c)
|
|
266
|
+
snl.SNLDesign.addClockToOutputsArcs(c, q)
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
def constructFDSE(lib):
|
|
270
|
+
fdse = snl.SNLDesign.createPrimitive(lib, "FDSE")
|
|
271
|
+
q = snl.SNLScalarTerm.create(fdse, snl.SNLTerm.Direction.Output, "Q")
|
|
272
|
+
c = snl.SNLScalarTerm.create(fdse, snl.SNLTerm.Direction.Input, "C")
|
|
273
|
+
ce = snl.SNLScalarTerm.create(fdse, snl.SNLTerm.Direction.Input, "CE")
|
|
274
|
+
s = snl.SNLScalarTerm.create(fdse, snl.SNLTerm.Direction.Input, "S")
|
|
275
|
+
d = snl.SNLScalarTerm.create(fdse, snl.SNLTerm.Direction.Input, "D")
|
|
276
|
+
snl.SNLParameter.create_binary(fdse, "INIT", 1, 0b0)
|
|
277
|
+
snl.SNLDesign.addInputsToClockArcs([ce, s, d], c)
|
|
278
|
+
snl.SNLDesign.addClockToOutputsArcs(c, q)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
def constructRAM32M(lib):
|
|
282
|
+
ram32m = snl.SNLDesign.createPrimitive(lib, "RAM32M")
|
|
283
|
+
snl.SNLBusTerm.create(ram32m, snl.SNLTerm.Direction.Output, 1, 0, "DOA")
|
|
284
|
+
snl.SNLBusTerm.create(ram32m, snl.SNLTerm.Direction.Output, 1, 0, "DOB")
|
|
285
|
+
snl.SNLBusTerm.create(ram32m, snl.SNLTerm.Direction.Output, 1, 0, "DOC")
|
|
286
|
+
snl.SNLBusTerm.create(ram32m, snl.SNLTerm.Direction.Output, 1, 0, "DOD")
|
|
287
|
+
snl.SNLBusTerm.create(ram32m, snl.SNLTerm.Direction.Input, 4, 0, "ADDRA")
|
|
288
|
+
snl.SNLBusTerm.create(ram32m, snl.SNLTerm.Direction.Input, 4, 0, "ADDRB")
|
|
289
|
+
snl.SNLBusTerm.create(ram32m, snl.SNLTerm.Direction.Input, 4, 0, "ADDRC")
|
|
290
|
+
snl.SNLBusTerm.create(ram32m, snl.SNLTerm.Direction.Input, 4, 0, "ADDRD")
|
|
291
|
+
snl.SNLBusTerm.create(ram32m, snl.SNLTerm.Direction.Input, 1, 0, "DIA")
|
|
292
|
+
snl.SNLBusTerm.create(ram32m, snl.SNLTerm.Direction.Input, 1, 0, "DIB")
|
|
293
|
+
snl.SNLBusTerm.create(ram32m, snl.SNLTerm.Direction.Input, 1, 0, "DIC")
|
|
294
|
+
snl.SNLBusTerm.create(ram32m, snl.SNLTerm.Direction.Input, 1, 0, "DID")
|
|
295
|
+
snl.SNLScalarTerm.create(ram32m, snl.SNLTerm.Direction.Input, "WCLK")
|
|
296
|
+
snl.SNLScalarTerm.create(ram32m, snl.SNLTerm.Direction.Input, "WE")
|
|
297
|
+
snl.SNLParameter.create_binary(ram32m, "INIT_A", 64, 0)
|
|
298
|
+
snl.SNLParameter.create_binary(ram32m, "INIT_B", 64, 0)
|
|
299
|
+
snl.SNLParameter.create_binary(ram32m, "INIT_C", 64, 0)
|
|
300
|
+
snl.SNLParameter.create_binary(ram32m, "INIT_D", 64, 0)
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
def constructRAM64M(lib):
|
|
304
|
+
ram64m = snl.SNLDesign.createPrimitive(lib, "RAM64M")
|
|
305
|
+
snl.SNLScalarTerm.create(ram64m, snl.SNLTerm.Direction.Output, "DOA")
|
|
306
|
+
snl.SNLScalarTerm.create(ram64m, snl.SNLTerm.Direction.Output, "DOB")
|
|
307
|
+
snl.SNLScalarTerm.create(ram64m, snl.SNLTerm.Direction.Output, "DOC")
|
|
308
|
+
snl.SNLScalarTerm.create(ram64m, snl.SNLTerm.Direction.Output, "DOD")
|
|
309
|
+
snl.SNLBusTerm.create(ram64m, snl.SNLTerm.Direction.Input, 5, 0, "ADDRA")
|
|
310
|
+
snl.SNLBusTerm.create(ram64m, snl.SNLTerm.Direction.Input, 5, 0, "ADDRB")
|
|
311
|
+
snl.SNLBusTerm.create(ram64m, snl.SNLTerm.Direction.Input, 5, 0, "ADDRC")
|
|
312
|
+
snl.SNLBusTerm.create(ram64m, snl.SNLTerm.Direction.Input, 5, 0, "ADDRD")
|
|
313
|
+
snl.SNLScalarTerm.create(ram64m, snl.SNLTerm.Direction.Input, "DIA")
|
|
314
|
+
snl.SNLScalarTerm.create(ram64m, snl.SNLTerm.Direction.Input, "DIB")
|
|
315
|
+
snl.SNLScalarTerm.create(ram64m, snl.SNLTerm.Direction.Input, "DIC")
|
|
316
|
+
snl.SNLScalarTerm.create(ram64m, snl.SNLTerm.Direction.Input, "DID")
|
|
317
|
+
snl.SNLScalarTerm.create(ram64m, snl.SNLTerm.Direction.Input, "WCLK")
|
|
318
|
+
snl.SNLScalarTerm.create(ram64m, snl.SNLTerm.Direction.Input, "WE")
|
|
319
|
+
snl.SNLParameter.create_binary(ram64m, "INIT_A", 64, 0)
|
|
320
|
+
snl.SNLParameter.create_binary(ram64m, "INIT_B", 64, 0)
|
|
321
|
+
snl.SNLParameter.create_binary(ram64m, "INIT_C", 64, 0)
|
|
322
|
+
snl.SNLParameter.create_binary(ram64m, "INIT_D", 64, 0)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
def constructRAMB18E1(lib):
|
|
326
|
+
ramb18e1 = snl.SNLDesign.createPrimitive(lib, "RAMB18E1")
|
|
327
|
+
snl.SNLBusTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, 13, 0, "ADDRARDADDR")
|
|
328
|
+
snl.SNLBusTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, 13, 0, "ADDRBWRADDR")
|
|
329
|
+
snl.SNLScalarTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, "CLKARDCLK")
|
|
330
|
+
snl.SNLScalarTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, "CLKBWRCLK")
|
|
331
|
+
snl.SNLBusTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, 15, 0, "DIADI")
|
|
332
|
+
snl.SNLBusTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, 15, 0, "DIBDI")
|
|
333
|
+
snl.SNLBusTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, 1, 0, "DIPADIP")
|
|
334
|
+
snl.SNLBusTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, 1, 0, "DIPBDIP")
|
|
335
|
+
snl.SNLBusTerm.create(ramb18e1, snl.SNLTerm.Direction.Output, 15, 0, "DOADO")
|
|
336
|
+
snl.SNLBusTerm.create(ramb18e1, snl.SNLTerm.Direction.Output, 15, 0, "DOBDO")
|
|
337
|
+
snl.SNLBusTerm.create(ramb18e1, snl.SNLTerm.Direction.Output, 1, 0, "DOPADOP")
|
|
338
|
+
snl.SNLBusTerm.create(ramb18e1, snl.SNLTerm.Direction.Output, 1, 0, "DOPBDOP")
|
|
339
|
+
snl.SNLScalarTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, "ENARDEN")
|
|
340
|
+
snl.SNLScalarTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, "ENBWREN")
|
|
341
|
+
snl.SNLScalarTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, "REGCEAREGCE")
|
|
342
|
+
snl.SNLScalarTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, "REGCEB")
|
|
343
|
+
snl.SNLScalarTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, "RSTRAMARSTRAM")
|
|
344
|
+
snl.SNLScalarTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, "RSTRAMB")
|
|
345
|
+
snl.SNLScalarTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, "RSTREGARSTREG")
|
|
346
|
+
snl.SNLScalarTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, "RSTREGB")
|
|
347
|
+
snl.SNLBusTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, 1, 0, "WEA")
|
|
348
|
+
snl.SNLBusTerm.create(ramb18e1, snl.SNLTerm.Direction.Input, 3, 0, "WEBWE")
|
|
349
|
+
snl.SNLParameter.create_decimal(ramb18e1, "DOA_REG", 0)
|
|
350
|
+
snl.SNLParameter.create_decimal(ramb18e1, "DOB_REG", 0)
|
|
351
|
+
snl.SNLParameter.create_binary(ramb18e1, "INIT_A", 18, 0x00000)
|
|
352
|
+
snl.SNLParameter.create_binary(ramb18e1, "INIT_B", 18, 0x00000)
|
|
353
|
+
for i in range(64):
|
|
354
|
+
paramName = "INIT_" + hex(i)[2:].zfill(2).upper()
|
|
355
|
+
snl.SNLParameter.create_binary(ramb18e1, paramName, 256, 0)
|
|
356
|
+
for i in range(8):
|
|
357
|
+
paramName = "INITP_" + hex(i)[2:].zfill(2).upper()
|
|
358
|
+
snl.SNLParameter.create_binary(ramb18e1, paramName, 256, 0)
|
|
359
|
+
snl.SNLParameter.create_string(ramb18e1, "RAM_MODE", "TDP")
|
|
360
|
+
snl.SNLParameter.create_decimal(ramb18e1, "READ_WIDTH_A", 0)
|
|
361
|
+
snl.SNLParameter.create_decimal(ramb18e1, "READ_WIDTH_B", 0)
|
|
362
|
+
snl.SNLParameter.create_binary(ramb18e1, "SRVAL_A", 18, 0)
|
|
363
|
+
snl.SNLParameter.create_binary(ramb18e1, "SRVAL_B", 18, 0)
|
|
364
|
+
snl.SNLParameter.create_string(ramb18e1, "WRITE_MODE_A", "WRITE_FIRST")
|
|
365
|
+
snl.SNLParameter.create_string(ramb18e1, "WRITE_MODE_B", "WRITE_FIRST")
|
|
366
|
+
snl.SNLParameter.create_decimal(ramb18e1, "WRITE_WIDTH_A", 0)
|
|
367
|
+
snl.SNLParameter.create_decimal(ramb18e1, "WRITE_WIDTH_B", 0)
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
def constructRAMB36E1(lib):
|
|
371
|
+
ramb36e1 = snl.SNLDesign.createPrimitive(lib, "RAMB36E1")
|
|
372
|
+
snl.SNLBusTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, 15, 0, "ADDRARDADDR")
|
|
373
|
+
snl.SNLBusTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, 15, 0, "ADDRBWRADDR")
|
|
374
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, "CASCADEINA")
|
|
375
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, "CASCADEINB")
|
|
376
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Output, "CASCADEOUTA")
|
|
377
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Output, "CASCADEOUTB")
|
|
378
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, "CLKARDCLK")
|
|
379
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, "CLKBWRCLK")
|
|
380
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Output, "DBITERR")
|
|
381
|
+
snl.SNLBusTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, 31, 0, "DIADI")
|
|
382
|
+
snl.SNLBusTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, 31, 0, "DIBDI")
|
|
383
|
+
snl.SNLBusTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, 3, 0, "DIPADIP")
|
|
384
|
+
snl.SNLBusTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, 3, 0, "DIPBDIP")
|
|
385
|
+
snl.SNLBusTerm.create(ramb36e1, snl.SNLTerm.Direction.Output, 31, 0, "DOADO")
|
|
386
|
+
snl.SNLBusTerm.create(ramb36e1, snl.SNLTerm.Direction.Output, 31, 0, "DOBDO")
|
|
387
|
+
snl.SNLBusTerm.create(ramb36e1, snl.SNLTerm.Direction.Output, 3, 0, "DOPADOP")
|
|
388
|
+
snl.SNLBusTerm.create(ramb36e1, snl.SNLTerm.Direction.Output, 3, 0, "DOPBDOP")
|
|
389
|
+
snl.SNLBusTerm.create(ramb36e1, snl.SNLTerm.Direction.Output, 7, 0, "ECCPARITY")
|
|
390
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, "ENARDEN")
|
|
391
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, "ENBWREN")
|
|
392
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, "INJECTDBITERR")
|
|
393
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, "INJECTSBITERR")
|
|
394
|
+
snl.SNLBusTerm.create(ramb36e1, snl.SNLTerm.Direction.Output, 8, 0, "RDADDRECC")
|
|
395
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, "REGCEAREGCE")
|
|
396
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, "REGCEB")
|
|
397
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, "RSTRAMARSTRAM")
|
|
398
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, "RSTRAMB")
|
|
399
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, "RSTREGARSTREG")
|
|
400
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, "RSTREGB")
|
|
401
|
+
snl.SNLScalarTerm.create(ramb36e1, snl.SNLTerm.Direction.Output, "SBITERR")
|
|
402
|
+
snl.SNLBusTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, 3, 0, "WEA")
|
|
403
|
+
snl.SNLBusTerm.create(ramb36e1, snl.SNLTerm.Direction.Input, 7, 0, "WEBWE")
|
|
404
|
+
|
|
405
|
+
snl.SNLParameter.create_decimal(ramb36e1, "DOA_REG", 0)
|
|
406
|
+
snl.SNLParameter.create_decimal(ramb36e1, "DOB_REG", 0)
|
|
407
|
+
snl.SNLParameter.create_binary(ramb36e1, "INIT_A", 36, 0)
|
|
408
|
+
snl.SNLParameter.create_binary(ramb36e1, "INIT_B", 36, 0)
|
|
409
|
+
for i in range(128):
|
|
410
|
+
paramName = "INIT_" + hex(i)[2:].zfill(2).upper()
|
|
411
|
+
snl.SNLParameter.create_binary(ramb36e1, paramName, 256, 0)
|
|
412
|
+
snl.SNLParameter.create_string(ramb36e1, "RAM_EXTENSION_A", "NONE")
|
|
413
|
+
snl.SNLParameter.create_string(ramb36e1, "RAM_EXTENSION_B", "NONE")
|
|
414
|
+
for i in range(16):
|
|
415
|
+
paramName = "INITP_" + hex(i)[2:].zfill(2).upper()
|
|
416
|
+
snl.SNLParameter.create_binary(ramb36e1, paramName, 256, 0)
|
|
417
|
+
snl.SNLParameter.create_string(ramb36e1, "RAM_MODE", "TDP")
|
|
418
|
+
snl.SNLParameter.create_decimal(ramb36e1, "READ_WIDTH_A", 0)
|
|
419
|
+
snl.SNLParameter.create_decimal(ramb36e1, "READ_WIDTH_B", 0)
|
|
420
|
+
snl.SNLParameter.create_decimal(ramb36e1, "WRITE_WIDTH_A", 0)
|
|
421
|
+
snl.SNLParameter.create_decimal(ramb36e1, "WRITE_WIDTH_B", 0)
|
|
422
|
+
snl.SNLParameter.create_binary(ramb36e1, "SRVAL_A", 36, 0)
|
|
423
|
+
snl.SNLParameter.create_binary(ramb36e1, "SRVAL_B", 36, 0)
|
|
424
|
+
snl.SNLParameter.create_string(ramb36e1, "WRITE_MODE_A", "WRITE_FIRST")
|
|
425
|
+
snl.SNLParameter.create_string(ramb36e1, "WRITE_MODE_B", "WRITE_FIRST")
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
def load(db):
|
|
429
|
+
lib = snl.SNLLibrary.createPrimitives(db, "xilinx")
|
|
430
|
+
constructIBUF(lib)
|
|
431
|
+
constructOBUF(lib)
|
|
432
|
+
constructBUFG(lib)
|
|
433
|
+
constructDSP48E1(lib)
|
|
434
|
+
constructINV(lib)
|
|
435
|
+
constructCARRY4(lib)
|
|
436
|
+
constructLUT1(lib)
|
|
437
|
+
constructLUT2(lib)
|
|
438
|
+
constructLUT3(lib)
|
|
439
|
+
constructLUT4(lib)
|
|
440
|
+
constructLUT5(lib)
|
|
441
|
+
constructLUT6(lib)
|
|
442
|
+
constructMUXF7(lib)
|
|
443
|
+
constructMUXF8(lib)
|
|
444
|
+
constructSRL16E(lib)
|
|
445
|
+
constructFDCE(lib)
|
|
446
|
+
constructFDPE(lib)
|
|
447
|
+
constructFDRE(lib)
|
|
448
|
+
constructFDSE(lib)
|
|
449
|
+
constructRAM32M(lib)
|
|
450
|
+
constructRAM64M(lib)
|
|
451
|
+
constructRAMB18E1(lib)
|
|
452
|
+
constructRAMB36E1(lib)
|
najaeda/snl.so
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: najaeda
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Naja EDA Python package
|
|
5
5
|
Author-Email: Naja Authors <contact@keplertech.io>
|
|
6
6
|
License: Apache License 2.0
|
|
@@ -33,10 +33,6 @@ a netlist from a Verilog file.
|
|
|
33
33
|
|
|
34
34
|
.. code-block:: python
|
|
35
35
|
|
|
36
|
-
from os import path
|
|
37
|
-
import sys
|
|
38
|
-
from najaeda import netlist
|
|
39
|
-
|
|
40
36
|
benchmarks = path.join('..','benchmarks')
|
|
41
37
|
liberty_files = [
|
|
42
38
|
'NangateOpenCellLibrary_typical.lib',
|
|
@@ -50,6 +46,23 @@ a netlist from a Verilog file.
|
|
|
50
46
|
|
|
51
47
|
top.dump_verilog('.', 'tinyrocket_naja.v')
|
|
52
48
|
|
|
49
|
+
Load a design with pre-existing libraries
|
|
50
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
51
|
+
In FPGA design environments, Liberty files are often unavailable.
|
|
52
|
+
To address this, the following example demonstrates how to load primitives
|
|
53
|
+
without relying on Liberty files.
|
|
54
|
+
|
|
55
|
+
najaeda comes with pre-configured libraries to simplify this process.
|
|
56
|
+
Currently, it includes support for partial Xilinx primitives, but this can be
|
|
57
|
+
easily extended in the future. Don't hesitate to reach out if you need help.
|
|
58
|
+
|
|
59
|
+
.. code-block:: python
|
|
60
|
+
|
|
61
|
+
netlist.load_primitives('xilinx')
|
|
62
|
+
benchmarks = path.join('..','benchmarks')
|
|
63
|
+
top = netlist.load_verilog([path.join(benchmarks, 'verilog', 'arm_core_netlist.v')])
|
|
64
|
+
#
|
|
65
|
+
|
|
53
66
|
Print all the instances in the netlist
|
|
54
67
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
55
68
|
Next example shows how to browse all the netlist and print all its content.
|
|
@@ -63,6 +76,7 @@ Next example shows how to browse all the netlist and print all its content.
|
|
|
63
76
|
|
|
64
77
|
Documentation
|
|
65
78
|
-------------
|
|
79
|
+
najaeda is a work in progress, and the documentation is still under development.
|
|
66
80
|
|
|
67
81
|
Naja documentation is available on the `Naja GitHub repository <https://github.com/najaeda/naja>`_.
|
|
68
82
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
najaeda-0.1.4.dist-info/RECORD,,
|
|
2
|
+
najaeda-0.1.4.dist-info/WHEEL,sha256=WOiMFvo9bzNKIh5Rxx7xDwR4DzXJ4VAFWxSvvQdE_uA,115
|
|
3
|
+
najaeda-0.1.4.dist-info/METADATA,sha256=rpver3Febf2UhLXS-HAceNHU3YnNLGKde1icywDK_-Y,2842
|
|
4
|
+
najaeda-0.1.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
5
|
+
najaeda-0.1.4.dist-info/licenses/AUTHORS,sha256=7NYEGDAX_1QZvCCHfq8YVXC5ZbwH_pbNI8DcSmm70GU,377
|
|
6
|
+
najaeda/netlist.py,sha256=ena4A9S1UxQV-pO1XWxO_qbG-4ELnorKInJgX0zN3M0,25633
|
|
7
|
+
najaeda/libnaja_snl_python.dylib,sha256=0uzkylAN7mfQQL_oXx0b476SaB2mGyrJXhsxI8nVuhs,740272
|
|
8
|
+
najaeda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
najaeda/libnaja_snl.dylib,sha256=8Ei7KKU0b14IqlvH_8yQSSCpH0rjbxpeRaXgyfSemMY,574112
|
|
10
|
+
najaeda/snl.so,sha256=Og454YB20jBXM9_5w2YG0e-yDHX95KaJxdGK-6FvjW4,97888
|
|
11
|
+
najaeda/primitives/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
najaeda/primitives/xilinx.py,sha256=fuu4KxEIuC0ueCK4C_gds6hzgtJsLE3tjDtOHtY9McM,25947
|
|
@@ -3,4 +3,5 @@
|
|
|
3
3
|
# This does not necessarily list everyone who has contributed code, since in
|
|
4
4
|
# some cases, their employer may be the copyright holder. To see the full list
|
|
5
5
|
# of contributors, see the revision history in source control.
|
|
6
|
-
Christophe Alexandre <christophe.
|
|
6
|
+
Christophe Alexandre <christophe.alexandre@keplertech.io>
|
|
7
|
+
Noam Cohen <noam.cohen@keplertech.io>
|
najaeda/.dylibs/PythonT
DELETED
|
Binary file
|
najaeda-0.1.3.dist-info/RECORD
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
najaeda-0.1.3.dist-info/RECORD,,
|
|
2
|
-
najaeda-0.1.3.dist-info/WHEEL,sha256=WOiMFvo9bzNKIh5Rxx7xDwR4DzXJ4VAFWxSvvQdE_uA,115
|
|
3
|
-
najaeda-0.1.3.dist-info/METADATA,sha256=cUsTBMA9mhbFVF1WSI0wQYb3hc9-ThpBYShih2Yru6E,2147
|
|
4
|
-
najaeda-0.1.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
5
|
-
najaeda-0.1.3.dist-info/licenses/AUTHORS,sha256=e4DCPGHo6wKMyQz24V59EP7zMwalK-KBDBHHlMLFxHY,330
|
|
6
|
-
najaeda/netlist.py,sha256=sKIacJE8olG3-NxUru0ntAnzeU-enJNocnvJ3O0Jnp0,25102
|
|
7
|
-
najaeda/libnaja_snl_python.dylib,sha256=NufBTjIC-14Ailajr63ycpoHng0PONuZY3y26c9aehw,740272
|
|
8
|
-
najaeda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
najaeda/libnaja_snl.dylib,sha256=8Ei7KKU0b14IqlvH_8yQSSCpH0rjbxpeRaXgyfSemMY,574112
|
|
10
|
-
najaeda/snl.so,sha256=Pm6IrWbo5sJ7VbokbTf36Q_tVlttrtXkNT4A_b4X1Pg,97888
|
|
11
|
-
najaeda/.dylibs/PythonT,sha256=PKxrOOyA9Wrc11wkOBZVdQachBkACXp9879F1jMycxc,13116640
|
|
File without changes
|
|
File without changes
|