Академический Документы
Профессиональный Документы
Культура Документы
Modeling Transactions
Tom Fitzpatrick
Verification Evangelist
info@verificationacademy.com | www.verificationacademy.com
Separating Stimulus from the Testbench
• A key to reusability is to separate Behavior from Structure
• Transactions (a.k.a. Sequence Items) are the main
communication vehicle across the boundary
Behavior
Structure
Testbench VIP
DUT
transaction streams
• May start on any sequencer
s3 s5
• Sequences can call children s2
Virtual method
do_copy()
do_compare()
convert2string()
do_print()
endfunction:
do_record() do_copy
do_pack()
endclass: bus_item
do_unpack()
endfunction: do_copy
endclass: bus_item
endfunction: do_copy
endclass: bus_item
endclass: bus_item
endfunction: do_compare
endclass: bus_item
endfunction: do_compare
endclass: bus_item
endclass: bus_item
s = super.convert2string();
endfunction: convert2string
endclass: bus_item
s = super.convert2string();
$sformat(s,
"%s\n delay \t%0d\n addr \t%0h\n op_code \t%s\n slave_name \t%s\n",
s, delay, addr, op_code.name(), slave_name);
Returns enum
value as a string
endfunction: convert2string
endclass: bus_item
endfunction: convert2string
endclass: bus_item
s = super.convert2string();
$sformat(s,
"%s\n delay \t%0d\n addr \t%0h\n op_code \t%s\n slave_name \t%s\n",
s, delay, addr, op_code.name(), slave_name);
foreach(data[i]) begin
$sformat(s, "%s data[%0d] \t%0h\n", s, i, data[i]);
end
$sformat(s, "%s response \t%0b\n", s, response);
return s;
USAGE:
endfunction: convert2string bus_item A;
endclass: bus_item `uvm_info(“FOO”,A.convert2string(), UVM_NONE)
USAGE:
bus_item A;
A.print();
`uvm_info(“FOO”,A.convert2string,UVM_LOW)
endclass: bus_item
Record inherited
data members
endfunction: do_record
endclass: bus_item
Simulator-specific implementation
Questa uses $add_attribute
endfunction: do_record
endclass: bus_item
See the
Online UVM Cookbook
for details
endclass: bus_item
bus_item_pair
extends uvm_sequence_item;
rand bus_item a;
rand bus_item b;
Tom Fitzpatrick
Verification Evangelist
info@verificationacademy.com | www.verificationacademy.com