Skip to content

Commit 335fece

Browse files
authored
Merge pull request #1064 from louiic/mab_0509
Mock Array Big - Power Grid and macro placement modification
2 parents ab3c847 + 44db8a8 commit 335fece

File tree

10 files changed

+256
-235
lines changed

10 files changed

+256
-235
lines changed

flow/designs/asap7/mock-array-big/Element/config.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ export DIE_AREA = $(shell python3 designs/asap7/mock-array-big/ce_die_area.py)
1616
export IO_CONSTRAINTS = designs/asap7/mock-array-big/Element/io.tcl
1717

1818
export PDN_TCL = designs/asap7/mock-array-big/Element/pdn.tcl
19+
20+
# max routing layer need to be set to M5, since M6 is needed for next level up to connect
21+
# to the ring and stipe
22+
export MAX_ROUTING_LAYER = M5

flow/designs/asap7/mock-array-big/Element/pdn.tcl

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,29 @@
33
####################################
44
add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power
55
add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground
6+
67
####################################
78
# voltage domains
89
####################################
910
set_voltage_domain -name {CORE} -power {VDD} -ground {VSS}
11+
1012
####################################
1113
# standard cell grid
14+
# M1 M2 are for follow pin, width derived from PG rail in standard cell
15+
# M5 stripe width rerived from one of width allowed in LEF, offset and pitch
16+
# put stripe on M5 track
17+
# M4 M5 ring follow stripe width
1218
####################################
1319
define_pdn_grid -name {top} -voltage_domains {CORE}
14-
add_pdn_stripe -grid {top} -layer {M1} -width {0.018} -pitch {0.54} -offset {0} -followpins
15-
add_pdn_stripe -grid {top} -layer {M2} -width {0.018} -pitch {0.54} -offset {0} -followpins
16-
add_pdn_stripe -grid {top} -layer {M5} -width {0.12} -spacing {0.072} -pitch {11.88} -offset {0.300}
20+
21+
add_pdn_ring -grid {top} -layers {M5 M4} -widths {0.12 0.12} -spacings {0.072} -core_offset {0.084}
22+
23+
add_pdn_stripe -grid {top} -layer {M1} -width {0.018} -pitch {0.54} -offset {0} -followpins
24+
add_pdn_stripe -grid {top} -layer {M2} -width {0.018} -pitch {0.54} -offset {0} -followpins
25+
26+
add_pdn_stripe -grid {top} -layer {M5} -width {0.12} -spacing {0.072} -pitch {2.976} -offset {1.5} -extend_to_core_ring
27+
1728
add_pdn_connect -grid {top} -layers {M1 M2}
1829
add_pdn_connect -grid {top} -layers {M2 M5}
30+
add_pdn_connect -grid {top} -layers {M4 M5}
1931

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import config
22

3-
margin = config.routing_pitch * 10
3+
margin_x = config.placement_grid_x * 8
4+
margin_y = config.placement_grid_y * 2
45

5-
print(f'{margin} {margin} {config.pitch - margin} {config.pitch - margin}')
6+
print(f'{margin_x} {margin_y} {config.ce_width - margin_x} {config.ce_height - margin_y}')
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
import config
22

3-
print(f'0 0 {config.pitch} {config.pitch}')
3+
margin_x = config.placement_grid_x * 8
4+
margin_y = config.placement_grid_y * 2
5+
6+
print(f'0 0 {config.ce_width} {config.ce_height}')
Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,36 @@
1-
# see flow/platforms/asap7/openRoad/pdn/grid_strategy-M2-M5-M7.tcl
21
import os
32

3+
# number of Elements in row and column, user can set via environment variable
44
rows = int(os.environ.get("MOCK_ARRAY_HEIGHT", "8"))
55
cols = int(os.environ.get("MOCK_ARRAY_WIDTH", "8"))
6+
7+
# Element placement pitch can be control by user
68
pitch_scale = int(os.environ.get("MOCK_ARRAY_PITCH_SCALE", "2"))
79

8-
# Routing pitches for relevant metal layers.
9-
# For x, this is M5; for y, this is M4.
10-
# Pitches are specified in OpenROAD-flow-scripts/flow/platforms/asap7/lef/asap7_tech_1x_201209.lef.
11-
# For asap7, x and y pitch is the same.
12-
routing_pitch = 0.048
13-
14-
# 0.048 * 125 = 6, which is a nice round number to work with
15-
pitch = routing_pitch * 125 * pitch_scale
16-
margin = routing_pitch * 125 * 2
17-
core_offset_x = margin
18-
core_offset_y = margin
19-
die_offset_x = core_offset_x + margin
20-
die_offset_y = core_offset_y + margin
21-
22-
pitch_and_margin = pitch + margin
23-
24-
core_width = cols * pitch_and_margin + core_offset_x
25-
core_height = rows * pitch_and_margin + core_offset_y
26-
die_width = core_width + margin * 2
27-
die_height = core_height + margin * 2
10+
if pitch_scale < 1:
11+
raise Exception("Element placement pitch must be greater than 1")
12+
13+
# routing pitch for M4, M5 and M6 tied to placement grid at 2.16
14+
# therefore, the Element size should be multiple of 2.16 and
15+
# placement of Element should be multiple of 2.16
16+
placement_grid_x = 0.054
17+
placement_grid_y = 0.27
18+
19+
# Element size is set to multiple of 2.16
20+
ce_width = 12.96
21+
ce_height = 12.96
22+
23+
# Element placement, can be controled by user
24+
ce_pitch_x = ce_width * pitch_scale
25+
ce_pitch_y = ce_height * pitch_scale
26+
27+
# top level core offset
28+
margin_x = 2.16
29+
margin_y = 2.16
30+
31+
# top level core size
32+
core_width = (ce_pitch_x * (cols + 0.5))
33+
core_height = (ce_pitch_y * (rows + 0.5))
34+
35+
die_width = core_width + (2 * margin_x)
36+
die_height = core_height + (2 * margin_y)
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
import config
22

3-
x = config.core_offset_x
4-
y = config.core_offset_y
5-
6-
print(f'{x} {y} {x+config.core_width} {y+config.core_height}')
3+
print(f'{config.margin_x} {config.margin_y} {config.core_width + config.margin_x} {config.core_height + config.margin_y}')
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
# fish out values from single source of truth: config.py
2-
set vals [regexp -all -inline {\S+} [exec sh -c {cd designs/asap7/mock-array-big && python3 -c "import config;print(f'{config.rows} {config.cols} {config.pitch_and_margin} {config.die_offset_x} {config.die_offset_y}')"}]]
3-
lassign $vals rows cols pitch_and_margin die_offset_x die_offset_y
2+
set vals [regexp -all -inline {\S+} [exec sh -c {cd designs/asap7/mock-array-big && python3 -c "import config;print(f'{config.rows} {config.cols} {config.ce_pitch_x} {config.ce_pitch_y} {config.margin_x} {config.margin_y} {config.placement_grid_x} {config.placement_grid_y}')"}]]
3+
lassign $vals rows cols ce_pitch_x ce_pitch_y margin_x margin_y placement_grid_x placement_grid_y
44

55
set block [ord::get_db_block]
66
set units [$block getDefUnits]
77

8+
set x [expr ($margin_x + ($ce_pitch_x / 2)) * $units]
9+
set y [expr ($margin_y + ($ce_pitch_y / 2)) * $units]
10+
811
for {set row 0} {$row < $rows} {incr row} {
912
for {set col 0} {$col < $cols} {incr col} {
1013
set inst [$block findInst [format "ces_%d_%d" $row $col]]
1114
$inst setOrient R0
12-
set x [expr round([expr {$die_offset_x + $col * $pitch_and_margin}] * $units)]
13-
set y [expr round([expr {$die_offset_y + $row * $pitch_and_margin}] * $units)]
1415

15-
$inst setOrigin $x $y
16+
$inst setOrigin [expr int($x)] [expr int($y)]
1617
$inst setPlacementStatus FIRM
18+
19+
set x [expr $x + ($ce_pitch_x * $units)]
1720
}
21+
set y [expr $y + ($ce_pitch_y * $units)]
22+
set x [expr ($margin_x + ($ce_pitch_x / 2)) * $units]
1823
}

0 commit comments

Comments
 (0)