2 Commits
Author SHA1 Message Date
stefan f863b70457 use float32 for delays, more robust node-port name splitting 2026-05-27 17:02:42 +09:00
stefan bd23dfb016 get a techlib by name 2026-05-20 13:47:13 +09:00
2 changed files with 12 additions and 6 deletions

No files matched your search

+9 -4
View File
@@ -59,7 +59,7 @@ class DelayFile:
if name not in circuit.cells: name = name.replace('[', '_').replace(']', '_')
return circuit.cells.get(name, None)
delays = np.zeros((len(circuit.lines), 2, 2, 3)) # dataset last during construction.
delays = np.zeros((len(circuit.lines), 2, 2, 3), dtype=np.float32) # dataset last during construction.
with log.limit(50):
for name, iopaths in self.cells.items():
@@ -101,14 +101,19 @@ class DelayFile:
* Axis 3: polarity of the transition, 0='rising/posedge', 1='falling/negedge'
"""
delays = np.zeros((len(circuit.lines), 2, 2, 3)) # dataset last during construction.
delays = np.zeros((len(circuit.lines), 2, 2, 3), dtype=np.float32) # dataset last during construction.
def split_node_port(n_str):
if (split := n_str.rfind('.')) > 0 or (split := n_str.rfind('/')) > 0:
return n_str[:split], n_str[split+1:]
return (n_str, None)
nonfork_annotations = 0
for n1, n2, *delvals in self._interconnects:
delvals = [d if len(d) > 0 else [0, 0, 0] for d in delvals]
if max(max(delvals)) == 0: continue
cn1, pn1 = (n1, None) if (slash := n1.rfind('/')) < 0 else (n1[:slash], n1[slash+1:])
cn2, pn2 = (n2, None) if (slash := n2.rfind('/')) < 0 else (n2[:slash], n2[slash+1:])
cn1, pn1 = split_node_port(n1)
cn2, pn2 = split_node_port(n2)
cn1 = cn1.replace('\\','')
cn2 = cn2.replace('\\','')
c1, c2 = circuit.cells[cn1], circuit.cells[cn2]
+3 -2
View File
@@ -10,7 +10,6 @@ from itertools import product
from . import bench
class TechLib:
"""Class for standard cell library definitions.
@@ -640,4 +639,6 @@ $lpflow_isobufsrckapwr_16 input(A,SLEEP) output(X) AI=INV1(A) X=OR2(AI,SL
$lpflow_inputisolatch_1 input(D,SLEEP_B) output(Q) Q=LATCH(D,SLEEP_B) ;
""".replace('$','sky130_fd_sc_hd__'))
"""SkyWater 130nm High Density Digital Standard Cells (skywater-pdk-libs-sky130_fd_sc_hd).
"""
"""
techlib_by_name = {k: v for k, v in globals().items() if isinstance(v, TechLib)}