|
|
|
@ -123,9 +123,13 @@ class TechLibNew:
@@ -123,9 +123,13 @@ class TechLibNew:
|
|
|
|
|
self.cells[name] = (c, pin_dict) |
|
|
|
|
|
|
|
|
|
def pin_index(self, kind, pin): |
|
|
|
|
assert kind in self.cells, f'Unknown cell: {kind}' |
|
|
|
|
assert pin in self.cells[kind][1], f'Unknown pin: {pin} for cell {kind}' |
|
|
|
|
return self.cells[kind][1][pin][0] |
|
|
|
|
|
|
|
|
|
def pin_is_output(self, kind, pin): |
|
|
|
|
assert kind in self.cells, f'Unknown cell: {kind}' |
|
|
|
|
assert pin in self.cells[kind][1], f'Unknown pin: {pin} for cell {kind}' |
|
|
|
|
return self.cells[kind][1][pin][1] |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -377,4 +381,39 @@ SDFFSSRX{1,2}$ input(CLK,D,RSTB,SETB,SI,SE) output(Q,QN) DR=AND2(D,RSTB) SET=IN
@@ -377,4 +381,39 @@ SDFFSSRX{1,2}$ input(CLK,D,RSTB,SETB,SI,SE) output(Q,QN) DR=AND2(D,RSTB) SET=IN
|
|
|
|
|
SDFFX{1,2}$ input(D,CLK,SE,SI) output(Q,QN) DI=MUX21(D,SI,SE) Q=DFF(DI,CLK) QN=INV1(Q) ; |
|
|
|
|
|
|
|
|
|
LATCHX{1,2}$ input(D,CLK) output(Q,QN) Q=LATCH(D,CLK) QN=INV1(Q) ; |
|
|
|
|
""".replace('$','_RVT')) |
|
|
|
|
""".replace('$','_RVT')) |
|
|
|
|
|
|
|
|
|
GSC180 = TechLibNew(r""" |
|
|
|
|
BUFX{1,3} input(A) output(Y) Y=BUF1(A) ; |
|
|
|
|
CLKBUFX{1,2,3} input(A) output(Y) Y=BUF1(A) ; |
|
|
|
|
INVX{1,2,4,8} input(A) output(Y) Y=INV1(A) ; |
|
|
|
|
TBUFX{1,2,4,8} input(A,OE) output(Y) Y=AND2(A,OE) ; |
|
|
|
|
TINVX1 input(A,OE) output(Y) AB=INV1(A) Y=AND2(AB,OE) ; |
|
|
|
|
|
|
|
|
|
AND2X1 input(A,B) output(Y) Y=AND2(A,B) ; |
|
|
|
|
NAND2X{1,2} input(A,B) output(Y) Y=NAND2(A,B) ; |
|
|
|
|
NAND3X1 input(A,B,C) output(Y) Y=NAND3(A,B,C) ; |
|
|
|
|
NAND4X1 input(A,B,C,D) output(Y) Y=NAND4(A,B,C,D) ; |
|
|
|
|
OR2X1 input(A,B) output(Y) Y=OR2(A,B) ; |
|
|
|
|
OR4X1 input(A,B,C,D) output(Y) Y=OR4(A,B,C,D) ; |
|
|
|
|
NOR2X1 input(A,B) output(Y) Y=NOR2(A,B) ; |
|
|
|
|
NOR3X1 input(A,B,C) output(Y) Y=NOR3(A,B,C) ; |
|
|
|
|
NOR4X1 input(A,B,C,D) output(Y) Y=NOR4(A,B,C,D) ; |
|
|
|
|
XOR2X1 input(A,B) output(Y) Y=XOR2(A,B) ; |
|
|
|
|
|
|
|
|
|
MX2X1 input(A,B,S0) output(Y) Y=MUX21(A,B,S0) ; |
|
|
|
|
AOI21X1 input(A0,A1,B0) output(Y) Y=AOI21(A0,A1,B0) ; |
|
|
|
|
AOI22X1 input(A0,A1,B0,B1) output(Y) Y=AOI22(A0,A1,B0,B1) ; |
|
|
|
|
OAI21X1 input(A0,A1,B0) output(Y) Y=OAI21(A0,A1,B0) ; |
|
|
|
|
OAI22X1 input(A0,A1,B0,B1) output(Y) Y=OAI22(A0,A1,B0,B1) ; |
|
|
|
|
OAI33X1 input(A0,A1,A2,B0,B1,B2) output(Y) AA=OR2(A0,A1) BB=OR2(B0,B1) Y=OAI22(AA,A2,BB,B2) ; |
|
|
|
|
ADDFX1 input(A,B,CI) output(CO,S) AB=XOR2(A,B) CO=XOR(AB,CI) S=AO22(AB,CI,A,B) ; |
|
|
|
|
ADDHX1 input(A,B) output(CO,S) CO=XOR2(A,B) S=AND2(A,B) ; |
|
|
|
|
|
|
|
|
|
DFFX1 input(CK,D) output(Q,QN) Q=DFF(D,CK) QN=INV1(Q) ; |
|
|
|
|
DFFSRX1 input(CK,D,RN,SN) output(Q,QN) DR=AND2(D,RN) SET=INV1(SN) DRS=OR2(DR,SET) Q=DFF(DRS,CK) QN=INV1(Q) ; |
|
|
|
|
SDFFSRX1 input(CK,D,RN,SE,SI,SN) output(Q,QN) DR=AND2(D,RN) SET=INV1(SN) DRS=OR2(DR,SET) DI=MUX21(DRS,SI,SE) Q=DFF(DI,CK) QN=INV1(Q) ; |
|
|
|
|
|
|
|
|
|
TLATSRX1 input(D,G,RN,SN) output(Q,QN) DR=AND2(D,RN) SET=INV1(SN) DRS=OR2(DR,SET) Q=LATCH(DRS,G) QN=INV1(Q) ; |
|
|
|
|
TLATX1 input(C,D) output(Q,QN) Q=LATCH(D,C) QN=INV1(Q) ; |
|
|
|
|
""") |