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

[HWToBTOR2] Use APInt value directly in constant generation #7853

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

TaoBi22
Copy link
Contributor

@TaoBi22 TaoBi22 commented Nov 20, 2024

Currently creating a constant with any value that won't fit in an i64 will break HWToBTOR2 as it tries to fetch the value from an APInt and place it in an int64_t - not ideal if you have wires wider than 64 bits.

Breaking example:

hw.module @top() {
    hw.constant 111111111111111111111111111 : i100
}

This just swaps to using the APInt directly to print the value - AFAICT this will still yield correct BTOR2.

@TaoBi22 TaoBi22 requested a review from dobios November 20, 2024 17:45
Copy link
Member

@dobios dobios left a comment

Choose a reason for hiding this comment

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

Good idea, the use of int64 was definitely limiting!

@TaoBi22 TaoBi22 merged commit 87948a2 into llvm:main Nov 20, 2024
4 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