Professional Documents
Culture Documents
Assertions in UVM
Surinder SOOD
SANDISK INDIA
Motivation
Transaction checks and compare. These are typically packet level. This is
done inside monitor and scoreboard
How we enable assertions
Property ip_trfr;
@(posedge clk)
Disable iff(!checks_on)
Req |-> if(cfg_speed_level ==FAST)
Fast_trfr;
Else
Slow_trfr;
Endproperty
Config_db
Config_
db::get
VIF Config_
db::set
SVA
AGENT TB Module
Place for SVA
Encapsulated in interface.
SVA code is verbose and complex
Majority of the lines of code comprised of SVA checks in physical
interface.
Method 1: call SVA interface from main
interface
interface my_interface;
interface assertion_chkr(
// local signals
// signal ports
logic CLK;
input logic CLK,
logic REQ;
input logic REQ,
logic GNT;
input logic ACK,
logic [7:0] DATA;
input logic [7:0] DATA
logic OTHER;
); // support code
... // modports,
etc. // properties //
assertions
...
endinterface
// protocol checker
assertion_ chkr
sva_checker(.*);
endinterface
SVA Configuration [Method 1]
interface assertion_chkr(...);
// control points
bit checks_enable = 1;
// config object Interface is not a
phased component in this case.
my_config cfg;
Configuration class is built during the build
// local variables for SVA phase
speed_level cfg_speed_level;
int unsigned cfg_max_value;
bit cfg_data_on;
void'(uvm_config_db#(bit)::get
(this,","checks_enable,checks_enable));
cfg_speed_level= cfg.speed_mode;
copy required cfg fields to
cfg_max_value = cfg.max_value;
local variables for use in SVA
cfg_data_en = cfg.data_en;
endfunction
Dynamic Configuration: Use Run_Phase
References:
http://www.verilab.com/files/litterick_sva_encapsulation.pdf