amar712 Posted July 18, 2016 Report Share Posted July 18, 2016 I have two classes, one is block_seq which extends from uvm_sequence and other is block_cfg_mngr which extends from uvm_component. How do I exchange information between these two. I need to generate random values in block_cfg_mngr which depends on the values I generate in the bock_sequence body method. I need a communication mechanism to pass the information from uvm_sequence to uvm_component or vice versa. How can I do that ? Quote Link to comment Share on other sites More sharing options...
bhunter1972 Posted July 19, 2016 Report Share Posted July 19, 2016 Your sequence has a handle to the sequencer it runs on, called p_sequencer. You can create a TLM imp there, and a TLM port in your block_cfg_mngr component, and then write the data from the port to the imp. Your sequence can then see the value using its handle to the sequencer. Quote Link to comment Share on other sites More sharing options...
shankarsrinivasan Posted July 26, 2016 Report Share Posted July 26, 2016 Hi Brain, Can you elaborate with example. it will useful to understand. Thanks in advance Quote Link to comment Share on other sites More sharing options...
karandeep963 Posted August 12, 2016 Report Share Posted August 12, 2016 One other way could be: Since binding of port can be possible with the components(which are supposed to be hierarchical members unlike sequence which associated during run-time). So you can create one port in your env and connect it to block_cfg_mngr import. Now in the sequence you might be already having the env pointer through config_db (if not set the port from env in the config_db) , get the pointer of env,port in your sequence and start accessing it. ///// Env Classs ///// class my_env extends uvm_env; uvm_tlm_b_initiator_socket #(uvm_tlm_gp) config_socket; function my_env::new(string name = "my_env", uvm_component parent = null); super.new(name, parent); // CONFIG config_socket = new ("config_socket",this); endfunction // build_phase: uvm_config_db #(uvm_tlm_b_initiator_socket)::set(this, "", "config", config_socket); //// Sequence Class /// class my_seq extends uvm_sequence(uvm_sequence_item) // CONFIG tlm block socket for configuration uvm_tlm_b_initiator_socket #(uvm_tlm_gp) bsocket; task body; // CONFIG GEtting Handle from env for config socket if(!uvm_config_db #(uvm_tlm_b_initiator_socket)::get(null,"uvm_test_top.m_env", "config", bsocket)) begin `uvm_error("CONFIG_DB_ERROR", "Could not find config") end // Use it the way you want bsocket.write(uvm_tlm_gp); endtask: body 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.