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
scala.MatchError on EmptyExpression; only manifests in rocket-chip vsim/ directory. #292
Comments
Can you e-mail me the Chisel generated *.fir file? |
Sent. |
Ok, figured out my bug. @jackkoenig gave me a suggestion on how to handle it, but what's the best generalized solution to this? b/c I'm sure this'll come up over and over again. (Something great for FIRRTL pass writing tutorial, @azidar ). Had a function
But I was missing Is there some way to guarantee our cases are complete? It kind of requires knowledge of all of the possible WSubField, WSubIndex, etc. FIRRTL can use??? I really just want to find every time an EmptyExpression is used, so Jack recommended something like:
This requires that you know how to properly use the FIRRTL mappers and seems pretty intense given what I'm trying to actually find... Anywho, will PR this as a bug fix for now... |
Also, @sdtwigg made a good point. @azidar @jackkoenig @donggyukim You should prob case out the match on EmptyExpression and print out the Statement it failed on. Would be more useful than trying to look for where it was generated manually. [And I probably would've had a harder time println-ing to look for WSubField(EmptyExpression...) if not for println-ing after already switching to Jack's solution -- b/c BOOM is huge xD]. |
I agree with the suggestion that internal errors include some sort of stack trace of where we are in the firrtl design along with the current stack trace of what function we are in. I'm not sure how to do this off the top of my head, any suggestions @sdtwigg? |
Since you can arbitrarily nest Expressions, I do not believe it is possible for the type system or anything to guarantee you have exhaustively put all the cases. The most general way to check for all possible cases is exactly what my recommended function does, it walks the whole Firrtl subtree looking for EmptyExpressions. It would definitely be better if we did this walk more functionally via a "foreach" or "fold" though. |
Can I close this? |
Yes, I'm happy with it. |
I suspect some sort of memory/SRAM pass is going wrong.
I'm using version (6a05468), but it also manifests on master (765b880).
This is on rocket-chip (using BOOM on boom branch), and everything works in the emulator/ build directory, but fails in the vsim/ directory.
Error message:
To replicate:
The text was updated successfully, but these errors were encountered: