-
Notifications
You must be signed in to change notification settings - Fork 535
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
ivtest: add array_slice_concat #1014
Conversation
Thank you for the example. Our normal tests check parsing and that the correct results is also generated. This does not have any results checking or indication of success. This could be marked CO (compile only) or as a minimum you could add an initial block that prints "PASSED" to indicate success. Printing nothing should be an indication of failure, but I need to double check that is the case. |
@caryr added a tb with 7bba9dd, but now I'm getting a different failure than #1012, even with @larsclausen's #1012 (comment) applied.
|
Please use the new format for all new ivtest submissions. In particular, do not touch any of the .list files, and instead create a vvp_tests/foo.json file that describes how to run your test. |
There was a change in the proposed fix. Is your test failing with that change or only the initial one? |
You created the vvp_tests/array_slice_concat.json file, and it looks fine, but you need to add it to the ivtest/regress-vvp.list file. I understand I said "don't touch any of the .list files", but the egg on my face is that I didn't mean this one specifically, since the regress-vvp.list file is a list file in the new format. |
232b3ce
to
f9fb19c
Compare
@steveicarus noted! should be fixed with 021601e |
f9fb19c
to
021601e
Compare
looks like the CI failure comes from 56c5bf1#diff-1d54053eed91417946beb50efd2a60e3af269b32af6425c12bbcc55486da8128R210-R213 (and a left over |
A fix has been merged. Try rebasing off the current master so that it can get through CI. |
021601e
to
63aa332
Compare
rebased, thanks! |
I've merged the fix. Sorry, you have to rebase one more time to make the tests pass. |
63aa332
to
0a53b52
Compare
Done! |
initial begin | ||
a = {32'h44444444, 32'h33333333, 32'h22222222, 32'h11111111}; | ||
start = 1; | ||
if (out !== 96'h444444443333333322222222) begin |
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.
Looks like the test is failing in CI. Might need a #1
before the if
.
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.
It should be combinational (so no delay involved).
The logs say:
2023-12-30T02:13:41.5806676Z array_slice_concat: Failed - No PASSED output, and no gold file
do we also need to create a gold file?
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.
No you do not need a gold file, but the test is also not passing as expected for the reason Lars mentioned. When the code is run it produces:
FAILED
tmp.v:31: $finish called at 0 (1s)
The reason for this has to do with the non-determinism in how the simulator handles events.
You are expecting that once a
and start
have been assigned values the value of out
is immediately updated so that the if can verify the result is correct, but that is not how logic simulators are specified to work. Even no delay combinational logic has to be evaluated at a given time step and this does not happen immediately. What is happening in your code is that you are actually checking the value of out
before it has been updated and that is the reason it is report this as a failing test.
It is always best to run your test code standalone to make sure it is running properly before submitting the change.
To make things work we need to stop the execution of the initial begin/end
block so that the new output value can be calculated and that is done with some kind of delay or wait statement. In this case adding a #1
after the variable assignments and before the if
will allow the simulator to calculate the output and then the newly calculated value will be compared in the if
statement.
Add delay to avoid race in TB code and DUT code
Related #1012