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

Add a Han-Carlson option for $lcu mapping #4779

Merged
merged 8 commits into from
Nov 29, 2024
Merged

Conversation

widlarizer
Copy link
Collaborator

@widlarizer widlarizer commented Nov 28, 2024

The Han-Carlson parallel-prefix adder (PPA) is an adder construction for ASIC use with an attractive tradeoff. We expect similar delay to Kogge-Stone PPA but better area. I have implemented it in the same procedural style as the current Kogge-Stone and Brent-Kung PPAs. I'm testing it by proving equivalence with equiv_simple for bit widths from 1 to 16. I have additionally replaced the test for Kogge-Stone with the same approach. To sweep a variable, full TCL scripting is necessary, which Yosys supports. This PR adds support for using TCL scripts in tests. The HC-PPA and KS-PPA tests take 120ms and 95ms on my Zen 4 machine, respectively.

I'm not really sure what to do with the priority integer at the beginning of the module name. Reviewers may test the tests by locally modifying the designs and watching the tests fail

@widlarizer widlarizer requested a review from povik November 28, 2024 14:35
Copy link
Member

@povik povik left a comment

Choose a reason for hiding this comment

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

I left some comments but by me it's fine to merge as is

techlibs/common/choices/han-carlson.v Outdated Show resolved Hide resolved
tests/techmap/lcu_refined.v Show resolved Hide resolved
design -load init
chparam -set WIDTH $i
yosys proc
equiv_make -blacklist ppa.nomatch lcu _80_lcu_kogge_stone equiv
Copy link
Member

Choose a reason for hiding this comment

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

The fact that this matches on internal names makes me think we are using the wrong command to check equivalence here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

looks like the folklore is opt_clean before equiv_make

@widlarizer widlarizer changed the title Add a Han-Carlson option $lcu mapping Add a Han-Carlson option for $lcu mapping Nov 29, 2024
@widlarizer widlarizer merged commit e436cc0 into main Nov 29, 2024
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants