-
Notifications
You must be signed in to change notification settings - Fork 615
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
PeekPokeAPI expectations don't return the actual test line (or I'm getting it very wrong) #4128
Comments
I should add — I'm happy to have a go at the implementation if it is indeed as simple a matter as I imagine! |
Thanks for the report! Improving this would be really good for the user experience. There are two ways we could fix it:
(1) probably the easiest and definitely the most performant, (2) grabbing stack traces for every single expect could be a bit expensive (more expensive than simulation? unclear, would need to be measured). Thank you for your interest and having a go at the implementation. If you can get to it, great, if not, at least this will serve as a suggested implementation for anyone else who gets a chance to take a look. You can capture a If you just want to report the source locator, that should be enough. If you want to make it a bit prettier with Chisel pulling the source-line and having a carat pointing to the offending expect, you can try using some of Chisel's error reporting logic in the ErrorLog3. You may need to massage the internal APIs a bit as they are very much built around the assumption of a Chisel runtime that reports errors at the end (which SVSim does not interact with at all). Not sure it's worth it for you to attempt that, but it's an option! Footnotes
|
Thank you so much for the pointers! I'll get (1) going as-is to have something minimal, and then I'll give the better reporting a try. If I have the time I'll see about (2); I can imagine it might indeed be expensive. |
The fix has been merged to
|
Ta! 😊 |
Hi all! I'm using ChiselSim with Chisel 6.4.0. The actual tests test fine, but when an expectation fails, I sometimes find it hard to debug, except by adding loads of additional
message
arguments. For a concrete example:I haven't actually implemented any non-initial state yet, so I expect the final line to fail. And it does, but the spec file itself only gets a mention for the line with the
simulate
call (line 17 in this case). The full output is long, so it's hidden below.`sbt test` output with `-oF` added to the test options
I'm sure this is hard to avoid because
expect
is probably just enqueuing the expectation until the sim runtime next goes back to talk to the simulator. (Or something — I haven't looked into how it works at all, other than seeing that such a flow is possible!)I guess it'd be nice to also capture
SourceInfo
when doing anexpect
, and to report it with any failures? Any thoughts, or if I'm missing something big?The text was updated successfully, but these errors were encountered: