Академический Документы
Профессиональный Документы
Культура Документы
Version <1.0>
<03/29/2019>
2
VERSION HISTORY
TABLE OF CONTENTS
1 INTRODUCTION 4
2 VERIFICATION STRATEGY 4
3 TESTBENCH ARCHITECTURE 5
3.2 sequence 6
3.5 AGENT 7
3.6 scoreboard 7
4 COVERAGE ANALYSIS 8
5 ASSERTIONS 9
TESTCASE SCENARIOS 10
Appendix A: References 11
Appendix B: Key Terms 12
4
1 INTRODUCTION
2 VERIFICATION STRATEGY
5
3 TESTBENCH ARCHITECTURE
apb_top
apb_test
apb_env
apb_sequence
apb_scb
DUT
apb_seq apb_driver APB SLAVE
apb_agent_act
apb_mon_act
apb_agent_pas
apb_mon_pas
6
3.2 SEQUENCE:
apb write wait sequence : To check the data written correctly to the selected address
of the selected slave device with a wait time.
apb write no wait sequence : To check the data written correctly to the selected
address of the selected slave device with no wait time.
apb read wait sequence : To check the data read correctly from the selected address
of the selected slave device with a wait time.
apb read no wait sequence : To check the data read correctly from the selected
address of the selected slave device without wait time.
apb error sequence:To check the error signal is given from the slave device
3.4 TOP.SV:
Accomodates DUT, Test,Interfaces between test and DUT,clock ,reset instantiation.
module apb_top;
import uvm_pkg::*;
7
bit clk;
bit rst;
clock generation
always #5 clk = ~clk;
intrf apb_if(clk);
apb_top dut(.clk(clk),
.rst(rst),
.paddr(paddr),
.pdata(pdata),
.psel(psel),
.penable(penable),
.pready(pready),
.pslverr(pslverr)
);
3.5 APB_ENV:
Used to instantiate entire test components like agent ,scoreboard etc.
3.6 APB_TEST.SV
It comes after top in hierarchy and before environment. Here we are instantiating
environment and all test cases are given to the DUT through test. The objection raising to
inject test case into DUT is done here.
8
input rst_n,
input [addrWidth-1:0] paddr,
input pwrite,
input psel,
input penable,
input [dataWidth-1:0] pwdata,
output logic [dataWidth-1:0] prdata
output logic pready
output logic prdata
);
3.8 DRIVER.SV
Drives the sequence signals coming from from sequencer to DUT. Sequences are exactly
the stimuli.
Reading data from slave and writing data into slave device are the task given to driver.
class apb_driver extends uvm_driver(#apb_seq_item);
`uvm_component_utils(apb_driver)
3.9 MONITOR.SV
Monitor checks the signal activity from DUT and reference model.
class apb_monitor_before extends uvm_monitor;
`uvm_component_utils (apb_monitor_before)
virtual intrf vif;
uvm_analysis_port #(apb_seq_item) mon_analysis_port_before;
3.10 SEQUENCER.SV
Sequencer will transfer sequences to driver to drive it to DUT.
class counter_sequencer extends uvm_sequencer#(counter_seq_item);
`uvm_object_utils(counter_sequencer)
//Constructor
function new(string name = "counter_sequencer");
super.new(name);
endfunction
10
3.11 SEQUENCE.SV
repeat(20)
begin
start_item(req);
assert (req.randomize())
finish_item(req);
3.12 AGENT:
Implemented two agents. An active one and a passive one. The active one is
having a sequencer driver and monitor. Sequences from sequence is given to driver
through sequencer and is given to DUT. Same signal is given to monitor from driver.
In passive agent declare only monitor to check the output from DUT.
3.13 SCOREBOARD.SV
A Scoreboard is a functional block of testbench in UVM Methodology that does the
following:
Receives response data from the monitor block. Here the monitor is present in the passive
agent which takes the responses from DUT.
Fetches expected results from monitor in Active agent which has the expected output and
compares with the response data received from the monitor block in the passive agent
11
Generates results and stores them for each test case. This aids in generating reports
Scoreboard
3.14
4 COVERAGE ANALYSIS
5 ASSERTIONS
Reset is set to 1 and reasserted to 0 at power on state. At reset=1 all signal should be in
known or initial condition. At reset=0 only the device starts its normal operation.
13
TESTCASE SCENARIOS
4. apb_read_with_wait Read from the slave device with wait signal. Pass/Fail
Check whether data taken from selected
device using PSEL line and device address .
Appendix A: References
[Insert the name, version number, description, and physical location of any
documents referenced in this document. Add rows to the table as necessary.]
The following table summarizes the documents referenced in this document.
Document Description Location
Name and
Version
<Document [Provide description of the <URL or Network path where
Name and document] document is located>
Version
Number>
15