Skip to content
Get App

W2 SystemVerilog Part2 EN

SystemVerilog lecture covering blocking vs non-blocking assignments, the always_ff/always_comb rule of thumb, FSMs, and module parameterization with examples.

Key Takeaways

  • Always use non-blocking assignments (<=) in sequential always_ff blocks to correctly model flip-flops.
  • Always use blocking assignments (=) in combinational always_comb blocks for sequential evaluation of operations.
  • Each signal should be driven from only one always block or continuous assignment to avoid incorrect synthesis.
  • Module parameterization makes designs reusable across different bit widths.

What the video covers

  • Explains the difference between blocking (=) and non-blocking (<=) assignments: non-blocking occurs in parallel, blocking in statement order.
  • Demonstrates with a D flip-flop example that non-blocking assignment produces two serially connected flip-flops, while blocking assignment wrongly collapses them into one.
  • States the rule of thumb: use non-blocking assignments in always_ff blocks and blocking assignments in always_comb blocks.
  • Recommends continuous assign for simple combinational logic and always_comb for more complex combinational logic.
  • Warns that a signal should be assigned in only one always block or continuous assignment, otherwise the tool generates incorrect circuits.
  • Introduces module parameterization, using a width parameter (default 8) so a mux module can be instantiated for any bit width.
  • Touches on other SystemVerilog concepts such as typedef enum, unions, and structs as data types.
  • Covers finite state machine design, with state encoding, next-state logic, and output logic split into separate blocks.
  • Discusses counters, ALU control with operation tables, and shift registers, including serial-to-parallel conversion.
  • Introduces memory concepts such as ROM and RAM addressing (e.g., 256 locations addressed by 8 bits), and notes that delays are simulation-only and ignored in synthesis.

Answers

Questions about this video

What is the main difference between blocking and non-blocking assignments?

Non-blocking assignments (<=) occur simultaneously in parallel, while blocking assignments (=) execute in the order they appear in the file. This difference determines whether registers are modeled as serial flip-flops or collapse into one.

Which assignment type should be used in always_ff and always_comb blocks?

The lecturer's rule of thumb is to use non-blocking assignments in always_ff blocks for sequential logic and blocking assignments in always_comb blocks for combinational logic.

How does module parameterization work in this lecture?

A parameter such as width is declared with a default value of 8 in the module header, and internal signal widths are defined in terms of it. When instantiating the module, a different width can be passed to create a mux of any bit size.

Full Transcript — Download SRT & Markdown

00:03
Speaker A
So, then we can switch to English, right? Okay. Welcome. Did you understand that? No problem? Did you understand fully?
00:16
Speaker A
Is there any question? Okay, these are for the sequential and compilation logic. And then now we now we are going to switch the blocking and non-blocking assignments.
00:29
Speaker A
Uh There are two type of assignment statements in System Verilog. One of them is blocking and other one is non-blocking. There is a small difference between them. Not small, by the way. It is very important concept.
00:42
Speaker A
Uh if you describing it as a smaller than equal, it's a non-blocking assignment. If it is equal, blocking assignment.
00:52
Speaker A
In here, I didn't mention, but as you can notice, this is a different assignment statement when you look at the combinational ones. Combinational one is just equal, but in sequential ones, while assigning, I use less than and equal sign.
01:13
Speaker A
So, in here, while writing a sequential statement, I am using non-blocking assignment. And while writing a combinational logic, while describing a combinational logic, I am using the blocking assignment.
01:28
Speaker A
Non-blocking assignment means that it occurs simultaneously with others, as parallel. And blocking assignment means that it occurs in order it appears in file.
01:39
Speaker A
Uh let's do an example and understand the difference. For example, in here, I have an example uh for non-blocking assignments. I have a clock. I have a D input and Q output.
01:53
Speaker A
This is a just a flip-flop. But in here, when clock comes I am getting the D input and assigning it to N1. And N1, by the way, is a logic inside the module. We we define a logic signal also inside the module.
02:10
Speaker A
And then this N1 if clock comes in the rising edge of clock I am assigning D to N1 and assigning N1 to Q.
02:22
Speaker A
Okay? In here I used the non-blocking assignment. So, when I synthesize this circuit, what happens?
02:31
Speaker A
This clock comes. Whenever this clock rises this D is assigned to N1. But, since this assignment is non-blocking these assignments occurs at the same time. So, this D sends the new value. This N1 gets the value of D, but this Q gets the value of
02:52
Speaker A
N1, but not the the not not the current value, previous value of N1. So, this circuit corresponds to two flip-flops.
03:03
Speaker A
When clock comes, this is clock. When this clock comes, D is assigned to this N1.
03:11
Speaker A
Here is the N1 point. But, at the same time the previous value of N1 is stored in this flip-flop.
03:18
Speaker A
That's why we this this code corresponds to two flip-flops connected as serial. This is the use of non-blocking assignment.
03:33
Speaker A
What about the misuse? For example, in an always FF block, if I use a blocking assignment then it means that blocking assignment says that it occurs in order it appears in file.
03:47
Speaker A
So in this assignment it for first N1 gets the value of D. And we are doing this assignment in sequential. This N1 gets the new value.
04:01
Speaker A
And in the second statement, this new value is assigned to Q. So, for example, in the non-blocking one, the N1 was getting the value of D and Q was getting the previous value of N1. For this reason, we put two two flip-flops. But,
04:21
Speaker A
in here, N1 was getting the value of D and Q was getting the value of N1, but the new value. So, it means that Q was getting Q is getting the value of D.
04:32
Speaker A
So, then it turns to a single flip-flop. Because whenever clock comes, D is directly assigned to Q. For this reason, if you misuse uh for example, if you use a blocking non-blocking assignment in a always FF block instead of non-blocking
04:50
Speaker A
assignment, it turns to a single flip-flop. And this is the misuse, because maybe you want to build this two flip-flop like shift register, for example. Uh but, if you use a blocking assignment in here, uh you can get the single flip-flop uh
05:10
Speaker A
mistakenly. Is this clear? So, it's a rule that if you are building a logic always FF block, for example, if you are building a logic in always FF block, you have to use non-blocking assignment. And in always comp
05:27
Speaker A
statements, you have to use blocking assignments. This is a general rule. Rule. Uh yeah, I can give an example, for example, in for the for the always comp block. For example, this is always comp block.
05:41
Speaker A
And in always comp block, for example, I am assign I am doing D and C operation and assigning it to A and in the second row, I am for example getting not of A and assigning it to the D.
05:57
Speaker A
In always comp block, most likely you want to do first end operation and after that you want to get the inverse of this end operation and assign it to D. For this reason, people use blocking assignments because in always comp
06:12
Speaker A
block, we are doing it in sequentially. First doing this one, this operation, and then using the result of this operation as an input to the next operation. But in sequential blocks, people generally want to build sequential logic. Uh so,
06:31
Speaker A
in here it is different. People wants to use for example use this operation, but at the same time people want to also do this operation.
06:41
Speaker A
Uh not using the result of the the result of the previous flip-flop, for example.
06:51
Speaker A
For this reason, people generally if you are writing a code in SystemVerilog, you you want to use non-blocking assignment in always FF statements and blocking assignment is in always comp blocks.
07:04
Speaker A
So, it's a rule of thumb. And in simple combination logic, also people use continuous assignment. This is continuous assignment. This is a different assign- And more complicated combination logic, we use always comp and use blocking assignment. And in synchronous
07:23
Speaker A
sequential logic in always FF statement, we use non-blocking assignments. Uh this is the question that you ask.
07:32
Speaker A
Assign a signal in only one always statement or continuous assignment statement. Otherwise, the tool cannot understand and it generates uh wrong actually circuit.
07:46
Speaker A
Is there any question until now about System Verilog? No question? Okay, we can see one more concept. In In this class, I will show you some concepts of System Verilog, but you can take a System Verilog course uh because I will I will try to teach
08:09
Speaker A
you System Verilog in just one week, uh but of course System Verilog is very huge class.
08:15
Speaker A
Uh huge topic. So, if you want, you can Google it. You can take a class on System Verilog.
08:23
Speaker A
Uh but there are lots of different concepts of a System Verilog you you can learn.
08:28
Speaker A
Uh most likely I will not teach you. For example, there are functions, uh there are package types. I will mention a little bit, but you can learn yourself also because in here I will teach in just in one week.
08:41
Speaker A
Another concept in System Verilog is the module parameterization. Uh for example, previously we wrote a module mux two, and it was getting four-bit inputs.
08:54
Speaker A
But what if for example if I want to write I want to write a module, and this module can get n-bit input?
09:03
Speaker A
For example, if I give the n as four-bit, this module will behave as a four-bit mux. If I give it a eight, this module will behave as a eight-bit mux.
09:12
Speaker A
How can I do it? Uh the method is module parameterization. In here, while defining the module, I am putting a dash in here, module module name, and I am putting a dash in here and in here I am specifying the parameters.
09:28
Speaker A
For example, in here I have a parameter. This parameter says that uh the module has a width parameter. This is integer parameter. If I I If I didn't write anything, it means it is integer parameter. Parameter width and it is
09:41
Speaker A
default value. Default value is eight. And inside the module from now on, I am defining everything in terms of width. For example, my D0 and D1 inputs are the width size.
09:56
Speaker A
Defining according to this parameter. And my output is in the same size and S is single bit input. There is no parameter definition in here and this is my output.
10:08
Speaker A
So, while using this max module, while calling it then now I am also giving the parameter width. For example, in here By the way, if I want to use it as a with default value, default value is eight. You don't have to specify default
10:25
Speaker A
value, but if you if you want to use it with your default value and if you define it then for example, you can just call the module as is as we did before.
10:39
Speaker A
And since it is default value is eight, it it behaves as a eight-bit max.
10:45
Speaker A
But if you want to make it for example 12-bit then you you want you need to give this 12 as the parameter width parameter.
10:55
Speaker A
So, for example, in here our in in this call, I am giving the width 12 and this module becomes 12-bit max from now on.
11:07
Speaker A
So, in here this D0 and D1 inputs must be 12-bits. There is also another construct that you can use type def enum.
11:18
Speaker A
This type def is used to create a new data type. For example, until now we saw only one data type. It was logic and we saw three, but forget three. No problem with three. We will not use it.
11:30
Speaker A
But for example, you can define a logic data type For example, you can define a data type that corresponds to 8-bit value. For example, this say We are In here, we are defining a data type uh type def logic
11:45
Speaker A
70. It means that 8-bit value, and I named it as a logic 8. So, from now on, whenever I wrote logic 8, it means that logic 70. But, I am just calling it as a logic 8. For example, in here, I told logic 8
12:03
Speaker A
example, it means that example is a 8-bit value, 8-bit signal. So, these are these two are equal.
12:18
Speaker A
There is also another struct enum. Enum is used to create enumerated data type. Uh this is a little bit different.
12:27
Speaker A
Uh In here, I was I was defining a data type, but in enum, I am saying that I I have two bit signals. For example, in here, I am saying that type def enum, and I am saying that enum type def enum
12:45
Speaker A
is a keyword in here, and I am saying that I have a two bit two bit signal.
12:51
Speaker A
And this two bit signal can take these values: idle, reading, writing. And the name of this enum type is FSMT.
13:03
Speaker A
So, for example, in here, I defined a FSMT type FSM I I defined FSMT and name it as example state.
13:17
Speaker A
This example state actually is a two bit logic value, but its value becomes idle, reading, or writing.
13:25
Speaker A
You can, for example, assign For example, example state and assign example state to idle.
13:32
Speaker A
How this runs? For example, the in here, the tool assigns some values to idle, reading, and writing. For example, it says that idle is 00, reading is 01, writing is 11, for example.
13:47
Speaker A
And then whenever you assign idle to this example state, actually it assigns 00. The good thing in using enum is that while running simulation in the waveform, you can instead of reading the zeros ones, you can read the state. For
14:02
Speaker A
example, if you define a, for example, finite state machines and it has different states, for example, it has a init state, it has read state, it has a write state. Instead of looking to do 0011 in the waveform, you can just
14:16
Speaker A
directly see the state names. For example, read, write, idle. So, the good thing by using enum is only this one. But and it is very, by the way, it's very useful data type.
14:34
Speaker A
This is This was typedef. If you want to just define a basic type definition by using logic, you can use typedef. Typedef enum is that I described. You are enumerating the type. Yeah, just enumerating it means that you are assigning a word to a
14:50
Speaker A
number. And there is also another structure, typedef struct. This is very useful, also. You can use typedef struct to create a new struct data type. Struct means in here that it consists of more than data type. For example, in here, I
15:08
Speaker A
am designing a typedef struct. Typedef struct package. This is a package data type and its name is called ST control, for example.
15:18
Speaker A
For example, in here, in this data type, I have a four-bit mode, three-bit configuration, and one-bit enable field, for example. So, it consists of this data type. ST control consists of these three different values.
15:37
Speaker A
And each of them has different number of bits, for example. So, how can you use it? Maybe I can give an example. For example, this are By the way, this is bit.
15:49
Speaker A
Until now, I showed you logic logic 108 and Z. If you define it as a bit, bit logic is same, but bit can have a value only one or zero, not X and Z.
16:03
Speaker A
So, you can use bit also, but what when you run simulation and if you use bit, you can only see one or zero.
16:12
Speaker A
But if you use logic in the simulation, you can see X and Z also at the same time.
16:18
Speaker A
But, of course, if you use logic, logic corresponds to two-bit because it has a four states.
16:26
Speaker A
Then, simulation runs a little bit slower. So, there is a slight difference only. But still, but using logic is better still.
16:36
Speaker A
I can give an example to this struct type. For example, in here, you want to define a ST control data type.
16:46
Speaker A
For example, I can say that my control, for example. I In a similar way, I am just writing the type name. This is a type name, type def name, and this is my type. And my controller from now on, my controller has these
17:04
Speaker A
fields. It's a signal. This my control is a signal, and this signal has four-bit mode, three-bit configuration, and one-bit enable. And in order to access these values, you will to just write my control {dot} for example enable. If you want to
17:22
Speaker A
enable access to enable bit. If you want to access the mode for example, you need to say my control {dot} mode.
17:30
Speaker A
You can access with {dot}. This is type def struct. If you write type def struct, you are combining different types of data types and then forming a new data type.
17:47
Speaker A
But there is also type def union. Type def the union, there is a slight difference between type def struct and type def union. In type def union, you are forming the different views of the same data.
18:00
Speaker A
In here for example, this this struct actually total there is four bit in here, three bit in here, one bit here. This is total eight bit.
18:10
Speaker A
But in here, I defined a data type type def union patch. Now, I use union.
18:18
Speaker A
And this data type says that I have a data this data. For example, I can create a data by using this union type data type data. For example, my data.
18:29
Speaker A
And this my data consists of either data byte view or data half view. For example, when you look at data byte is 16 bit.
18:40
Speaker A
Data half is 16 bit. But they keep the same value. It is not total. It is totally 16 bit.
18:49
Speaker A
It's not 32 bit. In here, it was the combination of them. But in union, it is either of them.
18:56
Speaker A
Either you can represent it as a either data byte or data half. But it is same. It is same 16 bit. You can either represent it as a 0 to 15 or it says that two dimensional logic array.
19:12
Speaker A
It says that either two dimensional logic array from zero to seven. By the way, we saw one dimensional vectors. This is one dimensional vector. This is two dimensional vector. If you want to define a two dimensional vector like
19:29
Speaker A
this one, you are saying that this is one to zero and each of them is from zero to seven. So, it is a two dimensional vector.
19:40
Speaker A
You can define two dimensional logic vector in this way also. And everyone, you can add more dimensions here and you can define three dimensions also.
19:54
Speaker A
So, in my data, for example, if you want to represent it as a data hub, you need to write my data data hub.
20:04
Speaker A
If you want to represent it as a data byte, you need to write my data dot data byte.
20:10
Speaker A
But, for example, if you change the, for example, fourth bit of this data hub, it also changed the data byte corresponding bit of the data byte because they are the same data. It's only representation. Union actually only representation changes the
20:26
Speaker A
representation. While accessing by using data hub, you can access it as a one dimensional vector. While accessing through the data byte, you can access it by using two dimensional access. In order to do access, for example, if you
20:40
Speaker A
say that my data data hub, for example, five, it is the same data as my data data byte first dimension, zero and five.
20:58
Speaker A
It is same. If it is, for example, 10, my data data hub 10, it corresponds to my data dot data byte one because I need to switch the other row.
21:10
Speaker A
And uh in here second element of the other row. Okay? Yes, one two. Is it clear?
21:24
Speaker A
Okay. Now, I will give you some examples about the finite state machines. Uh Finite state machines are two types.
21:34
Speaker A
Now, we will see how to define the finite state machines using the SystemVerilog. Uh finite state machines uh has next state logic, state register, and output logic. In here I have a I have a register. This keeps the state.
21:48
Speaker A
And in order to build a finite state machine, always you have these three components: next state logic, state register, and output logic. This is the output logic. Output logic decides on the output. Next state logic decides on the next state. So, whenever I reach a
22:05
Speaker A
state in order to decide on the next state, I need to give this state to my next state logic and inputs also. And this one this block generates the next state.
22:16
Speaker A
But, this is combinational block. Whenever clock comes, we are switching to next state. And this here in here we are keeping our state.
22:30
Speaker A
There are two types, Moore and Mealy. The only difference is that in Moore output is depends on the state. In Mealy, output is depends on both input and state at the same time. This is the difference. But, by the way, while
22:43
Speaker A
writing a code, we don't care whether it is Moore and Mealy. Well, the synthesize tool uh can do what can put whatever it wants.
22:54
Speaker A
Uh that's why I mentioned about abstraction. We don't care whether it is Moore and Mealy because it is abstracted to us. Uh we don't deal with them.
23:03
Speaker A
So, in here I have an example of a finite state machine. I have a clock input, reset input, and Q. Reset in here is important because this is a good example. While when I started the finite state machine, I need to start with a
23:18
Speaker A
known state. For this reason, I have to use reset, for example. For this reason in here, I have to use reset to initialize the registers.
23:29
Speaker A
In here, I have module module as clock, reset, input, and Q output. This module has no has no input, by the way. It has a output, just output.
23:42
Speaker A
And what it does, it has three state, and I defined the state as enum.
23:48
Speaker A
So, type def enum logic, it says that two-bit value. I have a two-bit enumerated values, and they are S0, S1, and S2. You can put S3, by the way, but we are not using S3, for this reason we
24:02
Speaker A
do not put. Most likely, S3 corresponds to zero, S1 corresponds to, for example, 01, S2 corresponds to 10, and there is no state corresponding to 11.
24:13
Speaker A
This is two-bit. Two-bit represents four value, but we are only using three-bit. Still, we keep we need to use two-bit to keep it, but we we we have three-bit in here.
24:25
Speaker A
And by using this enumerated state type, I am defining two variables, two signals. One of them is state, and other one is the next state.
24:35
Speaker A
So, most likely, this is the next state. Whenever clock comes, I have I will assign this next state to state.
24:45
Speaker A
In here, I have a flip-flop. This flip-flop has a asynchronous reset, and positive edge flip-flop. Whenever reset comes, I am initializing the state to S0.
24:58
Speaker A
But otherwise, if there is no reset, I am always assigning next state to state as I draw here.
25:06
Speaker A
And this is the next state logic. By the way, for the flip-flop, in order to use form flip-flop, I use always FF statement.
25:16
Speaker A
In here, in order to define on the next state logic, I am using always comb block because this is combinational.
25:26
Speaker A
And in this combinational logic, I am saying that, by the way, this finite state machine just it has an input, for example, clock input.
25:36
Speaker A
And whenever, for example, this clock comes three times, and in the, for example, in here, when it comes third time, it gives one.
25:49
Speaker A
It gives a one value. It is divide by three. So, clock comes and at each at every third occurrence of the clock, it gives a logic one.
26:04
Speaker A
Okay, what what this FSM is doing. So, when I look at the next state logic, every time when when I was in a state, I am switching to the next state. For example, while I was in S0 state, I am
26:19
Speaker A
switching to the S1 state. If I am in S1 state, I am switching to S2 S2 state.
26:25
Speaker A
Which as in S2, I am switching to S0 state. And in default, I put a default value in here not to create a latch mistakenly for This is my default value.
26:41
Speaker A
In the default one, the next state is S0. And output logic, this is also a combinational logic. You can build the combinational logic by using always comb. But in here, in the example, we put we use a size
26:53
Speaker A
statement. In this assignment statement it says that if state is zero S0, it is equality comparison. If state if if state is S0, this gives one.
27:06
Speaker A
So, state equal equal means that comparison. If state is equal to S0, I am assigning uh one to Q.
27:18
Speaker A
So, whenever state becomes, for example, in here it is first uh Yeah, in for example, assume that it is in here, state is S1.
27:28
Speaker A
It is S2 S2 and immediately it goes to S0. Whenever it becomes state becomes S0, during that time Q becomes Q gives the value of one.
27:40
Speaker A
And this is the corresponding uh system Verilog code. Is it clear? Do you have any question?
27:50
Speaker A
Uh this is also another example. Uh in here I am doing a sequence detection.
28:02
Speaker A
So, for example, which sequence I am detecting in here? Uh For example, yeah, this is the FSM state diagram.
28:14
Speaker A
Most likely you are familiar with this diagrams from your logic design course. Uh so, in the I said I'm starting with S0 state and in S0 I am giving the output as zero. Whenever one comes, I am staying in S0, but whenever
28:30
Speaker A
zero comes, I am switching to S1 state. But in S1 state I am still giving the output as zero.
28:38
Speaker A
In S1 state, while zero comes, I am staying in this state and whenever one comes, I am switching to S2 state and in S2 state I am giving an output one.
28:49
Speaker A
And while in S2 state, if zero comes, I am switching back to S1 state. If one comes, I am switching to S0 state.
28:58
Speaker A
So, basically, actually, this one just detects For example, when you look at here, it detects for example, zero one.
29:08
Speaker A
Right? If uh when I started from here, if zero comes and then after one comes, if I detect zero one, it gives one.
29:18
Speaker A
So, that's why when another zero comes here, it goes back to S1 state and waits for another one to to give one. So, whenever in this one, if another zero comes, it goes to S1 state and waits for
29:32
Speaker A
another one. So, it switches back to S2 state and gives the one as output.
29:38
Speaker A
And this is the corresponding Verilog code. Still, I am using a type def enum logic in here to to to show the states state types. And I have two state types, one of them current one and other one is
29:49
Speaker A
the next one. This is my flip flop. This is just two flip two two-bit flip flop because it keeps states.
29:57
Speaker A
And this is my next state logic always comb block. Uh now, I am not just changing the state because input is also important. I have an input in here. My input is A.
30:11
Speaker A
And if, for example, A in S0 state, if A is one, I am keep staying in S0 state.
30:20
Speaker A
Uh but, if it is zero, I am switching to S1 state. So, in the next state logic, now, the input also matters for this reason.
30:32
Speaker A
Uh I am also uh using if-else statements to decide on the next state. This one uh decides on the next state.
30:42
Speaker A
And also in here, I have also the assignment. And in this assignment uh I am deciding on the output logic.
30:52
Speaker A
And this output logic the output is smile. The smile is becoming one whenever my state is is S S2.
31:01
Speaker A
Okay? Is Is there anything you didn't understand in this Verilog code? This is the Mealy version of it. In Mealy version, the difference is that in here I mentioned in Mealy version uh the output in here the output was
31:24
Speaker A
depending on the only state. In Mealy one, it was also depending on the input.
31:29
Speaker A
So, in the Mealy version while actually deciding on the next state, at the same time I am also deciding on the output logic. So, while I am looking to state and both state and inputs also uh gives the smile
31:50
Speaker A
uh output also. So, in here this is the same. The state register deciding is same.
31:58
Speaker A
Always I am switching to the next state. And in here in always comp block, now I will decide on the next state and output logic.
32:07
Speaker A
So, in here first I I am initializing the smile as zero. And for example, if state is S0 and uh A is one, then I am staying in this S0.
32:24
Speaker A
Because this is Mealy by the way. So, this representation FSM representation is a little bit different because more depends on only state output in more depends on only output.
32:38
Speaker A
But in Mealy, it depends on state and input also at the same time. For this reason, [clears throat] in here, in this state diagram, I am mentioning about the input, but also I am giving the output, corresponding output. So, in here, this
32:53
Speaker A
output depends on this input and also state it is on. It is in. So, in here, if state is S0 and if A is 1, my next state is S0.
33:07
Speaker A
Otherwise, my next state is S1. When you look at for the S1 state case, whenever in S1 state, if input 1 comes, I am giving the output as 1. For this reason, in S1 state, if A is 1, then I am saying that smile needs to
33:26
Speaker A
be 1. Otherwise, this is the default value. Smile is always in other cases, smile is 0, but only while running this code, this is blocking statement, by the way.
33:38
Speaker A
This is First, I am running this one. And after running the others, if I do another assignment, smile is replaced with the new assignment, because this is the blocking assignment.
34:00
Speaker A
So, only in this condition, in S1 state, and if input is 1, I am giving the output as 1, smile output as 1. In other cases, I am going switching to the next state and smile is always kept as 0.
34:21
Speaker A
You can later, after the course, you can later also inspect the examples. So, I can we can do some more examples.
34:30
Speaker A
In In I have an arithmetic logic unit and operations example. For example, while you are defining a uh uh processor, you will use these examples.
34:39
Speaker A
You will write such codes, for example. In here, I have a basic ALU module. And this ALU module takes M-bit inputs for A, B, and it it takes A and B are the inputs. Most likely, we will do addition, subtraction, and
34:55
Speaker A
operations on these inputs depending on the ALU control signal. ALU control is a 2-bit signal.
35:01
Speaker A
And I am giving the M-bit result as a result. And this module does behaves as if ALU control is 0 0, I am doing the add function. If it is 0 1, I am doing subtraction. If it is 1 0, I am doing
35:15
Speaker A
and and so on. So, depending this ALU control, I am doing some operation on these A and B inputs. So, for example, this table says that if it is 0 0, I need to do and. So, this is just In here, there is nothing
35:30
Speaker A
sequential. It is a combination logic. And I am writing always come begin case ALU control. And depending ALU ALU control signal, I am doing to I am writing the corresponding operation. For example, in here, if ALU control is 0 0,
35:44
Speaker A
it is going to this 0 0 case statement, and the result is becoming A plus B.
35:50
Speaker A
And these are the other ones. I am writing still in I am I am defining the default statement because I want I don't want to infer latch for the result. This is why I use default statement in here as I told before.
36:06
Speaker A
So, and if you synthesize it, this is the logical correspondence of this circuit. But this is the this is abstraction for us. We don't deal In this course, actually, I showed you some logic uh fundamentals, but we will not deal with
36:21
Speaker A
the logic, also. The more examples, for example, shifters, logical shifters, uh arithmetic shifters. There is a small difference, slight difference between them. Logical shifter shifts the value to left or right and fills the empty spaces with zeros. And arithmetic
36:38
Speaker A
shifters same as logical shifter, but on the right shift you you are filling the empty space with the old most significant bit.
36:48
Speaker A
This is important because in arithmetic shift you need to you want to keep the sign of the number.
36:56
Speaker A
For example, people use arithmetic shifter, for example, divide the negative number. For example, while dividing a minus eight, for example, you want to divide minus eight by half and the result is minus four.
37:09
Speaker A
If you do logical shifter, you you don't you cannot get minus minus four. You are getting four.
37:19
Speaker A
But if you use arithmetic shifter, in this way you are getting minus four. [clears throat] Logical shifter always fills it with zero, left or right. In here, you are you in here I have a value and in here I
37:35
Speaker A
am saying that how much bits needs to be shifted. For example, this says that 11001 number is shifted right by two.
37:45
Speaker A
So, it shifts two. These are the shifters. RISC-V is using all these shifter types in in their operation types. There are shifters, shift operations in RISC-V.
38:02
Speaker A
Counters increments on each clock edge. So, [clears throat] you can use just a adder, for example, and add one at every time and build a counter.
38:14
Speaker A
So, counters are used digital clock displays and for program counters. We will see program counters. For example, we We in while defining a risk 5 processor, we will use program counters. Uh so, for example, you can use program counter to
38:29
Speaker A
keep track of the current instruction executing, but we will show it later. So, counters, it's just a flip-flop, but it is counting.
38:39
Speaker A
Uh but its implementation is of course if you are incrementing it by one by one by one, then you have a one-bit adder in here also.
38:50
Speaker A
So, this is a counter implementation. At each clock, if reset comes, counter starts with zero because you have to start with a known value.
38:58
Speaker A
And otherwise, at every time you are increasing Q to one one one by So, this is a basic counter implementation.
39:09
Speaker A
Uh every time you are adding one to Q and assigning it to it. But this is the alternative version.
39:15
Speaker A
Uh in here, I have a Q output, but also I have a next Q value.
39:23
Speaker A
And I am assigning next Q always as Q plus one, and whenever clock comes, I am assigning next Q to Q.
39:31
Speaker A
Uh this is more verbose one, but generally we use these versions while coding processors.
39:39
Speaker A
Always we are always separating the combinational and logic blocks. And in here, instead of assign statements, we are using always comp.
39:48
Speaker A
Generally, this is our coding style, for example, in in Tubitak, this is our coding style.
39:54
Speaker A
So, we are using this version actually because it is uh if you are doing more complex logic, this always FF block becomes more complex. So, instead of it making a very complex of FF always FF, it is better to
40:10
Speaker A
separate it into always comp and always FF blocks. So, this is the shift register implementation example.
40:19
Speaker A
So, if load is one, for example, you are writing a value to M bit register. And when load is zero, it is at each clock edge, it is shifting one bit to to right.
40:36
Speaker A
Yeah, so it is a like serial to parallel converter. First, you are loading the value as parallel. For example, if you have a 8-bit register, you are loading the 8-bit value.
40:47
Speaker A
And after this load operation, at every time you are shifting it one bit right and giving the shifted one, the right most one to the output.
40:57
Speaker A
And this is the corresponding system Verilog code for this shift register. So, in here maybe we can give a break because we we finished at 30, right? In the previous one.
41:20
Speaker A
Open it's more than 1 hour we started. Okay, we can give a break. And we can start again at 45.
41:33
Speaker A
14:45 We will go back. So, now we will see the system Verilog memory types.
42:55
Speaker A
Memory types are used to define the memory. Normally, memory means actually flip-flop latches. They are memories.
43:02
Speaker A
But, if you want to build many of them, for example, a memory 2 megabyte for example, if you want to build a 2 megabyte memory, you have to define multi-dimensional logic gates, logics, actually logic structures.
43:15
Speaker A
You need to use multi-dimensional logics. And it's yeah, memory is used efficiently to store large amounts of data. And, for example, you can define the data value read width, for example, M bit.
43:29
Speaker A
And at each time you can read M bit value and write M bit value, for example. And you can keep it in M bit address, for example. If you are keeping M bit value at M bit address, it means
43:42
Speaker A
that you are keeping M times 2 to the N. You have M times 2 to the N bit.
43:51
Speaker A
Because this is the address. So, you are defining you are giving an address, for example, if you define five if you are giving five bit address, it means that you are addressing between 0 to 31.
44:03
Speaker A
So, and if you each if each address keeps 32 bit value, 32 value. Then total size is becoming 2 to the 5 * 32 bits or 2 to the 2 to the 5 * 4 byte, for example.
44:21
Speaker A
So, if you want to store a data in uh in uh chip, in an integrated circuit, there are three different values three different types. One of them is DRAM, dynamic random memory access memory. Uh DRAM consists of a transistor and
44:40
Speaker A
capacitor. This capacitor keeps the value. And if you want to access the value stored in this capacitor, yeah, this is not like cross-coupled inverter. This is just a capacitor and capacitor keeps the value.
44:53
Speaker A
For example, if you load a voltage to a capacitor, and then keep this value in this capacitor, then it is a storage.
44:59
Speaker A
It's like a storage. Uh but, if you want to read it, you need to just apply to one to this word line and read it from the bit line. This is basic DRAM memory.
45:12
Speaker A
Uh Another one is a static asset memory. This is the one we we saw. This is cross-coupled inverter.
45:20
Speaker A
It has a bit line and cross bit line and not of them. And if you want if you want to access it, you need to just trigger this word line and then get read the data.
45:30
Speaker A
And other type is the read-only memory. Read-only memory means that just, for example, you have a wire and you are just connecting into the VDD or VSS.
45:43
Speaker A
Then it is a read-only memory because if you connect a wire to one to be, for example, VDD, then if you read a if you read this wire, you are always getting one.
45:54
Speaker A
This is read-only memory. You cannot change it. In read-only memory, you cannot change it.
46:00
Speaker A
And in all by using all these structures, you are defining two-dimensional data and these two-dimensional data forms the memory.
46:11
Speaker A
So, in here at the beginning I mentioned that M-bit data value and M-bit address.
46:16
Speaker A
So, M * 2 to the N value you can build a memory. And the memory capacity is so. In order to access the memory, we need to use decoder. For example, if address is 2-bit, I can access 0 0, 1,
46:31
Speaker A
2, or third rows. So, you have to use you need if you get a 2-bit address, then you need to select the corresponding word line to access and this word line can be either this one, this one, this one,
46:45
Speaker A
this one. So, this 2-bit address needs to be converted to two 4-bit signal. So, for example, if you want to access in here, if you want to access uh row three, then you are giving address 1 1 and this
47:02
Speaker A
1 1 activates this word line and you can read the values stored in here.
47:11
Speaker A
By the way, this when you look at here, in here, there is 2-bit address and each address keeps a 3-bit value.
47:20
Speaker A
So, in here there is a 2 to 2 * 3-bit data. So, total in here there is 12-bit data. You you can count it.
47:29
Speaker A
These are the memories uh and we will see how to define the memory arrays in SystemVerilog. Uh of course, in memory, we are using two-dimensional memories and each bit cell stores 1 bit.
47:42
Speaker A
Uh I mentioned about the com- yeah, the array size. Uh depth means the number of rows and width means the number of columns. So, this is the width.
47:54
Speaker A
This is the depth. And if you want, for example, if you want to access 32-bit data, your width can be 32. For example, if you want to keep 124 uh words, then your depth is 124, for example.
48:12
Speaker A
So, uh this is, for example, in here, if you have a such a memory, then your address is 10 bits, and your data in here, you are storing 4 byte.
48:26
Speaker A
So, uh this this one corresponds to here yes. So, how can we define a single port RAM in SystemVerilog?
48:35
Speaker A
In here, I have clock and write enable input. Uh this is my clock. This is write enable. If I want to write, I am just triggering this input.
48:45
Speaker A
I have a A input, 8-bit, and uh data write destination and read destination inputs.
48:54
Speaker A
And whenever I want to write, I need to make the write enable one. And this is the description.
49:01
Speaker A
First, I need to create the memory itself. So, what is memory? Memory is a two two-dimensional signal.
49:08
Speaker A
Normally, I was defining here, for example logic 7 to 0, for example, and it was creating a vector, right?
49:17
Speaker A
One-dimensional vector. But memory is two-dimensional vector. So, in order to define two-dimensional vector, I am using two-dimensional logic structures.
49:25
Speaker A
And this says that I am using in each row, there are three bits, but there are 256 rows.
49:35
Speaker A
And this is my RAM. This is memory, memory itself. And this is the address input. By the way, this is not data. This is address input, and this is the data inputs. I I I told it wrongly.
49:52
Speaker A
Address is 8 bits because 256 is addressed by 8-bits. 256 location addressed by 8-bits.
50:02
Speaker A
So whenever for the output if whatever A addresses, I am giving the corresponding 3-bit 3-bit to RD. I am assigning it to RD. So, for example, if A is zero this first element of RAM RAM 3-bit of it assigned to RD. Okay? So, this is
50:25
Speaker A
like combinational read because I'm doing combinational read in here, not doing sequential read. Read is combinational but raw write is always must be sequential. So, in write, whenever clock comes, if write enable signal is one, I am just assigning this VD to
50:45
Speaker A
corresponding RAM uh row. So, this VD signal is 3-bit signal. I'm assigning to the RAM.
50:53
Speaker A
That's all. Is it clear? So, you can also define multi-port memory. Uh for example, in here, I define two read ports and one write ports. Two read ports has two address, A1 and A2, and two data outputs, RD1 and
51:09
Speaker A
RD2, and one write port, A3, write data three, and write enable three. Because I am not writing always. In each cycle, you can read it because read is not destructive. You can read the memory, no problem. But, if you want to write it,
51:25
Speaker A
you want you need to write it only if you want to write. Otherwise, you shouldn't write.
51:30
Speaker A
Uh so, for this design, write is depends on enable signal also. Write has enable signal. And this is the corresponding, for example, 32 * 32 register file with two read and write one write port. By the way, while designing a RISC-V
51:44
Speaker A
you will exactly use this register file, for example. In here, I have two read ports, uh one write port, and read is combinational.
51:54
Speaker A
In here, I am doing combinational read. Uh so, for example, in here, there is a special case. If read address is zero, I am giving zero to output. This is a special case. You will see it after 4 weeks why
52:08
Speaker A
I this this example coded in a such way. Uh but, otherwise, you are giving the corresponding data to output. RD1 and RD2 output. What about write section? In write section, whenever clock comes, if write enable enabled, then you are writing this VD3 to this
52:28
Speaker A
flip-flop, but corresponding row of the flip-flop. Okay? Is this example clear? You can also inspect them in ROM.
52:40
Speaker A
Uh what about ROM? ROM has no write input. So, I have an address input and getting the output.
52:49
Speaker A
So, whenever I provide an address, I'm getting the corresponding output in this row, in the row that corresponds this address.
52:56
Speaker A
And ROM, if you want to build a ROM in your uh for your chip, uh you need to just create a read port, and at the beginning, you need to give data to this ROM.
53:10
Speaker A
And you can give this data from a file. This is a file, memfile.dat file.
53:16
Speaker A
And this .dat file has values actually in here. Uh has some data. Uh this ROM actually has 128 rows, and each row has 32-bit data.
53:31
Speaker A
And at the beginning, by using this read mem H, I am reading a hexadecimal data from this file, and this file in this file there are 128 entries for example and these entries are loaded to the ROM.
53:51
Speaker A
So, instead of writing actually assign for example assign ROM 0 is uh 0 1 2 3 4 5 6 for example in this way and if you if instead of writing 128 assign statements to define the initial values of the ROM we are just
54:13
Speaker A
putting a file data we are putting the data in a file and then reading this file and then loading this data to ROM this ROM signal.
54:23
Speaker A
And after that this is by the way initial statement initial statement runs once while seeing the simulation I will show this statements in detail. Uh this I will show in detail this statement but while running the simulation this
54:39
Speaker A
statement runs only once at the beginning and never runs again. And this is the read corresponding read port. Read port always assigns the corresponding address to the output.
54:52
Speaker A
System Verilog has a concept of delay. Uh delay is described by dash and delay amount.
55:01
Speaker A
For example in here I have a module example module it has some inputs and doing some operations.
55:08
Speaker A
And these are the structural description of these operations and these delays says that for example this statement is evaluated but assigned to these values after one delay after one unit time.
55:25
Speaker A
In here this statement is evaluated but assigned to N1 after two unit delay time.
55:31
Speaker A
And two unit delay time two unit delay time four unit delay time. It's just delaying the assignment. So, if there was no one here, this would be assigned immediately. This statement would be assigned immediately. But, since there is a delay statement here, the
55:51
Speaker A
assignment is delayed one unit time. This unit depends nanosecond, picosecond, uh microsecond. You are defining it.
56:00
Speaker A
Uh but, this is unit time. Uh but, this is only for simulation. For example, if you write such a statement and say that while uh synthesizing this system Verilog code and build a actual hardware, it will not put any delay. This is only for
56:18
Speaker A
simulation, not for actual hardware. Because, we don't know how to control the delay value in actual hardware. So, this is not realistic thing. This is only for simulation. And, you will see it is very useful in simulation, especially in order to generate a clock.
56:36
Speaker A
So, they are not corresponding to the delay of actual hardware. And, here here you can in here you can see the uh simulation result. And, according to the simulation results, these for example, ABC changes its values.
56:51
Speaker A
But, these statements, for example, N1, N2, and N3, when you look at it here, it is actually changed after this specified amount of delay time.
57:07
Speaker A
Okay? So, in here there is an example, for example. In here you need to be careful.
57:19
Speaker A
For example, this is not sequential. So, for example, you cannot say that, for example, this assignment is will be done after one delay time, and this assignment will be done after two delay time, but they they are running at the same time. For this
57:36
Speaker A
reason, uh this is not after three unit time. This is after two unit time.
57:41
Speaker A
Because every line works as parallel in SystemVerilog. So, this is the corresponding waveform diagrams.
57:53
Speaker A
I will mention about test benches. This delay is useful for test benches. Uh test benches are the SystemVerilog structures. Still, they are SystemVerilog uh they are SystemVerilog modules, but they we are using these test benches to test, not
58:11
Speaker A
not for synthesizers. You know, we are not using it to create actual hardware. So, its purpose is to test another module.
58:20
Speaker A
And the module tested is named as device under test, and they are not synthesizable.
58:27
Speaker A
Uh there are three types of it: simple, self-checking, and self-checking with test vectors. There are more complex ones, but you can see them maybe later in the different uh in the professional work.
58:41
Speaker A
Uh so, in here, for example, I am in a DUT example. I am doing a I have BC ABAB C signals, and I am doing AND operation and then adding them.
58:54
Speaker A
This is a basic function. Uh this is named as silly function. It has a AB C input and output Y, and I am doing this operation.
59:03
Speaker A
In here, at means OR. The same thing, actually. Uh so, and assume that I described that it in you by writing a hardware description language, SystemVerilog, and I would like to test it. How can do it?
59:23
Speaker A
I am writing a another module, and this module is named as test bench. And this test bench module calls this silly function, my function to be tested.
59:36
Speaker A
And in this test bench I am applying some inputs to this function and probing its output.
59:45
Speaker A
And in this test bench I have a initial block. This is another block, by the way. We Until now we saw always always FF always latch, always comp. And this is initial is another block. It initial, but this is initial is only used for in
60:02
Speaker A
test bench. And in this test bench we are saying that we begin and at the beginning A is 0, B is 0, C is 0. And after 10 unit time, -10 means 10 unit time. After 10 unit time
60:17
Speaker A
Okay, at the beginning we are assigning ABC as 0 and waiting for 10 unit time.
60:22
Speaker A
And after that we continue. We are assigning C to 1 and waiting 10 unit time more.
60:30
Speaker A
We are going in this way. We are assigning B to 1. At that in here B to 1, C to 0. And then waiting another 10 unit time and applying these test vectors. So you see, I am applying
60:45
Speaker A
inputs to this to this function to the another module that I want to test.
60:51
Speaker A
And at every time I am changing the inputs. And after running this test bench, actually I will see the test bench. For example, at every time I will check the Y, for example. You will see a waveform.
61:06
Speaker A
Uh I will upload a video uh that shows how to run Verilator. So you will see it uh in action to you.
61:14
Speaker A
Uh but now I am using Windows. It is very hard to use uh Verilator in Windows. Uh By the way, you can install Verilator in Windows, but it is a little bit cumbersome, so for this reason I am
61:25
Speaker A
not showing it. Uh but when you use these two modules and then run it on simulator, for example, you can see the waveforms and you can check the waveforms whether Y is correct or not. Because in here I'm
61:41
Speaker A
applying the inputs and in here I need to check the Y visually by looking to the waveform and check that whether it is correct or not.
61:52
Speaker A
This is the simple test bench, but in simple test bench we need to check it by eye. We need to check it by looking to the waveform.
62:01
Speaker A
In here there is also another version of test bench. This is the self-checking test bench.
62:06
Speaker A
The same logic. I have a test bench here, but this is self-checking test bench.
62:11
Speaker A
And I initially in initiate my design under test in here. This is silly function that I defined.
62:20
Speaker A
And in here I am applying the test inputs. At the beginning I am applying 0 0 and 0.
62:27
Speaker A
And after 10 unit time, I am checking whether Y is 1 or not. I am doing the test in this way.
62:36
Speaker A
This works as sequential because in here there are time unit weights. So if I don't get 0 0 0, yeah, sorry, if I don't get 1, then I am saying that the test is failed.
62:49
Speaker A
So and after, for example, checking the first input, I am changing the C as 1 and waiting 10 unit time and checking whether Y is 0 or not. If it is not, then we are failed.
63:03
Speaker A
And this goes in this way and in the with different inputs I am checking every time whether Y is set the correct value.
63:16
Speaker A
Another one is that there are three methods. One of them simple, second one is self-checking, and other one is self-checking with test vectors. Test vectors is similar, but in here you are defining a example file.
63:30
Speaker A
And this example file has the input combinations, ABC values, and expected Y value this file.
63:40
Speaker A
And of course in here for the for the timing you are generating a clock. I will show. You are generating a clock.
63:51
Speaker A
And at each time when clock comes you are for example reading you are giving the ABC a line and then checking whether Y is the expected value or not. But you are doing it with a clock with clock edge for
64:08
Speaker A
example because you need to synchronize it while testing. You have a you need to have a concept of time.
64:15
Speaker A
So you are generating a clock for assigning inputs and reading outputs because at each clock you need to switch to next line.
64:23
Speaker A
You don't have to write clock, but it's better. Uh you can just for example in a for loop you can just write a dash 10.
64:31
Speaker A
For example, 10 unit delay and then do it in a same way, but no no problem. We will see how to generate the clocks also.
64:40
Speaker A
And in this stage way test bench you are generating clock for assigning the inputs and reading outputs. Uh you are reading the test work test vectors file into an array and at each time at each clock input you are assigning inputs and
64:55
Speaker A
checking the expected outputs and compare it. This is the method for self-checking test bench.
65:02
Speaker A
Uh so [clears throat] in here for example if you want to do it with a clock uh assign inputs for example. We will generate a clock. We will see it.
65:11
Speaker A
And in the rising edge of the clock, we need to assign the inputs and in the falling edge of the clock, we will compare the outputs whether it is expected or not. And in the next rising edge, we will assign the
65:24
Speaker A
new inputs and in the next falling edge, we will compare it and it will go so until we reach to the end of the test vectors.
65:34
Speaker A
So, this is the code. In here, I have a clock and reset inputs, A, B, C inputs and Y expected uh value, [clears throat] uh logic Y output.
65:49
Speaker A
Vector num corresponds to the number of the vectors and errors is number of errors we encountered.
65:57
Speaker A
And uh test vectors is the For example, we will apply for example, in here 10,000 10,001 by the way, 0 to 10,000 means 10,001 different test vectors.
66:09
Speaker A
So, this is the array of test vectors. So, at each time for example, I will apply test vector 0 and check the result is correct or not.
66:18
Speaker A
And after that, in the next block, I will apply test vector 1, 2, 3 at every time and I will check the output.
66:26
Speaker A
This is my model instantiation, uh the the function that I want to test. I instantiate it and connect A, B, C uh to here.
66:36
Speaker A
Uh by the way, note that in test bench, there is no input and output.
66:42
Speaker A
There is no input and output. Everything is signal in test bench because test bench is not a real model. It is just to check the whether my function is my model is correct or not. For this reason, it has no input and output
66:54
Speaker A
concept because it is just We are using it just to test. So, these are the signals inside the test bench.
67:04
Speaker A
[clears throat] So, in this block, we are generating a clock. So, we are generating clock in an always block. Always means that always run.
67:16
Speaker A
It is not initial. Initial means that run only once, but always says that always run.
67:22
Speaker A
How this generates clock? In this always, by the way, no sensitivity, so it always executes.
67:30
Speaker A
So, this always block, for example, first this is a for example clock signal. This is a one bit signal.
67:36
Speaker A
First, it assigns one to clock, and then waits five unit time. At five after five unit time, clock becomes Sorry, it was one at the beginning.
67:47
Speaker A
At the beginning, it was one, and after five unit time, clock becoming zero, and after another five units of time, at 10, it becomes one again.
67:57
Speaker A
And at 15, it becomes zero. So, it runs forever, so it generates a clock signal for sequential logic. This is how we are generating the clock.
68:07
Speaker A
And we will continue We are continuing on the this module, test bench module. [clears throat] At the start of the test, we are loading the vectors and pass to apply the reset.
68:19
Speaker A
So, how we are applying the test vectors? It is written in a file, as I told before. For example, in this file, in a such way, the file This is the test vectors file.
68:34
Speaker A
It has a ABC inputs and expected Y output. We are applying this example test file to test vectors.
68:45
Speaker A
And assume that in here, there are 10,001 tests. And vector num and errors are initialized as zero at the beginning, and I applied reset. If reset is one, uh I am starting from the beginning.
69:00
Speaker A
There is a reset in here. And after 22 unit time, I am releasing the reset.
69:07
Speaker A
Reset is becoming zero. This is initial block. This is runs once only. If it comes here, then nothing change.
69:15
Speaker A
This this block will not change run again. And in here, in always FF block, just write always FF. You can say always also, it is fine, but it's better to use always FF.
69:30
Speaker A
At every clock, you are applying the test vectors on the rising edge of the clock.
69:37
Speaker A
And [clears throat] for example, this is the test vectors we loaded from the file. And vector num is at each time, vector num will be increased by one. At the beginning, it was zero.
69:50
Speaker A
And I'm getting the first test vector and applying it to ABCY expected. And after that, I am here in the negedge of the clock.
70:02
Speaker A
In here, in the negedge of the clock, if there is no reset, I am checking whether Y is Y expected.
70:09
Speaker A
And if there is an error, if not expected, I am giving an error. And increasing the error count one, but still continue.
70:18
Speaker A
And this is the this is still always statement. It continues at each test, I am increasing the vector number one.
70:29
Speaker A
And if I reach the end of the test vector, I am saying that I finished the test.
70:35
Speaker A
And in here, there is a stop statement. Stop says that simulation needs to stop.
70:39
Speaker A
This is a special also keyword. It says the simulation to stop. Uh by the way, as I told, we will release a video recordings to show how to use the Verilator.
70:52
Speaker A
You will use a Verilator and do basic simulation. We will show it to you.
71:00
Speaker A
In here, there is a comparison. Previously, we saw comparison as equal equal or not equal.
71:06
Speaker A
Uh if you are using three equal or not uh equal equal, then this one also compares values 1 0 X and Z also. Normally, this one compares the value 1 or 0, but if you use three of them, three equal
71:26
Speaker A
uh then you can compare the values whether it is X or Z also. It's more detailed comparison.
71:34
Speaker A
So, that that's the end of the lecture. Uh do you have any any questions?
71:43
Speaker A
So, if no question, in the next week, inshallah, we will start the RISC-V instruction set architecture.
71:51
Speaker A
No question? Okay, then. See you.
Topics:SystemVerilogblocking assignmentnon-blocking assignmentalways_ffalways_combflip-flopmodule parameterizationfinite state machinetestbenchdigital design

Get More with the SozAI App

Transcribe recordings, audio files, and YouTube videos — with AI summaries and speaker detection. 30 minutes free.

Or transcribe another YouTube video here →