Usage of Virtual sequence

Hi All,

I am using virtual sequence in my env. To generate any sequence through virtual sequence i am using below syntax:

`ovm_do_seq_with(mutc, p_sequencer.seq_cons_if[“master_agent[1]”],{
hsize_t == BYTE;
hlock_t == 0;
total_busy_cycle_t == 0;
position_of_busy_cycle_t == 3;
})

This is working on ovm1.1 but it shows me an warning in ovm2.0

warning: Inline constraints for hierarchical call to randomize() will be resolved with respect to the current scope

I would appreciate if any body can answer?

Regards,
Ankit

Hi All,
I am using virtual sequence in my env. To generate any sequence through virtual sequence i am using below syntax:
`ovm_do_seq_with(mutc, p_sequencer.seq_cons_if[“master_agent[1]”],{
hsize_t == BYTE;
hlock_t == 0;
total_busy_cycle_t == 0;
position_of_busy_cycle_t == 3;
})
This is working on ovm1.1 but it shows me an warning in ovm2.0
warning: Inline constraints for hierarchical call to randomize() will be resolved with respect to the current scope
I would appreciate if any body can answer?
Regards,
Ankit

Hello guys,

I am also facing error in similar kind of code…
I am getting this error in Questa 6.4 :

Warning during compilation is :
(vlog-2223) Inline constraints for hierarchical call to randomize() will be resolved with respect to the current scope

Warning during simulation is :
(vopt-2223) Inline constraints for hierarchical call to randomize() will be resolved with respect to the current scope

Error during simulation is :

** Error: (vsim-3043) test.sv(89): Unresolved reference to ‘start_addr_t’.

Region: /top/virtual_seq

Can you help us out??

Thanks in advance,
Chintan

Hi,
I do not have the solution, but I managed to isolate the problem.
As dsantos pointed out here some time ago, it is not just a virtual sequence problem, not even sequence-related problem.
Here is a compressed version of ovm_pkg:

package ovm_pkg;
   class ovm_sequence_item; endclass

   class ovm_sequence_base extends ovm_sequence_item; endclass

   virtual class ovm_sequence #(type REQ = ovm_sequence_item) extends ovm_sequence_base;
      REQ req;
   endclass
endpackage

Now, what the user does is

module test;

import ovm_pkg::*;

class item extends ovm_sequence_item;
   rand int a;
endclass

class seq extends ovm_sequence#(item);
   item item0;

   virtual task body();
      req = new();
      assert(req.randomize() with { a == -2; });

      item0 = new();
      assert(item0.randomize() with { a == -2; });
   endtask
endclass

initial begin
   seq seq0 = new();
   seq0.body();
   $display("seq0.req.a = %0d", seq0.req.a);
end

endmodule

If you copy&paste the above pieces of code into a single file and “vlog” it, you get the same

*** Warning: constraint.sv(26): (vlog-2223) Inline constraints for hierarchical call to randomize() will be resolved with respect to the current scope*

Moreover, if you’ll try to load it via vsim you’ll get

# ** Error: constraint.sv(26): Failed to find ‘a’ in hierarchical name.

The fact that

  • seq inherits ovm_sequence which in turn inherits ovm_sequence_base which in turn inherits ovm_sequence_item &
  • req field is declared under ovm_sequence as REQ(which should become item following the specialization) &
  • item0 is declared under seq as item &
  • the compiler only complains about not finding a under req(but not under item0 too)

makes me guess that, somehow, it(the compiler) forgot to update the type of req(which remained ovm_sequence_item, as default specialization). But this is merely a guess.
As a workaround, if you replace

assert(req.randomize() with { a == -2; });

with

assert(req.randomize() with { **req.**a == -2; });

you’ll still get the warning, but this time will work, i.e. run:

Loading work.ovm_pkg(fast)

Loading work.test(fast)

run

seq0.req.a = -2

VSIM 2>

Hi Daniel,

Thanks for the solution…
Your solution really worked here and we got the rid out of it…

But now i am facing another problem…:confused:

Thats why i am getting Fatal message during simulation…

The Fatal message is : Item done reports empty request fifo

Do you have solution for this??

Thanks for the answer again…

Regards,
Chintan

Hi,
Since I find this error message in

*[daniel@daniel-p ovm-2.0]$ grep -A 14 -B 8 -e “Item done reports empty request fifo” find . -name '*.sv*'
./src/methodology/sequences/ovm_sequencer.svh- function void item_done(RSP item = null);
./src/methodology/sequences/ovm_sequencer.svh- REQ t;
./src/methodology/sequences/ovm_sequencer.svh-
./src/methodology/sequences/ovm_sequencer.svh- // Set flag to allow next get_next_item or peek to get a new sequence_item
./src/methodology/sequences/ovm_sequencer.svh- sequence_item_requested = 0;
./src/methodology/sequences/ovm_sequencer.svh- get_next_item_called = 0;
./src/methodology/sequences/ovm_sequencer.svh-
./src/methodology/sequences/ovm_sequencer.svh- if (m_req_fifo.try_get(t) == 0) begin
./src/methodology/sequences/ovm_sequencer.svh: ovm_report_fatal(get_full_name(), “Item done reports empty request fifo”);
./src/methodology/sequences/ovm_sequencer.svh- end else begin
./src/methodology/sequences/ovm_sequencer.svh- m_wait_for_item_sequence_id = t.get_sequence_id();
./src/methodology/sequences/ovm_sequencer.svh- m_wait_for_item_transaction_id = t.get_transaction_id();
./src/methodology/sequences/ovm_sequencer.svh- end
./src/methodology/sequences/ovm_sequencer.svh-
./src/methodology/sequences/ovm_sequencer.svh- if (item != null) begin
./src/methodology/sequences/ovm_sequencer.svh- seq_item_export.put_response(item);
./src/methodology/sequences/ovm_sequencer.svh- end
./src/methodology/sequences/ovm_sequencer.svh-
./src/methodology/sequences/ovm_sequencer.svh- // Missing item_done functionality
./src/methodology/sequences/ovm_sequencer.svh-
./src/methodology/sequences/ovm_sequencer.svh- // Grant any locks as soon as possible
./src/methodology/sequences/ovm_sequencer.svh- grant_queued_locks();
./src/methodology/sequences/ovm_sequencer.svh- endfunction // void
*
I suspect you have, somewhere in your code(your driver more precisely), a call to seq_item_port.item_done() and no previous call to seq_item_port.get_next_item(req).
I get the same error message if I, for example, comment the call to get_next_item() in the simple_driver, presented as an example under ovm-2.0/examples/sequence/simple:

class simple_driver extends ovm_driver #(simple_item);

  // Provide implementations of virtual methods such as get_type_name and create
  `ovm_component_utils(simple_driver)

  // Constructor
  function new (string name, ovm_component parent);
    super.new(name, parent);
  endfunction : new

  task run ();
    while(1) begin
      #10;
//      seq_item_port.get_next_item(req);
      ovm_report_info("Driver", "Printing received item :");
//      req.print();
      seq_item_port.item_done();
    end
  endtask: run

endclass : simple_driver

*[daniel@daniel-p simple]$ ./run_questa

OVM_FATAL @ 10: sequencer [sequencer] Item done reports empty request fifo*

Hope my answer does not come too late…

Hi Daniel,

Thanks for the answer … but I have called get_next_item befor calling item_done…
So still I am getting same error…

Without a code snippet, I cannot really help you…

Hi All,
I am using virtual sequence in my env. To generate any sequence through virtual sequence i am using below syntax:
`ovm_do_seq_with(mutc, p_sequencer.seq_cons_if[“master_agent[1]”],{
hsize_t == BYTE;
hlock_t == 0;
total_busy_cycle_t == 0;
position_of_busy_cycle_t == 3;
})
This is working on ovm1.1 but it shows me an warning in ovm2.0
warning: Inline constraints for hierarchical call to randomize() will be resolved with respect to the current scope
I would appreciate if any body can answer?
Regards,
Ankit

Hi ,

We can suppress this warning .For that we need to use -suppress 2223
Use : vlog -suppress 2223 when you compile the code

Hi,
I do not have the solution, but I managed to isolate the problem.
As dsantos pointed out here some time ago, it is not just a virtual sequence problem, not even sequence-related problem.
Here is a compressed version of ovm_pkg:

package ovm_pkg;
class ovm_sequence_item; endclass
class ovm_sequence_base extends ovm_sequence_item; endclass
virtual class ovm_sequence #(type REQ = ovm_sequence_item) extends ovm_sequence_base;
REQ req;
endclass
endpackage

Now, what the user does is

module test;
import ovm_pkg::*;
class item extends ovm_sequence_item;
rand int a;
endclass
class seq extends ovm_sequence#(item);
item item0;
virtual task body();
req = new();
assert(req.randomize() with { a == -2; });
item0 = new();
assert(item0.randomize() with { a == -2; });
endtask
endclass
initial begin
seq seq0 = new();
seq0.body();
$display("seq0.req.a = %0d", seq0.req.a);
end
endmodule

If you copy&paste the above pieces of code into a single file and “vlog” it, you get the same
*** Warning: constraint.sv(26): (vlog-2223) Inline constraints for hierarchical call to randomize() will be resolved with respect to the current scope*
Moreover, if you’ll try to load it via vsim you’ll get
# ** Error: constraint.sv(26): Failed to find ‘a’ in hierarchical name.
The fact that

  • seq inherits ovm_sequence which in turn inherits ovm_sequence_base which in turn inherits ovm_sequence_item &
  • req field is declared under ovm_sequence as REQ(which should become item following the specialization) &
  • item0 is declared under seq as item &
  • the compiler only complains about not finding a under req(but not under item0 too)

makes me guess that, somehow, it(the compiler) forgot to update the type of req(which remained ovm_sequence_item, as default specialization). But this is merely a guess.
As a workaround, if you replace

assert(req.randomize() with { a == -2; });

with

assert(req.randomize() with { **req.**a == -2; });

you’ll still get the warning, but this time will work, i.e. run:

Loading work.ovm_pkg(fast)

Loading work.test(fast)

run

seq0.req.a = -2

VSIM 2>

Hi Daniel,
Thanks for your post.I am using questasim 6.4c.I was getting same error.It was solved as you have suggested.If there is anything more on this please let us know.
Thanks again,
Chandan