-
Notifications
You must be signed in to change notification settings - Fork 815
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
Edalize and dvsim #9514
Comments
@rswarbrick others can explain it better, but i think edalize is invoked by fusesoc. So we don't use it directly as part of dvsim. |
We use fusesoc to gather up all the code that we want to simulate. Normally, fusesoc would then use edalize to invoke the backend EDA tool. However, we do things differently and grab the output from fusesoc then run the tool directly from dvsim's code. I'm afraid we don't have a Questa backend. I doubt it would be particularly hard to add. You can probably just add a |
This is just a matter of adding |
Thanks for the information. I have taken the questa.hjson from the #4635 ticket and have been trying to modify it to make it work. Unfortunately I am getting some errors. Firstly when running, I get the following:
Commenting out the csr_rd_check function call I get the error when it is used in cip_base_vseq__tl_errors
If I comment out that |
This is all on the most up to date Questa software (21.4.1) |
@cindychip / @weicaiyang: I think the shadow reg sequence and TL error sequences are yours, respectively. Any ideas? |
IIUC, below case is similar to those 2 failed cases.
We create an associative array using class object as index. In your cases, those associative arrays should be empty and foreach loop should not be even started. |
I created a small case here. It's passing with VCS and Xcelium but failing with Questa. It seems like a tool issue to me. |
Thanks for the information and test case @weicaiyang . I have raised a support call with Siemens. It does not look like there is an easy work around. If I comment out the |
If you're running uart_smoke, those 2 lines are not even executed. The test should pass. What kind of error do you see? If it's an assertion error, can you check if it make sense or attach a wave here? |
Thanks, I think I am a bit further through the error process now and have reached the same error as in #4377 where @svenka3 found a custom UVM compile was required to change UVM_REG_ADDR_WIDTH down to 32. Siemens have got back to me about the error when using a class object as an index to an associative array. This is indeed a bug on their end. Hopefully they can fix that in the next Questa release. |
Ah actually using @svenka3 's script gets around that. I now have 2 assert failures for
Plus a few of these:
for d_source values |
Thanks for the waveform. We should not have an unknown value on d_ready after reset. The other error may be related that as well. Can you try to trace down why this unknown happens? Unfortunately, we need to dump internal signals in order to debug this |
I can now view the internal signals and have been looking at the unknown It turns out this has already been looked at in #4427. The fixes there still work now and the UART smoke test will pass. That is: Add clocking to the d_ready signal at line 57 of invalidate_a_channel();
// cfg.vif.h2d_int.d_ready <= 1'b0;
cfg.vif.host_cb.h2d_int.d_ready <= 1'b0; and the other h2d signals line 233 onwards: function void invalidate_a_channel();
// cfg.vif.h2d_int.a_opcode <= tlul_pkg::tl_a_op_e'('x);
// cfg.vif.h2d_int.a_param <= '{default:'x};
// cfg.vif.h2d_int.a_size <= '{default:'x};
// cfg.vif.h2d_int.a_source <= '{default:'x};
// cfg.vif.h2d_int.a_address <= '{default:'x};
// cfg.vif.h2d_int.a_mask <= '{default:'x};
// cfg.vif.h2d_int.a_data <= '{default:'x};
// // The assignment to tl_type must have a cast since the LRM doesn't allow enum assignment of
// // values not belonging to the enumeration set.
// cfg.vif.h2d_int.a_user <= '{instr_type:prim_mubi_pkg::mubi4_t'('x), default:'x};
// cfg.vif.h2d_int.a_valid <= 1'b0;
cfg.vif.host_cb.h2d_int.a_opcode <= tlul_pkg::tl_a_op_e'('x);
cfg.vif.host_cb.h2d_int.a_param <= '{default:'x};
cfg.vif.host_cb.h2d_int.a_size <= '{default:'x};
cfg.vif.host_cb.h2d_int.a_source <= '{default:'x};
cfg.vif.host_cb.h2d_int.a_address <= '{default:'x};
cfg.vif.host_cb.h2d_int.a_mask <= '{default:'x};
cfg.vif.host_cb.h2d_int.a_data <= '{default:'x};
// The assignment to tl_type must have a cast since the LRM doesn't allow enum assignment of
// values not belonging to the enumeration set.
cfg.vif.host_cb.h2d_int.a_user <= '{instr_type:prim_mubi_pkg::mubi4_t'('x), default:'x};
cfg.vif.host_cb.h2d_int.a_valid <= 1'b0;
endfunction : invalidate_a_channel @weicaiyang it looks like the lack of cb is there on purpose. Here is the waveform that you asked for with h2d.d_ready and h2d_int.d_ready as it comes out of reset: If I do as you suggested and drive all h2d signals both with and without What do you think is the route forward here? The changes are uploaded on my forked feature/questa_support branch. Thanks David |
Thanks for trying that out. |
Sure, Il make a simplified example and send it off. |
Hi, I have done a bit of digging and found that the issue isn't directly caused by the use of non clocking blocks. It is actually also to do with the use of packed structs for the tilelink signals. In So at reset all of h2d_int is set at the same time, non clocking. Then after this These issues looked to be only occuring because the I have made a simple example in eda playground here: https://www.edaplayground.com/x/Xxbf In Aldec Riviera behaves the same as Questa and Cadence Xcelium the same as VCS. Il raise a ticket with Siemens now for Questa, but am not that hopeful for them changing the behaviour, plus it looks like Riviera will also have the same issues. I assume non clocking assignments are only ever used at reset? Will there be any detrimental effect of adding a clocking assignment after the non clocking assignment after reset? |
we need the valid signals to be known value right after reset. In top-level, we have multiple clock domain. If it's X after reset, it may cause X propagation. It will be great if we can find a way that works for all the simulator. We basically need this clocking signal (valid) to be 0 right after reset, but reset is async and it is aligned with the clock. |
For the run_pass_patterns / run_fail_patterns question: That sounds like a good idea to me. But I'd probably suggest generalising the fail patterns further to e.g. |
I vaguely recall Questa having some kind of switch that disables prefixing all log lines with characters, but I could be wrong. Might be worth checking. |
when reset occurs, tl_driver will immediately call finish_item(rsp) for all the request, so that these rsp will be put to the response queue. In the meanwhile, tl_seq will get the rsp from this queue. All of these happen at the same timestamp. Seems like in Questa, driver item put happens earlier than sequence item get, so the queue is overflow. Can you try to remove this line or set it to
|
1
I can't think of another way, unless there is a way of checking that 2 |
Ah! Good point about the run/fail patterns. Boo :-) About the response queue: I don't see any reason not to make it unbounded. |
Agree with @rswarbrick. @davidp135 can you push a PR to make these changes? Thanks |
The pass / fail patterns are set less generically precisely due to the issue you are seeing. If we make it generic, we may end up with more unforeseen issues down the road. I just realized that it was Aldec Riviera simulator that had the same problem (it would prefix If you could reach out to Questa AE, I think they can help provide a similar fix. |
Good news, I have found a command to remove the "# " from the start of log file lines in Questa. So the current run and fail patterns should now work. Sure, Il set up a PR for the response queue. I have just heard back from Siemens about the clocking + non-clocking issue. They are asking if it would be possible to always set all signals in the struct at the same time rather than individually at different times. It looks to me like this would not be possible due to the difference in behaviour between |
right, they follows the TLUL protocol and these signals won't always change at the same time. |
Awesome, thanks! |
I have set up a pull request to change the set_response_queue_depth to unbounded. With the other Questa issues (clocking and associative arrays) Mentor have not yet changed their software. Hopefully they will be in the next Questa release. Shall I leave this issue open whilst I wait for this? |
The original issue was about supporting Questa with dvsim, which seems to be resolved. Please make a PR that enables Questa with dvsim. Anything unrelated to this should be filed as a separate issue. |
Sure, thanks for all the help. |
Sorry if I was not clear - I do not see a PR yet that adds |
Ah right, sure ok. I have raised a PR with the changes. It is number 10574. Thanks |
#10574 now merged |
Hi,
I am looking at using Questa to simulate the designs within Opentitan. From what I understand dvsim does not support Questa. Looking around the repository there are a number of references to Edalize, but I can't see anywhere it is used.
It looks like Edalize supports the Questa simulator. Is Edalize currently being used for simulations at all?
Thanks
David
The text was updated successfully, but these errors were encountered: