Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report_design_area: allow redirection to file #6046

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rsz/src/Resizer.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ proc repair_timing { args } {

sta::define_cmd_args "report_design_area" {}

proc report_design_area { args } {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to update the define_cmd_args to reflect this change.
See:

sta::define_cmd_args "report_floating_nets" {[-verbose] [> filename] [>> filename]} ;# checker off

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting some errors.

Running tapcell.tcl, stage 2_4_floorplan_tapcell
Error: TCL init script: invalid command name "wrong # args: should be "sta::proc_redirect proc_name body"
    while executing
"sta::proc_redirect report_design_area { args } {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like the proc_redirect indirectly defined args:

sta::proc_redirect report_floating_nets {

I think you just need to change it to sta::proc_redirect report_design_area {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a bit more hacking and

find tools/OpenROAD/ -regex .*tclInitVar.*.cc -exec rm {} \;
./build_openroad.sh --local --no_init

It compiles.

However "make do-2_1_floorplan" does not redirect yet...

$ make open_floorplan
ODB_FILE=./results/nangate45/gcd/base/2_floorplan.odb /home/oyvind/OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad -no_init -threads 48  /home/oyvind/OpenROAD-flow-scripts/flow/scripts/open.tcl
OpenROAD v2.0-16809-g23f5678bc 
Features included (+) or not (-): +Charts +GPU +GUI +Python : Debug
This program is licensed under the BSD-3 license. See the LICENSE file for details.
Components of this program may be licensed under more restrictive licenses which must be honored.
[INFO ORD-0030] Using 48 thread(s).
GUI_TIMING=1 reading timing, takes a little while for large designs...
Populating timing paths...
openroad> report_design_area >ll.txt
Design area 663 u^2 58% utilization.
openroad> report_design_area >>ll.txt
Design area 663 u^2 58% utilization.
openroad> 

$ cat ll.txt 

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue seems to be that using utl::report bypasses the file redirect.
The same issue appears in the report_floating_nets it's possible that the redirect doesn't work correctly with the logger.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sitting tight for advice here, I have no idea what the intention is or what would be consistent in this code.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the fix needs to be in a different PR (you might want to open an issue for tracking).
While this code doesn't work as intended until the underlying issue is resolved I don't think there is any harm in merging this in (just means to be able to use it it might take some time)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One concern at the time, yes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maliberty Can you check if it is a quick fix to address what @gadfort found or articulate a github issue? I'm a little bit vague on exactly what the problem is.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's somewhat involved...
The underlying issue is here:

void dbStaReport::printLine(const char* line, size_t length)

Because the tcl code and STA directs all it's prints to this function we correctly redirect the code, in openroad, we use the logger directly and thus this is broken.

sta::proc_redirect report_design_area { args } {
sta::parse_key_args "report_design_area" args keys {} flags {}
set util [format %.0f [expr [rsz::utilization] * 100]]
set area [sta::format_area [rsz::design_area] 0]
Expand Down
Loading