Introducing The Universal Verification Methodology (Uvm) in Systemc and Systemc-Ams
Introducing The Universal Verification Methodology (Uvm) in Systemc and Systemc-Ams
Introducing The Universal Verification Methodology (Uvm) in Systemc and Systemc-Ams
NASCUG 2014
© Fraunhofer IIS/EAS
Outline
NASCUG 2014
1
Presented during DAC 51 in San Francisco, CA Page 1 of 24
North American SystemC User's Group June 2, 2014
Outline
NASCUG 2014
n Class library which provides a set of built-in features dedicated to simulation-
based verification
n Utilities for phasing, component overriding (factory), configuration,
comparing, scoreboarding, reporting, etc.
4
© Fraunhofer IIS/EAS Karsten Einwich
2
Presented during DAC 51 in San Francisco, CA Page 2 of 24
North American SystemC User's Group June 2, 2014
Motivation
5
© Fraunhofer IIS/EAS Karsten Einwich
6
© Fraunhofer IIS/EAS Karsten Einwich
3
Presented during DAC 51 in San Francisco, CA Page 3 of 24
North American SystemC User's Group June 2, 2014
Outline
NASCUG 2014
UVM-SystemC overview
8
© Fraunhofer IIS/EAS Karsten Einwich
4
Presented during DAC 51 in San Francisco, CA Page 4 of 24
North American SystemC User's Group June 2, 2014
Spec
Test Test
Test
ccases
ases
Functional
coverage
Sequences
Verification component
Functional Sequencer Scoreboard
Signal Device
under test
NASCUG 2014
9
© Fraunhofer IIS/EAS Karsten Einwich
UVM-SystemC phasing
build connect run » extract check report final
before_end_of_elaboration* end_of_simulation*
end_of_elaboration
UVM
runtime
phases »
Legend
start_of_simulation
configure main shutdown » =
SystemC
process(es)
pre-‐reset post-‐reset =
top-‐down
execution
=
bottom-‐up
execution
reset =
SystemC-‐only
callback
*
10
© Fraunhofer IIS/EAS Karsten Einwich
5
Presented during DAC 51 in San Francisco, CA Page 5 of 24
North American SystemC User's Group June 2, 2014
UVM agent
seq
agent
trans
config
n Component responsible for driving and sequencer
monitoring the DUT seq_item_export analysis
n Typically contains three components
n Sequencer seq_item_port item_collected_port
driver monitor
n Driver
vif vif
n Monitor
n Can contain analysis functionality for
basic coverage and checking
n Possible configurations
n Active agent: sequencer and driver are enabled
n Passive agent: only monitors signals
(sequencer and driver are disabled)
n C++ base class: uvm_agent
NASCUG 2014
11
© Fraunhofer IIS/EAS Karsten Einwich
12
© Fraunhofer IIS/EAS Karsten Einwich
6
Presented during DAC 51 in San Francisco, CA Page 6 of 24
North American SystemC User's Group June 2, 2014
13
© Fraunhofer IIS/EAS Karsten Einwich
NASCUG 2014
14
© Fraunhofer IIS/EAS Karsten Einwich
7
Presented during DAC 51 in San Francisco, CA Page 7 of 24
North American SystemC User's Group June 2, 2014
n In this example, the UVM verification component (UVC) contains only one
agent. In practice, more agents are likely to be instantiated
NASCUG 2014 NOTE: UVM-SystemC API under review – subject to change
15
© Fraunhofer IIS/EAS Karsten Einwich
NASCUG 2014
16
© Fraunhofer IIS/EAS Karsten Einwich
8
Presented during DAC 51 in San Francisco, CA Page 8 of 24
North American SystemC User's Group June 2, 2014
transaction
17
© Fraunhofer IIS/EAS Karsten Einwich
18
© Fraunhofer IIS/EAS Karsten Einwich
9
Presented during DAC 51 in San Francisco, CA Page 9 of 24
North American SystemC User's Group June 2, 2014
UVM-SystemC sequence
template
<typename
REQ
=
uvm_sequence_item,
typename
RSP
=
REQ>
class
sequence
:
public
uvm_sequence<REQ,RSP>
{
seq
public:
agent
sequence(
const
std::string&
name
)
Factory registration trans
:
uvm_sequence<REQ,RSP>(
name
)
{}
supports template classes config
UVM_OBJECT_PARAM_UTILS(sequence<REQ,RSP>);
sequencer
Raise objection if there is seq_item_export analysis
virtual
void
pre_body()
{
no parent sequence
if
(
starting_phase
!=
NULL
)
starting_phase-‐>raise_objection(this);
}
seq_item_port item_collected_port
virtual
void
body()
{
A sequence contains a request driver monitor
and (optional) response, both
REQ*
req;
defined as sequence item
RSP*
rsp;
vif vif
...
start_item(req);
Compatibility layer to SCV or
//
req-‐>randomize();
CRAVE not yet available
finish_item(req);
get_response(rsp);
Optional: get response
}
virtual
void
post_body()
{
if
(
starting_phase
!=
NULL
)
starting_phase-‐>drop_objection(this);
}
};
NASCUG 2014 NOTE: UVM-SystemC API under review – subject to change
19
© Fraunhofer IIS/EAS Karsten Einwich
20
© Fraunhofer IIS/EAS Karsten Einwich
10
Presented during DAC 51 in San Francisco, CA Page 10 of 24
North American SystemC User's Group June 2, 2014
21
© Fraunhofer IIS/EAS Karsten Einwich
...
virtual_sequencer
=
virt_sequencer::type_id::create(
Testbench
(env) config
"virtual_sequencer",
this);
assert(virtual_sequencer);
scoreboard
virtual Subscr Subscr
scoreboard1
=
eval
sequencer 1 2
scoreboard::type_id::create("scoreboard1",
this);
assert(scoreboard1);
}
Virtual sequencer points to UVC1 (env) UVC2 (env)
UVC sequencer
agent agent
virtual
void
connect_phase(
uvm_phase&
phase
)
…..
Sqr conf Sqr conf
{
virtual_sequencer-‐>vip_seqr
=
uvc1-‐>agent-‐>sequencer;
Drv Mon Drv Mon
uvc1-‐>agent-‐>monitor-‐>item_collected_port.connect(
scoreboard1-‐>xmt_listener_imp);
uvc2-‐>agent-‐>monitor-‐>item_collected_port.connect(
scoreboard1-‐>rcv_listener_imp);
}
Analysis ports of the
monitors are connected to
};
the scoreboard
subscribers (listeners)
NASCUG 2014 NOTE: UVM-SystemC API under review – subject to change
22
© Fraunhofer IIS/EAS Karsten Einwich
11
Presented during DAC 51 in San Francisco, CA Page 11 of 24
North American SystemC User's Group June 2, 2014
UVM test
default
Test sequence
config
n Each UVM test is defined as a dedicated C+
+ test class, which instantiates the test Testbench (env) config
bench and defines the test sequence(s) scoreboard
virtual Subscr ref Subscr
sequencer 1 model 2
n Reuse of tests and topologies is possible by
deriving tests from a test base class UVC1 (env) UVC2 (env)
agent agent
…..
Sqr conf Sqr conf
n The UVM configuration and factory concept
Drv Mon Drv Mon
can be used to configure or override UVM
components, sequences or sequence items
NASCUG 2014
23
© Fraunhofer IIS/EAS Karsten Einwich
24
© Fraunhofer IIS/EAS Karsten Einwich
12
Presented during DAC 51 in San Francisco, CA Page 12 of 24
North American SystemC User's Group June 2, 2014
...
scoreboard
virtual Subscr ref Subscr
virtual
void
run_phase(
uvm_phase&
phase
)
sequencer 1 model 2
{
UVM_INFO(
get_name(),
"**
UVM
TEST
STARTED
**",
UVM_NONE
);
UVC1 (env) UVC2 (env)
}
agent agent
…..
virtual
void
extract_phase(
uvm_phase&
phase
)
Sqr conf Sqr conf
{
Get result of the scoreboard
if
(
tb-‐>scoreboard1.error
)
Drv Mon Drv Mon
in the extract phase
test_pass
=
false;
}
virtual
void
report_phase(
uvm_phase&
phase
)
{
if
(
test_pass
)
UVM_INFO(
get_name(),
"**
UVM
TEST
PASSED
**",
UVM_NONE
);
else
UVM_ERROR(
get_name(),
"**
UVM
TEST
FAILED
**"
);
Report results in
}
the report phase
};
25
© Fraunhofer IIS/EAS Karsten Einwich
NASCUG 2014
26
© Fraunhofer IIS/EAS Karsten Einwich
13
Presented during DAC 51 in San Francisco, CA Page 13 of 24
North American SystemC User's Group June 2, 2014
27
© Fraunhofer IIS/EAS Karsten Einwich
28
© Fraunhofer IIS/EAS Karsten Einwich
14
Presented during DAC 51 in San Francisco, CA Page 14 of 24
North American SystemC User's Group June 2, 2014
29
© Fraunhofer IIS/EAS Karsten Einwich
30
© Fraunhofer IIS/EAS Karsten Einwich
15
Presented during DAC 51 in San Francisco, CA Page 15 of 24
North American SystemC User's Group June 2, 2014
31
© Fraunhofer IIS/EAS Karsten Einwich
NASCUG 2014
32
© Fraunhofer IIS/EAS Karsten Einwich
16
Presented during DAC 51 in San Francisco, CA Page 16 of 24
North American SystemC User's Group June 2, 2014
Outline
NASCUG 2014
Contribution to Accellera
NASCUG 2014
34
© Fraunhofer IIS/EAS Karsten Einwich
17
Presented during DAC 51 in San Francisco, CA Page 17 of 24
North American SystemC User's Group June 2, 2014
Outline
NASCUG 2014
n Simplifies development of UVM based verification methods for AMS systems
NASCUG 2014
36
© Fraunhofer IIS/EAS Karsten Einwich
18
Presented during DAC 51 in San Francisco, CA Page 18 of 24
North American SystemC User's Group June 2, 2014
default
Test
sequence
config
scoreboard
virtual
Subscr
ref
Subscr
sequencer
1
model
2
NASCUG 2014
37
© Fraunhofer IIS/EAS Karsten Einwich
download
integrate
monitor
38
© Fraunhofer IIS/EAS Karsten Einwich
19
Presented during DAC 51 in San Francisco, CA Page 19 of 24
North American SystemC User's Group June 2, 2014
UVM-SystemC Codegeneration
UVM-SystemC-AMS
40
© Fraunhofer IIS/EAS Karsten Einwich
20
Presented during DAC 51 in San Francisco, CA Page 20 of 24
North American SystemC User's Group June 2, 2014
UVM-SystemC-AMS extensions
n UVM AMS extensions will not break the existing UVM
n Time annotation to transaction
n Decoupled sequence time
n Data dependent synchronization
NASCUG 2014
41
© Fraunhofer IIS/EAS Karsten Einwich
Vision
n Translating specifications (documents, standards) to readable – also for non
verification experts - test scenarios, this should also include ranges and
uncertainties
n No separation between analog/digital, hard- and software
n “real” system-level verification
Main question:
n Will the system work for the purposes for which it will be built
NASCUG 2014
42
© Fraunhofer IIS/EAS Karsten Einwich
21
Presented during DAC 51 in San Francisco, CA Page 21 of 24
North American SystemC User's Group June 2, 2014
n How much of the possible application scenarios, input stimuli, operating
conditions, specification items are verified?
43
© Fraunhofer IIS/EAS Karsten Einwich
Outline
NASCUG 2014
22
Presented during DAC 51 in San Francisco, CA Page 22 of 24
North American SystemC User's Group June 2, 2014
Ongoing developments
n Extend UVM-SystemC with constrained randomization capabilities using
SystemC Verification Library (SCV) or CRAVE
n Introduction of assertions and functional coverage features
n Add register abstraction layer and callback mechanism
n Develop UVM based AMS and system-level verification methods
NASCUG 2014
45
© Fraunhofer IIS/EAS Karsten Einwich
Acknowledgements
NASCUG 2014
46
© Fraunhofer IIS/EAS Karsten Einwich
23
Presented during DAC 51 in San Francisco, CA Page 23 of 24
North American SystemC User's Group June 2, 2014
Resources
NASCUG 2014
47
© Fraunhofer IIS/EAS Karsten Einwich
24
Presented during DAC 51 in San Francisco, CA Page 24 of 24