manojb Posted June 10, 2011 Report Posted June 10, 2011 Hello, I am working a simple test bench that has one master agent, and multiple slave agents. Each slave agent has some properties that are randomized. I want to generate constrained random stimulus from the master agent to any of the slaves. I am stuck trying to get a reference to the test environment (derived from uvm_env) from within the sequence class. I have derived a class from uvm_sequence, and want to reference the slave agents in order to constrain the generated stimulus. What is the best way for sequences body() to read constraints from other test environment components. Manoj Quote
jadec Posted June 10, 2011 Report Posted June 10, 2011 You can use the find_all method of uvm_root to get pointers to those components. Quote
uwes Posted June 14, 2011 Report Posted June 14, 2011 hi, you might use your sequencer from within the sequence via get_sequencer() or when using the uvm_declare_p_sequencer() macro plus the p_sequencer field. once you know your sequencer you can traverse the way you want. as alternativ you can use jade's suggested path or you could use the uvm_config_db to share your config under a known key and access the db from any place such as within a sequence. Quote
manojb Posted June 16, 2011 Author Report Posted June 16, 2011 Thanks for the tips. I was able to get a pointer to the component using the find_all method. class my_squence extends uvm_sequence #(myTransactionType1) uvm_root top; uvm_component compList[$]; virtual task body(); top = uvm_root::get() top.find_all("*",compList,); ..... I have not tried the get_sequencer() method yet, but I think it would lead to more portable code, so I may try going back to that later on. 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.