OpenROAD icon indicating copy to clipboard operation
OpenROAD copied to clipboard

Gain-based (ABC-style) buffering

Open povik opened this issue 1 year ago • 12 comments

This branch implements a buffering algorithm similar to ABC's buffer command.

povik avatar May 08 '24 14:05 povik

@povik what is the status on this work?

maliberty avatar Jul 09 '24 21:07 maliberty

@maliberty Experiments with running a re-implementation of naive ABC-style buffering at the time of repair_design gave bad results. Because the buffer tree structure is generated with no regard for placement, there's a lot of extra wiring which worsens both the signal delay and routing congestion (I would say this was to be expected). The crucial difference to the earlier experiments with keeping ABC buffers is that here we buffer post placement, and it looks like the extra wiring is an issue no matter how we place the newly inserted buffers. I looked at some options and have more to say tomorrow.

The branch has the ABC-style buffering as the synthesize_buffers command. There's no work to integrate it into repair_design.

povik avatar Jul 09 '24 23:07 povik

@maliberty Let me know how you want to name the command that does ABC-style buffering that we have implemented. It will take max_fanout gain slew for its parameters.

povik avatar Jul 10 '24 16:07 povik

It will take max_fanout gain slew for its parameters.

Why will max_fanout need to be a parameter? You should take that from sta as the rest of rsz does. What is the slew parameter for?

maliberty avatar Jul 10 '24 16:07 maliberty

Why will max_fanout need to be a parameter? You should take that from sta as the rest of rsz does.

On second thought I agree. The algorithm works without a max_fanout limit too.

What is the slew parameter for?

That's the slew override on unrepaired nets. There's Resizer::targetSlew(), should we make it the default for that parameter?

povik avatar Jul 10 '24 17:07 povik

That's the slew override on unrepaired nets. There's Resizer::targetSlew(), should we make it the default for that parameter?

That seems reasonable. I'm wondering if this can be reduced to -gain on the existing repair_design command.

maliberty avatar Jul 10 '24 17:07 maliberty

Is repair_design on unplaced designs supported? In any case I would make it -buffering_gain since gain can be used for resizing but that's not what we do.

povik avatar Jul 10 '24 17:07 povik

Is repair_design on unplaced designs supported?

Only in the sense that it would be a no-op as it will skip any net with unplaced instances. It would be now with your option.

Do you feel it is different enough to warrant a separate command?

maliberty avatar Jul 10 '24 17:07 maliberty

Only in the sense that it would be a no-op as it will skip any net with unplaced instances. It would be now with your option.

Do you feel it is different enough to warrant a separate command?

Given the above, yes. To the user it's weird that repair_design would buffer but not resize on an unplaced design. If we cannot make it do resizing, then I would argue for keeping the gain buffering separate.

povik avatar Jul 10 '24 17:07 povik

I am looking at the code

    // Resize the driver to normalize slews before repairing limit violations.
    if (parasitics_src_ == ParasiticsSrc::placement && resize_drvr) {
      resize_count_ += resizer_->resizeToTargetSlew(drvr_pin);
    }

maybe making it do resizing when run pre placement would only be a question of removing that part of the conditional?

povik avatar Jul 10 '24 17:07 povik

No you need a Steiner tree to drive the code and there is none without placement.

maliberty avatar Jul 10 '24 17:07 maliberty

I don’t think that’s true of the resizing bit (looking at the insides of resizeToTargetSlew)

povik avatar Jul 10 '24 18:07 povik

At least one unit test is needed in this PR.

maliberty avatar Sep 04 '24 17:09 maliberty

OK, I assume a Tcl one is good enough

povik avatar Sep 04 '24 17:09 povik

OK, I assume a Tcl one is good enough

Yes

maliberty avatar Sep 04 '24 17:09 maliberty

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Sep 04 '24 18:09 github-actions[bot]

I have rebased, added a test, and handled don't-touch sinks (they are ignored for buffering but warned about)

povik avatar Sep 04 '24 19:09 povik

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Sep 04 '24 19:09 github-actions[bot]

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Sep 04 '24 19:09 github-actions[bot]

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Sep 04 '24 19:09 github-actions[bot]

The CI failure looks like something unrelated

OpenROAD
error1 (tcl) pass
get_core_die_areas (tcl) pass
timing_api (py) pass
timing_api_2 (py) *FAIL*
timing_api_3 (py) pass
upf_test (tcl) pass
upf_aes (tcl) pass
two_designs (py) pass
commands_without_load (tcl) pass
------------------------------------------------------
Failed 1/9
See /tmp/workspace/OpenROAD-Public_PR-5068-head/test/results/diffs for differences
See /tmp/workspace/OpenROAD-Public_PR-5068-head/test/results for log files

povik avatar Sep 04 '24 20:09 povik

The unit test is unrelated and occurs in multiple PRs but not for me locally.

maliberty avatar Sep 04 '24 20:09 maliberty

handled don't-care sinks (they are ignored for buffering but warned about)

Err, don't-touch sinks

povik avatar Sep 04 '24 20:09 povik

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] avatar Sep 05 '24 14:09 github-actions[bot]