Jump to content

bug in uvm_rand_send* persists

Recommended Posts


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.



Edited by Gunther
Link to comment
Share on other sites

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;


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,


Link to comment
Share on other sites

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.



Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...