11load ("@bazel-orfs//:openroad.bzl" , "orfs_flow" )
22
3+ # single source of truth for defaults.
4+ # each number is a unit
5+ # current unit is configured as 2.16 which is on the routing grid for M5
6+
7+ # table of Elements - (rows cols width height pitch_x pitch_y)
8+ MOCK_ARRAY_TABLE = [
9+ 8 ,
10+ 8 ,
11+ 20 ,
12+ 20 ,
13+ 20 ,
14+ 22 ,
15+ ]
16+
17+ # Element'd data width
18+ MOCK_ARRAY_DATAWIDTH = 64
19+
20+ # Must be zero for routing by abutment
21+ MACRO_BLOCKAGE_HALO = 0
22+
23+ MOCK_ARRAY_SCALE = 45
24+
25+ # Routing pitches for relevant metal layers.
26+ # For x, this is M5; for y, this is M4.
27+ # Pitches are specified in OpenROAD-flow-scripts/flow/platforms/asap7/lef/asap7_tech_1x_201209.lef.
28+ # For asap7, x and y pitch is the same.
29+ #
30+ # make_tracks M5 -x_offset 0.012 -x_pitch 0.048 -y_offset 0.012 -y_pitch 0.048
31+ #
32+ # the macro needs to be on a multiple of the track pattern
33+ placement_grid_x = 0.048 * MOCK_ARRAY_SCALE
34+
35+ placement_grid_y = 0.048 * MOCK_ARRAY_SCALE
36+
37+ # number of Elements in row and column, can be control by user via environment variable
38+ # MOCK_ARRAY_TABLE (rows, cols, width, height, pitch_x, pitch_y)
39+ # rows, cols - number of Element in rows, cols
40+ # width, height - width and height of each Element
41+ #
42+ # When the pitch is equal to the width/height, we have routing by abutment
43+ # https://en.wikipedia.org/wiki/Pitch#Linear_measurement
44+ #
45+ # pitch_x, pitch_y - placement pitch for each Element, in x and y direction
46+ # specification are in unit of placement grid
47+ rows , cols , ce_x , ce_y , pitch_x , pitch_y = MOCK_ARRAY_TABLE
48+
49+ # Element size is set to multiple of placement grid above
50+ ce_width = ce_x * placement_grid_x
51+
52+ ce_height = ce_y * placement_grid_y
53+
54+ # top level core offset
55+ margin_x = placement_grid_x
56+
57+ margin_y = placement_grid_y
58+
59+ # Element core margin
60+ ce_margin_x = placement_grid_x * 0.5
61+
62+ ce_margin_y = placement_grid_y * 0.5
63+
64+ # PDN problems if it is smaller. Not investigated.
65+ array_spacing_x = margin_x * 2
66+
67+ array_spacing_y = margin_y * 2
68+
69+ array_offset_x = array_spacing_x + margin_x
70+
71+ array_offset_y = array_spacing_y + margin_y
72+
73+ # top level core and die size
74+ core_width = (
75+ 2 * array_spacing_x + ((placement_grid_x * pitch_x ) * (cols - 1 )) + ce_width
76+ )
77+
78+ core_height = (
79+ 2 * array_spacing_y + ((placement_grid_y * pitch_y ) * (rows - 1 )) + ce_height
80+ )
81+
82+ die_width = core_width + (margin_x * 2 )
83+
84+ die_height = core_height + (margin_y * 2 )
85+
386filegroup (
487 name = "mock-array-constraints" ,
588 srcs = [
@@ -24,8 +107,16 @@ orfs_flow(
24107 arguments = {
25108 "PLACE_PINS_ARGS" : "-annealing" ,
26109 "PLACE_DENSITY" : "0.30" ,
27- "DIE_AREA" : "0 0 358.56 388.8" ,
28- "CORE_AREA" : "2.16 2.16 356.40000000000003 386.64000000000004" ,
110+ "CORE_AREA" : "{} {} {} {}" .format (
111+ margin_x ,
112+ margin_y ,
113+ core_width + margin_x ,
114+ core_height + margin_y ,
115+ ),
116+ "DIE_AREA" : "0 0 {} {}" .format (
117+ die_width ,
118+ die_height ,
119+ ),
29120 "MACRO_PLACE_HALO" : "0 2.16" ,
30121 "RTLMP_BOUNDARY_WT" : "0" ,
31122 "PDN_TCL" : "$(PLATFORM_DIR)/openRoad/pdn/BLOCKS_grid_strategy.tcl" ,
@@ -38,11 +129,13 @@ orfs_flow(
38129 "GND_NETS_VOLTAGES" : "" ,
39130 "IO_PLACER_V" : "M5 M7" ,
40131 "IO_PLACER_H" : "M4 M6" ,
132+ "DETAILED_ROUTE_END_ITERATION" : "6" ,
41133 },
42134 macros = ["Element_generate_abstract" ],
43135 sources = {
44136 "SDC_FILE" : [":mock-array-constraints" ],
45137 "IO_CONSTRAINTS" : [":mock-array-io" ],
138+ # "MACRO_PLACEMENT_TCL": [":macro-placement.tcl"],
46139 },
47140 verilog_files = ["//designs/src/mock-array:verilog" ],
48141)
@@ -73,8 +166,16 @@ orfs_flow(
73166 "PLACE_PINS_ARGS" : "-annealing" ,
74167 "GND_NETS_VOLTAGES" : "" ,
75168 "PWR_NETS_VOLTAGES" : "" ,
76- "DIE_AREA" : "0 0 43.2 43.2" ,
77- "CORE_AREA" : "1.08 1.08 42.120000000000005 42.120000000000005" ,
169+ "CORE_AREA" : "{} {} {} {}" .format (
170+ ce_margin_x ,
171+ ce_margin_y ,
172+ ce_width - ce_margin_x ,
173+ ce_height - ce_margin_y ,
174+ ),
175+ "DIE_AREA" : "0 0 {} {}" .format (
176+ ce_width ,
177+ ce_height ,
178+ ),
78179 "PDN_TCL" : "$(PLATFORM_DIR)/openRoad/pdn/BLOCK_grid_strategy.tcl" ,
79180 },
80181 sources = {
0 commit comments