Jump to content

kaushalmodi

Members
  • Content Count

    6
  • Joined

  • Last visited

About kaushalmodi

  • Rank
    Member

Recent Profile Visitors

398 profile views
  1. Here's a minor update with respect to point (1) in my above summary. I had to do: mem_tr = spi_mem_tr::type_id::create(.name("mem_tr"), .contxt(get_full_name())); instead of mem_tr = spi_mem_tr::type_id::create({get_full_name(), ".mem_tr"}); With the latter, I get an SDI/Verilog warning saying: Message! [SDI/Verilog] In sdiT::transactionTypeT ctor, the transaction name had illegal characters. Those characters have been replaced. Here's the new name: 'uvm_test_top_env_spi_m[0]_reg2spi_adapter_mem_tr' ... Message! [SDI/Verilog] In sdiT::transactionTypeT ctor, the transaction name had illegal characters. Those characters have been replaced. Here's the new name: 'uvm_test_top_env_spi_m[1]_reg2spi_adapter_mem_tr' But the overrides still worked. Now with that fixed (by not using get_full_name() or "." in the "name" argument, mem_tr.get_full_name() now prints just "mem_tr". But the overrides still work!! This is very confusing.
  2. Hi Tudor, Thanks for your immense help. I was finally able to get the overrides work with these changes: (1) Append the full name to the transaction objects generated in the adapter: mem_tr = spi_mem_tr::type_id::create({get_full_name(), ".mem_tr"}); (2) Append the full name even to the adapter object generated in the SPI env: reg2spi_adapter = spi_master_reg_adapter::type_id::create({get_full_name(), ".reg2spi_adapter"}); (3) Finally set the instance overrides as usual in the base test: set_inst_override_by_type ( .relative_inst_path("env.spi_m[0].*"), .original_type(spi_mem_tr::get_type()), .override_type(spi_mem_ext_tr::get_type())); set_inst_override_by_type ( .relative_inst_path("env.spi_m[1].*"), .original_type(spi_mem_tr::get_type()), .override_type(spi2_mem_ext_tr::get_type())); Once again, I really appreciate the help you provided. Thanks!
  3. Thank you. It now makes sense why that full path of "env..." did not work. So I thought that the below would fix that. But it is not.. Below code is in the "SPI env" component whose objects are "spi_m[0]" and "spi_m[1]". reg2spi_adapter = spi_master_reg_adapter::type_id::create(.name("reg2spi_adapter"), .contxt(get_full_name())); `uvm_info("DEBUG_FULL_NAME", $sformatf("Full name of this spi_env obj is %s", this.get_full_name()), UVM_MEDIUM) `uvm_info("DEBUG_FULL_NAME", $sformatf("Full name of the new reg2spi_adapter obj is %s", reg2spi_adapter.get_full_name()), UVM_MEDIUM) Inside the "new" function of the "spi_master_reg_adapter" class, I have: `uvm_info("DEBUG_FULL_NAME", $sformatf("Full name of this adapter obj is %s", this.get_full_name()), UVM_MEDIUM) But still, this is what gets printed (formatting changed from default using a custom report server): UVM_INFO @ 0ns Full name of this adapter obj is reg2spi_adapter :DEBUG_FULL_NAME UVM_INFO @ 0ns Full name of this spi_env obj is uvm_test_top.env.spi_m[0] :DEBUG_FULL_NAME UVM_INFO @ 0ns Full name of the new reg2spi_adapter obj is reg2spi_adapter :DEBUG_FULL_NAME UVM_INFO @ 0ns Full name of this adapter obj is reg2spi_adapter :DEBUG_FULL_NAME UVM_INFO @ 0ns Full name of this spi_env obj is uvm_test_top.env.spi_m[1] :DEBUG_FULL_NAME UVM_INFO @ 0ns Full name of the new reg2spi_adapter obj is reg2spi_adapter :DEBUG_FULL_NAME I am curious why the below does not work; I am specifying the env's "get_full_name()" as the context: reg2spi_adapter = spi_master_reg_adapter::type_id::create(.name("reg2spi_adapter"), .contxt(get_full_name()));
  4. Hi Tudor, Thanks for the reply. I have tried something similar. But that doesn't work. Here's is some code to show what I tried. In the adapter class where I create the transaction objects: mem_tr = spi_mem_tr::type_id::create(.name("mem_tr"), .contxt(get_full_name())); In the base test where I do the overrides: spi_mem_tr::type_id::set_inst_override(.override_type(spi_mem_ext_tr::get_type()) , .inst_path("env.spi_m[0].reg2spi_adapter.*") , .parent(null)); spi_mem_tr::type_id::set_inst_override(.override_type(spi2_mem_ext_tr::get_type()) , .inst_path("env.spi_m[1].reg2spi_adapter.*") , .parent(null)); Note that I have fixed the order of the arguments to set_inst_override; the parent argument is the last argument. To avoid confusion, I am using named argument association. The difference here is that we have a VIP that wraps the SPI adapter, and I have 2 instances spi_m[0] and spi_m[1] of the same VIP class. the mem_tr objects are created inside the reg2spi_adapter. Even then, the overrides do not work at all.
  5. Hello, We have a test bench environment where we have 2 objects of the same SPI env class. The SPI env sets the sequencer for the RAL model as follows: reg_model.default_map.set_sequencer(spi_master_agt.mem_sqr, reg2spi_adapter); The transaction type handled by the spi_master_agt.mem_sqr is spi_mem_tr. Now I need to extend the spi_mem_tr to spi_mem_tr_1 and spi_mem_tr_2, and then override spi_mem_tr with those separately for the 2 objects of the SPI env class. // Below does not work set_inst_override_by_type ( .relative_inst_path("env.spi_m[0].*"), // Here spi_m[0] is the first instance of the SPI env .original_type(spi_mem_tr::get_type()), .override_type(spi_mem_tr_1::get_type())); set_inst_override_by_type ( .relative_inst_path("env.spi_m[1].*"), // Here spi_m[1] is the second instance of the SPI env .original_type(spi_mem_tr::get_type()), .override_type(spi_mem_tr_2::get_type())); // This does not work too! set_inst_override_by_type ( .relative_inst_path("env.*"), .original_type(spi_mem_tr::get_type()), .override_type(spi_mem_tr_1::get_type())); // Even this does not work! // So looks like "inst" override by type does not work for tr objects in RAL // connecting agents? set_inst_override_by_type ( .relative_inst_path("*"), .original_type(spi_mem_tr::get_type()), .override_type(spi_mem_tr_1::get_type())); // Other the other hand, below works, BUT that overrides the tr in both SPI env objects // That is not what I want; I need to override using different types for the // two SPI env objects spi_mem_tr::type_id::set_type_override(spi_mem_tr_1::get_type()); Questions: Is it possible to do instance specific overrides over transaction class inside the SPI agent connecting to my RAL model? If so, what is the correct way to set the relative_inst_path? If not, are there any hacks to achieve the same? The fact that the global type override does work gives me some hope.
  6. As rustagi said, you can extend the uvm_report_server and have your own compose_message function. Here's what I do to have a filename without path and to customize other parts of the message too. class custom_report_server extends uvm_report_server; virtual function string compose_message ( uvm_severity severity, string name, string id, string message, string filename, int line ); // Declare function-internal vars string filename_nopath = ""; uvm_severity_type severity_type = uvm_severity_type'( severity ); begin // Extract just the file name, remove the preceeding path foreach(filename[i]) begin if (filename[i]=="/") filename_nopath = ""; else filename_nopath = {filename_nopath, filename[i]}; end // number of initial spaces in the second line // = 8 + 1(space) + 1(@) + 7 + 2("ns") + 3(spaces) + 2(indentation) = 24 return $psprintf( "%-8s @%7tns%3s\"%s\" >%s(%0d)\n%24s%s [%s]", severity_type.name(), $time/1000.00, " ", name, filename_nopath, line, " ", message, id ); end endfunction: compose_message endclass: custom_report_server I would then put this in the base test. It is up to you where you want the new server to be effective: before build, before run, etc. virtual function void build_phase(uvm_phase phase); // Set the custom report server to output the uvm_info messages in custom format custom_report_server my_server = new; uvm_report_server::set_server( my_server ); super.build_phase(phase); ...... endfunction
×