Beruflich Dokumente
Kultur Dokumente
ABSTRACT 1. INTRODUCTION
When the Design Under Test (DUT) is reset during On-the-fly reset happens during DUT operation in the
normal operation, the testbench must act accordingly form of hard reset or soft reset. The reset that
and must not behave abnormally or give ambiguous happens through an external reset (XRES) input is a
results. The Open Verification Methodology (OVM) hard reset. The reset that happens by writing into a
and the new Universal Verification Methodology register (e.g. REG1) through firmware is a soft reset.
(UVM) both have a number of ways to implement on- Figure 1 shows the sources for on-the-fly reset.
the-fly reset in various testbench components like the
monitor, driver and scoreboard.
In the Open Verification Methodology (OVM) there is XRES
DUT
no reset phase. So it will be difficult to stop a
testbench component (like driver) during “on-the-fly
REG 1
reset" while the component is processing a AHB BUS
AHB MVC
transaction. The reset information must reach the REG 2
scoreboard too, to halt the checks and come to the
initial state. The test case should have control to apply
“on-the-fly reset” to the testbench components and
the scoreboard should be well able to recognize an Figure 1 On-the-fly Reset Sources
“on-the-fly reset”.
In the Open Verification Methodology (OVM) the During on-the-fly reset the testbench must not behave
driver/monitor/scoreboard code should be able to abnormally or give ambiguous results.
react to a reset, but the real potential problem occurs
whenever reset happens during normal operations. On-the-fly reset logic can be implemented in various
This paper is going to explain the techniques through testbench components like monitors, drivers and
which the driver can be stopped immediately scoreboards. During on-the-fly reset the following
whenever there is a reset and start driving the reset things should happen in the testbench,
values on the bus and send the same items to the
analysis port, so even the scoreboard and coverage Scoreboard variables should be reset
model work well whenever there is an on-the-fly reset. The monitor should recognize on-the-fly resets
and qualify the transactions
OVM Verification Components (OVCs) or UVM Coverage update logic should not trigger any
Verification Components (UVCs) needs to support on- transition coverage except reset coverage
the-fly reset, instead of the user controlling it from the The driver should recognize resets and stop
test case. This paper will show effective techniques to transactions at the right time
implement on-the-fly reset for components like the Data Checkers should delete the transactions
driver, monitor, and scoreboard in OVM and UVM. which are collected in FIFOs or QUEUEs
This paper will also present, how one can easily Protocol Checkers should recognize on-the-fly
reset
implement on-the-fly reset logic in the Universal
Verification methodology (UVM) with minimal changes
2. OVM RESET TECHNIQUES
using phasing for the same code implemented in
OVM.
The Generic OVM reset technique for on-the-fly reset
implementation is based on global reset events that
Keywords: are generated by monitoring the on-the-fly reset
sources in the DUT through the reset interface
DUT, OVM, UVM, OVC, UVC, driver, monitor, virtual monitor.
sequencer, scoreboard, coverage model.
The global events will be used by the scoreboard to forever
reset the scoreboard variables, to reset registers in begin //{
the register model, and to qualify the data obtained is_reset.wait_trigger();
register_map.reset();
through the analysis ports of interface
end //}
OVCs/monitors. endtask
The same on-the-fly reset global events will be used The Interface Agent1/Agent2 driver and monitor will
to exclude the functional coverage of all DUT have their own reset logic and work independent of
functionalities other than reset functionality. the global reset monitor event.
Figure 2 shows a sample OVM testbench 2.1 Issues with OVM reset technique
environment with on-the-fly reset logic
implementation.
The following are issues with the OVM reset
technique explained above,
AGENT1 AGENT2
Drivers don’t recognize the on-the-fly reset
DUT between transactions
XRES
Irrespective of the on-the-fly reset, the
Reset monitor will send data to
Monitor
scoreboard/coverage components
During on-the-fly reset, it is difficult to control
the sequencers of the sub-sequences from
AGENT1 AP
Score Board/Data the virtual_sequence
Checker
AGENT2 AP
2.1.1 Driver issue
Reset AP
In the above OVM reset technique, drivers will be
Register Model Coverage Model
driving the bus without considering that on-the-fly
reset occurred during execution of some transactions.
Reference Model Figure 3 shows a driver that has two driver tasks that
are running independently. The RESET DRIVER task
gets a reset in between and drives the interface with
Figure 2 Sample testbench environment default values. But the DRIVER task that is running in
parallel to the RESET DRIVER task will be driving the
The Reset monitor shown in Figure 2 monitors the interface still without considering the reset. Due to
external reset (XRES) pin. Whenever the reset occurs this, some unwanted transactions will be driven to the
through XRES, the monitor will create/trigger a global interface during reset.
reset event. The Reset monitor code is shown below,
RESET Monitor
function void build(); //reset event creation
oep = oep.get_global_pool(); OUTPUT
is_reset = oep.get("RESET_EVENT");
RESET IF DRIVER Task
endfunction Block
INPUT
Reset
NT
@(negedge rstagent_if_monitor.reset)
DO
is_reset.trigger();
end
endtask RESET DRIVER
Task
The scoreboard shown in Figure 2 looks for the global
reset event from the reset monitor and resets the
registers in the Register model. The scoreboard code
is shown below,
Figure 3 Driver Issue
Scoreboard
task run() begin
ovm_event_pool oep; The code below shows the top level driver that has
ovm_event is_reset; the driver task get_and_drive() and the reset task
oep = oep.get_global_pool(); reset_signals(), which are running in parallel.
is_reset = oep.get("RESET_EVENT");
Driver During the active low on-the-fly reset shown in Figure
task run(); 4, the data sent by the monitor to the scoreboard
fork
get_and_drive(); analysis port is invalid.
reset_signals();
join_none The code below shows an agent monitor that has a
endtask monitor_transactions() task and a reset_transactions()
task running in parallel. During the on-the-fly reset,
task get_and_drive();
the monitor_transactions() task will be sending data to
@(wait for reset to finish);
forever begin the scoreboard without considering the reset.
seq_item_port.get_next_item(req); or try_next_item
$cast(rsp, req.clone()); Monitor
rsp.set_id_info(req); // Interface OVC/Agent MONITOR
drive_transfer(rsp); task run();
@(posedge intf.cb); fork
send_idle(rsp); monitor_transactions();
seq_item_port.item_done(rsp); reset_transactions(); //Reset
end join_none
endtask endtask
FORK
MONITOR 1 MONITOR 2 Reset Sequence(S)
Reset
Sequence
task run();
fork
reset_t = RESET_DE;//Initialize reset_t variable Figure 6 Qualified Data from Monitor
get_and_drive();
reset_signals(); The code below shows a monitor that has two tasks
join_none monitor_transactions() and reset_transactions()
endtask running in parallel. The monitor_transactions() task
has a collect_transfer() task that collects the data only
task get_and_drive(); when there is a qualified clock. This data is the
//wait for the initial Power On Reset
qualified data for the scoreboard.
@(reset)
reset_t = RESET_DE; //disable event or variable
Monitor
fork
task run();
forever begin
fork
seq_item_port.get_next_item(req);
monitor_transactions();
ovm_report_info(get_type_name(), "sequencer got
reset_transactions();//To reset all monitor variables
next item");
join_none
drive_transfer(rsp);//Works on qualified clock
endtask
@(posedge intf.clk);//normal clock
task monitor_transactions(); Limitation: The verification engineer should know
begin when to stop the sequencer/sequence from the
@(Reset event);//From negative to positive virtual_sequence or test case.
forever begin
trans_collected = new();
@(posedge intf.cb); 2.2.3 State machine approach
//don’t collect data when there is no clock
collect_transfer(); This solution is for the driver issue specified in section
data_trans(); 2.1.1 and monitor issue specified in section 2.1.2.
end
Inside an agent driver or monitor, a state machine
if (checks_enable) // Check transaction
perform_transfer_checks(); approach could be used to look for the on-the-fly reset
if (coverage_enable) // Update coverage in every state. If on-the-fly reset happens in any of the
perform_transfer_coverage(); states, the state machine will stop the transaction and
// Publish to subscribers go to the reset state.
item_collected_port.write(trans_collected);
end Figure 7 shows the driver state machine. END is the
endtask Boolean value that signals the end of the sequence
item. If END is false the state machine goes to the
task collect_transfer();
void'(this.begin_tr(trans_collected)); IRDA_DRIVE state from the IDLE state and the driver
trans_collected.trans_kind = WRITE; starts driving the transactions. If there is a
@(posedge intf.cb);//qualified clock on-the-fly reset, the sequence-item will be terminated
data.push_back(intf.TB.cb.DAT_out); and the state machine will go to the reset state.
forever begin
@(posedge intf.cb);//qualified clock STATE
end FALSE END =IDLE
RESET
endtask
T
SE
ET
TRUE
RE
R ES
Limitation: During reset, the driver will not drive IDLE
ITEM
anything. But if the driver has some wait logic like DONE
START DRIVE
@posedge of some signals, then the driver will run
E
IDL
the logic under that wait logic before suspending the IRDA_DRIVE
driver task that leads to malfunction of the
driver/monitor and the analysis port.
This solution is for the sequence issue specified in The code below shows the driver state machine
section 2.1.3. During on-the-fly reset, the implementation.
sequence/sequencer should be stopped from the
virtual sequence or test case. Driver
task run();
fork
The code below waits for the “on-the-fly reset” event
get_and_drive();
and stops the sequencer when there is a on-the-fly join_none
reset. endtask
COLLECT STATE
endtask
RE
uvm_post_main_phase
Phase UVC1
PHASE PHASE
MONITOR/RESET MONITOR/RUN
SEQ
Re
AP
uvm_pre_shutdown_phase PHASE PHASE
se
tP
uvm_shutdown_phase
ha
s
RESET
e
uvm_post_shutdown_phase AGENT
Score Board
The UVM pre reset phase is used to, Figure 10 shows how the reset_phase propagates
Wait for power good from Test or ENV to all other components in the
Initialize the output of the components testbench.
connected to virtual interfaces to X’s or Z’s
Initialize the clock signals to a valid value The code below shows the on-the-fly reset
Assign reset signals to X (power-on reset) implementation in the UVM Agent. In the reset_phase
Wait for reset signal to be asserted if not the reset_and_suspend() task will be called during the
driven by the verification environment on-the-fly reset. The Agent reset_and_suspend() task
will call the driver/monitor reset_and_suspend() tasks
and then stop the sequences.
3.1.2 Reset phase
Agent
task reset_phase(uvm_phase phase);
The UVM reset phase is used to,
phase.raise_objection(this, "Resetting agent");
Assert reset signals reset_and_suspend();
Drive the output of the components phase.drop_objection(this);
connected to virtual interfaces to their endtask
specified reset or idle value
Initialize the components and environments virtual task reset_and_suspend();
to their initial states fork
drv.reset_and_suspend();
To start generating active edges from clock tx_mon.reset_and_suspend();
generators rx_mon.reset_and_suspend();
De-assert the reset signal(s) just before exit join
Wait for reset signal(s) to be de-asserted sqr.stop_sequences();//Stop sequences but can’t
//stop driver immediately
endtask
3.1.3 Post reset phase
The code below shows the on-the-fly reset
implementation in the UVM driver. During the on-the-
The UVM post reset phase is used to start the fly reset, the reset_phase will call the
behavior appropriate for reset being inactive from the reset_and_suspend() task to drive default values to
components. For example, components may start to the interface.
transmit idle transactions.
Driver
Note: The UVM reset phase uses listed above in task reset_phase(uvm_phase phase);
section 3.1.1, 3.1.2, and 3.1.3 are from UVM phase.raise_objection(this, "Resetting driver");
documentation. reset_and_suspend();
phase.drop_objection(this);
endtask
virtual task reset_and_suspend(); 4. OVM TO UVM MIGRATION - TIPS FOR
//drive default values to all the interface
endtask RESET
//This Task will be called from RUN_PHASE The following are tips for migrating a testbench from
task get_and_drive(); OVM to UVM with respect to reset/on-the-fly reset,
//wait for the RESET event to complete to negedge of
//reset
//Wait for reset and suspend Ensure that all the reset logic implemented in
reset_and_suspend(); OVM should be moved to the reset phase in
forever begin UVM.
seq_item_port.get_next_item(req); Control the reset phases of each component
drive_transfer(rsp);//Works on qualified clock
such as Interface agents, monitors and
@(posedge intf.cb);//normal clock
seq_item_port.item_done(rsp); drivers from the environment or test in UVM.
end Better option is to control from the
endtask environment.