SlideShare a Scribd company logo
SV-CONTROL FLOW
PUSHPA.Y
INTRODUCTION:
System Verilog has the following types of control flow within a
process:
• Selection, loops and jumps : Sv adds c-Like do...while,
break, continue
• Task and function calls : Sv adds return
• Sequential and parallel blocks
• Timing control
SELECTION STATEMENTS:
• In Verilog, an if (expression) is evaluated as a boolean, so that
if the result of the expression is 0 or X, the test is considered
false.
• Sv adds the keywords unique and priority, which can be used
before an if.
• If either keyword is used, it shall be a run-time error for no
condition to match unless there is an explicit else.
UNIQUE IF:
• Unique if evaluates all the conditions parallel.
• In the following conditions simulator issue a run time
error/warning,
• More than one condition is true
• No condition is true or final if doesn’t have corresponding
else
PRIORITY IF:
• Priority if evaluates all the conditions in sequential order.
• In the following conditions simulator issue a run time
error/warning
• No condition is true or final if doesn’t have corresponding
else.
LOOP STATEMENTS
WHILE LOOP:
• Execution of statements within the loop happens only if the
condition is true.
DO WHILE LOOP:
• The condition will be checked after the execution of statements
inside the loop.
FOREACH LOOP:
• System Verilog foreach specifies iteration over the elements of
an array.
• The loop variable is considered based on elements of an array
and the number of loop variables must match the dimensions
of an array.
• Foreach loop iterates through each index starting from index 0.
Syntax: foreach(<variable>[<iterator>]]) begin
statement - 1
...
statement - n
end
FOR LOOP:
• System Verilog for loop is enhanced for loop of Verilog.
In Verilog,
• the control variable of the loop must be declared before the loop
• allows only a single initial declaration and single step assignment
within the for a loop
System Verilog for loop allows,
• declaration of a loop variable within the for loop
• one or more initial declaration or assignment within the for loop
• one or more step assignment or modifier within the for loop
FOR LOOP:
Syntax: for(initialization; condition; modifier) begin
statement - 1
...
statement - n
end
• Initialization: executed first, and only once. This allows the user
to declare and initialize loop control variables.
• Condition: the condition is evaluated. If it is true, the body of
the loop is executed, else the flow jumps to the statement after
the ‘for’ loop.
• Modifier: at the end of each iteration it will be executed, and
execution moves to Condition.
REPEAT LOOP:
• Repeat will execute the statements within the loop for a loop
variable number of times.
• If the loop variable is N, then the statements within the repeat
block will be executed N number of times.
Syntax: repeat(<variable>) begin
statement - 1
...
statement - n
end
FOREVER LOOP:
• As the name says forever loop will execute the statements
inside the loop forever.
• It can be said as indefinite iteration.
Syntax: forever begin
statement - 1
...
statement - n
end
JUMP STATEMENTS
BREAK AND CONTINUE STATEMENTS:
Break:
• The execution of a break statement leads to the end of the
loop.
• break shall be used in all the loop constructs (while, do-while,
foreach, for, repeat and forever).
Continue:
• Execution of continue statement leads to skip the execution of
statements followed by continue and jump to next loop or
iteration value.
BREAK AND CONTINUE STATEMENTS:
TASKS AND FUNCTIONS
TASKS:
• Tasks and Functions provide a means of splitting code into
small parts.
• A Task can contain a declaration of parameters, input
arguments, output arguments, in-out arguments, registers,
events, and zero or more behavioral statements.
System Verilog task can be:
• static
• automatic
TASKS:
Static tasks:
• Static tasks share the same storage space for all task calls.
Automatic tasks:
• Automatic tasks allocate unique, stacked storage for each task
call.
System Verilog allows,
• to declare an automatic variable in a static task
• to declare a static variable in an automatic task
• more capabilities for declaring task ports
• multiple statements within task without requiring a begin…end or
fork…join block
• passing values by reference, value, names, and position
• the default direction of argument is input if no direction has been specified
FUNCTIONS:
• A Function can contain declarations of range, returned type,
parameters, input arguments, registers, and events.
• A function without a range or return type declaration returns a
one-bit value.
• Functions cannot contain any time-controlled statements, and
they cannot enable tasks.
• Functions can return only one value.
System Verilog function can be:
• Static
• automatic
FUNCTIONS:
Static Function:
• Static functions share the same storage space for all function
calls.
Automatic Function
• Automatic functions allocate unique, stacked storage for each
function call.
• System Verilog allows,
• to declare an automatic variable in static functions
• to declare the static variable in automatic functions
FUNCTIONS:
• more capabilities for declaring function ports.
• multiple statements within a function without requiring a
begin…end or fork…join block.
• returning from the function before reaching the end of the
function.
• Passing values by reference, value, names, and position.
• default argument values, function output and inout ports.
• the default direction of argument is input if no direction has
been specified.
• default arguments type is logic if no type has been specified.
TASKS AND FUNCTIONS:
System Verilog provides passing arguments to functions and
tasks:
• Argument pass by value
• Argument pass by reference
• Argument pass by name
• Argument default values:
TASKS AND FUNCTIONS:
Argument pass by value:
• The argument passing mechanism works by copying each
argument into the subroutine area.
• if any changes to arguments within the subroutine, those
changes will not be visible outside the subroutine.
Argument pass by Reference:
• As the argument within a subroutine is pointing to an original
argument, any changes to the argument within subroutine will
be visible outside.
• To indicate argument pass by reference, the argument
declaration is preceded by keyword ref.
TASKS AND FUNCTIONS:
Argument pass by name:
• In argument pass by name, arguments can be passed in any
order by specifying the name of the subroutine argument.
Argument default values:
• The default value can be specified to the arguments of the
subroutine.
• In the subroutine call, arguments with a default value can be
omitted from the call.
• if any value is passed to an argument with a default value, then
the new value will be considered.
MAIN DIFFERENCE B/W FUNCTIONS AND
TASK:
SEQUENTIAL AND PARALLEL BLOCKS
SEQUENTIAL BLOCK:
The System Verilog contains two types of blocks:
Sequential (begin-end blocks):
• All statements within sequential blocks are executed in the order in which they
are given. If a timing control statement appears within a block, then the next
statement will be executed after that delay.
Example: begin
a = 1;
#10 a = 0;
#5 a = 4;
end
• During the simulation, this block will be executed in 15 time units. At time 0,
the 'a' variable will be 1, at time 10 the 'a' variable will be 0, and at time 15
(#10 + #5) the 'a' variable will be 4.
PARALLEL BLOCK:
Parallel (fork-join blocks):
• All statements within parallel blocks are executed at the same time. This
means that the execution of the next statement will not be delayed even if
the previous statement contains a timing control statement.
Example: fork
a = 1;
#10 a = 0;
#5 a = 4;
join
• During the simulation this block will be executed in 10 time units. At time 0
the 'a' variable will be 1, at time 5 the 'a' variable will be 4, and at time 10
the 'a' variable will be 0.
PARALLEL BLOCKS:
Fork_join:
• Fork-Join will start all the processes inside it parallel and wait
for the completion of all the processes.
Fork join_any:
• Fork-Join_any will be unblocked after the completion of any of
the Processes.
Fork join_none:
• As in the case of Fork-Join and Fork-Join_any fork block is
blocking, but in case of Fork-Join_none fork block will be non-
blocking.
PARALLEL BLOCKS:
Wait fork:
• Causes the process to block until the completion of all
processes started from fork blocks.
Disable fork:
• Causes the process to kill/terminate all the active processes
started from fork blocks.
TIMING CONTROL
TIMING CONTROL:
Delay controls:
• Delays the execution of a procedural statements by specific
simulation time.
Syntax: #<time><statement>;
Edge sensitive event control:
• Delays execution of the next statement until the specified
transaction on a signal.
Syntax: @(<posedge>|<negedge>)<statement>;
TIMING CONTROL:
Level sensitive event controls: (wait statements):
• Delays execution of the next statement until expression
evaluates to true.
Syntax: wait(<expression>)<statement>;
Events:
• Events are useful for synchronization between the process.
Events operations are of two staged processes in which one
process will trigger the event, and the other processes will wait
for an event to be triggered.
• Events are triggered using -> operator or ->> operator
NAMED BLOCKS &DISABLE BLOCKS
NAMED BLOCKS:
• Named blocks in Verilog are allowed for begin and fork. They
can be added only after the reserve word begin and fork.
Example:
 begin : "MY_NAMED_BLOCK1"
 fork : "MY_NAMED_BLOCK2"
NAMED BLOCKS:
• System Verilog allows to add the LABLE or NAMED BLOCK
before begin, fork.
Example:
• "MY_NAMED_BLOCK" : begin
• "MY_NAMED_BLOCK" : end
• "MY_NAMED_BLOCK" : fork
• "MY_NAMED_BLOCK" : join
DISABLE BLOCK:
• Sv has break and continue to break out of or continue the
execution of loops. The Verilog-2001 disable can also be used
to break out of or continue a loop,.
• The disable is also allowed to disable a named block, which
does not contain the disable statement.
• If the block is currently executing, this causes control to jump
to the statement immediately after the block.
• If the block is a loop body, it acts like a continue. If the block is
not currently executing, the disable has no effect.
NON BLOCKING & BLOCKING
NON BLOCKING & BLOCKING:
Nonblocking assignment:
• non-blocking assignment statements execute in parallel.
• In the non-blocking assignment, all the assignments will occur
at the same time.
Blocking Assignment:
• Blocking assignment statements execute in series order.
Blocking assignment blocks the execution of the next
statement until the completion of the current assignment
execution.
System verilog control flow

More Related Content

What's hot (20)

PDF
UVM TUTORIAL;
Azad Mishra
 
PDF
Uvm presentation dac2011_final
sean chen
 
PDF
System verilog verification building blocks
Nirav Desai
 
PPTX
SOC Verification using SystemVerilog
Ramdas Mozhikunnath
 
PDF
How to create SystemVerilog verification environment?
Sameh El-Ashry
 
ODP
APB protocol v1.0
Azad Mishra
 
PPT
SystemVerilog Assertions verification with SVAUnit - DVCon US 2016 Tutorial
Amiq Consulting
 
PDF
Session 7 code_functional_coverage
Nirav Desai
 
PDF
System verilog important
elumalai7
 
PDF
UVM Methodology Tutorial
Arrow Devices
 
PDF
Ral by pushpa
Pushpa Yakkala
 
ODP
axi protocol
Azad Mishra
 
PDF
CPU Verification
Ramdas Mozhikunnath
 
PPTX
AMBA 2.0 PPT
Nirav Desai
 
PPT
Axi protocol
Azad Mishra
 
PPTX
SystemVerilog based OVM and UVM Verification Methodologies
Ramdas Mozhikunnath
 
PPTX
AMBA Ahb 2.0
Akhil Srivastava
 
PPTX
AXI Protocol.pptx
Yazan Yousef
 
PPT
SystemVerilog OOP Ovm Features Summary
Amal Khailtash
 
PPTX
Axi protocol
Rohit Kumar Pathak
 
UVM TUTORIAL;
Azad Mishra
 
Uvm presentation dac2011_final
sean chen
 
System verilog verification building blocks
Nirav Desai
 
SOC Verification using SystemVerilog
Ramdas Mozhikunnath
 
How to create SystemVerilog verification environment?
Sameh El-Ashry
 
APB protocol v1.0
Azad Mishra
 
SystemVerilog Assertions verification with SVAUnit - DVCon US 2016 Tutorial
Amiq Consulting
 
Session 7 code_functional_coverage
Nirav Desai
 
System verilog important
elumalai7
 
UVM Methodology Tutorial
Arrow Devices
 
Ral by pushpa
Pushpa Yakkala
 
axi protocol
Azad Mishra
 
CPU Verification
Ramdas Mozhikunnath
 
AMBA 2.0 PPT
Nirav Desai
 
Axi protocol
Azad Mishra
 
SystemVerilog based OVM and UVM Verification Methodologies
Ramdas Mozhikunnath
 
AMBA Ahb 2.0
Akhil Srivastava
 
AXI Protocol.pptx
Yazan Yousef
 
SystemVerilog OOP Ovm Features Summary
Amal Khailtash
 
Axi protocol
Rohit Kumar Pathak
 

Similar to System verilog control flow (20)

PPTX
C language (Part 2)
Dr. SURBHI SAROHA
 
PPT
Lecture-13.ppt
AliSarmad15
 
PPTX
Module_2_1_Building Python Programs_Final.pptx
nikhithavarghese77
 
PPTX
Operators loops conditional and statements
Vladislav Hadzhiyski
 
PDF
Sva.pdf
SamHoney6
 
PPTX
Pl sql Prograaming of Database management system
AjitPatil801582
 
PPTX
Java 2.pptx
usmanusman720379
 
PPT
8 statement level
Munawar Ahmed
 
PDF
Repetition, Basic loop structures, Loop programming techniques
Jason J Pulikkottil
 
PDF
Unit II chapter 4 Loops in C
Sowmya Jyothi
 
PPTX
Computer programming 2 Lesson 8
MLG College of Learning, Inc
 
PPTX
Managing input and output operations & Decision making and branching and looping
letheyabala
 
PPTX
MODULE 3 process synchronizationnnn.pptx
senthilkumar969017
 
PPT
control-statements....ppt - definition
Papitha7
 
PPTX
chapter 6.pptx
ThedronBerhanu
 
PPTX
Machine_Learning_JNTUH_R18_UNIT5_CONCEPTS.pptx
Hemavanth1
 
PPT
03 conditions loops
Manzoor ALam
 
PDF
Chapter 12 Computer Science ( ICS 12).pdf
AamirShahzad527024
 
PPTX
JAVA programming language made easy.pptx
Sunila31
 
PPTX
systemverilog and veriog presentation
KhushiV8
 
C language (Part 2)
Dr. SURBHI SAROHA
 
Lecture-13.ppt
AliSarmad15
 
Module_2_1_Building Python Programs_Final.pptx
nikhithavarghese77
 
Operators loops conditional and statements
Vladislav Hadzhiyski
 
Sva.pdf
SamHoney6
 
Pl sql Prograaming of Database management system
AjitPatil801582
 
Java 2.pptx
usmanusman720379
 
8 statement level
Munawar Ahmed
 
Repetition, Basic loop structures, Loop programming techniques
Jason J Pulikkottil
 
Unit II chapter 4 Loops in C
Sowmya Jyothi
 
Computer programming 2 Lesson 8
MLG College of Learning, Inc
 
Managing input and output operations & Decision making and branching and looping
letheyabala
 
MODULE 3 process synchronizationnnn.pptx
senthilkumar969017
 
control-statements....ppt - definition
Papitha7
 
chapter 6.pptx
ThedronBerhanu
 
Machine_Learning_JNTUH_R18_UNIT5_CONCEPTS.pptx
Hemavanth1
 
03 conditions loops
Manzoor ALam
 
Chapter 12 Computer Science ( ICS 12).pdf
AamirShahzad527024
 
JAVA programming language made easy.pptx
Sunila31
 
systemverilog and veriog presentation
KhushiV8
 
Ad

Recently uploaded (20)

PPTX
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
PPTX
原版一样(Acadia毕业证书)加拿大阿卡迪亚大学毕业证办理方法
Taqyea
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PPTX
ISO/IEC JTC 1/WG 9 (MAR) Convenor Report
Kurata Takeshi
 
PPTX
Green Building & Energy Conservation ppt
Sagar Sarangi
 
PDF
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PPTX
site survey architecture student B.arch.
sri02032006
 
PDF
MOBILE AND WEB BASED REMOTE BUSINESS MONITORING SYSTEM
ijait
 
PDF
Statistical Data Analysis Using SPSS Software
shrikrishna kesharwani
 
PPTX
Innowell Capability B0425 - Commercial Buildings.pptx
regobertroza
 
PPTX
Structural Functiona theory this important for the theorist
cagumaydanny26
 
PPTX
Break Statement in Programming with 6 Real Examples
manojpoojary2004
 
PDF
UNIT-4-FEEDBACK AMPLIFIERS AND OSCILLATORS (1).pdf
Sridhar191373
 
PPTX
Benefits_^0_Challigi😙🏡💐8fenges[1].pptx
akghostmaker
 
PPTX
UNIT DAA PPT cover all topics 2021 regulation
archu26
 
PDF
PRIZ Academy - Change Flow Thinking Master Change with Confidence.pdf
PRIZ Guru
 
PPTX
Hashing Introduction , hash functions and techniques
sailajam21
 
PPTX
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
PDF
6th International Conference on Machine Learning Techniques and Data Science ...
ijistjournal
 
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
原版一样(Acadia毕业证书)加拿大阿卡迪亚大学毕业证办理方法
Taqyea
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
ISO/IEC JTC 1/WG 9 (MAR) Convenor Report
Kurata Takeshi
 
Green Building & Energy Conservation ppt
Sagar Sarangi
 
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
site survey architecture student B.arch.
sri02032006
 
MOBILE AND WEB BASED REMOTE BUSINESS MONITORING SYSTEM
ijait
 
Statistical Data Analysis Using SPSS Software
shrikrishna kesharwani
 
Innowell Capability B0425 - Commercial Buildings.pptx
regobertroza
 
Structural Functiona theory this important for the theorist
cagumaydanny26
 
Break Statement in Programming with 6 Real Examples
manojpoojary2004
 
UNIT-4-FEEDBACK AMPLIFIERS AND OSCILLATORS (1).pdf
Sridhar191373
 
Benefits_^0_Challigi😙🏡💐8fenges[1].pptx
akghostmaker
 
UNIT DAA PPT cover all topics 2021 regulation
archu26
 
PRIZ Academy - Change Flow Thinking Master Change with Confidence.pdf
PRIZ Guru
 
Hashing Introduction , hash functions and techniques
sailajam21
 
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
6th International Conference on Machine Learning Techniques and Data Science ...
ijistjournal
 
Ad

System verilog control flow

  • 2. INTRODUCTION: System Verilog has the following types of control flow within a process: • Selection, loops and jumps : Sv adds c-Like do...while, break, continue • Task and function calls : Sv adds return • Sequential and parallel blocks • Timing control
  • 3. SELECTION STATEMENTS: • In Verilog, an if (expression) is evaluated as a boolean, so that if the result of the expression is 0 or X, the test is considered false. • Sv adds the keywords unique and priority, which can be used before an if. • If either keyword is used, it shall be a run-time error for no condition to match unless there is an explicit else.
  • 4. UNIQUE IF: • Unique if evaluates all the conditions parallel. • In the following conditions simulator issue a run time error/warning, • More than one condition is true • No condition is true or final if doesn’t have corresponding else
  • 5. PRIORITY IF: • Priority if evaluates all the conditions in sequential order. • In the following conditions simulator issue a run time error/warning • No condition is true or final if doesn’t have corresponding else.
  • 7. WHILE LOOP: • Execution of statements within the loop happens only if the condition is true.
  • 8. DO WHILE LOOP: • The condition will be checked after the execution of statements inside the loop.
  • 9. FOREACH LOOP: • System Verilog foreach specifies iteration over the elements of an array. • The loop variable is considered based on elements of an array and the number of loop variables must match the dimensions of an array. • Foreach loop iterates through each index starting from index 0. Syntax: foreach(<variable>[<iterator>]]) begin statement - 1 ... statement - n end
  • 10. FOR LOOP: • System Verilog for loop is enhanced for loop of Verilog. In Verilog, • the control variable of the loop must be declared before the loop • allows only a single initial declaration and single step assignment within the for a loop System Verilog for loop allows, • declaration of a loop variable within the for loop • one or more initial declaration or assignment within the for loop • one or more step assignment or modifier within the for loop
  • 11. FOR LOOP: Syntax: for(initialization; condition; modifier) begin statement - 1 ... statement - n end • Initialization: executed first, and only once. This allows the user to declare and initialize loop control variables. • Condition: the condition is evaluated. If it is true, the body of the loop is executed, else the flow jumps to the statement after the ‘for’ loop. • Modifier: at the end of each iteration it will be executed, and execution moves to Condition.
  • 12. REPEAT LOOP: • Repeat will execute the statements within the loop for a loop variable number of times. • If the loop variable is N, then the statements within the repeat block will be executed N number of times. Syntax: repeat(<variable>) begin statement - 1 ... statement - n end
  • 13. FOREVER LOOP: • As the name says forever loop will execute the statements inside the loop forever. • It can be said as indefinite iteration. Syntax: forever begin statement - 1 ... statement - n end
  • 15. BREAK AND CONTINUE STATEMENTS: Break: • The execution of a break statement leads to the end of the loop. • break shall be used in all the loop constructs (while, do-while, foreach, for, repeat and forever). Continue: • Execution of continue statement leads to skip the execution of statements followed by continue and jump to next loop or iteration value.
  • 16. BREAK AND CONTINUE STATEMENTS:
  • 18. TASKS: • Tasks and Functions provide a means of splitting code into small parts. • A Task can contain a declaration of parameters, input arguments, output arguments, in-out arguments, registers, events, and zero or more behavioral statements. System Verilog task can be: • static • automatic
  • 19. TASKS: Static tasks: • Static tasks share the same storage space for all task calls. Automatic tasks: • Automatic tasks allocate unique, stacked storage for each task call. System Verilog allows, • to declare an automatic variable in a static task • to declare a static variable in an automatic task • more capabilities for declaring task ports • multiple statements within task without requiring a begin…end or fork…join block • passing values by reference, value, names, and position • the default direction of argument is input if no direction has been specified
  • 20. FUNCTIONS: • A Function can contain declarations of range, returned type, parameters, input arguments, registers, and events. • A function without a range or return type declaration returns a one-bit value. • Functions cannot contain any time-controlled statements, and they cannot enable tasks. • Functions can return only one value. System Verilog function can be: • Static • automatic
  • 21. FUNCTIONS: Static Function: • Static functions share the same storage space for all function calls. Automatic Function • Automatic functions allocate unique, stacked storage for each function call. • System Verilog allows, • to declare an automatic variable in static functions • to declare the static variable in automatic functions
  • 22. FUNCTIONS: • more capabilities for declaring function ports. • multiple statements within a function without requiring a begin…end or fork…join block. • returning from the function before reaching the end of the function. • Passing values by reference, value, names, and position. • default argument values, function output and inout ports. • the default direction of argument is input if no direction has been specified. • default arguments type is logic if no type has been specified.
  • 23. TASKS AND FUNCTIONS: System Verilog provides passing arguments to functions and tasks: • Argument pass by value • Argument pass by reference • Argument pass by name • Argument default values:
  • 24. TASKS AND FUNCTIONS: Argument pass by value: • The argument passing mechanism works by copying each argument into the subroutine area. • if any changes to arguments within the subroutine, those changes will not be visible outside the subroutine. Argument pass by Reference: • As the argument within a subroutine is pointing to an original argument, any changes to the argument within subroutine will be visible outside. • To indicate argument pass by reference, the argument declaration is preceded by keyword ref.
  • 25. TASKS AND FUNCTIONS: Argument pass by name: • In argument pass by name, arguments can be passed in any order by specifying the name of the subroutine argument. Argument default values: • The default value can be specified to the arguments of the subroutine. • In the subroutine call, arguments with a default value can be omitted from the call. • if any value is passed to an argument with a default value, then the new value will be considered.
  • 26. MAIN DIFFERENCE B/W FUNCTIONS AND TASK:
  • 28. SEQUENTIAL BLOCK: The System Verilog contains two types of blocks: Sequential (begin-end blocks): • All statements within sequential blocks are executed in the order in which they are given. If a timing control statement appears within a block, then the next statement will be executed after that delay. Example: begin a = 1; #10 a = 0; #5 a = 4; end • During the simulation, this block will be executed in 15 time units. At time 0, the 'a' variable will be 1, at time 10 the 'a' variable will be 0, and at time 15 (#10 + #5) the 'a' variable will be 4.
  • 29. PARALLEL BLOCK: Parallel (fork-join blocks): • All statements within parallel blocks are executed at the same time. This means that the execution of the next statement will not be delayed even if the previous statement contains a timing control statement. Example: fork a = 1; #10 a = 0; #5 a = 4; join • During the simulation this block will be executed in 10 time units. At time 0 the 'a' variable will be 1, at time 5 the 'a' variable will be 4, and at time 10 the 'a' variable will be 0.
  • 30. PARALLEL BLOCKS: Fork_join: • Fork-Join will start all the processes inside it parallel and wait for the completion of all the processes. Fork join_any: • Fork-Join_any will be unblocked after the completion of any of the Processes. Fork join_none: • As in the case of Fork-Join and Fork-Join_any fork block is blocking, but in case of Fork-Join_none fork block will be non- blocking.
  • 31. PARALLEL BLOCKS: Wait fork: • Causes the process to block until the completion of all processes started from fork blocks. Disable fork: • Causes the process to kill/terminate all the active processes started from fork blocks.
  • 33. TIMING CONTROL: Delay controls: • Delays the execution of a procedural statements by specific simulation time. Syntax: #<time><statement>; Edge sensitive event control: • Delays execution of the next statement until the specified transaction on a signal. Syntax: @(<posedge>|<negedge>)<statement>;
  • 34. TIMING CONTROL: Level sensitive event controls: (wait statements): • Delays execution of the next statement until expression evaluates to true. Syntax: wait(<expression>)<statement>; Events: • Events are useful for synchronization between the process. Events operations are of two staged processes in which one process will trigger the event, and the other processes will wait for an event to be triggered. • Events are triggered using -> operator or ->> operator
  • 36. NAMED BLOCKS: • Named blocks in Verilog are allowed for begin and fork. They can be added only after the reserve word begin and fork. Example:  begin : "MY_NAMED_BLOCK1"  fork : "MY_NAMED_BLOCK2"
  • 37. NAMED BLOCKS: • System Verilog allows to add the LABLE or NAMED BLOCK before begin, fork. Example: • "MY_NAMED_BLOCK" : begin • "MY_NAMED_BLOCK" : end • "MY_NAMED_BLOCK" : fork • "MY_NAMED_BLOCK" : join
  • 38. DISABLE BLOCK: • Sv has break and continue to break out of or continue the execution of loops. The Verilog-2001 disable can also be used to break out of or continue a loop,. • The disable is also allowed to disable a named block, which does not contain the disable statement. • If the block is currently executing, this causes control to jump to the statement immediately after the block. • If the block is a loop body, it acts like a continue. If the block is not currently executing, the disable has no effect.
  • 39. NON BLOCKING & BLOCKING
  • 40. NON BLOCKING & BLOCKING: Nonblocking assignment: • non-blocking assignment statements execute in parallel. • In the non-blocking assignment, all the assignments will occur at the same time. Blocking Assignment: • Blocking assignment statements execute in series order. Blocking assignment blocks the execution of the next statement until the completion of the current assignment execution.