Transistors.Rose
Last Edited by: Spreitzer, March 20, 1984 1:59:40 pm PST
Directory RoseCreate, RoseRun, RoseTypes, SwitchTypes;
Imports RoseCreate, RoseRun, RoseTypes, SwitchTypes;
Open SwitchTypes, RoseRun, RoseCreate, RoseTypes;
CEDAR
Conductance: TYPE = {Off, Indeterminate, On};
NState: ARRAY Level OF Conductance = [Off, Indeterminate, On];
PState: ARRAY Level OF Conductance = [On, Indeterminate, Off];
;
NETrans:
CELL [gate<
BIT, ch1, ch2=
BIT]
InittableState
strength: Strength ← drive,
conductance: Conductance ← Indeterminate
Initializer
rs: REF Strength ← NARROW[initData];
IF rs # NIL THEN strength ← rs^;
ValsChanged
IF NState[gate.val] # conductance
THEN
{conductance ← NState[gate.val]; PerturbPort[cell, 1]; PerturbPort[cell, 2]};
FindVicinity
SELECT index
FROM
0 => NULL;
1, 2 => IF conductance # Off THEN FindExteriorVicinity[cell, 3-index];
ENDCASE => ERROR;
PropQ
IF conductance = On
THEN {
ch1.s[q] ← MAX[ch1.s[q], MIN[strength, ch2.s[q]]];
ch2.s[q] ← MAX[ch2.s[q], MIN[strength, ch1.s[q]]];
};
PropUD
IF conductance # Off
THEN
BEGIN
ch1.s[u] ← MAX[ch1.s[u], MIN[strength, ch2.s[u]]];
ch2.s[u] ← MAX[ch2.s[u], MIN[strength, ch1.s[u]]];
ch1.s[d] ← MAX[ch1.s[d], MIN[strength, ch2.s[d]]];
ch2.s[d] ← MAX[ch2.s[d], MIN[strength, ch1.s[d]]];
END;
ENDCELL;
PETrans:
CELL [gate<
BIT, ch1, ch2=
BIT]
InittableState
strength: Strength ← drive,
conductance: Conductance ← Indeterminate
Initializer
rs: REF Strength ← NARROW[initData];
IF rs # NIL THEN strength ← rs^;
ValsChanged
IF PState[gate.val] # conductance
THEN
{conductance ← PState[gate.val]; PerturbPort[cell, 1]; PerturbPort[cell, 2]};
FindVicinity
SELECT index
FROM
0 => NULL;
1, 2 => IF conductance # Off THEN FindExteriorVicinity[cell, 3-index];
ENDCASE => ERROR;
PropQ
IF conductance = On
THEN {
ch1.s[q] ← MAX[ch1.s[q], MIN[strength, ch2.s[q]]];
ch2.s[q] ← MAX[ch2.s[q], MIN[strength, ch1.s[q]]];
};
PropUD
IF conductance # Off
THEN
BEGIN
ch1.s[u] ← MAX[ch1.s[u], MIN[strength, ch2.s[u]]];
ch2.s[u] ← MAX[ch2.s[u], MIN[strength, ch1.s[u]]];
ch1.s[d] ← MAX[ch1.s[d], MIN[strength, ch2.s[d]]];
ch2.s[d] ← MAX[ch2.s[d], MIN[strength, ch1.s[d]]];
END;
ENDCELL;
PDTrans:
CELL [gate<
BIT, ch1, ch2=
BIT]
InittableState
strength: Strength ← drive,
conductance: Conductance ← On
Initializer
rs: REF Strength ← NARROW[initData];
IF rs # NIL THEN strength ← rs^;
FindVicinity
SELECT index
FROM
0 => NULL;
1, 2 => IF conductance # Off THEN FindExteriorVicinity[cell, 3-index];
ENDCASE => ERROR;
PropQ
IF conductance = On
THEN {
ch1.s[q] ← MAX[ch1.s[q], MIN[strength, ch2.s[q]]];
ch2.s[q] ← MAX[ch2.s[q], MIN[strength, ch1.s[q]]];
};
PropUD
IF conductance # Off
THEN
BEGIN
ch1.s[u] ← MAX[ch1.s[u], MIN[strength, ch2.s[u]]];
ch2.s[u] ← MAX[ch2.s[u], MIN[strength, ch1.s[u]]];
ch1.s[d] ← MAX[ch1.s[d], MIN[strength, ch2.s[d]]];
ch2.s[d] ← MAX[ch2.s[d], MIN[strength, ch1.s[d]]];
END;
ENDCELL;
NDTrans:
CELL [gate<
BIT, ch1, ch2=
BIT]
InittableState
strength: Strength ← drive,
conductance: Conductance ← On
Initializer
rs: REF Strength ← NARROW[initData];
IF rs # NIL THEN strength ← rs^;
FindVicinity
SELECT index
FROM
0 => NULL;
1, 2 => IF conductance # Off THEN FindExteriorVicinity[cell, 3-index];
ENDCASE => ERROR;
PropQ
IF conductance = On
THEN {
ch1.s[q] ← MAX[ch1.s[q], MIN[strength, ch2.s[q]]];
ch2.s[q] ← MAX[ch2.s[q], MIN[strength, ch1.s[q]]];
};
PropUD
IF conductance # Off
THEN
BEGIN
ch1.s[u] ← MAX[ch1.s[u], MIN[strength, ch2.s[u]]];
ch2.s[u] ← MAX[ch2.s[u], MIN[strength, ch1.s[u]]];
ch1.s[d] ← MAX[ch1.s[d], MIN[strength, ch2.s[d]]];
ch2.s[d] ← MAX[ch2.s[d], MIN[strength, ch1.s[d]]];
END;
ENDCELL;
PassTransistor:
CELL [gate, in<
BIT, out>
BIT]
InittableState
strength: Strength ← drive,
conductance: Conductance ← Indeterminate
Initializer
rs: REF Strength ← NARROW[initData];
IF rs # NIL THEN strength ← rs^;
ValsChanged
IF NState[gate.val] # conductance
THEN
{conductance ← NState[gate.val]; PerturbPort[cell, 2]};
FindVicinity
SELECT index
FROM
0 => NULL;
1 => IF state.conductance # Off THEN FindExteriorVicinity[cell, 3-index];
2 => ERROR;
ENDCASE => ERROR;
PropQ
IF conductance = On
THEN {
IF in.s[q] <
MIN[strength, out.s[q]]
THEN
ERROR Error["Backward flow across unidirectional transistor!", cell];
out.s[q] ← MAX[out.s[q], MIN[strength, in.s[q]]];
};
PropUD
IF conductance # Off
THEN
BEGIN
IF in.s[u] < Block[
MIN[strength, out.s[u]], in.s[q]]
THEN
ERROR Error["Backward flow across unidirectional transistor!", cell];
out.s[u] ← MAX[out.s[u], MIN[strength, in.s[u]]];
IF in.s[d] < Block[
MIN[strength, out.s[d]], in.s[q]]
THEN
ERROR Error["Backward flow across unidirectional transistor!", cell];
out.s[d] ← MAX[out.s[d], MIN[strength, in.s[d]]];
END;
ENDCELL;
PullupTransistor:
CELL [gate, in<
BIT, out>
BIT]
InittableState
strength: Strength ← driveWeak,
conductance: Conductance ← Indeterminate
Initializer
rs: REF Strength ← NARROW[initData];
IF rs # NIL THEN strength ← rs^;
FindVicinity
SELECT index
FROM
0 => NULL;
1 => IF state.conductance # Off THEN FindExteriorVicinity[cell, 3-index];
2 => ERROR;
ENDCASE => ERROR;
PropQ
IF conductance = On
THEN {
IF in.s[q] <
MIN[strength, out.s[q]]
THEN
ERROR Error["Backward flow across unidirectional transistor!", cell];
out.s[q] ← MAX[out.s[q], MIN[strength, in.s[q]]];
};
PropUD
IF conductance # Off
THEN
BEGIN
IF in.s[u] < Block[
MIN[strength, out.s[u]], in.s[q]]
THEN
ERROR Error["Backward flow across unidirectional transistor!", cell];
out.s[u] ← MAX[out.s[u], MIN[strength, in.s[u]]];
IF in.s[d] < Block[
MIN[strength, out.s[d]], in.s[q]]
THEN
ERROR Error["Backward flow across unidirectional transistor!", cell];
out.s[d] ← MAX[out.s[d], MIN[strength, in.s[d]]];
END;
ENDCELL