Skip to content

Commit

Permalink
Merge pull request #4856 from gudeh/patch-2
Browse files Browse the repository at this point in the history
gpl: Update README.md with debug mode instructions
  • Loading branch information
maliberty authored Apr 3, 2024
2 parents c3da78b + 7d919c0 commit 03c08c7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
30 changes: 26 additions & 4 deletions src/gpl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,40 @@ cluster_flops
| `-num_paths` | KIV, default value is 0, type `int`. |


### Debug Mode

The `global_placement_debug` command initiates a debug mode, enabling real-time visualization of the algorithm's progress on the layout. Use the command prior to executing the `global_placement` command, for example in the `global_place.tcl` script.

```tcl
global_placement_debug
[-pause]
[-update]
[-inst]
[-draw_bins]
[-initial]
```

#### Options

| Switch Name | Description |
| ----- | ----- |
| `-pause` | Number of iterations between pauses during debugging. Allows for visualization of the current state. Useful for closely monitoring the progression of the placement algorithm. Allowed values are integers, default is 10. |
| `-update` | Defines the frequency (in iterations) at which the tool refreshes its layout output to display the latest state during debugging. Allowed values are integers, default is 10. |
| `-inst` | Targets a specific instance name for debugging focus. Allowed value is a string, the default behavior focuses on no specific instance. |
| `-draw_bins` | Activates visualization of placement bins, showcasing their density (indicated by the shade of white) and the direction of forces acting on them (depicted in red). The default setting is disabled. |
| `-initial` | Pauses the debug process during the initial placement phase. The default setting is disabled. |

Example: `global_placement_debug -pause 100 -update 1 -initial -draw_bins -inst _614_`
This command configures the debugger to pause every 100 iterations, with layout updates occurring every iteration. It enables initial placement stage visualization, bin drawing, and specifically highlights instance 614.

## Useful Developer Commands

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

```
# debugging global placement
global_placement_debug -pause -update -inst -draw_bins -initial
# adds padding and gets global placement uniform target density
get_global_placement_uniform_density -pad_left -pad_right
```

Example scripts demonstrating how to run `gpl` on a sample design on `core01` as follows:

```shell
Expand Down
3 changes: 1 addition & 2 deletions src/gpl/src/replace.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,6 @@ proc cluster_flops { args } {
gpl::replace_run_mbff_cmd $max_split_size $tray_weight $timing_weight $num_paths
}


namespace eval gpl {
proc global_placement_debug { args } {
sta::parse_key_args "global_placement_debug" args \
keys {-pause -update -inst} \
Expand Down Expand Up @@ -385,6 +383,7 @@ proc global_placement_debug { args } {
gpl::set_debug_cmd $pause $update $draw_bins $initial $inst
}

namespace eval gpl {
proc get_global_placement_uniform_density { args } {
sta::parse_key_args "get_global_placement_uniform_density" args \
keys { -pad_left -pad_right } \
Expand Down

0 comments on commit 03c08c7

Please sign in to comment.