File size: 5,690 Bytes
d59bb1b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# Detailed Placement

The detailed placement module in OpenROAD (`dpl`) is based on OpenDP, or 
Open-Source Detailed Placement Engine. Its key features are: 

-   Fence region.
-   Fragmented ROWs.

## Commands

```{note}
- Parameters in square brackets `[-param param]` are optional.
- Parameters without square brackets `-param2 param2` are required.
```

### Detailed Placement

The `detailed_placement` command performs detailed placement of instances
to legal locations after global placement.

```tcl
detailed_placement
    [-max_displacement disp|{disp_x disp_y}]
    [-disallow_one_site_gaps]
    [-report_file_name filename]
```

#### Options

| Switch Name | Description | 
| ----- | ----- |
| `-max_displacement` | Max distance that an instance can be moved (in microns) when finding a site where it can be placed. Either set one value for both directions or set `{disp_x disp_y}` for individual directions. The default values are `{0, 0}`, and the allowed values within are integers `[0, MAX_INT]`. |
| `-disallow_one_site_gaps` | Disable one site gap during placement check. |
| `-report_file_name` | File name for saving the report to (e.g. `report.json`.) |

### Set Placement Padding

The `set_placement_padding` command sets left and right padding in multiples
of the row site width. Use the `set_placement_padding` command before
legalizing placement to leave room for routing. Use the `-global` flag
for padding that applies to all instances. Use  `-instances`
for instance-specific padding.  The instances `insts` can be a list of instance
names, or an instance object returned by the SDC `get_cells` command. To
specify padding for all instances of a common master, use the `-filter`
"ref_name == <name>" option to `get_cells`.

```tcl
set_placement_padding   
    -global|-masters masters|-instances insts
    [-right site_count]
    [-left site_count]
```

#### Options

```{warning}
Either one of these flags must be set: `-global | -masters | -instances`.
The order of preference is `global > masters > instances`
```

| Switch Name | Description | 
| ----- | ----- |
| `-global` | Set padding globally using `left` and `right` values. |
| `-masters` |  Set padding only for these masters using `left` and `right` values. | 
| `-instances` | For `-instances`, you will set padding only for these insts using `left` and `right` values. |
| `-left` | Left padding (in site count). |
| `-right` | Right padding (in site count). |
| `instances` | Set padding for these list of instances. Not to be confused with the `-instances` switch above. |

### Filler Placement

The `filler_placement` command fills gaps between detail-placed instances
to connect the power and ground rails in the rows. `filler_masters` is a
list of master/macro names to use for filling the gaps. Wildcard matching
is supported, so `FILL*` will match, e.g., `FILLCELL_X1 FILLCELL_X16 FILLCELL_X2
FILLCELL_X32 FILLCELL_X4 FILLCELL_X8`.  To specify a different naming prefix
from `FILLER_` use `-prefix <new prefix>`.

```tcl 
filler_placement
    [-prefix prefix]
    filler_masters
```

#### Options

| Switch Name | Description |
| ----- | ----- |
| `-prefix` | Prefix to name the filler cells. The default value is `FILLER_`. |
| `filler_masters` | Filler master cells. | 

### Remove Fillers

This command removes all filler cells.

```tcl
remove_fillers 
```

### Check Placement

The `check_placement` command checks the placement legality. It returns
`0` if the placement is legal.

```tcl
check_placement
    [-verbose]
    [-disallow_one_site_gaps]
    [-report_file_name filename]
```

#### Options

| Switch Name | Description |
| ----- | ----- |
| `-verbose` | Enable verbose logging. |
| `-disallow_one_site_gaps` | Disable one site gap during placement check. |
| `-report_file_name` | File name for saving the report to (e.g. `report.json`. |

### Optimize Mirroring

The `optimize_mirroring` command mirrors instances about the Y axis in
a weak attempt to reduce the total half-perimeter wirelength (HPWL).

```tcl
optimize_mirroring
```

## Useful Developer Commands

If you are a developer, you might find these useful. More details can be found in the [source file](./src/Opendp.cpp) or the [swig file](./src/Opendp.i).

| Command Name | Description |
| ----- | ----- |
| `detailed_placement_debug` | Debug detailed placement. |
| `get_masters_arg` | Get masters from a design. |
| `get_inst_bbox` | Get bounding box of an instance. |
| `get_inst_grid_bbox` | Get grid bounding box of an instance. |
| `format_grid` | Format grid (takes in length `x` and site width `w` as inputs). |
| `get_row_site` | Get row site name.

## Example scripts

Examples scripts demonstrating how to run `dpl` on a sample design of `aes` as follows:

```shell
./test/aes.tcl
```

## Regression tests

There are a set of regression tests in `./test`. Refer to this [section](../../README.md#regression-tests) for more information.

Simply run the following script: 

```shell
./test/regression
```

## Limitations

## FAQs

Check out [GitHub discussion](https://github.com/The-OpenROAD-Project/OpenROAD/discussions/categories/q-a?discussions_q=category%3AQ%26A+opendp+in%3Atitle)
about this tool.

## Authors

-   SangGi Do and Mingyu Woo (respective Ph. D. advisors: Seokhyeong Kang,
    Andrew B. Kahng).
-   Rewrite and port to OpenDB/OpenROAD by James Cherry, Parallax Software

## References
1. Do, S., Woo, M., & Kang, S. (2019, May). Fence-region-aware mixed-height standard cell legalization. In Proceedings of the 2019 on Great Lakes Symposium on VLSI (pp. 259-262). [(.pdf)](https://dl.acm.org/doi/10.1145/3299874.3318012)

## License

BSD 3-Clause License. See [LICENSE](LICENSE) file.