-
Notifications
You must be signed in to change notification settings - Fork 347
[FIRRTL][SV] Add fflush operation #8420
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
Conversation
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.
Only went through part of the way as I realized I'm reviewing while I think you're still coding. 🙃
addToIfDefBlock("SYNTHESIS", std::function<void()>(), [&]() { | ||
addToAlwaysBlock(clock, [&]() { | ||
circuitState.usedPrintf = true; | ||
circuitState.addFragment(theModule, "PRINTF_FD_FRAGMENT"); |
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.
Is this unused here?
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.
I changed to flush default FD when file name was not provided, so it's used now.
c5ccc80
to
4c2c853
Compare
755c420
to
4bb5380
Compare
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.
LGTM
The fact that this also takes a format string is funky. However, it's consistent with fprintf
.
Thank you for finishing the fine details on this, like keeping the FIREmitter up to date. 👍
Add support for fflush operation in FIRRTL and SystemVerilog dialects. This operation maps to SystemVerilog's $fflush system task, which flushes buffered output to files. The implementation adds FFlushOp to FIRRTL dialect with clock and condition operands, adds FFlushOp to SystemVerilog dialect with optional file descriptor, implements lowering from FIRRTL to SystemVerilog, guards fflush with #ifndef SYNTHESIS like other simulation constructs, and adds visitor pattern support in both dialects. Similar to StopOp in implementation pattern and behavior.
4bb5380
to
16a5636
Compare
Add support for fflush operation in FIRRTL and SV dialects. This operation maps to SystemVerilog's $fflush system task, which flushes buffered output to files. The implementation adds FFlushOp to FIRRTL dialect with clock, condition operands and optional filename with substitutions, adds FFlushOp to SystemVerilog dialect with optional file descriptor, implements lowering from FIRRTL to SystemVerilog, guards fflush with #ifndef SYNTHESIS like other simulation constructs, and adds visitor pattern support in both dialects.
Add support for fflush operation in FIRRTL and SV dialects. This operation maps to SystemVerilog's $fflush system task, which flushes buffered output to files.
The implementation adds FFlushOp to FIRRTL dialect with clock, condition operands and optional filename with substitutions, adds FFlushOp to SystemVerilog dialect with optional file descriptor, implements lowering from FIRRTL to SystemVerilog, guards fflush with #ifndef SYNTHESIS like other simulation constructs, and adds visitor pattern support in both dialects.
Similar to StopOp in implementation pattern and behavior.