Tutorials
CONFIGURATION
Confoguration class is inherited from avm_verification_component. This class genarates addresses to configure the dut 4 output ports.
CODE:CFG.SV
`ifndef CFG_CLASS
`define CFG_CLASS
class Configuration extends avm_verification_component;
rand bit [ 7 : 0 ] da_port [ 4 ];
string msg;
constraint da_ports { ( da_port[ 0 ] != da_port[ 1 ])&&( da_port[ 1 ] != da_port[ 2 ])&&( da_port[ 2 ] != da_port[ 3 ]);}
virtual function void display( string prefix = "Test Configuration" );
$swrite ( msg, " addresss %x %x %x %x \n" , da_port[ 0 ], da_port[ 1 ], da_port[ 2 ], da_port[ 3 ]);
avm_report_message( "cfg" , msg);
endfunction
function new ( string nm, virtual switch_if intf, avm_named_component p = null );
super . new ( nm, p);
avm_report_message( "cfg" , " Configuration Created \n" );
endfunction
task run;
endtask
endclass
`endif