| # How to get heatmap data? | |
| Tool: Graphical User Interface | |
| Subcategory: Data extraction | |
| ## Conversation | |
| ### gudeh | |
| Hi guys, congratulations on all the great job done with the OpenROAD project!! I want to use it to develop my ideas during my Ph.D. | |
| I am trying to build a dataset for graph neural network training. My idea is to perform physical design predictions with a mapped circuit before P&R. I am trying to extract features from Verilog with Yosys, send them to the DGL python library and perform training with DGL. These steps are already operational, but I am missing an essential aspect of the prediction: the label! | |
| To solve the mentioned issue **I would like to have the data shown by the heatmaps in the GUI, such as placement density and routing congestion**. I would like them not as images but the actual numeric values. The positions of the cells and wires would also be essential. | |
| - Can anyone point me to which path I should go to get this data? I understand all of it is already processed by the code to show the images in the GUI. I just need to find it. | |
| - Would there be any TCL command which could help me with that? | |
| - Or my best shot is to try and use the odb database and edit some code? | |
| I noticed there are some heatmap codes in [./src/gui/src](https://github.com/The-OpenROAD-Project/OpenROAD/tree/master/src/gui/src), but there are so many attributes and methods. Also, I am not used to the odb database yet. Any help is welcome. | |
| ### gudeh | |
| By the way I couldn't find the path `./build/src/swig/tcl/opendbtcl` and `./build/src/swig/tcl/opendb_wrapper.cpp` as mentioned in [the documentation](https://openroad.readthedocs.io/en/latest/main/src/odb/README.html). | |
| ### maliberty | |
| The bit of documentation is out of date as we now include the tcl functionality in openroad itself and no longer build standalone executables for odb. (@vvbandeira) | |
| @arlpetergadfort My first thought was to look at each engine but maybe it would be easier to provide a dump_heatmap command in the GUI since it has already abstracted the interface to each engine. Does that seem reasonable to you? | |
| ### maliberty | |
| #1612 is merged so you should be good to go. | |
| ### maliberty | |
| You are repeating the previous rule and probably want something like: | |
| my_gui: my_gui_6_final.def | |
| $(foreach file,$(RESULTS_DEF),my_gui_$(file)): my_gui_%: | |
| You are getting the bbox of each instance. You'll have to map that back to the grid you are working with (an instance may be across a boundary as well). | |
| ### gudeh | |
| Hey guys, I have some issues with the heatmap features. I noticed that running the GCD project from a fresh OpenROAD-flow with this exact sequence of commands: | |
| ``` | |
| git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git | |
| cd OpenROAD-flow-scripts/ | |
| sudo ./build_openroad.sh --local | |
| cd flow | |
| make | |
| make gui_final | |
| ``` | |
| Renders no output on the circuit's image when clicking on the checkbox for `Placement Density`. The `Power Density` checkbox works fine. Furthermore, clicking on `Routing Congestion` and `IR Drop` gives the error message bellow and shows no heatmap in the image. | |
| ``` | |
| [WARNING GUI-0066] Heat map "Routing Congestion" has not been populated with data. | |
| [WARNING GUI-0066] Heat map "IR Drop" has not been populated with data. | |
| ``` | |
| If I run the AES project I can see the Placement and Power heatmaps. Although I have the same errors with Routing and IR Drop. | |
| The Routing and IR Drop also gives errors when trying to call gui::dump_heatmap: `[ERROR GUI-0072] "Routing Congestion" is not populated with data.` | |
| I also noticed that the CSVs provided by the gui::dump_heatmap command gives bouding boxes with different sizes for Placement and Power, is this expected? | |
| ### maliberty | |
| I don't see any issue with placement density. This is gcd/ng45: | |
|  | |
| ### maliberty | |
| @arlpetergadfort I'm seeing: | |
| ``` | |
| >>> read_guides results/nangate45/gcd/base/route.guide | |
| [WARNING GUI-0066] Heat map "Routing Congestion" has not been populated with data. | |
| ``` | |
| This used to work - do you know what has changed? | |
| ### gudeh | |
| Hi again! I am progressing with my dataset generation. Looking real promising. I am only having issues trying to close the gui. Even if I use gui::hide it goes to the `openroad>` command option in terminal. How can I exit it the gui AND the openroad afterwards via a TCL file? [This is what I have tried](https://github.com/gudeh/OpenROAD-flow-scripts/blob/master/flow/scripts/getLabels.tcl). As seen in the last lines. | |
| By the way if you uncoment the part where I try to use the Routing and IRdrop heatmaps the gui::hide doesn't work. | |
| ### gudeh | |
| ### gudeh | |
| Hi everyone! I am coming back to this project. I was focusing on other tasks the last months. | |
| I wanted to share with you an example of what my code is able to generate by editing Yosys and OpenROAD: https://drive.google.com/drive/folders/1xTz4iTuGx0bDD-ZWAOV-MDQWKI0a8XA8?usp=sharing . | |
| This pair of CSV files can be used as input for DGL Python library and create a GNN. | |
| There is an issue though, I created a [Python script to check for collisions among the heatmaps and logic gate locations,](https://github.com/gudeh/OpenROAD-flow-scripts/blob/master/flow/myStuff/gateToHeat.py) and it is really slow. I made it by comparing the location of all the gates against each of the 4 heat types. I would like to ask any suggestions on how to improve this. Is this able to be solved on the OpenROAD db? | |
| ### maliberty | |
| The link to your script is broken. The heatmaps are a grid so it should be easy to compute the index into the map. | |
| Matt | |
| ### gudeh | |
| Hello again! I found a bug on my code to retrieve learning data using OpenROAD. The logic gate names don't match! | |
| My machine learning model features come from the verilog generated during the flow. Optionally I can use the 1_1_yosys.v ( post tech map ) or the 6_final.v ( post route ). Afterwards I get the labels using some TCL commands discussed previously in this post. For example: | |
| > set dut gatesPosition_ | |
| > set fileName ${designPath}/${dut}${::env(DESIGN_NAME)}.csv | |
| > set outFile [open $fileName w] | |
| > puts $outFile "Name,xMin,yMin,xMax,yMax" | |
| > set block [ord::get_db_block] | |
| > foreach inst [$block getInsts] { | |
| > set box [$inst getBBox] | |
| > puts $outFile "[$inst getName], [ord::dbu_to_microns [$box xMin]], [ord::dbu_to_microns [$box yMin]], [ord::dbu_to_microns [$box xMax]], [ord::dbu_to_microns [$box yMax]]" | |
| > } | |
| > close $outFile | |
| At last, I have to build up my dataset by matching the logic gates names from the verilog, the logic gate names(from the TCL snippet pasted here and the heatmap dumps (positions). **But there is a problem:** | |
| I noticed that sometimes the flow changes the names of the gates between the verilog and the names retrieved from the TCL command ( `[$inst getName]`) causing unexpected behavior when I build the dataset. For example, the design bp_be_top with nangate45, there is a gate called `\be_calculator/_09864_` in the 6_final.v, and the name I get with the TCL command is `be_calculator/_09864_` without the `\`. | |
| **My question is:** Is there anyway to be sure that OR flow won't change the names of the gates? If not when and how does the tool changes the names of the gates, does it simply remove the starting `\` or are there any other possible modifications? | |
| ### gudeh | |
| Hi guys, I have another doubt regarding the heatmaps provided by OR. I would like to make sure the behavior is as intended. This is the routing congestion heatmap when executing the Rocket Tile design with standard values (config.mk) given by the repository: | |
|  | |
| After executing the flow, OR inserts a lot of Filler Cells. It seems that the standard core size for Rocket Tile is extremely large, is there a reason for that? | |
| I ran the flow with the same design, although dividing the max X and max Y core area values in half and leaving the die area as is: | |
| > export DIE_AREA = 0 0 924.92 799.4 | |
| > #export CORE_AREA = 10.07 9.8 914.85 789.6 | |
| > export CORE_AREA = 10.07 9.8 457.425 394.8 | |
| And this is the routing congestion heatmap after execution. There is still a considerably high congestion between core and die: | |
|  | |
| To confirm, this is the placement density after the same run: | |
|  | |
| This seems strange to me. I wouldn't expect so much routing congestion between die and core area. Furthermore, I couldn't even see metal wires on the green congested area. Is this as supposed to? | |
| ### gudeh | |
| Hello again. I wonder if there is a way to get the heatmaps considering only certain metal layers, is that possible? | |