Commit e2473460 by Ravi Varadarajan

Merge branch 'main' of github.com:TILOS-AI-Institute/MacroPlacement into main

Signed-off-by: Ravi Varadarajan <rvaradarajan@ucsd.edu>
parents acac8ebf ca521938
......@@ -38,14 +38,14 @@ After applying all forces, we move nodes in the direction of their force vector.
The [Circuit Training FAQ](https://github.com/google-research/circuit_training/blob/main/README.md) adds:
* **How do we perform clustering of standard cells?** In our Nature paper, we describe how to use hMETIS to cluster standard cells,
* **"How do we perform clustering of standard cells?** In our Nature paper, we describe how to use hMETIS to cluster standard cells,
including all necessary settings. For detailed settings, please see Extended Data Table 3 from our [Nature article](https://www.nature.com/articles/s41586-021-03544-w.epdf?sharing_token=tYaxh2mR5EozfsSL0WHZLdRgN0jAjWel9jnR3ZoTv0PW0K0NmVrRsFPaMa9Y5We9O4Hqf_liatg-lvhiVcYpHL_YQpqkurA31sxqtmA-E1yNUWVMMVSBxWSp7ZFFIWawYQYnEXoBE4esRDSWqubhDFWUPyI5wK_5B_YIO-D_kS8%3D).
Internally, Google pays for a commercial license, but non-commercial entities are welcome to use a free open-source license.
Internally, Google pays for a commercial license, but non-commercial entities are welcome to use a free open-source license."
Finally, the Methods section of the [Nature paper](https://www.nature.com/articles/s41586-021-03544-w.epdf?sharing_token=tYaxh2mR5EozfsSL0WHZLdRgN0jAjWel9jnR3ZoTv0PW0K0NmVrRsFPaMa9Y5We9O4Hqf_liatg-lvhiVcYpHL_YQpqkurA31sxqtmA-E1yNUWVMMVSBxWSp7ZFFIWawYQYnEXoBE4esRDSWqubhDFWUPyI5wK_5B_YIO-D_kS8%3D) also explains the provenance of the netlist hypergraph:
* **Synthesis of the input netlist.** We use a commercial tool to synthesize the netlist from RTL. Synthesis is physical-aware, in the sense that it has access to the floorplan size and the locations of the input/output pins, which were informed by inter- and intra-block-level information.
* **"Synthesis of the input netlist.** We use a commercial tool to synthesize the netlist from RTL. Synthesis is physical-aware, in the sense that it has access to the floorplan size and the locations of the input/output pins, which were informed by inter- and intra-block-level information."
## **II. What *exactly* is the Hypergraph, and how is it partitioned?**
......@@ -100,20 +100,16 @@ In default mode, our implementation will also run RePlAce in GUI mode automatica
We implement the entire flow based on [OpenROAD APIs](https://github.com/the-openroad-project).
**Please refer to [the OpenROAD repo](https://github.com/the-openroad-project) for explanation of each Tcl command.**
We have provided the openroad exe in the [utils](https://github.com/TILOS-AI-Institute/MacroPlacement/tree/main/CodeElements/Clustering/utils) dir. Please note that [The OpenROAD Project](https://github.com/the-openroad-project) does not
We have provided the openroad exe in the [utils](https://github.com/TILOS-AI-Institute/MacroPlacement/tree/main/CodeElements/Clustering/src/utils) dir. Please note that [The OpenROAD Project](https://github.com/the-openroad-project) does not
distribute any compiled binaries. While we build our implementation on top of the OpenROAD application, our effort is not associated with the OpenROAD project.
Input file: [setup.tcl](https://github.com/TILOS-AI-Institute/MacroPlacement/blob/main/CodeElements/Clustering/setup.tcl) (you can follow the example to set up your own design)
Input file: [setup.tcl](https://github.com/TILOS-AI-Institute/MacroPlacement/blob/main/CodeElements/Clustering/test/setup.tcl) (you can follow the example to set up your own design) and [FixFile](https://github.com/TILOS-AI-Institute/MacroPlacement/blob/main/CodeElements/Clustering/test/fix_files_grouping/ariane.fix.old) (This file is generated by our [Grouping](https://github.com/TILOS-AI-Institute/MacroPlacement/tree/main/CodeElements/Grouping) scripts)
Output_files: clusters.lef and clustered_netlist.def
Output_files: [clusters.lef](https://github.com/TILOS-AI-Institute/MacroPlacement/blob/main/CodeElements/Clustering/test/results/OpenROAD/clusters.lef) and [clustered_netlist.def](https://github.com/TILOS-AI-Institute/MacroPlacement/blob/main/CodeElements/Clustering/test/results/OpenROAD/clustered_netlist.def) for OpenROAD flows; [cluster.tcl](https://github.com/TILOS-AI-Institute/MacroPlacement/blob/main/CodeElements/Clustering/test/results/Cadence/ariane_cluster_500.tcl) for Cadence flows.
Example commands: python [generate_clustered_netlist.py](https://github.com/TILOS-AI-Institute/MacroPlacement/blob/main/CodeElements/Clustering/generate_clustered_netlist.py) ariane hmetis
Note that the [example](https://github.com/TILOS-AI-Institute/MacroPlacement/tree/main/CodeElements/Clustering/test) that we provide is the ariane design implemented in NanGate45. The netlist is synthesized by Yosys, and the floorplan def is generated by OpenROAD.
You can use the command: python [generate_clustered_netlist.py](https://github.com/TILOS-AI-Institute/MacroPlacement/blob/main/CodeElements/Clustering/generate_clustered_netlist.py) -h for other options
Note that the [example](https://github.com/TILOS-AI-Institute/MacroPlacement/tree/main/CodeElements/Clustering/design) that we provide is the ariane design implemented in NanGate45. The netlist is synthesized by Yosys, and the floorplan def is generated by OpenROAD.
## **Thanks**
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
import os
import argparse
import time
import shutil
import sys
sys.path.append('../src')
from clustering import Clustering
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--design", help="design_name: ariane, MegaBoom_x2 ", type = str, default = "ariane")
parser.add_argument("--fixed_file", help="fixed file generated by grouping", type = str, default = "./fix_files_grouping/ariane.fix.old")
parser.add_argument("--net_size_threshold", help = "large net threshold", type = int, default = 300)
parser.add_argument("--Nparts", help = "number of clusters (only for hmetis, default = 500)", type = int, default = 500)
parser.add_argument("--setup_file", help = "setup file for openroad (default = setup.tcl)", type = str, default = "setup.tcl")
parser.add_argument("--RePlace", help = "Run RePlace for blob placement (default = True)", type = bool, default = True)
parser.add_argument("--placement_density", help = "Placement density for RePlace (default = 0.7)", type = float, default = 0.7)
parser.add_argument("--GUI", help = "Run OpenROAD in GUI Mode (default = True)", type = bool, default = True)
args = parser.parse_args()
design = args.design
# The fixed file should be generated by our grouping script in the repo.
# Here we should use *.fix.old as the fix file.
# *.fix.old includes the IOs and Macros in the corresponding group, thus
# we don't need to change the hypergraph when we do partitioning.
# Then we will remove all the IOs and Macros when we create soft blocks.
fixed_file = args.fixed_file
net_size_threshold = args.net_size_threshold
Nparts = args.Nparts
setup_file = args.setup_file
RePlace = args.RePlace
placement_density = args.placement_density
GUI = args.GUI
# To use the grouping function, you need to specify the directory of src file
src_dir = "../src"
Clustering(design, src_dir, fixed_file, net_size_threshold, Nparts, setup_file, RePlace, placement_density, GUI)
......@@ -14,7 +14,7 @@ if __name__ == '__main__':
parser.add_argument("--K_in", help = "K_in", type = int, default = "1")
parser.add_argument("--K_out", help = "K_out", type = int, default = "1")
parser.add_argument("--setup_file", help = "setup file for openroad (default = setup.tcl)", type = str, default = "setup.tcl")
parser.add_argument("--global_net_threshold", help = "global net threshold", type = int, default = 100)
parser.add_argument("--global_net_threshold", help = "global net threshold", type = int, default = 300)
args = parser.parse_args()
......
......@@ -11,7 +11,7 @@
- [Related Links](#related-links)
## **Testcases**
The list of avaialbe testcases
The list of available testcases
- Ariane (RTL)
- [RTL files for Ariane design with 136 macros](./Testcases/ariane136/), which are generated by instantiating 16-bit memories in Ariane netlist availabe in [lowRISC](https://github.com/lowRISC/ariane) GitHub repository.
- [RTL files for Ariane designs with 133 macros](./Testcases/ariane133/), which are generated by updating the memory connection of 136 macro version.
......@@ -55,9 +55,9 @@ The directory structure is as follows *./FLows/\<enablement\>/\<testcase\>/<cons
- Also, we provide the *run* directory to run the scripts provided in the *scripts* directory.
## **Code Elements**
The code elements below are most crucial undocumented portions of Circuit Training. We thank Google
The code elements below are the most crucial undocumented portions of Circuit Training. We thank Google
engineers for Q&A in a shared document, as well as live discussions on May 19, 2022,
that explained the following code elements used in Circuit Training.
that have explained aspects of several of the following code elements used in Circuit Training.
All errors of understanding and implementation are the authors'.
We will rectify such errors as soon as possible after being made aware of them.
......@@ -66,7 +66,7 @@ We will rectify such errors as soon as possible after being made aware of them.
thus allowing RL to train within reasonable runtimes. Gridding enables hard macros to find locations consistent with high solution quality,
while allowing soft macros (standard-cell clusters) to also find good locations.
- [Grouping](./CodeElements/Grouping/) ensures that closely-related logic is kept close to hard macros and to clumps of IOs. The clumps of IOs are induced by IO locations with respect to the row and column coordinates in the gridded layout canvas.
- [Hypergraph clustering](./CodeElements/Clustering/) clusters millions of standard cells into a few thousand clusters. In Circuit Training, the purpose of clustering is to generate an approximate but fast standard cell placement that facilitates policy networks.
- [Hypergraph clustering](./CodeElements/Clustering/) clusters millions of standard cells into a few thousand clusters. In Circuit Training, the purpose of clustering is to enable an approximate but fast standard cell placement that facilitates policy network optimization.
- [Force-directed placement](./CodeElements/FDPlacement/) places the center of each standard cell cluster onto centers of gridcells generated by [Gridding](./CodeElements/Gridding/).
- [Simulated annealing](./CodeElements/SimulatedAnnealing/) places the center of each macro onto centers of gridcells generated by [Gridding](./CodeElements/Gridding/). In Circuit Training, simulated annealing is used as a baseline to show the relative sample efficiency of RL.
- [LEF/DEF and Bookshelf (OpenDB, RosettaStone) translators](./CodeElements/FormatTranslators/) ease the translation between different representations of the same netlist.
......@@ -108,4 +108,5 @@ while allowing soft macros (standard-cell clusters) to also find good locations.
- A. Mirhoseini, A. Goldie, M. Yazgan, J. Jiang, E. Songhori, et al.,
"Chip Placement with Deep Reinforcement Learning",
*arXiv:2004.10746*, 2020. \[[paper](https://arxiv.org/pdf/2004.10746.pdf)\]
- TILOS AI Institute. \[[link](https://tilos.ai/)\]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment