Skip to content

Commit 2552f00

Browse files
authored
Merge pull request #8178 from Pinata-Consulting/power-mock-array-element
power: hierarchical .odb testing
2 parents 823d133 + 15ccc9b commit 2552f00

File tree

3 files changed

+40
-29
lines changed

3 files changed

+40
-29
lines changed

test/orfs/mock-array/BUILD

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ MOCK_ARRAY_TABLE = [
2525
22,
2626
]
2727

28-
# Element'd data width
29-
MOCK_ARRAY_DATAWIDTH = 64
30-
31-
# Must be zero for routing by abutment
32-
MACRO_BLOCKAGE_HALO = 0
33-
3428
MOCK_ARRAY_SCALE = 45
3529

3630
# Routing pitches for relevant metal layers.
@@ -77,10 +71,6 @@ array_spacing_x = margin_x * 2
7771

7872
array_spacing_y = margin_y * 2
7973

80-
array_offset_x = array_spacing_x + margin_x
81-
82-
array_offset_y = array_spacing_y + margin_y
83-
8474
# top level core and die size
8575
core_width = (
8676
2 * array_spacing_x + ((placement_grid_x * pitch_x) * (cols - 1)) + ce_width
@@ -191,7 +181,12 @@ orfs_flow(
191181
ce_height,
192182
),
193183
"PDN_TCL": "$(PLATFORM_DIR)/openRoad/pdn/BLOCK_grid_strategy.tcl",
184+
# We want to report power per module using hierarhical .odb
194185
"OPENROAD_HIERARCHICAL": "1",
186+
# Keep only one module, enough for testing, faster builds. There's
187+
# some width in multiply reduction going on here to speed up
188+
# builds, so we want to keep this exact module.
189+
"SYNTH_KEEP_MODULES": "Multiplier",
195190
},
196191
sources = {
197192
"IO_CONSTRAINTS": [":mock-array-element-io"],
@@ -339,6 +334,8 @@ genrule(
339334
],
340335
)
341336

337+
# If we want to measure power after final, instead of with estimated parasitics,
338+
# we'll need this.
342339
SPEFS_AND_NETLISTS = [
343340
":results/asap7/{macro}/{stem}.{ext}".format(
344341
ext = ext,

test/orfs/mock-array/rules-base.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"synth__design__instance__area__stdcell": {
3-
"value": 7635.06,
3+
"value": 14185.31,
44
"compare": "<="
55
},
66
"constraints__clocks__count": {
77
"value": 1,
88
"compare": "=="
99
},
1010
"placeopt__design__instance__area": {
11-
"value": 138015,
11+
"value": 137948,
1212
"compare": "<="
1313
},
1414
"placeopt__design__instance__count__stdcell": {
@@ -32,7 +32,7 @@
3232
"compare": "<="
3333
},
3434
"detailedroute__route__wirelength": {
35-
"value": 77761,
35+
"value": 73938,
3636
"compare": "<="
3737
},
3838
"detailedroute__route__drc_errors": {
@@ -48,23 +48,23 @@
4848
"compare": "<="
4949
},
5050
"finish__timing__setup__ws": {
51-
"value": -351.636,
51+
"value": 0.0,
5252
"compare": ">="
5353
},
5454
"finish__design__instance__area": {
55-
"value": 138064,
55+
"value": 137975,
5656
"compare": "<="
5757
},
5858
"finish__timing__drv__setup_violation_count": {
5959
"value": 536,
6060
"compare": "<="
6161
},
6262
"finish__timing__drv__hold_violation_count": {
63-
"value": 108,
63+
"value": 100,
6464
"compare": "<="
6565
},
6666
"finish__timing__wns_percent_delay": {
67-
"value": -107.06,
67+
"value": -10.0,
6868
"compare": ">="
6969
}
7070
}

test/orfs/mock-array/src/main/scala/MockArray.scala

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,35 @@ class MockArrayBundle(width: Int, height: Int, singleElementWidth: Int) extends
4949
val lsbs = Output(Vec(width * height, Bool()))
5050
}
5151

52+
class MultiplierIO extends Bundle {
53+
val a = Input(UInt(32.W))
54+
val b = Input(UInt(32.W))
55+
val o = Output(UInt(32.W))
56+
val rst = Input(Bool())
57+
val clk = Input(Clock())
58+
}
59+
5260
// Generated with:
5361
//
5462
// vlsi-multiplier --register-input --register-post-ppg --register-post-ppa --register-output --bits=32 --algorithm=brentkung --tech=asap7 --output=multiplier.v
55-
class Multiplier extends BlackBox with HasBlackBoxResource {
63+
class MultiplierBlackBox extends BlackBox with HasBlackBoxResource {
5664
override def desiredName = "multiplier"
57-
val io = IO(new Bundle {
58-
val a = Input(UInt(32.W))
59-
val b = Input(UInt(32.W))
60-
val o = Output(UInt(32.W))
61-
val rst = Input(Bool())
62-
val clk = Input(Clock())
63-
})
65+
val io = IO(new MultiplierIO())
66+
}
67+
68+
// This module is kept in synthesis for hierarchical power testing purposes
69+
class Multiplier extends RawModule {
70+
val io = IO(new MultiplierIO())
71+
72+
val mod = Module(new MultiplierBlackBox())
73+
mod.io.a := io.a
74+
mod.io.b := io.b
75+
mod.io.rst := io.rst
76+
mod.io.clk := io.clk
77+
// reduce output bit-width until we slight negative slack
78+
// and also until we run in a few minutes for fast local
79+
// smoke-testing
80+
io.o := mod.io.o(3, 0)
6481
}
6582

6683
class MockArray(width: Int, height: Int, singleElementWidth: Int)
@@ -89,10 +106,7 @@ class MockArray(width: Int, height: Int, singleElementWidth: Int)
89106
// save some area and complexity by not having reset
90107
mult.io.rst := false.B
91108
mult.io.clk := clock
92-
// reduce output bit-width until we slight negative slack
93-
// and also until we run in a few minutes for fast local
94-
// smoke-testing
95-
mult.io.o(3, 0)
109+
mult.io.o
96110
})
97111
}
98112

0 commit comments

Comments
 (0)