Hi,
what is the ovm recommendation for the report messages of systemverilog assertion in interfaces? We would like to use ovm_report_error function instead of the task $error: is there a way to do this?
Thank you
bye
Fabio
Hi,
what is the ovm recommendation for the report messages of systemverilog assertion in interfaces? We would like to use ovm_report_error function instead of the task $error: is there a way to do this?
Thank you
bye
Fabio
ovm_report_error can be used anywhere you can import ovm_pkg. It exists as a regular function in addition to being a method of the ovm_report_object. It uses a global reporter object that is created in the ovm_pkg. You use that object to configure all global reporting.
Dave
Hi all,
I am not able to use ovm_report_error within interfaces. In particular it seems it is not possible to instantiate any OVM object on it
Anyone have suggestions?
Thanks
Alberto
Have you imported ovm_pkg into the interface?
I am using ncsim by Cadence and in my understanding the ovm_pkg is not supported . What I tryed was to include ovm.svh
(`include ovm.svh) within the interface
Regards
Alberto
Hi Alberto,
We always put our test bench classes in a package -this works with both Questa and Incisive. The start of this package will have something like
package tb_pkg;
`ifdef INCA
`include "ovm.svh"
`else
import ovm_pkg::*;
`endif
...
You can use this package to import ovm_report_error, etc. e.g.
interface chip_if(input bit clk);
`ifdef INCA
import tb_pkg::ovm_report_error;
`else
import ovm_pkg::ovm_report_error;
`endif
...
assert property (@(posedge clk) (addr > 8'd10))
else ovm_report_error("INTF","address is not greater than 10");
endinterface: chip_if
Regards,
Dave
Thanks Dave
I tried what you suggest but it does not work. This is what I get from the ncsim report log:
file: ./src/top.sv
module worklib.top:sv
errors: 0, warnings: 0
file: ./src/scb2dbe_if_pkg.sv
package worklib.scb2dbe_if_pkg:sv
errors: 0, warnings: 0
file: ./src/scb2dbe_if.sv
interface worklib.scb2dbe_if:sv
errors: 0, warnings: 0
Caching library 'worklib' ....... Done
Elaborating the design hierarchy:
Top level design units:
top
function void ovm_report_error(string id,
|
ncelab: *E,CUDACO (/home/rwcv/OVM/ovm-1.0.1/src/base/ovm_report_global.svh,55|39): Unsupported hierarchical reference to dynamic object at 'ovm_report_error'.
string message,
|
ncelab: *E,CUDACO (/home/rwcv/OVM/ovm-1.0.1/src/base/ovm_report_global.svh,56|44): Unsupported hierarchical reference to dynamic object at 'ovm_report_error'.
function void ovm_report_error(string id,
|
ncelab: *E,CUDACO (/home/rwcv/OVM/ovm-1.0.1/src/base/ovm_report_global.svh,55|39): Unsupported hierarchical reference to dynamic object at 'ovm_report_error'.
string message,
|
ncelab: *E,CUDACO (/home/rwcv/OVM/ovm-1.0.1/src/base/ovm_report_global.svh,56|44): Unsupported hierarchical reference to dynamic object at 'ovm_report_error'.
function void ovm_report_error(string id,
|
ncelab: *E,CUDACO (/home/rwcv/OVM/ovm-1.0.1/src/base/ovm_report_global.svh,55|39): Unsupported hierarchical reference to dynamic object at 'ovm_report_error'.
string message,
|
ncelab: *E,CUDACO (/home/rwcv/OVM/ovm-1.0.1/src/base/ovm_report_global.svh,56|44): Unsupported hierarchical reference to dynamic object at 'ovm_report_error'.
function void ovm_report_error(string id,
|
ncelab: *E,CUDACO (/home/rwcv/OVM/ovm-1.0.1/src/base/ovm_report_global.svh,55|39): Unsupported hierarchical reference to dynamic object at 'ovm_report_error'.
string message,
|
ncelab: *E,CUDACO (/home/rwcv/OVM/ovm-1.0.1/src/base/ovm_report_global.svh,56|44): Unsupported hierarchical reference to dynamic object at 'ovm_report_error'.
irun: *E,ELBERR: Error during elaboration (status 1), exiting.
TOOL: irun 06.20-s003: Exiting on Apr 23, 2008 at 12:12:28 CEST (total: 00:00:05)
scb2dbe_if_pkg.sv is the package that includes the ovm.svh as you suggest and ./src/scb2dbe_if.sv is the interface that import everything is included in the scb2dbe_if_pkg package (import scb2dbe_if_pkg::*; )
I tried also to import only the ovm_report_erro with import scb2dbe_if_pkg:: ovm_report_error; but it does not work either
Regards
Alberto
Hi Alberto,
You are seeing an elaboration error due to an unsupported feature of IUS rather than any problem in using ovm_report_error. This is confirmed by the fact that the error message has picked up the global ovm_report_error function and is objecting to whatever has been supplied as its first two string arguments.
The error code “CUDACO” gives a clue as to what the cause might be. If you enter
nchelp ncelab CUDACO
you will get a bit more information:
The current implementation of the software does not support a
hierarchical path name that refers to a dynamic object.
These include the following data types: queue, associative array,
dynamic array, string, or class object.
Can you post the call to ovm_report_error that is causing the problem? I suspect you are calling a member function of a class that is instantiated somewhere else in the hierarchy to set the id and message strings?
Regards,
Dave
Hi Dave,
This is the package I created based on your suggestion:
package scb2dbe_if_pkg;
`ifdef INCA
`include "ovm.svh"
`else
import ovm_pkg::*;
`endif
endpackage: scb2dbe_if_pkg
This is a snipped of the interface
interface scb2dbe_if();
`ifdef INCA
//import scb2dbe_if_pkg::ovm_report_error;
import scb2dbe_if_pkg::*;
`else
import ovm_pkg::ovm_report_error;
`endif
....
sequence out_of_frame;
...
endsequence
property check_out_of_frame;
@(posedge DBECLK) !data_frame |-> out_of_frame;
endproperty
assert_out_of_frame: assert property(check_out_of_frame) else
begin
//$display(">>> Error out of frame");
//$fatal(1);
ovm_report_error("DUT", "Error out of frame");
end
...
Regards
Alberto
Hi Alberto,
Well I’m not sure what else so suggest.![]()
I have something pretty similar to the code you show that works OK. You might try upgrading to the latest version of IUS (I am using 6.20-s005) in case that fixes it. Otherwise perhaps you need to contact your local Cadence AE to see if there is something else in your code/setup that is causing the problem.
Best Regards,
Dave
Hi Alberto,
Dave is correct, this technique works in IUS simulator. I just tried v6.2s004 with the following code (a slight modification of your example) and it compiled and elaborated fully.
package scb2dbe_if_pkg;
`ifdef INCA
`include "ovm.svh"
`else
import ovm_pkg::*;
`endif
endpackage: scb2dbe_if_pkg
interface scb2dbe_if();
`ifdef INCA
//import scb2dbe_if_pkg::ovm_report_error;
import scb2dbe_if_pkg::*;
`else
import ovm_pkg::ovm_report_error;
`endif
logic DBECLK;
logic data_frame;
logic out_of_frame;
property check_out_of_frame;
@(posedge DBECLK) !data_frame |-> out_of_frame;
endproperty
assert_out_of_frame: assert property(check_out_of_frame) else
begin
//$display(">>> Error out of frame");
//$fatal(1);
ovm_report_error("DUT", "Error out of frame");
end // UNMATCHED !!
endinterface
What version of IUS are you using?
Umer
Thank you Dave and Umer
Currently we are using the 06.20-s003. I will ask my IT to install the latest one
Regards
Alberto
Hi all.
It seems not an issue related to the IUS version.
I’m working with Cadence Ius 6.2 s006.
I’ve tried with the following code and it doesn’t work.
module top;
scb2dbe_if s2di0();
`include "ovm.svh"
class demo_sve extends ovm_env;
`ovm_component_utils(demo_sve)
// new
function new (string name, ovm_component parent=null);
super.new(name, parent);
endfunction : new
// build
virtual function void build();
super.build();
endfunction : build
task run;
begin end
endtask
endclass : demo_sve
endmodule
package scb2dbe_if_pkg;
`ifdef INCA
`include "ovm.svh"
`else
import ovm_pkg::*;
`endif
endpackage: scb2dbe_if_pkg
interface scb2dbe_if();
`ifdef INCA
import scb2dbe_if_pkg::*;
`else
import ovm_pkg::ovm_report_error;
`endif
logic DBECLK;
logic data_frame;
logic out_of_frame;
property check_out_of_frame;
@(posedge DBECLK) !data_frame |-> out_of_frame;
endproperty
assert_out_of_frame: assert property(check_out_of_frame) else
begin
ovm_report_error("DUT", "Error out of frame");
end
endinterface
I need to modify the code as follow and it seems to work.
`include "ovm_pkg.sv"
module top;
import ovm_pkg::*;
scb2dbe_if s2di0();
class demo_sve extends ovm_env;
`ovm_component_utils(demo_sve)
// new
function new (string name, ovm_component parent=null);
super.new(name, parent);
endfunction : new
// build
virtual function void build();
super.build();
endfunction : build
task run;
begin end
endtask
endclass : demo_sve
endmodule
interface scb2dbe_if();
import ovm_pkg::*;
logic DBECLK;
logic data_frame;
logic out_of_frame;
property check_out_of_frame;
@(posedge DBECLK) !data_frame |-> out_of_frame;
endproperty
assert_out_of_frame: assert property(check_out_of_frame) else
begin
ovm_report_error("DUT", "Error out of frame");
end
endinterface
I have a question. This way to include ovm with Cadence apparently is not the official one, as I got from our Cadence support.
Is it the correct way to go?
Thanks
Matteo
With IUS 8.10 p002, we are having Hierarchical reference issues with ovm_report_*, when used within a generate block.
Here’s the ncelab error, followed by a code snippet below. As a work around, we are planning on trying to trigger an event instead of print out a message and then outside the generate block monitor the event, and print an generic ovm_report_*(…) if the event happens. A bit of a hack, but not sure what else to do at this point.
ncelab: *E,CUDACO (/tools/ldv/lnx/IUS08.10.002_lnx86/tools/ovm/src/base/ovm_report_global.svh,62|39): Unsupported hierarchical reference to dynamic object at ‘ovm_report_error’.
string message,
genvar i; //used in all for loops
generate
for (i=0; i<(2**PAENTWID); i++)
begin : assert_pa
assert property(
@(posedge clk_qs) disable iff (!dif.has_assert || (paent!=i))
##1 (!$stable(paband_c) && $stable(pabandp))|->
(paband_p == dut.top.PABAND)[*i] ##1 (paband_c == dut.top.PABAND)
) else ovm_report_error(“assert_pa”,
$psprintf(“=============== paent PABAND = %d %b”,i, dut.top.PABAND));
end
endgenerate
Steve
Why wouldn’t you just `include “ovm.svh” directly? Why bother with the packages at all? We’re trying to use assertions in modules with ovm_report_error, but can’t seem to get it going.
Well, we are able to use ovm_report_error, but aren’t able to control when it exits the simulation… When it’s used in the module, there seems to be no control over it. It exits the simulation on the first error, quit_count should be zero by default, and continue, but it doesn’t (when ovm_report_error is used in a module).
ncsim: *E,ASRTST …): (time 50882 NS) Assertion top.assert_pll[40].__assert_42 has failed (41 cycles, starting 11362 NS)
*** OVM: DUT error at time 50882
Checked at line 0 in
In global
===============: fail in generate assert
Will stop execution immediately (check effect is DISPLAY COUNT EXIT )
*** Error: A DUT error has occurred
Steve
You need to use packages instead of `include if you intend to do any kind of OVM communication between multiple modules. Remember that in in SystemVerilog, a class defined inside a module instance is not type equivalent with any class outside that instance. This is because all named user defined types include the instance path as part of their equivalence. This is needed because modules could be parameterized which could affect the class definition, even if that class is not a parameterized class.
If you want to control the settings for ovm_report_, use global_report.set_report().
You can also do
_global_reporter.set_report_handler(
ovm_top.get_report_handler()
);
and any settings to ovm_top will now be synchronized with the _global_reporter.
Dave Rich
Thanks Dave,
I’ve tried what you suggested (using the _global_report.set_report_handler(ovm_top.get_report_handler() ); in our module with the assertions ), and then in the end_of_elaboration function in my extended ovm_test, I’m issuing a set_report_severity_action(OVM_ERROR,OVM_COUNT|OVM_DISPLAY);
which I think it should be by default anyway, but my simulation still stops on the first assertion error, where I issue ovm_report_error(“asdf”,“some error”);
I’m still getting this, saying I have OVM_DISPLAY | OVM_COUNT | OVM_EXIT set for ovm_report_error.
Will stop execution immediately (check effect is DISPLAY COUNT EXIT )
Any other things I can try?
Steve
Hello Dave,
I just tried creating the ovm_component just to act as a report handler that you mentioned in this thread (http://ovmworld.org/forums/showthread.php?t=246) , and that seems to be working. I’m getting reporting in a module and it’s not ending on the first error. So now in the module I’m just referencing rh.ovm_report_error(…) now (where rh is my report handler component).
I’m still curious as to why it’s dying though with the _global_reporter setup.
Steve H.