Documente Academic
Documente Profesional
Documente Cultură
Stimulus Modeling
1.1. Objectives
Use the UVM class library to:
uvm-"3g::< is im"orted at the to" level to im"ort the UVM library 8lab1-note19.
uart-#rame.sv is included to im"ort the #rame de#inition 8lab1-note%9.
4 #rame-generator class loo"s through BcountC times to randomi@e a #rame and send it to the
:U'.
'he to" module instantiates the #rame-generator( constructs and randomi@es it and calls the
gen-and-"ush89 method to start generating stimulus.
&n the send-to-dut 89 tas3 8lab1-note=9 )e e!"lore the UVM built$in automation: co"y89( clone89(
s"rint89( set-name89.
=. 5un a simulation and revie) the results:
* irun 1# run.#
5evie) the results in the irun.log #ile.
>. Use the UVM messaging ca"ability:
'he de#ault UVM-V5DOS&'E value is LOF( so only UVM-LOF and UVM-6O6 messages are
"rinted.
* irun 1# run.# GUVM-V5DOS&'EHUVM-/&G/ 8lots o# data is dis"layed9
* irun 1# run.# GUVM-V5DOS&'EHUVM-6O6 8minimal data is dis"layed9
,adence ,on#idential
A
6ote: &S$IL does not recom"ile0re$elaborate the design0testbench #or these changes.
A. 5un )ith multi"le random seeds to get di##erent results:
* irun 1# run.# GsvseedH546:OM
Lab 1b: ,onstraint Layering
1. 4dding constraints via layering: lab1b-to".sv
6ote:
5evie) the lab1c-to".sv #ile and loo3 #or lab1c-note1. Fhen "rinting the #rame data( the
de#ault tree "rinter #ormat is used 8instead o# the table "rinter9.
5un a simulation and revie) the results:
* irun 1# run1c.#
5evie) the irun.log #ile to see ho) the tree "rinter #ormats out"ut data.
,adence ,on#idential
M
Lab %. UVM Se7uences
%.1. Objectives
uart-se7uencer is derived #rom the uvm-se7uencer base class 8lab%-note19. 'his "rovides UVM
built$in #ields and automation.
uvm-com"onent-utils 8lab%-note%9 9 is a macro( used #or registering a uvm-com"onent or any o#
its sub$class.
%. 5evie) the :river:
'his sim"le se7uence )ill generate random U45' #rames as they are re7uested #rom the driver.
'he "re-body89tas3 raises an objection #or the se7uence( the body89tas3 )ill e!ecute #ive
U45' #rames in a loo" 1 each #rame is generated )hen the driver re7uests through the
get-ne!t-item89call. 'he "ost-body89tas3 dro"s an objection #or the se7uence so that the
simulation can grace#ully end.
>. 5evie) the to"$level test: 8Starting at lab%-noteM9
De#ore creating the driver and se7uencer( the UVM con#iguration mechanism is used to s"eci#y
the se7uence to be e!ecuted in the run-"hase 8lab%-noteN9. 'his sets the de#ault se7uence to
the sim"le-se7uence.
'he se7uencer and driver are declared and created 8lab%-noteN9. 'hen they are connected using
a 'LM connection. 8lab%-noteJ9
2inally( a global run-test 89 tas3 is called to start the simulation. run-test89 is "art o# the UVM
library and )ill start the simulation 8lab%-noteO9
,adence ,on#idential
N
A. 5un a simulation and revie) the results 8results are in the irun.log #ile9:
* irun 1# run.#
5evie) the #rame "rinted out by the driver:
o
o
o
/o) many #rames )ere e!ecutedP
Fhich se7uence8s9 )ere e!ecuted during the simulationP 8hint: loo3 at the value o# B"arent
se7uenceC in each #rame9
/o) did the se7uencer 3no) )hat se7uence to e!ecuteP
M. 5un )ith di##erent random seeds and get di##erent results:
* irun 1# run.# GsvseedH546:OM
N. One )ay to vie) the transactions )as in the irun.log #ile. Fith built$in transaction recording(
SimVision
allo)s you to vie) the transactions gra"hically. &nvo3e Simvision and load u" the transaction
database:
* simvision 1in"ut lab%a.svc#
'he SimVision Fave#orm )indo) dis"lays the #ive transactions generated during the simulation
run. Eou should be able to see the transactions generated by the sim"le se7uence( and those
ca"tured in the driverKs send-to-dut89 tas3. 'he #ields o# the uart-#rame are ca"tured and the
timing o# the tas3 matches the delay value.
'he 'ransaction Stri"e ,hart )indo) dis"lays the same data in a di##erent #ormat. Eou can see
the #rame #ield values in either stri"e$chart or table #ormat.
Select a transaction in the stri"e chart 8or 'able9 and you )ill see the same transaction
highlighted in the )ave#orm )indo).
Lab %b: User$:e#ined Se7uences
1. 5evie) the se7uence library: uart-se7-lib.sv
4 base se7uence( uart-base-se7 8lab%-note%9 incor"orates the objection mechanism so any
4,'&V se7uences should e!tend #rom this class and )ill automatically incor"orate setting0dro""ing
objections.
2our user$de#ined se7uences are included: uart-incr-"ayload-se7( uart-bad-"arity-se7(
uart-transmit-se7( and uart-nested-se7 8hint: search #or SQU6, in the #ile9.
'he uart-nested-se7 8lab%-note=9 is a se7uence that e!ecutes other se7uences.
%. Modi#y the lab%-to".sv #ile to include the se7uence library 8lab%-note1R9
=. Modi#y the to"$level test: lab%-to".sv
S"eci#y the uart-nested -se7 as the ne) de#ault se7uence.
Uncomment the t)o lines containing lab%-note11 and comment out the lines above it.
>. 5un another simulation and revie) the results:
* irun 1# run.#
o
o
o
Fhich se7uence8s9 )ere e!ecuted during the simulationP 8/int: loo3 at the value o# B"arent
se7uenceC in each #rame9. Decause this is a nested se7uence( you )ill see that the nested
se7uence e!ecuted multi"le sub$se7uences
:o the values loo3 correctP
/o) did the se7uencer 3no) )hat se7uence to e!ecuteP
,adence ,on#idential
J
A. &nvo3e Simvision and load u" the ne) transaction database:
* simvision 1in"ut lab%b.svc#
'he SimVision Fave#orm )indo) dis"lays the se7uencer and driver transactions. &# you e!"and
the uart-nested-se7 8the SGT sign ne!t to the name in the Fave#orm9 it sho)s the to"$level
se7uence 8uart-nested-se79( the sub$se7uences 8incr-"ayload-se7( bad-"arity-se7( and
transmit$se79( and the individual uart #rame transactions 8re79 that )ere generated.
'he 'ransaction Stri"e ,hart )indo) can also e!"and0colla"se to sho) the se7uence and
transaction data.
Lab %c: ,reating Eour O)n Se7uence 8O?'&O64L9
1. Modi#y the se7uence library: uart-se7-lib.sv:
6o) )e are going to see )hat ha""ens )hen )e ma3e a com"onent UVM-?4SS&V.
o
Modi#y the uart-to".sv #ile 1 go to line containing lab=-note> and uncomment the lines
that con#igure the '! 4gent as UVM-?4SS&V.
A. 5un a simulation and revie) the results:
* irun 1# run.#
6ote that the 5! and '! agents are no) UVM-?4SS&V( and no stimulus is generated or sent to the
:U'. 'his is ho) a UV, )ould be used as a monitoring device at the system level.
,adence ,on#idential
11
Lab >. 'est ,reation Using 5eusable
,om"onents
>.1. Objectives
'his se7uence "rograms the :U' via the 4?D bus( e!ecutes an incrementing "ayload se7uence
via the U45' inter#ace and then reads the 'I 2i#o via the 4?D bus.
* irun 1# run%.#
'he &US simulator should not recom"ile0re$elaborate the design because )e only changed the
UVM-'S'64M argument in the run%.# #ile.
M. 5un a simulation in GU& mode: