Quantcast
Channel: UVM SystemVerilog Discussions Forum RSS Feed
Viewing all 410 articles
Browse latest View live

randomize and $dist_normal?

$
0
0

Is there a way to make the randomization of variables via randomize() use one of the different RNGs listed in 20.15 of the IEEE Std 1800 (such as $dist_normal or others)?  Or does the use of one of the alternative RNGs require manually doing randomization via direct calls to those utility functions ($dist_normal, etc) in the post_ or pre_randomize() functions?

 

Greg


How to respond for a NACK request to resend the frame in UVM?

$
0
0
Hello all,
 
How do I set priorities for some features, to be added in a transaction class? Is there any method in UVM for that? For eg. when I get a NACK, I need to respond to it quickly and resend the same frame or (a nested frame), in priority. Can some one please give me some guggestions for this? How do I include this feature in a transaction/packet class?
 
Thanks,

Questasim simulation error?

$
0
0
Dear All,
 
I am getting one strange error while using questasim 10.2a. While simulating 1st time, it simulates properly, all the packages, libraries get loaded fine. But when I tried to simulate the design 2nd time, the Questasim gets stuck forever while loading the libraries and packages, and further doesnt simulate it. So I have to restart the tool. This process is happening again and again, And it gets stuck again at the 2nd time while simulating.
What might be the error/problem happenning here? I am using the license server for this. Please help me to debug this error.
 
Thanks,

Nesting of frames in UVM?

$
0
0
Hello all,
 
I want to create nested frames/packets. My packet structure is shown below. I want to have nested frames(one or more frames within another frame) starting from 2nd byte of header and before the EOF/EOT. Please give me some guidance of how to include nested frames into another frames in UVM? What are the methods/macros in UVM which will be usefull in this regard. 
 
[/code] 
       rand bit [7:0] sync;      
       rand bit [7:0] sof;  
       rand bit [15:0] header; 
       rand bit [7:0] payload[];       
       rand bit [15:0] crc;
       rand bit [7:0] eof; //Or EOT(end of transmission)
[/code]
 
Any help/suggestion is appreciated.
Thanks,

Incompatible complex type usage in uvm

$
0
0

Hi,

    In my current environment I have monitors class and parametrized scoreboard class. I am sending monitor transaction into scoreboard through the tlm analysis port. Below is snippet of code.

 

class pkt_monitor extends uvm_monitor

  uvm_analysis_port #(pkt_item) pkt_collected_port;

 

  function new(uvm_component parent = null)

       pkt_collected_port = new("pkt_collected_port", this);

 

....

....

endclass

 

class pkt_sbd #(type T = uvm_transaction)  extends uvm_component;

 

  uvm_analysis_export #(T) sb_check_port;

 

 // typedef pkt_sbd #(T) this_type;

 

  function new(uvm_component parent = null)

       sb_check_port = new("sb_check_port", this);

 

.....

.....

endclass

 

class top_env extends uvm_env;

 pkt_sbd #(pkt_item)   pkt_sbd_inst;

 pkt_monitor  pkt_monitor_inst;

 

  build_phase()

  pkt_monitor_inst = pkt_monitor::type_id::create("pkt_monitor_inst",this);

  pkt_sbd_inst = pkt_sbd #(pkt_item) :: type_id::create("pkt_sbd_inst",this)

 

 connect_phase()

 pkt_monitor_inst.pkt_collected_port.connect(pkt_sbd_inst.sb_check_port)

 

endclass

 

 

 

While compiling above code there is a type incompatability issue observed

 

Error-[ICTTFC] Incompatible complex type usage
  Incompatible complex type usage in task or function call.
  The following expression is incompatible with the formal parameter of the
  function. The type of the actual is 'class
  uvm_pkg::uvm_analysis_export#(class pkt_pkg::pkt_item)', while the type of
  the formal is 'class uvm_pkg::uvm_port_base#(class
  uvm_pkg::uvm_tlm_if_base#(class pkt_pkg::pkt_item,class
  pkt_pkg::pkt_item))'. Expression: this.pkt_sbd_inst.sb_check_port
  Source info:
  pkt_monitor_inst.pkt_collected_port.connect(pkt_sbd_inst.sb_check_port) 

 

Any help is appreciated.

 

 

Switching between data_items during simullation

$
0
0

Hi , 

 

I would like to use some data items in one test: frame_packet,  short_packet , illegal_packet.

 

In the uvm documentation i found that in order to switch between packets i should use factory setting in the test:

 

frame_packet::type_id::set_type_override(short_packet::get_type());

 

according to my understanding this completly replaces that data item and does not leave option to use frame_packet in this test.

 

Is there any other way to do it?

 

Thanks, 

Ilan

 

 

 

Streaming operator for unpacking a bitstream

$
0
0

I'm stuck on a problem I encountered with a use of the streaming operator to unpack into a dynamic array.  Rather than write procedural code, I thought I could use it actually with some amount of success.  Here is what the code more or less looks like:

 

 

uvm_pack_bitstream_t bit_vector;
bit bit_array[];
...
bit_vector = packer.get_packed_bits();
{<<{bit_array with [0 +: packer.count]}} = bit_vector;
myfunc(bit_array);
 

Yes, I'm trying to use "unadvertised" features of the UVM packer here.  This has worked in many cases, but there is one case that led to the following:

 

 

# ** Fatal: Width do not match. Stream larger than variable.

 

I thought maybe the packer count was too large compared to the bits returned from the packer, but similar scenarios had executed previously in the simulation without error.

 

BTW, this is the only thing reported in the error, which is followed by the file and line number where it occurred (i.e. the streaming operator above).

 

So, any ideas or insight as to what is going on here?

 

TIA

3 TLMs between sequencer and driver?

$
0
0

Hello all,

 

Can I have 3 TLMs connected between a single sequencer and a single driver in UVM? In other words, I want 3 pipes/TLM connections to send three different kind of packets to the same driver from the same sequencer. Or in other words, can a sequencer has 3 exports? Can a diver has 3 ports, so that they can be connected with each other?

 

Please guide, thanks


connection between monitor and driver?

$
0
0
Hello All,
I need to send some bytes/packets(which are received from the DUT, for eg. NACK for missed packets) to the driver. So can I directly connect the monitor to the driver, without going through the sequencer? In other words, I want to connect one TLM between monitor and driver, can this be done? Please guide,
Thanks

control knobs for a driver to be controlled from test class?

$
0
0

Dear All,

Is it always the case that the TOP test class can control/manage the control knobs of sequences only? I mean, I want to override/control some parameters of driver class from top test class, can this be done? If yes, how can that be done? because top test class stimulates only a sequence, so how would the control knob of driver be controlled from top test class? any guidance will be helpfull.

Thanks

Is it possible to call Python script from SystemVerilog?

$
0
0

Is there any way to call python function from SystemVerilog?

Single transaction class to create different kinds of pkts?

$
0
0
Dear all,
 
I need to create different kinds of packets, for eg nested packets(one or more pkts encapsulated in another pkt), simple packets etc, of the same protocol. Can these different kinds of pkts be made/created (as an object) from the same transaction class? If yes, how shall I manage the packing/unpakcing(do_pack/do_unpack functions) of their bytes, as the bytes travel scenerios, will vary from pkt to pkt?
OR if I am creating different classes for each different kind of pkt structure, then will they be controlled properly from sequences, in order to create testcase scenerios? Any guidance will be helpfull.
Thanks

Many more sequences in a single sequence?

$
0
0

Hello all,

Can there be more than one different kinds of sequences, containing different kinds of pkts, be nested in one single sequence? so that the test case scenerio, will be to show different kinds of pkts,going one after another in a single sequence to the driver? Please guide,thanks

How to generate the even number's and add number's.

$
0
0

Hi all,

I have 16 bit data line and in transaction class i declared as "rand".
But i want even even number's in one transaction and odd no number's in another transaction.

Please suggests me..

Regards,
Santhosh.

How to send some random data in between two packets/frames?

$
0
0

Dear All,

 

I need to send some high impedance/IDLE symbols (eg 101010...) between the two packets/frames for long time. So is it possible in UVM to send some random data (not through packets in the form of bytes)? If yes, how do I do it? Can this be done through some constraint variables, set in a config db object? Its urgent, so any guidance, regarding the process, will be appreciated. 

Thanks


uvm_cmdline_processor get_arg_value/s to receive hex

$
0
0

SPOILER ALERT:  I figured this one out, but since I'd already typed up most of the question, here it is anyhow posted to the public domain.   Comments welcome.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Who can tell me how to pass a hex value into Systemverilog using uvm_cmdline_processor?

 

My current code is shown below as well as the command line option that is supplied.

 
code snippet: 
 
   bit [31:0] stimulus_xyz_min = 32'h12121212;             // *** setting default here works fine

      `uvm_info(get_type_name(), $psprintf("1st TEST-SETTINGS.  xyz_min=%8h",stimulus_xyz_min), UVM_LOW)
      if (cmdline_proc.get_arg_values(.match("+xyz_min="), .values(arg_values))) begin  
		stimulus_xyz_min = arg_values[$];  
	end
      `uvm_info(get_type_name(), $psprintf("2nd TEST-SETTINGS.  xyz_min=%8h",stimulus_xyz_min), UVM_LOW)

 

command line option:   //** this value passed in from cmdline is not properly recognized
+xyz_min=09090909
 
 
The edited (for clarity) output is here (where you can see that the above +xyz_min did not 'take'):
1st TEST-SETTINGS. xyz_min=12121212
2nd TEST-SETTINGS. xyz_min=30393039

 

 
More +options/results data points listed here:
+xyz_min=09090909
2nd TEST-SETTINGS. xyz_min=30393039
+xyz_min=00000000
2nd TEST-SETTINGS. xyz_min=30303030
+xyz_min=00000001
2nd TEST-SETTINGS.  xyz_min=30303031
+xyz_min=00000002 
2nd TEST-SETTINGS.  xyz_min=30303032
+xyz_min=00000020
2nd TEST-SETTINGS.  xyz_min=30303230

 

Woo-hoo.  I looked at some other code I was using, which used

 

stimulus_lkj = arg_values[$].atoi();

and then in the sv spec found atohex.

Using the following worked (emphasis on .atohex()).

 

      `uvm_info(get_type_name(), $psprintf("1st TEST-SETTINGS.  xyz_min=%8h",stimulus_xyz_min), UVM_LOW)
      if (cmdline_proc.get_arg_values(.match("+xyz_min="), .values(arg_values))) begin
             stimulus_xyz_min = arg_values[$].atohex();  
      end
      `uvm_info(get_type_name(), $psprintf("2nd TEST-SETTINGS.  xyz_min=%8h",stimulus_xyz_min), UVM_LOW)

 

+xyz_min=1ACECAFE
2nd TEST-SETTINGS.  xyz_min=1acecafe

 

 
Even thoe I initially thought I was seeing the ASCII values, I mistakenly looked at an ASCII table of decimal-to-char, instead of hex-to-char, which further confused me.
 
I'd even tried this (as a wild hope that cmdline_processor would recognize it):
   +xyz_min=0x12121212
   +xyz_min=32'h12121212
 

 

AXI Bridge to ethernet connection

$
0
0

Hi,

I've created a UVM model for ethernet 10Gb MAC CoRE. There is a requirement to connect the AXI Bridge to my UVM model. I'm facing severe problems while integrating AXI Bridge to ethernet model.
Please provide some suggestions or share some document help for integration?

 

Thanks,

regards,
Mahee.

 

SystemVerilog checkers. simulator support. usage in a UVM environment

$
0
0

Q1) How well do the major simulators support SystemVerilog checkers (1800-2012.pdf Section 17.)?

Q2) In (the) UVM, do you think there is a place for checkers?

 

Context)  We have VHDL rtl.   For the data-interface between modules ABC and XYZ, we want to consolidate our protocol checking.  

case1) ABC testbench.  We now have the protocol checking in the sv interface which ABC and XYZ share

case2) XYZ testbench.               the same

case3) Top level testbench (testing DUT which instantiates ABC and XYZ).  Either we have to move the protocol checking to a module which is bind-ed to the VHDL.  Or, we can bind the sv interface to the ABC-XYZ connection, to reuse the protocol checking of that interface.

 

Without using a macro or `include of the protocol checking code, I'd like to just have a package or some place where we store the protocol checking code and can reuse it, whether in an sv interface, or a module which we bind to the VHDL.  Looking into this, and researching putting assertions into packages, I discovered checkers.  Hence this line of questioning.

 

 

Please share your thoughts and experience. 

 

 

question about `uvm_sequence_utils

$
0
0

Does the latest uvm no longer have `uvm_sequence_utils?  In the user_guide, seems `uvm_object_utils(seq) is enough to associate a sequence with a sequencer? how does it work?

 

thanks,

sequence is not running - make sure sequencer name 'correct'

$
0
0
//This is not a question, but me storing some debug notes online, lest I run into this problem again.
 
 
//good for debugging this issue, print_topology in particular.  Put them in your test.
      `uvm_info("TEST",$psprintf(" TOPOLOGY..............................."),UVM_HIGH);
      uvm_top.print_topology();
      `uvm_info("TEST",$psprintf(" CONFIG_DB_DUMP..............................."),UVM_HIGH);
      uvm_config_db::dump();
 
 
//When a sequence doesn't run, double-check the following.
 
//in the test (or wherever) where we assign the sequence to run on a sequencer
      uvm_config_db#(uvm_object_wrapper)::set(this,
                                              "*.dpx_xyz_agent_m.dpx_xyz_seq.main_phase",
                                              "default_sequence",
                                              dpx_xyz_simple1_seq::type_id::get());
 

//compare the name of the sequencer with the name that is given to the factory for the sequencer, when it is created

 
//where we create the sequencer (in the agent), what name did we supply to it with the factory?
      m_seq = dpx_xyz_sequencer::type_id::create("dpx_xyz_seq", this);
 
//make sure they match.  This problem has bitten me a few times.

 

 

Viewing all 410 articles
Browse latest View live