-
Notifications
You must be signed in to change notification settings - Fork 307
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
[ImportVerilog] add real literal support, refine real type, and add real format support #8020
base: main
Are you sure you want to change the base?
Conversation
…eal format support
Maybe we can extend its argument and result type, like |
Could you add some test cases? And thanks for your work on this 😄. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove unnecessary header files.
let description = [{ | ||
}]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let description = [{ | |
}]; |
$value `,` | ||
attr-dict `:` type($value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$value `,` | |
attr-dict `:` type($value) | |
$value `,` attr-dict `:` type($value) |
// The result of using logical or relational operators or the inside operator on real operands shall be a | ||
// single-bit scalar value. | ||
// For other operators, if any operand, except before the ? in the conditional operator, is real, the result is | ||
// real. Otherwise, if any operand, except before the ? in the conditional operator, is shortreal, the result is | ||
// shortreal. | ||
if(isa<moore::RealType>(lhsType) || isa<moore::RealType>(rhsType)) { | ||
if(!isa<moore::RealType>(lhsType)) | ||
lhs = builder.create<moore::ConversionOp>(lhs.getLoc(), moore::RealType::get(context.getContext()), lhs); | ||
if(!isa<moore::RealType>(rhsType)) | ||
rhs = builder.create<moore::ConversionOp>(rhs.getLoc(), moore::RealType::get(context.getContext()), rhs); | ||
} else if(isa<moore::ShortRealType>(lhsType) || isa<moore::ShortRealType>(rhsType)) { | ||
if(!isa<moore::ShortRealType>(lhsType)) | ||
lhs = builder.create<moore::ConversionOp>(lhs.getLoc(), moore::ShortRealType::get(context.getContext()), lhs); | ||
if(!isa<moore::ShortRealType>(rhsType)) | ||
rhs = builder.create<moore::ConversionOp>(rhs.getLoc(), moore::ShortRealType::get(context.getContext()), rhs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to limit code <= 80 chars.
This PR is aimed to support systemverilog real, shortreal, realtime, and there conversion and operation.
One thing I'm not so sure about is that
why this opbase just support SimpleBitVectorType? is there any shortcoming to just convert it to a UnpackedType? I also want to use this OpBase support float point operation.