Skip to content
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

Merged
merged 5 commits into from
Jan 1, 2024
Merged

Conversation

proppy
Copy link
Contributor

@proppy proppy commented Oct 23, 2023

Related #1012

@caryr
Copy link
Collaborator

caryr commented Oct 24, 2023

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.

@proppy
Copy link
Contributor Author

proppy commented Oct 26, 2023

@caryr added a tb with 7bba9dd, but now I'm getting a different failure than #1012, even with @larsclausen's #1012 (comment) applied.

vvp: array.cc:166: virtual int __vpiArray::get_word_size() const: Assertion `vsig' failed.

@steveicarus
Copy link
Owner

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.

@steveicarus steveicarus added the Need info Needs more information, or changes are requested, before a merge is approved. label Oct 29, 2023
@proppy
Copy link
Contributor Author

proppy commented Oct 30, 2023

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.

Done with 87965e3, PTAL.

@caryr
Copy link
Collaborator

caryr commented Nov 7, 2023

There was a change in the proposed fix. Is your test failing with that change or only the initial one?

@steveicarus
Copy link
Owner

steveicarus commented Dec 11, 2023

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.

@proppy
Copy link
Contributor Author

proppy commented Dec 20, 2023

@steveicarus noted! should be fixed with 021601e

@proppy
Copy link
Contributor Author

proppy commented Dec 23, 2023

looks like the CI failure comes from 56c5bf1#diff-1d54053eed91417946beb50efd2a60e3af269b32af6425c12bbcc55486da8128R210-R213 (and a left over expected_fail).

@steveicarus steveicarus added Bug and removed Need info Needs more information, or changes are requested, before a merge is approved. labels Dec 28, 2023
@steveicarus
Copy link
Owner

A fix has been merged. Try rebasing off the current master so that it can get through CI.

@steveicarus steveicarus added Need info Needs more information, or changes are requested, before a merge is approved. and removed Bug labels Dec 28, 2023
@steveicarus steveicarus self-assigned this Dec 28, 2023
@proppy
Copy link
Contributor Author

proppy commented Dec 29, 2023

A fix has been merged. Try rebasing off the current master so that it can get through CI.

rebased, thanks!

@larsclausen
Copy link
Collaborator

I've merged the fix. Sorry, you have to rebase one more time to make the tests pass.

@proppy
Copy link
Contributor Author

proppy commented Dec 30, 2023

I've merged the fix. Sorry, you have to rebase one more time to make the tests pass.

Done!

initial begin
a = {32'h44444444, 32'h33333333, 32'h22222222, 32'h11111111};
start = 1;
if (out !== 96'h444444443333333322222222) begin
Copy link
Collaborator

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.

Copy link
Contributor Author

@proppy proppy Jan 1, 2024

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?

Copy link
Collaborator

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
@caryr caryr merged commit cec7a64 into steveicarus:master Jan 1, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need info Needs more information, or changes are requested, before a merge is approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants