Skip to content

Commit ffa8e4e

Browse files
committed
grt: add new unit tests for estimate_path_resistance
Signed-off-by: Jonas Gava <[email protected]>
1 parent 2949545 commit ffa8e4e

File tree

4 files changed

+93
-0
lines changed

4 files changed

+93
-0
lines changed

src/grt/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ TESTS = [
2525
"est_rc2",
2626
"est_rc3",
2727
"est_rc4",
28+
"estimate_path_resistance",
2829
"gcd",
2930
"gcd_cugr",
3031
"gcd_flute",

src/grt/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ or_integration_tests(
2323
est_rc2
2424
est_rc3
2525
est_rc4
26+
estimate_path_resistance
2627
gcd
2728
gcd_cugr
2829
gcd_flute
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[INFO ODB-0128] Design: gcd
3+
[INFO ODB-0130] Created 54 pins.
4+
[INFO ODB-0131] Created 676 components and 2850 component-terminals.
5+
[INFO ODB-0133] Created 579 nets and 1498 connections.
6+
Test 1: Basic usage with ITerms
7+
Estimating Path Resistance between pin (_858_/D) and pin (_762_/Z) through net (_000_)
8+
Via resistance: 5 - From metal1 to metal2 at (59850, 111150)
9+
Via resistance: 5 - From metal2 to metal3 at (59850, 111150)
10+
Wire resistance: 10.178572 - From (54150, 111150) - To (59850, 111150) - Layer metal3
11+
Via resistance: 5 - From metal3 to metal2 at (54150, 111150)
12+
Wire resistance: 10.178572 - From (54150, 105450) - To (54150, 111150) - Layer metal2
13+
Via resistance: 5 - From metal2 to metal1 at (54150, 105450)
14+
Total Resistance: 40.357143 ohms
15+
Resistance: 40.35714340209961
16+
17+
Test 2: Usage with layers
18+
Estimating Path Resistance between pin (_858_/D) and pin (_762_/Z) using layers metal2 and metal3
19+
Via resistance (Start): 5 - From Layer metal1 to metal2
20+
Wire resistance: 10.178572 - From (54150, 105450) - To (54150, 111150) - Mapped Layer metal2
21+
Via resistance (Corner): 5 - Between metal3 and metal2
22+
Wire resistance: 10.178572 - From (54150, 111150) - To (59850, 111150) - Mapped Layer metal3
23+
Via resistance (End): 10 - From Layer metal1 to metal3
24+
Total Resistance: 40.357143 ohms
25+
Resistance: 40.35714340209961
26+
27+
Test 3: Usage with BTerms
28+
Estimating resistance between BTerm clk and ITerm _858_/CK
29+
Estimating Path Resistance between pin (clk) and pin (_858_/CK) through net (clk)
30+
Via resistance: 5 - From metal1 to metal2 at (59850, 105450)
31+
Wire resistance: 10.178572 - From (59850, 111150) - To (59850, 105450) - Layer metal2
32+
Via resistance: 5 - From metal2 to metal3 at (59850, 111150)
33+
Wire resistance: 30.535713 - From (76950, 111150) - To (59850, 111150) - Layer metal3
34+
Wire resistance: 20.357143 - From (88350, 111150) - To (76950, 111150) - Layer metal3
35+
Via resistance: 5 - From metal3 to metal2 at (88350, 111150)
36+
Wire resistance: 20.357143 - From (88350, 122550) - To (88350, 111150) - Layer metal2
37+
Wire resistance: 20.357143 - From (88350, 133950) - To (88350, 122550) - Layer metal2
38+
Wire resistance: 10.178572 - From (88350, 139650) - To (88350, 133950) - Layer metal2
39+
Via resistance: 5 - From metal2 to metal3 at (88350, 139650)
40+
Wire resistance: 10.178572 - From (94050, 139650) - To (88350, 139650) - Layer metal3
41+
Via resistance: 5 - From metal3 to metal4 at (94050, 139650)
42+
Wire resistance: 17.1 - From (94050, 162450) - To (94050, 139650) - Layer metal4
43+
Via resistance: 3 - From metal4 to metal5 at (94050, 162450)
44+
Via resistance: 3 - From metal5 to metal6 at (94050, 162450)
45+
Wire resistance: 25.65 - From (94050, 196650) - To (94050, 162450) - Layer metal6
46+
Total Resistance: 195.89287 ohms
47+
Resistance: 195.8928680419922
48+
49+
Test 4: Error handling - Invalid pin
50+
[ERROR GRT-0284] Pin invalid_pin not found.
51+
Expected error: GRT-0284
52+
53+
Test 5: Error handling - Missing layer
54+
[ERROR GRT-0288] Both or neither -layer1 and -layer2 must be provided.
55+
Expected error: GRT-0288
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Test estimate_path_resistance command
2+
source "helpers.tcl"
3+
read_lef "Nangate45/Nangate45.lef"
4+
read_liberty Nangate45/Nangate45_typ.lib
5+
read_def "gcd.def"
6+
7+
set_routing_layers -signal metal2-metal10
8+
9+
global_route
10+
11+
# Test 1: Basic usage with ITerms
12+
puts "Test 1: Basic usage with ITerms"
13+
set res [estimate_path_resistance _858_/D _762_/Z -verbose]
14+
puts "Resistance: $res"
15+
16+
# Test 2: Usage with layers
17+
puts "\nTest 2: Usage with layers"
18+
set res [estimate_path_resistance _858_/D _762_/Z -layer1 metal2 -layer2 metal3 -verbose]
19+
puts "Resistance: $res"
20+
21+
# Test 3: Usage with BTerms
22+
puts "\nTest 3: Usage with BTerms"
23+
24+
puts "Estimating resistance between BTerm clk and ITerm _858_/CK"
25+
set res [estimate_path_resistance clk _858_/CK -verbose]
26+
puts "Resistance: $res"
27+
28+
# Test 4: Error handling - Invalid pin
29+
puts "\nTest 4: Error handling - Invalid pin"
30+
catch {estimate_path_resistance "invalid_pin" _762_/Z} err
31+
puts "Expected error: $err"
32+
33+
# Test 5: Error handling - Missing layer
34+
puts "\nTest 5: Error handling - Missing layer"
35+
catch {estimate_path_resistance _858_/D _762_/Z -layer1 metal2} err
36+
puts "Expected error: $err"

0 commit comments

Comments
 (0)