Skip to content

Commit

Permalink
Merge pull request The-OpenROAD-Project#4610 from The-OpenROAD-Projec…
Browse files Browse the repository at this point in the history
…t-staging/ifp-hybrid-fix

ifp: rework the handling of hybrid rows
  • Loading branch information
maliberty authored Jan 31, 2024
2 parents f9a24b7 + 62ce576 commit b0d81bb
Show file tree
Hide file tree
Showing 88 changed files with 1,708 additions and 1,197 deletions.
2 changes: 1 addition & 1 deletion src/cts/test/array.ok
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[INFO ODB-0222] Reading LEF file: array_tile.lef
[INFO ODB-0225] Created 1 library cells
[INFO ODB-0226] Finished LEF file: array_tile.lef
[INFO IFP-0001] Added 3528 rows of 26000 site FreePDK45_38x28_10R_NP_162NW_34O with height 1.
[INFO IFP-0001] Added 3528 rows of 26000 site FreePDK45_38x28_10R_NP_162NW_34O.
[INFO ODB-0303] The initial 3528 rows (91728000 sites) were cut with 225 shapes for a total of 52263 rows (14219856 sites).
[INFO CTS-0050] Root buffer is BUF_X4.
[INFO CTS-0051] Sink buffer is BUF_X4.
Expand Down
2 changes: 1 addition & 1 deletion src/cts/test/array_ins_delay.ok
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[INFO ODB-0222] Reading LEF file: array_tile.lef
[INFO ODB-0225] Created 1 library cells
[INFO ODB-0226] Finished LEF file: array_tile.lef
[INFO IFP-0001] Added 3528 rows of 26000 site FreePDK45_38x28_10R_NP_162NW_34O with height 1.
[INFO IFP-0001] Added 3528 rows of 26000 site FreePDK45_38x28_10R_NP_162NW_34O.
[INFO ODB-0303] The initial 3528 rows (91728000 sites) were cut with 225 shapes for a total of 52263 rows (14219856 sites).
[INFO CTS-0050] Root buffer is BUF_X4.
[INFO CTS-0051] Sink buffer is BUF_X4.
Expand Down
2 changes: 1 addition & 1 deletion src/cts/test/array_no_blockages.ok
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[INFO ODB-0222] Reading LEF file: array_tile.lef
[INFO ODB-0225] Created 1 library cells
[INFO ODB-0226] Finished LEF file: array_tile.lef
[INFO IFP-0001] Added 3528 rows of 26000 site FreePDK45_38x28_10R_NP_162NW_34O with height 1.
[INFO IFP-0001] Added 3528 rows of 26000 site FreePDK45_38x28_10R_NP_162NW_34O.
[INFO CTS-0050] Root buffer is BUF_X4.
[INFO CTS-0051] Sink buffer is BUF_X4.
[INFO CTS-0052] The following clock buffers will be used for CTS:
Expand Down
2 changes: 1 addition & 1 deletion src/grt/test/no_tracks.ok
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
[INFO ODB-0224] Created 27 technology vias
[INFO ODB-0225] Created 135 library cells
[INFO ODB-0226] Finished LEF file: Nangate45/Nangate45.lef
[INFO IFP-0001] Added 29 rows of 219 site FreePDK45_38x28_10R_NP_162NW_34O with height 1.
[INFO IFP-0001] Added 29 rows of 219 site FreePDK45_38x28_10R_NP_162NW_34O.
[ERROR GRT-0057] Missing track structure for layer metal1.
GRT-0057
16 changes: 14 additions & 2 deletions src/ifp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ initialize_floorplan
initialize_floorplan
[-die_area {llx lly urx ury}]
[-core_area {llx lly urx ury}]
[-sites site_name]
[-additional_sites site_names]
-site site_name
```

##### Options
Expand All @@ -49,12 +50,23 @@ initialize_floorplan
| ----- | ----- |
| `-die_area` | Die area coordinates in microns (lower left x/y and upper right x/y coordinates). |
| `-core_area` | Core area coordinates in microns (lower left x/y and upper right x/y coordinates). |
| `-sites` | Tcl list of sites to make rows for (e.g. `{SITEXX, ...}`) |
| `-site` | The LEF site to make rows for. |
| `-additional_sites` | Any additional LEF site to make rows. |

The die area and core area used to write ROWs can be specified explicitly
with the `-die_area` and `-core_area` arguments. Alternatively, the die and
core areas can be computed from the design size and utilization as shown below:

The -site argument determines the basic single-height rows to make.
For a hybrid row design the site should have a row pattern. Any sites
referenced by an instance in the netlist will also have rows
constructed for them.

Additional sites are specified if you wish to have rows for a site
that is not used in the nelist but may be needed later. For example,
you might not have any double height cells in the incoming netlist but
you expect some to be generated by flop clustering later in the flow.

Example computation:

```
Expand Down
40 changes: 21 additions & 19 deletions src/ifp/include/ifp/InitFloorplan.hh
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,23 @@ class InitFloorplan
InitFloorplan(odb::dbBlock* block, Logger* logger, sta::dbNetwork* network);

// utilization is in [0, 100]%
// The base_site determines the single-height rows. For hybrid rows it is
// a site containing a row pattern.
void initFloorplan(double utilization,
double aspect_ratio,
int core_space_bottom,
int core_space_top,
int core_space_left,
int core_space_right,
const std::vector<odb::dbSite*>& extra_sites = {});
odb::dbSite* base_site,
const std::vector<odb::dbSite*>& additional_sites = {});

// The base_site determines the single-height rows. For hybrid rows it is
// a site containing a row pattern.
void initFloorplan(const odb::Rect& die,
const odb::Rect& core,
const std::vector<odb::dbSite*>& extra_sites = {});
odb::dbSite* base_site,
const std::vector<odb::dbSite*>& additional_sites = {});

void insertTiecells(odb::dbMTerm* tie_term,
const std::string& prefix = "TIEOFF_");
Expand All @@ -93,28 +99,24 @@ class InitFloorplan
odb::dbSite* findSite(const char* site_name);

private:
using SitesByName = std::map<std::string, odb::dbSite*>;

double designArea();
int makeRows(odb::dbSite* site,
int core_lx,
int core_ly,
int core_ux,
int core_uy,
int factor,
int row_index);
int getOffset(const std::vector<odb::dbSite*>& pattern) const;
int makeHybridRows(odb::dbSite* parent_hybrid_site,
const odb::Point& core_ll,
const odb::Point& core_ur,
int row_index);
void generateContiguousHybridRows(
odb::dbSite* parent_hybrid_site,
const odb::dbSite::RowPattern& row_pattern,
std::vector<std::vector<odb::dbSite*>>& output_patterns_list);
void makeRows(const odb::dbSite::RowPattern& pattern, const odb::Rect& core);
void makeUniformRows(odb::dbSite* base_site,
const SitesByName& sites_by_name,
const odb::Rect& core);
void makeHybridRows(odb::dbSite* base_hybrid_site,
const SitesByName& sites_by_name,
const odb::Rect& core);
int getOffset(odb::dbSite* base_hybrid_site,
odb::dbSite* site,
odb::dbOrientType& orientation) const;
void makeTracks(const char* tracks_file, odb::Rect& die_area);
void autoPlacePins(odb::dbTechLayer* pin_layer, odb::Rect& core);
int snapToMfgGrid(int coord) const;
void updateVoltageDomain(int core_lx, int core_ly, int core_ux, int core_uy);
std::set<odb::dbSite*> getSites() const;
void addUsedSites(std::map<std::string, odb::dbSite*>& sites_by_name) const;

odb::dbBlock* block_;
Logger* logger_;
Expand Down
Loading

0 comments on commit b0d81bb

Please sign in to comment.