Universal Verification Methodology SystemVerilog Basics -- Sequence

Uploaded by CadenceDesign on 02.05.2012

Hello my name is Axel Scherer. I will give you a quick introduction into Sequences in
UVM. So sequences are really interesting. They’re
used to build up more interesting stimulus from lower level sequence items. You can even
go multi layer abstraction and combine lower level sequences into higher level transactions.
OK - So with sequences, you’re basically controlling the execution order of your sequence
items, exactly how they should happen, and you can control direction, and things like
that. So coordination of sequences or lower level sequence items to build interesting
stimulus is what sequences are all about. If you look at this in context of a interface
UVC, you know, we need to hand down sequences to the driver. But we don’t just so this
willy-nilly, we want to control exactly what’s happening, so we have control over the stimulus
generation. So the sequence is basically what controls the execution of the sequence item
- how densely they are spread apart, what type it is, and all that good stuff. And you
can have multiple layers of abstraction. You can have very long and complex interactions
between sequences and sub sequences. Let’s look at some examples We’re dealing again
with APB. Here’s a very simple sequence, it only executes two transactions. It does
read after write, so read after write sequence is what we are looking at. First couple of
code is just some auxiliary logic to help you with the execution control. The interesting
part happens in the tasks body, and that basically is what we are executing – right - when
the sequence is running. And first we are doing a write as you can see here, so we’re
controlling the direction. We’re not just let it being randomized as an individual sequence
item by telling the execution we need a write and then we need a read. We’re also telling
the execution don’t just randomize the address willy-nilly at the sequence item level, but
rather do it here, from the sequence down, so we are defining start address and we writing
to it and we’re reading back from the same start address. We also controlling other things
like write data and so forth. So this particular sequence only executes 2 sequence items, so
it’s a very small low-level sequence. But, we can combine multiple sequences into higher,
more complex sequences. So this particular sequence is called multiple read_after_write_sequence,
and you can see it references read_after_write_sequence, write_byte_sequence and read_byte_sequence.
So now it deals with multiple sub sequences. It also has here a little variable to randomize
how many sequences you want to execute. And we constrain that particular field to be between
5 and 10 inclusive. So again, in the body task, we are now executing a bunch of subsequences,
e have a for loop that is going up somewhere between 5and 10 and executed a bunch of this
raw sequences. So read after write is executed between 5 and 10 times, and after that, we
perform a set of W sequences and R sequences three times each. So you can see now how this
builds up to much more interesting and controlled stimulus and not willy-nilly randomized like
crazy and not pushing the device into interesting states.
You can find more videos like this, either on this youtube channel or at support.cadence.com
at the video library for the Incisive Simulator. Have a great day, thank you very and talk
to you soon.