[SimToSV] support lowering stdout/stderr#10283
Conversation
|
Thanks, @nanjo712. |
|
One tricky point with FIRRTL's fwrite semantics is we can literally make the file name dynamic, so it would be necessary to get file descriptor in the same cycle/always block. |
8799fa7 to
fe4949b
Compare
fe4949b to
4545d21
Compare
|
Sorry for the delayed follow-up on this PR — I was caught up with some personal matters and wasn’t able to address the review comments in time. I’ve now updated the implementation to reflect the feedback. I’d appreciate it if you could take another look. |
fzi-hielscher
left a comment
There was a problem hiding this comment.
Sorry for the delayed follow-up on this PR — I was caught up with some personal matters and wasn’t able to address the review comments in time.
I've added the print operations two years ago, I'm in no hurry. 😉
We should (hopefully) be able to resolve the conversion casts on-the-fly without needing materializations and reconciliation:
First, mark them as dynamically illegal if they carry any type we need to convert.
target.addDynamicallyLegalOp<:UnrealizedConversionCastOp>([&](UnrealizedConversionCastOp op){
return typeConverter.isLegal(op);
});
Then add a conversion pattern for them that checks if the converted input types match the converted result types. If so, we can directly replace the op with the values provided by the adaptor.
|
Thank you for your feedback. I think your suggestion is indeed a good one, and I have revised the code accordingly. |
…nd reconciliation
b86b3b2 to
36f8268
Compare
Support lowering stdout/stderr in SimToSV.