Академический Документы
Профессиональный Документы
Культура Документы
October 2011
The Idea Behind The Methodology
Objective Justification
Separation of stimulus Several people can develop
generation from delivery stimulus
Raise the abstraction level of Increase productivity
stimulus and checking
Test bench configuration Avoid expensive recompilation
Interoperability Important for intra and inter
— Standard class library & API company development
Reuse Key to productivity
— VIP
— Testbench components
— Stimulus
SPI
I/F
For the Design: IRQ
• What does it do?
• What are the use cases?
• Which test cases are required?
• What type of stimulus scenarios are required?
• What represents correct behavior?
• What kind of functional coverage do I need?
© 2011 Mentor Graphics Corp. Company Confidential
4 TF - UVM Recipe of the Month 10/11 www.mentor.com
UVC Structural Building Block
Analysis port: Send Detects transactions
transactions for checking on the interface
Sequencer
DUT
seq_item
Driver
Sends stimulus
to Driver
Configuration
Predict Object Monitor
RegSeq Sequencer
DUT
Driver
31:14 13 12 11 10 9 8 7 6:0
Registers contain R R/W R/W R/W R/W R/W R/W R R/W
Register Map
contains Registers
Register Block
contains Maps
Blocks are
hierarchical
© 2011 Mentor Graphics Corp. Company Confidential
7 TF - UVM Recipe of the Month 10/11 www.mentor.com
The Register Map – uvm_reg_map
Monitor
Sequencer
DUT
Driver
Stimulus Generation
— Abstraction of stimulus:
– i.e. Set this bit in this register rather than write x to address y
— Stimulus reuse
– If the bus agent changes, the stimulus still works
— Front and Back Door access:
– Front door is via an agent
– Back door is directly to the hardware via the simulator database
Configuration
— Register model reflects hardware programmable registers
— Set up desired configuration in register model then dump to DUT
– Randomization with configuration constraints
Analysis ‘Mirror’
— Current state of the register model matches the DUT hardware
— Useful for scoreboards and functional coverage monitors
© 2011 Mentor Graphics Corp. Company Confidential
9 TF - UVM Recipe of the Month 10/11 www.mentor.com
Register Model Code Example (Only 1 Reg)
class divider extends uvm_reg;
`uvm_object_utils(divider)
Register class with one field
uvm_reg_field reserved;
rand uvm_reg_field ratio;
Block containing Register
function new(string name = "divider");
super.new(name, 16, UVM_NO_COVERAGE);
endfunction
class spi_reg_block extends uvm_reg_block;
`uvm_object_utils(spi_reg_block) virtual function void build();
ratio = uvm_reg_field::type_id::create("ratio");
rand divider divider_reg; ratio.configure(this, 16, 0, "RW", 0, 16'hffff, 1, 1, 1);
endfunction
uvm_reg_map APB_map; // Block map endclass
divider_reg = divider::type_id::create("divider");
divider_reg.build();
divider_reg.configure(this, null, "");
divider_reg.add_hdl_path_slice("divider", 0, 16); A map is a component of a block
APB_map = create_map("APB_map", 'h800, 4, UVM_LITTLE_ENDIAN);
APB_map.add_reg(divider_reg, 32'h00000014, "RW");
add_hdl_path("DUT", "RTL");
lock_model();
endfunction: build
endclass: spi_reg_block
© 2011 Mentor Graphics Corp. Company Confidential
10 TF - UVM Recipe of the Month 10/11 www.mentor.com
Register Assistant* Overview
Register/Memory Definition & Management for the Entire Design Process
UVC(agent)
Template-Generated Monitor
RegSeq
Sequencer
DUT
Driver
Customer Example
Register Definitions Early in project:
335 Registers 11,500 lines
Final project:
1,000 Registers 35,000+ lines
of Register Package code
© 2011 Mentor Graphics Corp. Company Confidential
13 www.mentor.com
Register Documentation Generation
Communicate the
register layer to all
team members
Final documents
auto-generated
Customizable
content & style
A A
Blocks Readers P Datamodel P Writers RTL
I I
Block Map
OVM/UVM Pkg.
Checks
// Common functionality:
// Getting a handle to the register model
task body;
m_cfg = spi_env_config::get_config(m_sequencer);
spi_rm = m_cfg.spi_rm;
endtask: body
endclass: spi_bus_base_seq
task body;
super.body;
// Randomize the local data value
assert(this.randomize());
// Write to the divider register
spi_rm.divider_reg.write(status, data, .parent(this));
endtask: body
endclass: div_load_seq
endtask: body
endclass: data_load_seq
in the adapter
— Extended from uvm_reg_adapter
UVC(agent)
Monitor
RegSeq
Sequencer
DUT
Reg Driver
endclass: reg2ahb_adapter
© 2011 Mentor Graphics Corp. Company Confidential
23 TF - UVM Recipe of the Month 10/11 www.mentor.com
Keeping The Register Model Up To Date
UVC(agent)
Monitor
RegSeq
Sequencer
Driver reg
Reg
Reg
Breq
SQR
UVC(agent)
Predictor
Monitor
RegSeq
Sequencer
Breq Driver Breq reg
Reg
RegSeq
Sequencer
Driver
reg
SQR
UVC(agent)
Predictor
Monitor
RegSeq
Sequencer
Driver reg
desired desired
value value
hardware hardware
value value
Indirect methods:
— Only access the register database
reg.get(), reg.set(),
— Can be used on registers and fields
reg.reset(), reg.get_reset()
— set/get the register or field reset value
reg.update()
— Cause the hardware to be updated if register model content has
changed via reg.set(), reg.reset() or reg.randomize()
— Can specify front or back door access
Initial state, hardware Desired value changed Update() transfers Mirrored value updated
and reg model in sync by indirect access desired value to HW at the end of the
method (e.g. set()) via a write bus cycle write cycle
AHB to APB
Bridge
SPI Master
SPI Host Bus
Sequence AHB
APB
Bus Agent
APB SPI
Another DUT
Another DUT
APB ANI
Another DUT
APB ANI
APB ANI
apb_agent m_apb_agent;
spi_env_config m_cfg;
// Register layering adapter:
reg2apb_adapter reg2apb;
// Register predictor:
uvm_reg_predictor #(apb_seq_item) apb2reg_predictor;
apb_agent
ahb_agent m_apb_agent;
m_ahb_agent;
spi_env_config
io_ss_env_configm_cfg;
m_cfg;
// Register layering adapter:
reg2apb_adapter
reg2ahb_adapter reg2apb;
reg2ahb;
// Register predictor:
uvm_reg_predictor #(apb_seq_item)
#(ahb_seq_item) apb2reg_predictor;
ahb2reg_predictor;
`uvm_object_utils(div_load_seq)
endclass: div_load_seq
AHB to APB
Bridge
AXI SPI Master
Bus
Fabric APB SPI
AXI AXI
Bus Agent 2
AHB
Bridge
axi_agent m_axi_agent;
sys_env_config m_cfg;
// Register layering adapter:
reg2ahb_adapter reg2axi;
// Register predictor:
uvm_reg_predictor #(axi_seq_item) axi2reg_predictor;
axi_agent m_axi_agent;
sys_env_config m_cfg;
// Register layering adapter:
reg2ahb_adapter reg2axi;
// Register predictor:
uvm_reg_predictor #(axi_seq_item) axi2reg_predictor;
Questa
— Highest Performance with Questa
Support for TLM through
Transistor
— Unique Technologies
Combined for 100X in
Verification Per Cycle
— Unified Coverage Tracking and
Verification Process
Management
Vista Veloce
Veloce
— Hardware Assisted Verification
Platform for Both Acceleration
and Emulation UVM / OVM
ESL Em ulation
© 2011 Mentor Graphics Corp. Company Confidential
45 TF - UVM Recipe of the Month 10/11 www.mentor.com
Future Recipe of the Month Webinars
Register at http://www.mentor.com/products/fv/series/uvm-ovm-series
© 2011 Mentor Graphics Corp. Company Confidential
46 TF - UVM Recipe of the Month 10/11 www.mentor.com
© 2011 Mentor Graphics Corp. Company Confidential
www.mentor.com