Presentation is loading. Please wait.

Presentation is loading. Please wait.

Timing Controls in Behavioral Modeling Programmable Logic Design (40-493) Fall 2001 Computer Engineering Department Sharif University of Technology Maziar.

Similar presentations


Presentation on theme: "Timing Controls in Behavioral Modeling Programmable Logic Design (40-493) Fall 2001 Computer Engineering Department Sharif University of Technology Maziar."— Presentation transcript:

1 Timing Controls in Behavioral Modeling Programmable Logic Design (40-493) Fall 2001 Computer Engineering Department Sharif University of Technology Maziar Gudarzi

2 Introduction No timing controls  No advance in simulation time No timing controls  No advance in simulation time Three methods of timing control Three methods of timing control delay-based delay-based event-based event-based level-sensitive level-sensitive

3 Delay-based Timing Control Timing Controls in Behavioral Modeling

4 Delay-based Timing Controls Delay  Duration between encountering and executing a statement Delay  Duration between encountering and executing a statement Delay symbol: # Delay symbol: # Delay specification syntax: Delay specification syntax:<delay> ::= # ::= # ||= # ||= # ||= # >*)

5 Delay-based Timing Controls (cont’d) Types of delay-based timing controls Types of delay-based timing controls 1. Regular delay control 2. Intra-assignment delay control 3. Zero-delay control

6 Delay-based Timing Controls (cont’d) Regular Delay Control Regular Delay Control Symbol: non-zero delay to the left of a procedural assignment Symbol: non-zero delay to the left of a procedural assignment Used in most of our previous examples Used in most of our previous examples Look at the handout Look at the handout

7 Delay-based Timing Controls (cont’d) Intra-assignment Delay Control Intra-assignment Delay Control Symbol: non-zero delay to the right of the assignment operator Symbol: non-zero delay to the right of the assignment operator Operation sequence: Operation sequence: 1. Compute the right-hand-side expression at the current time. 2. Defer the assignment of the above computed value to the LHS by the specified delay. Look at the handout Look at the handout

8 Delay-based Timing Controls (cont’d) Zero-Delay Control Zero-Delay Control Symbol: #0 Symbol: #0 Different initial/always blocks in the same simulation time Different initial/always blocks in the same simulation time Execution order non-deterministic Execution order non-deterministic Zero-delay ensures execution after all other statements Zero-delay ensures execution after all other statements Eliminated race conditions Eliminated race conditions Multiple zero-delay statements Multiple zero-delay statements Non-deterministic execution order Non-deterministic execution order

9 Event-based Timing Control Timing Controls in Behavioral Modeling

10 Event-based Timing Control Event Event Change in the value of a register or net Change in the value of a register or net Used to trigger execution of a statement or block (reactive behavior/reactivity) Used to trigger execution of a statement or block (reactive behavior/reactivity) Types of Event-based timing control Types of Event-based timing control 1. Regular event control 2. Named event control 3. Event OR control 4. Level-sensitive timing control (next section)

11 Event-based Timing Control (cont’d) Regular event control Regular event control Symbol: @( ) Symbol: @( ) Events to specify: Events to specify: posedge sig: posedge sig: –Change of sig from any value to 1 or from 0 to any value negedge sig: negedge sig: –Change of sig from any value to 0 or from 1 to any value sig:Any chage in sig value sig:Any chage in sig value Look at the handout Look at the handout

12 Event-based Timing Control (cont’d) Named event control Named event control You can declare (name) an event, and then trigger and recognize it. You can declare (name) an event, and then trigger and recognize it. Verilog keyword for declaration: event Verilog keyword for declaration: event event calc_finished; event calc_finished; Verilog symbol for triggering: -> Verilog symbol for triggering: -> ->calc_finished ->calc_finished Verilog symbol for recognizing: @() Verilog symbol for recognizing: @() @(calc_finished) @(calc_finished)

13 Event-based Timing Control (cont’d) Event OR control Event OR control Used when need to trigger a block upon occurrence of any of a set of events. Used when need to trigger a block upon occurrence of any of a set of events. The list of the events: sensitivity list The list of the events: sensitivity list Verilog keyword: or Verilog keyword: or Look at the handout Look at the handout

14 Level-sensitive Timing Control Timing Controls in Behavioral Modeling

15 Level-sensitive Timing Control Level-sensitive vs. event-based Level-sensitive vs. event-based event-based: wait for triggering of an event (change in signal value) event-based: wait for triggering of an event (change in signal value) level-sensitive: wait for a certain condition (on values/levels of signals) level-sensitive: wait for a certain condition (on values/levels of signals) Verilog keyword: wait() Verilog keyword: wait() always wait(count_enable) #20 count=count+1;

16 Today Summary Timing control in behavioral statements Timing control in behavioral statements Required to advance simulation time Required to advance simulation time Different types Different types Delay-based Delay-based –Regular/intra-assignment/zero delay Event-based Event-based –Regular/Named/Event-OR event control Level-sensitive Level-sensitive –wait keyword

17 Complementary Notes Don’t forget to subscribe to course mailing list: Don’t forget to subscribe to course mailing list:ce493list Assignment 4 Assignment 4 Chapter 7: Chapter 7: Exercises 8, 9, 12 with ModelSim (submit the Verilog source codes to ce493@ce.sharif.edu) Exercises 8, 9, 12 with ModelSim (submit the Verilog source codes to ce493@ce.sharif.edu) Exercises 10, 11 in paper and pencil Exercises 10, 11 in paper and pencil


Download ppt "Timing Controls in Behavioral Modeling Programmable Logic Design (40-493) Fall 2001 Computer Engineering Department Sharif University of Technology Maziar."

Similar presentations


Ads by Google