Gunther Posted March 20, 2013 Report Posted March 20, 2013 (edited) Hello, I have a problem with the uvm_send_rand macro. When I do a uvm_do_on_with (SEQ, SEQR, CONSTRAINTS) it works fine, but a combo of uvm_create_on (SEQ, SEQR) uvm_rand_send_with (SEQ, CONSTRAINTS) does not. There is a related post on this forum (http://www.uvmworld.org/forums/showthread.php?267-Virtual-Sequence-not-work-in-some-condition-with-uvm1.1) which points to Mantis 3633. It never mentions what the root cause is. Looking at the Mantis, it has been fixed in October 2011. However the problem persists in uvm1.1c, which has been released well after that date. I have traced the problem to the uvm_rand_send_pri_with (no surprises there), line 298 in uvm_sequence_defines.svh of uvm1.1c: else __seq.set_item_context(this); \ The macro uvm_do_on_pri_with does not have that function call, hence that works. This function call loses the sequencer information. It should be set_item_context (this, SEQR); The default for the 2nd argument is null, hence the test terminates with a DCLPSQ fatal. The problem is that the SEQR is unknown in uvm_do_on_pri_with, but is in uvm_do_on_pri_with. So I think that else branch has accidentally been added to the wrong macro and SEQR been omitted. Regards Gunther Edited March 20, 2013 by Gunther Quote
tfitz Posted March 20, 2013 Report Posted March 20, 2013 This is a great example of why macros are evil. Instead of using the macros, why not just seq = SEQ_type::type_id::create("seq"); seq.randomize() with CONSTRAINTS; seq.start(SEQR); Personally, I find it much easier to create/randomize/start for sequences and create/start_item/randomize/finish_item for sequence items than it is to remember all the variations of 'uvm_create/on/rand/send/with/pri/... Good luck, -Tom Quote
uwes Posted March 21, 2013 Report Posted March 21, 2013 this sounds like http://eda.org/svdb/view.php?id=4322 and is fixed in uvm11d. i dont really think this is an instance of evil macros. there has been simply a new function introduced "set_item_context" which broke the code. Quote
Gunther Posted March 21, 2013 Author Report Posted March 21, 2013 Well, I think macros can't be evil, they are just a bit of code. Call it junk code if you like... And I think the macro names are quite self-explanaotry in what they do and I know I can basically code myself (thanks for extracting that info) what the macro hides. But none of that is to the point. The point is that those preople who decided what goes into uvm and what does not decided to put the macros in. Now they are in, so they should work. I think this is a bug and if that is indeed the case should be entered into the mantis database. Regards Gunther Quote
Gunther Posted March 21, 2013 Author Report Posted March 21, 2013 Thanks Uwe, I hadn't seen that. Good to see the bug fixed. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.