intel / rohd

The Rapid Open Hardware Development (ROHD) framework is a framework for describing and verifying hardware in the Dart programming language.
https://intel.github.io/rohd-website
BSD 3-Clause "New" or "Revised" License
374 stars 67 forks source link

Optimize performance of `Combinational.ssa` driver search #443

Closed mkorbel1 closed 10 months ago

mkorbel1 commented 10 months ago

Description & Motivation

For sufficiently large and complex designs, a substantial performance penalty was paid for constructing Combinational.ssa due to the search algorithm for potential SSA drivers. The algorithm had to search backwards from inputs to Conditionals for potential SSA drivers. This was especially expensive when using the Pipeline abstraction, since that chained multiple Combinational.ssas together.

This PR changes the algorithm to search outwards from SSA drivers to cache signals that are driven by it. This trades the performance glass jaws:

The latter glass jaw should be substantially smaller, less likely, and less frequent.

This PR also adds a benchmark which demonstrates a large performance improvement in a somewhat good example of common use cases.

Related Issue(s)

N/A

Testing

Existing tests cover functionality, new benchmark covers performance

Backwards-compatibility

Is this a breaking change that will not be backwards-compatible? If yes, how so?

No

Documentation

Does the change require any updates to documentation? If so, where? Are they included?

No