shail Posted October 19, 2011 Report Share Posted October 19, 2011 Hi , We (I believe many others ) have a case where sequence item's constraints depend on values in configuration object so wanted to use get_config_object or uvm_config_db in uvm_sequence_item, but there is no way to do get_config_object or uvm_config_db...::get in sequence_item so how do we pass config object to sequence item in a clean fashion. I know one rather not-clean (In my opinion) way is to always use `uvm_do_with in sequence body myseq::body() { `uvm_do_with(req, { cfg == p_sequence.cfg; }); } but this is not-so-clean due to two reasons One always have to use `uvm_do_with , instead of `uvm_do, in my sequences. If One is using `uvm_create and playing with req before sending, I need to assign config object on every create, before I play with the object. Any thoughts ?? Quote Link to comment Share on other sites More sharing options...
arno Posted October 19, 2011 Report Share Posted October 19, 2011 You could : 0) create the sequence 1) set whatever properites members you have in this sequence 2) then start the sequence on the related sequencer The "uvm_do" macros are shortcuts but limit the use of the sequences. Quote Link to comment Share on other sites More sharing options...
mpurna Posted October 20, 2011 Report Share Posted October 20, 2011 Hi Shail, Set the configuration object in your sequencer. As your sequence can access the sequencer, you will automatically gain access to the configurationn through the sequencer pointer. -- Thanks, Purna Praveen M. Quote Link to comment Share on other sites More sharing options...
shail Posted October 20, 2011 Author Report Share Posted October 20, 2011 Interesting. - I received 2 reply notifications in my email but none of the reply is on the forum here. forum also shows "0 replies" on main page. Quote Link to comment Share on other sites More sharing options...
uwes Posted October 24, 2011 Report Share Posted October 24, 2011 hi, btw: the code shown does NOT do what you think. in SV randomization and object allocation are separate (in contrast to specman/e). that means if you randomize an object such as when using uvm_do* sub objects are not automatically allocated by randomize. it is upto the user to allocate objects (as part of the constructor). now because allocation is user defined constraints on references/object handles itself are meaningless in SV. they can either be satisfied because the USER made the the references to be the same OR they make the randomization fail when the user doesnt handle the refs properly. you may use some other methods to pass in handles: 1. implement pre_randomize() or post_randomize() in the sequence to assign cfg 2. implement pre_body(), pre_do() or similar to retrieve references 3. use the config_db to pass references around 4. use explicit code in the body sequencer=get_sequencer(); sequencer.cfg ....; 5. split uvm_do into uvm_create, assign variables, then use uvm_rsend|uvm_send (make cfg a non-rand!) 6... regards /uwe Quote Link to comment Share on other sites More sharing options...
shail Posted October 24, 2011 Author Report Share Posted October 24, 2011 3. use the config_db to pass references around This is what I want to do, but not able to do in uvm_sequence_item because config_db or get_config_object() do not work in uvm_object. my question is - is it difficult to allow config_db/get_config_object() calls in uvm_object? If so, why ? Quote Link to comment Share on other sites More sharing options...
dudi Posted October 25, 2011 Report Share Posted October 25, 2011 config_db works in objects: my_type foo; ... uvm_config_db#(my_type)::get([B][COLOR="Red"]null[/COLOR][/B], get_full_name(), "foo", foo); Just make sure the object's get_full_name() return the correct path (for sequence items, it is already implemented for you, so you can use it strait away) Quote Link to comment Share on other sites More sharing options...
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.