mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-01 10:27:53 +02:00
WIP: some enhancements
Spice writer: don't prefix model name with "M" Added "device_class_mismatch" message to netlist compare Assertion if device classes or circuits are nil on "same_..."
This commit is contained in:
Vendored
+2
-2
@@ -10,7 +10,7 @@
|
||||
* net 3 n3
|
||||
* net 4 n4
|
||||
* device instance $1 0,0 M3CLS
|
||||
M$1 1 4 3 1 MM3CLS L=0.25U W=0.18U AS=1.2P AD=0.75P PS=2.2U PD=1.75U
|
||||
M$1 1 4 3 1 M3CLS L=0.25U W=0.18U AS=1.2P AD=0.75P PS=2.2U PD=1.75U
|
||||
* device instance $2 0,0 M3CLS
|
||||
M$2 3 4 2 3 MM3CLS L=1.4U W=0.25U AS=1.3P AD=0.85P PS=2.3U PD=1.85U
|
||||
M$2 3 4 2 3 M3CLS L=1.4U W=0.25U AS=1.3P AD=0.85P PS=2.3U PD=1.85U
|
||||
.ENDS C1
|
||||
|
||||
Vendored
+2
-2
@@ -12,7 +12,7 @@
|
||||
* net 4 n4
|
||||
* net 5 n5
|
||||
* device instance $1 0,0 M4CLS
|
||||
M$1 1 4 3 5 MM4CLS L=0.25U W=0.18U AS=1.2P AD=0.75P PS=2.2U PD=1.75U
|
||||
M$1 1 4 3 5 M4CLS L=0.25U W=0.18U AS=1.2P AD=0.75P PS=2.2U PD=1.75U
|
||||
* device instance $2 0,0 M4CLS
|
||||
M$2 3 4 2 5 MM4CLS L=1.4U W=0.25U AS=1.3P AD=0.85P PS=2.3U PD=1.85U
|
||||
M$2 3 4 2 5 M4CLS L=1.4U W=0.25U AS=1.3P AD=0.85P PS=2.3U PD=1.85U
|
||||
.ENDS C1
|
||||
|
||||
Vendored
+2
-2
@@ -28,7 +28,7 @@ XSC2 3 2 4 3 C1
|
||||
* net 4 n4
|
||||
* net 5 n5
|
||||
* device instance $1 0,0 M4CLS
|
||||
M$1 1 4 3 5 MM4CLS L=0.25U W=0.18U AS=1.2P AD=0.75P PS=2.2U PD=1.75U
|
||||
M$1 1 4 3 5 M4CLS L=0.25U W=0.18U AS=1.2P AD=0.75P PS=2.2U PD=1.75U
|
||||
* device instance $2 0,0 M4CLS
|
||||
M$2 3 4 2 5 MM4CLS L=1.4U W=0.25U AS=1.3P AD=0.85P PS=2.3U PD=1.85U
|
||||
M$2 3 4 2 5 M4CLS L=1.4U W=0.25U AS=1.3P AD=0.85P PS=2.3U PD=1.85U
|
||||
.ENDS C1
|
||||
|
||||
Vendored
+35
@@ -33,6 +33,10 @@ class NetlistCompareTestLogger < RBA::GenericNetlistCompareLogger
|
||||
@texts << text
|
||||
end
|
||||
|
||||
def device_class_mismatch(a, b)
|
||||
out("device_class_mismatch " + dc2str(a) + " " + dc2str(b))
|
||||
end
|
||||
|
||||
def begin_circuit(a, b)
|
||||
out("begin_circuit " + circuit2str(a) + " " + circuit2str(b))
|
||||
end
|
||||
@@ -101,6 +105,10 @@ class NetlistCompareTestLogger < RBA::GenericNetlistCompareLogger
|
||||
@texts = []
|
||||
end
|
||||
|
||||
def dc2str(x)
|
||||
return x ? x.name : "(null)"
|
||||
end
|
||||
|
||||
def circuit2str(x)
|
||||
return x ? x.name : "(null)"
|
||||
end
|
||||
@@ -173,6 +181,27 @@ class NetlistCompare_TestClass < TestBase
|
||||
|
||||
def test_1
|
||||
|
||||
nl1 = RBA::Netlist::new
|
||||
nl2 = RBA::Netlist::new
|
||||
dc = RBA::DeviceClass::new
|
||||
dc.name = "A"
|
||||
nl1.add(dc)
|
||||
dc = RBA::DeviceClass::new
|
||||
dc.name = "B"
|
||||
nl2.add(dc)
|
||||
|
||||
logger = NetlistCompareTestLogger::new
|
||||
comp = RBA::NetlistComparer::new(logger)
|
||||
|
||||
good = comp.compare(nl1, nl2)
|
||||
|
||||
assert_equal(logger.text, <<"END")
|
||||
device_class_mismatch A (null)
|
||||
device_class_mismatch (null) B
|
||||
END
|
||||
|
||||
assert_equal(good, false)
|
||||
|
||||
nls1 = <<"END"
|
||||
circuit INV($1=IN,$2=OUT,$3=VDD,$4=VSS);
|
||||
device PMOS $1(S=VDD,G=IN,D=OUT)(L=0.25,W=0.95,AS=0.49875,AD=0.26125,PS=2.95,PD=1.5);
|
||||
@@ -247,6 +276,9 @@ END
|
||||
|
||||
logger.clear
|
||||
comp.same_device_classes(nl1.device_class_by_name("NMOS"), nl2.device_class_by_name("NMOSB"))
|
||||
# avoids device class mismatch errors
|
||||
comp.same_device_classes(nl1.device_class_by_name("NMOSB"), nl2.device_class_by_name("NMOS"))
|
||||
comp.same_device_classes(nl1.device_class_by_name("PMOSB"), nl2.device_class_by_name("PMOS"))
|
||||
good = comp.compare(nl1, nl2)
|
||||
|
||||
assert_equal(logger.text(), <<"END")
|
||||
@@ -905,6 +937,9 @@ END
|
||||
|
||||
logger.clear
|
||||
comp.same_device_classes(nl1.device_class_by_name("NMOS"), nl2.device_class_by_name("NMOSB"))
|
||||
# avoids device class mismatch errors
|
||||
comp.same_device_classes(nl1.device_class_by_name("NMOSB"), nl2.device_class_by_name("NMOS"))
|
||||
comp.same_device_classes(nl1.device_class_by_name("PMOSB"), nl2.device_class_by_name("PMOS"))
|
||||
good = comp.compare(nl1, nl2)
|
||||
|
||||
assert_equal(logger.text(), <<"END")
|
||||
|
||||
Reference in New Issue
Block a user