I'm stuck on the print properties of uvm_tlm_analysis_fifo handle with `uvm_info(). I made a simple sequence item as below.

class simple_sequence_item extends uvm_sequence_item;                            
  rand bit[9:0] address;  
  rand bit[31:0] data;   
  rand bit wr_en;  
       bit acc;                                                                

  function new(string name="simple_sequence_item");
  constraint c_sequence_item { data<'d40;             
  constraint c_address{ address<'d500;                                 
  constraint c_wr_en{

I have implemented with a declaration of simple_sequence_item as the below,

class apb_scoreboard extends uvm_scoreboard;
    simple_sequence_item seq_item;
    uvm_tlm_analysis_fifo#(simple_sequence_item) fifo_exp;

virtual task run_phase( uvm_phase phase);
`uvm_info(get_type_name(), $sformat("fifo_get seq_item from mon in Scoreboard : \n Address=%02h\n data=%02h\n wr_en=%02h\n acc=%02h\n", seq_item.address, seq_item.data, seq_item.wr_en, seq_item.acc, ), UVM_LOW)

But, the problem is that I got the System task was invoked like a function (it has no return value) error message during compile.

xmelab: *W,DSEMEL: This SystemVerilog design will be simulated as per IEEE 1800-2009 SystemVerilog simulation semantics. Use -disable_sem2009 option for turnin
                                seq_item.address, seq_item.data, seq_item.wr_en, seq_item.acc ), UVM_LOW)
*E,NOTSYF (./apb_scoreboard.sv,46|105): System task was invoked like a function (it has no return value) [2.7.4(IEEE Std 1364-2001)].

How to print properties of uvm_tlm_analysis_fifo handle with uvm_info()?


1 Answer 1






Note the f at the end. Your code uses the system task $sformat, which does not return a string. You need the system function $sformatf, which does return a string. This is what the error message is referring to.

Refer to IEEE Std 1800-2017, section 21.3.3 Formatting data to a string for complete details about the syntax.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.