-
Notifications
You must be signed in to change notification settings - Fork 317
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
[Arcilator] Allow running verif.simulation ops #8233
Conversation
8a3a802
to
5a66259
Compare
%failure = seq.compreg %6, %clock reset %init, %false : i1 | ||
%6 = comb.or %failure, %5 : i1 | ||
|
||
// Print some statistics about the test. |
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.
Nice use of DPI!
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.
Really cool work! 😎
|
||
SmallVector<StringAttr> symbols; | ||
getOperation().walk([&](verif::SimulationOp op) { | ||
auto *symbolTableOp = SymbolTable::getNearestSymbolTable(op); |
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 there a need to have verif.simulation
nested in arbitrary ops or could we require builtin.module
as parent to simplify 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.
That would definitely be an option! I wasn't entirely sure though if we support HWModule
s nested in other operations – I think we might, for stuff like sv.ifdef
and similar. But we could definitely just force the verif.*
tests to be in a builtin.module
.
// Compute `exit_code | (exit_code != 0)` as a way of guaranteeing that | ||
// the exit code will be non-zero even if bits are truncated by the operating | ||
// system. |
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.
Smart way to deal with the fact that exit typically ANDs with 0xFF. Maybe worth mentioning in the simulation op documentation that on non-zero exit code the least significant bit is always set? But I guess also not really, because we are very vague about that anyway.
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.
Yeah I'm less and less convinced that we should actually have a multi-bit exit code at all. Maybe a success
line would be better…
2ab5136
to
d99eb7a
Compare
5a66259
to
bdf9e04
Compare
bdf9e04
to
588a431
Compare
Add the `LowerVerifSimulations` pass to the Arc dialect. This pass converts any `verif.simulation` ops in the input into a test harness module and a `func.func` that instantiates the module and applies the necessary stimulus to it using `arc.sim.*` ops. Also add the pass to the arcilator pipeline. This allows the user to run any `verif.simulation` ops in the input design by specifying the `--run --jit-entry=<simulation-name>` command line options. We may want to streamline this in the future. Also add an integration test which verifies an adder circuit and prints the simulation results.
588a431
to
61bb05d
Compare
Add the
LowerVerifSimulations
pass to the Arc dialect. This pass converts anyverif.simulation
ops in the input into a test harness module and afunc.func
that instantiates the module and applies the necessary stimulus to it usingarc.sim.*
ops.Also add the pass to the arcilator pipeline. This allows the user to run any
verif.simulation
ops in the input design by specifying the--run --jit-entry=<simulation-name>
command line options. We may want to streamline this in the future.Also add an integration test which verifies an adder circuit and prints the simulation results.