|
1 | 1 | import os |
2 | 2 |
|
3 | | -# number of Elements in row and column, user can set via environment variable |
4 | | -rows = int(os.environ.get("MOCK_ARRAY_HEIGHT")) |
5 | | -cols = int(os.environ.get("MOCK_ARRAY_WIDTH")) |
6 | | - |
7 | | -# Element placement pitch can be control by user |
8 | | -pitch_scale = int(os.environ.get("MOCK_ARRAY_PITCH_SCALE")) |
9 | | - |
10 | | -if pitch_scale < 1: |
11 | | - raise Exception("Element placement pitch must be greater than 1") |
12 | | - |
13 | | -# Routing pitches for relevant metal layers. |
14 | | -# For x, this is M5; for y, this is M4. |
15 | | -# Pitches are specified in OpenROAD-flow-scripts/flow/platforms/asap7/lef/asap7_tech_1x_201209.lef. |
16 | | -# For asap7, x and y pitch is the same. |
17 | | -# |
18 | | -# make_tracks M5 -x_offset 0.012 -x_pitch 0.048 -y_offset 0.012 -y_pitch 0.048 |
19 | | -# |
20 | | -# the macro needs to be on a multiple of the track pattern |
21 | | -routing_pitch = 0.048 |
22 | | - |
23 | | -placement_grid_x = routing_pitch |
24 | | -placement_grid_y = routing_pitch |
25 | | - |
26 | | -# historically pitch_scale 2 was ca 13 um |
27 | | -ce_width = int(3 * 2.16 / placement_grid_x) * placement_grid_x * pitch_scale |
28 | | -ce_height = int(3 * 2.16 / placement_grid_y) * placement_grid_y * pitch_scale |
29 | | -ce_margin_x = placement_grid_x * 8 |
30 | | -ce_margin_y = placement_grid_y * 8 |
| 3 | +# routing pitch for M4, M5 and M6 tied to placement grid at 2.16 |
| 4 | +# therefore, the optimal placement and Element size should be multiple of 2.16 |
| 5 | +# set grid x and y |
| 6 | +placement_grid_x = 2.16 |
| 7 | +placement_grid_y = 2.16 |
| 8 | + |
| 9 | +# number of Elements in row and column, can be control by user via environment variable |
| 10 | +# MOCK_ARRAY_TABLE (rows, cols, width, height, pitch_x, pitch_y) |
| 11 | +# rows, cols - number of Element in rows, cols |
| 12 | +# width, height - width and height of each Element |
| 13 | +# pitch_x, pitch_y - placement pitch for each Element, in x and y direction |
| 14 | +# specification are in unit of placement grid |
| 15 | +rows, cols, ce_x, ce_y, pitch_x, pitch_y = map(int, os.environ.get("MOCK_ARRAY_TABLE").split()) |
| 16 | + |
| 17 | +# Element size is set to multiple of placement grid above |
| 18 | +ce_width = ce_x * placement_grid_x |
| 19 | +ce_height = ce_y * placement_grid_y |
31 | 20 |
|
32 | 21 | # top level core offset |
33 | | -margin_x = int(2.16 / placement_grid_x) * placement_grid_x |
34 | | -margin_y = int(2.16 / placement_grid_y) * placement_grid_y |
35 | | - |
36 | | -channel = 12 # int(os.environ.get("MACRO_PLACE_CHANNEL").split()[0]) |
| 22 | +margin_x = placement_grid_x |
| 23 | +margin_y = placement_grid_y |
37 | 24 |
|
38 | | -# Element placement, can be controlled by user |
39 | | -ce_pitch_x = ce_width + int((channel * 2) / placement_grid_x) * placement_grid_x |
40 | | -ce_pitch_y = ce_height + int((channel * 2) / placement_grid_y) * placement_grid_y |
| 25 | +# Element core margin |
| 26 | +ce_margin_x = placement_grid_x * 0.5 |
| 27 | +ce_margin_y = placement_grid_y * 0.5 |
41 | 28 |
|
42 | | -# top level core size |
43 | | -core_width = ce_pitch_x * cols + ce_width |
44 | | -core_height = ce_pitch_y * rows + ce_height |
| 29 | +# top level core and die size |
| 30 | +core_width = ((placement_grid_x * pitch_x) * (cols + 1)) + (ce_width * cols) |
| 31 | +core_height = ((placement_grid_y * pitch_y) * (rows + 1)) + (ce_height * rows) |
45 | 32 |
|
46 | | -die_width = core_width + (2 * margin_x) |
47 | | -die_height = core_height + (2 * margin_y) |
| 33 | +die_width = core_width + (margin_x * 2) |
| 34 | +die_height = core_height + (margin_y * 2) |
0 commit comments