SlideShare a Scribd company logo
1 of 14
1
Verilog HDLVerilog HDL
ASIC DESIGN USING
FPGA
BEIT VII
KICSIT
Sept 19 2012 Lecture 8
2
Behavioral Model - Procedures
Sept 19 2012
• Sections of code intended for a specific task.
• Similar to a Hardware block.
• Procedural statements
• statements inside a procedure.
• they execute sequentially.
• e.g. 2-to-1 mux
Lecture 8
3
Behavioral Model - Procedures
Sept 19 2012
• Modules can contain any number of procedures
• Procedures execute in parallel (in respect to each
other)
• In behavioral modeling, everything comes in a
procedural block
Lecture 8
4
Behavioral Model - Procedures
Sept 19 2012
• Procedural block can be expressed in two types
of blocks:
• initial → they execute only once
• always → they execute forever (until
simulation finishes)
Lecture 8
5
“Initial” Blocks
Sept 19 2012
• This block starts with initial keyword
• This is not used in RTL
• This is non synthesizable
• All initial blocks execute concurrently in order
independent
• They execute only once
• This block is used only in Test Bench
Lecture 8
6
“Initial” Blocks
Sept 19 2012
• Start execution at sim. time zero and finish when
their last statement executes.
module nothing;
initial
$display (“I’m the first”);
initial begin
#50;
$display(“Really?”);
end
endmodule
Lecture 8
7
“Always” Blocks
Sept 19 2012
• This block starts with always keyword
• This block is more like H/W.
• Always Blocks execute forever until simulation
finishes.
• The always block can be viewed as continuously
repeated activity in a digital circuit starting from
power on.
Lecture 8
8
“Always” Blocks
Sept 19 2012
• Start execution at sim time zero and continue
until sim finishes.
Lecture 8
9
Procedural assignments
Sept 19 2012
• Blocking assignment =
• Regular assignment inside procedural block
• Assignment takes place immediately
• LHS must be a register
Lecture 8
10
Procedural assignments
Sept 19 2012
• Nonblocking assignment <=
• Compute right hand side
• Assignment takes place at the end of block
• LHS must be a register
Lecture 8
11
Procedural assignments
Sept 19 2012
• Nonblocking statements are used;
• whenever it is desired to make several register
assignments within the same time step without
regard to order or dependence upon each other.
• They are executed in two steps:
• The simulator evaluates the RHS.
• The assignment occurs at the end of the
time step.
Lecture 8
12
Procedural assignments
Sept 19 2012
• The order of concurrent evaluation is indeterminate
• Concurrent blocking assignments have
unpredictable results
always @(posedge clk)
#5 A = A + 1;
always @(posedge clk)
#5 B = A + 1;
• new value of B could be evaluated before or
after A changes Lecture 8
13
Procedural assignments
Sept 19 2012
• Concurrent non-blocking assignments have
predictable results
always @(posedge clk)
#5 A <= A + 1;
always @(posedge clk)
#5 B <= A + 1;
• New value of B will always be evaluated before
A changes.
Lecture 8
14
Example: Blocking/Non-blocking
Sept 19 2012 Lecture 8

More Related Content

Similar to Assic 8th Lecture

AgileLINC Continous Slides by Daniel Harp
AgileLINC Continous Slides by Daniel HarpAgileLINC Continous Slides by Daniel Harp
AgileLINC Continous Slides by Daniel Harp
Barry Gavril
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
Hannes Lowette
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
Hannes Lowette
 
Fpga 08-behavioral-modeling-mealy-machine
Fpga 08-behavioral-modeling-mealy-machineFpga 08-behavioral-modeling-mealy-machine
Fpga 08-behavioral-modeling-mealy-machine
Malik Tauqir Hasan
 

Similar to Assic 8th Lecture (20)

Assic 10th Lecture
Assic 10th LectureAssic 10th Lecture
Assic 10th Lecture
 
Lect 7: Verilog Behavioral model for Absolute Beginners
Lect 7: Verilog Behavioral model for Absolute BeginnersLect 7: Verilog Behavioral model for Absolute Beginners
Lect 7: Verilog Behavioral model for Absolute Beginners
 
Assic 5th Lecture
Assic 5th LectureAssic 5th Lecture
Assic 5th Lecture
 
AgileLINC Continous Slides by Daniel Harp
AgileLINC Continous Slides by Daniel HarpAgileLINC Continous Slides by Daniel Harp
AgileLINC Continous Slides by Daniel Harp
 
Microservices: The Best Practices
Microservices: The Best PracticesMicroservices: The Best Practices
Microservices: The Best Practices
 
Assic 9th Lecture
Assic 9th LectureAssic 9th Lecture
Assic 9th Lecture
 
MODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptxMODULE 3 process synchronizationnnn.pptx
MODULE 3 process synchronizationnnn.pptx
 
What is the merge window?
What is the merge window?What is the merge window?
What is the merge window?
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
 
Working With Concurrency In Java 8
Working With Concurrency In Java 8Working With Concurrency In Java 8
Working With Concurrency In Java 8
 
Summit 16: Stop Writing Legacy Code!
Summit 16: Stop Writing Legacy Code!Summit 16: Stop Writing Legacy Code!
Summit 16: Stop Writing Legacy Code!
 
Database development unit test with tSQLt
Database development unit test with tSQLtDatabase development unit test with tSQLt
Database development unit test with tSQLt
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
Lock free programming- pro tips
Lock free programming- pro tipsLock free programming- pro tips
Lock free programming- pro tips
 
Ver1-iitkgp.ppt
Ver1-iitkgp.pptVer1-iitkgp.ppt
Ver1-iitkgp.ppt
 
Ch11lect1 ud
Ch11lect1 udCh11lect1 ud
Ch11lect1 ud
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
 
Fpga 08-behavioral-modeling-mealy-machine
Fpga 08-behavioral-modeling-mealy-machineFpga 08-behavioral-modeling-mealy-machine
Fpga 08-behavioral-modeling-mealy-machine
 

More from babak danyal

Lecture1 Intro To Signa
Lecture1 Intro To SignaLecture1 Intro To Signa
Lecture1 Intro To Signa
babak danyal
 

More from babak danyal (20)

applist
applistapplist
applist
 
Easy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client SocketsEasy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client Sockets
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streams
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Java
 
Tcp sockets
Tcp socketsTcp sockets
Tcp sockets
 
block ciphers and the des
block ciphers and the desblock ciphers and the des
block ciphers and the des
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
 
Lecture10 Signal and Systems
Lecture10 Signal and SystemsLecture10 Signal and Systems
Lecture10 Signal and Systems
 
Lecture8 Signal and Systems
Lecture8 Signal and SystemsLecture8 Signal and Systems
Lecture8 Signal and Systems
 
Lecture7 Signal and Systems
Lecture7 Signal and SystemsLecture7 Signal and Systems
Lecture7 Signal and Systems
 
Lecture6 Signal and Systems
Lecture6 Signal and SystemsLecture6 Signal and Systems
Lecture6 Signal and Systems
 
Lecture5 Signal and Systems
Lecture5 Signal and SystemsLecture5 Signal and Systems
Lecture5 Signal and Systems
 
Lecture4 Signal and Systems
Lecture4  Signal and SystemsLecture4  Signal and Systems
Lecture4 Signal and Systems
 
Lecture3 Signal and Systems
Lecture3 Signal and SystemsLecture3 Signal and Systems
Lecture3 Signal and Systems
 
Lecture2 Signal and Systems
Lecture2 Signal and SystemsLecture2 Signal and Systems
Lecture2 Signal and Systems
 
Lecture1 Intro To Signa
Lecture1 Intro To SignaLecture1 Intro To Signa
Lecture1 Intro To Signa
 
Lecture9 Signal and Systems
Lecture9 Signal and SystemsLecture9 Signal and Systems
Lecture9 Signal and Systems
 
Lecture9
Lecture9Lecture9
Lecture9
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniques
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Security
 

Recently uploaded

SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 

Recently uploaded (20)

PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
Scopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS PublicationsScopus Indexed Journals 2024 - ISCOPUS Publications
Scopus Indexed Journals 2024 - ISCOPUS Publications
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
Climbers and Creepers used in landscaping
Climbers and Creepers used in landscapingClimbers and Creepers used in landscaping
Climbers and Creepers used in landscaping
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptx
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 

Assic 8th Lecture

  • 1. 1 Verilog HDLVerilog HDL ASIC DESIGN USING FPGA BEIT VII KICSIT Sept 19 2012 Lecture 8
  • 2. 2 Behavioral Model - Procedures Sept 19 2012 • Sections of code intended for a specific task. • Similar to a Hardware block. • Procedural statements • statements inside a procedure. • they execute sequentially. • e.g. 2-to-1 mux Lecture 8
  • 3. 3 Behavioral Model - Procedures Sept 19 2012 • Modules can contain any number of procedures • Procedures execute in parallel (in respect to each other) • In behavioral modeling, everything comes in a procedural block Lecture 8
  • 4. 4 Behavioral Model - Procedures Sept 19 2012 • Procedural block can be expressed in two types of blocks: • initial → they execute only once • always → they execute forever (until simulation finishes) Lecture 8
  • 5. 5 “Initial” Blocks Sept 19 2012 • This block starts with initial keyword • This is not used in RTL • This is non synthesizable • All initial blocks execute concurrently in order independent • They execute only once • This block is used only in Test Bench Lecture 8
  • 6. 6 “Initial” Blocks Sept 19 2012 • Start execution at sim. time zero and finish when their last statement executes. module nothing; initial $display (“I’m the first”); initial begin #50; $display(“Really?”); end endmodule Lecture 8
  • 7. 7 “Always” Blocks Sept 19 2012 • This block starts with always keyword • This block is more like H/W. • Always Blocks execute forever until simulation finishes. • The always block can be viewed as continuously repeated activity in a digital circuit starting from power on. Lecture 8
  • 8. 8 “Always” Blocks Sept 19 2012 • Start execution at sim time zero and continue until sim finishes. Lecture 8
  • 9. 9 Procedural assignments Sept 19 2012 • Blocking assignment = • Regular assignment inside procedural block • Assignment takes place immediately • LHS must be a register Lecture 8
  • 10. 10 Procedural assignments Sept 19 2012 • Nonblocking assignment <= • Compute right hand side • Assignment takes place at the end of block • LHS must be a register Lecture 8
  • 11. 11 Procedural assignments Sept 19 2012 • Nonblocking statements are used; • whenever it is desired to make several register assignments within the same time step without regard to order or dependence upon each other. • They are executed in two steps: • The simulator evaluates the RHS. • The assignment occurs at the end of the time step. Lecture 8
  • 12. 12 Procedural assignments Sept 19 2012 • The order of concurrent evaluation is indeterminate • Concurrent blocking assignments have unpredictable results always @(posedge clk) #5 A = A + 1; always @(posedge clk) #5 B = A + 1; • new value of B could be evaluated before or after A changes Lecture 8
  • 13. 13 Procedural assignments Sept 19 2012 • Concurrent non-blocking assignments have predictable results always @(posedge clk) #5 A <= A + 1; always @(posedge clk) #5 B <= A + 1; • New value of B will always be evaluated before A changes. Lecture 8