B e h a v i o r a l to R T L Coding

Slides:



Advertisements
Similar presentations
VHDL Lecture 1 Megan Peck EECS 443 Spring 08.
Advertisements

1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
1 VLSI DESIGN USING VHDL A workshop by Dr. Junaid Ahmed Zubairi October 2002.
6/27/20061 Sequence Detectors Lecture Notes – Lab 5 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
ECE C03 Lecture 18ECE C03 Lecture 61 Lecture 18 VHDL Modeling of Sequential Machines Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
VHDL And Synthesis Review. VHDL In Detail Things that we will look at: –Port and Types –Arithmetic Operators –Design styles for Synthesis.
ECE C03 Lecture 141 Lecture 14 VHDL Modeling of Sequential Machines Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Simple Testbenches Behavioral Modeling of Combinational Logic
Introduction to VHDL (part 2)
1 H ardware D escription L anguages Basic Language Concepts.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 4: Modeling Dataflow.
1 Part I: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
1 H ardware D escription L anguages Modeling Complex Systems.
1 H ardware D escription L anguages Modeling Digital Systems.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL L a n g u a g e C o n c e p t s Page 1.
Copyright © 1997 Altera Corporation & 提供 What is VHDL Very high speed integrated Hardware Description Language (VHDL) –is.
ENG241 Digital Design Week #8 Registers and Counters.
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
Modern VLSI Design 4e: Chapter 8 Copyright  2008 Wayne Wolf Topics VHDL register-transfer modeling: –basics using traffic light controller; –synthesis.
(1) Basic Language Concepts © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Hardware languages "Programming"-language for modelling of (digital) hardware 1 Two main languages: VHDL (Very High Speed Integrated Circuit Hardware Description.
Lecture 7 Chap 9: Registers Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
Introduction to ASIC flow and Verilog HDL
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
VHDL and Hardware Tools CS 184, Spring 4/6/5. Hardware Design for Architecture What goes into the hardware level of architecture design? Evaluate design.
VHDL Programming Fundamentals Presented By Dr. Pradyut Kumar Biswal Department of Electronics, IIIT Bhubaneswar.
55:032 - Intro. to Digital DesignPage 1 VHDL and Processes Defining Sequential Circuit Behavior.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Case Study: Xilinx Synthesis Tool (XST). Arrays & Records 2.
Joal 2006 HT:1 Em3 Digital Electronics Design 1 Lecture 3-4 Sequential VHDLChap 4.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Sequential statements (1) process
LAB #6 Sequential Logic Design (Flip Flops, Shift Registers)
Basic Language Concepts
Describing Combinational Logic Using Processes
Registers and Counters
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code.
Part II A workshop by Dr. Junaid Ahmed Zubairi
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Custom Designed Integrated Circuits
Sequential-Circuit Building Blocks
CPE/EE 422/522 Advanced Logic Design L06
ECE 434 Advanced Digital System L08
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
Hardware Description Languages
SYNTHESIS OF SEQUENTIAL LOGIC
Non-synthesizable VHDL Poor Design Practices
VHDL Introduction.
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code.
Modeling Complex Behavior
H a r d w a r e M o d e l i n g O v e r v i e w
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL code ECE 448 – FPGA and ASIC Design.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Sequntial-Circuit Building Blocks
(Sequential-Circuit Building Blocks)
EEL4712 Digital Design (Midterm 1 Review).
Presentation transcript:

B e h a v i o r a l to R T L Coding Page 1

Objectives Consider the differences and applications. Examine the two primary styles of writing VHDL code. Consider the differences and applications. Topics Include Synthesis Vs. Simulation Defining Behavioral Defining RTL Source Code Portability Modeling DFFs Page 2

Levels of Abstraction f Behavioral RTL Logic Layout Fewer details, Faster design entry and simulation f Behavioral RTL AND_OR2 DFF Logic Technology specific details, slower design entry and simulation Layout CLB_R5C5 CLB_R5C6 Page 3

User Intent A given module may be written in an Behavioral or RTL style depending on the intent. Specifically, what is the model to be used for at this time. Module (entity&Arch) Technology Library i.e. XC4000XL Netlist Analysis Work Library Elaboration Synthesis Top Level Simulation Execution (simulation) Page 4

Behavioral Coding Given that VHDL is a Hardware Modeling Language, there are considerable features and flexibility to that end. Assignment are clean Values stored in signal Model bus input / output No need to consider propagation delay Model timing as necessary Arbitrary sequencing of events Zero execution time Delta-cycle between simulation time Z <= A or B ; wait for 10 ns ; Z <= A or B after 2 ns ; A_bus <= “1010” ; signal A_bus :bit_vector (3 downto 0 ) := “0011” ; Page 5

Behavioral Description entity Security_1 is port (Clk, Reset : in std_logic ; Keypad : in std_logic_vector (3 downto 0) ; Front_Door, Rear_Door, Window: in boolean ; Alarm_Siren : out boolean ) ; end Security_1 ; Keypad Security_1 Front_Door Rear_Door Alarm_Siren Window Clk architecture Behave of Security_1 is constant Delay_Period : time := 20 s ; begin process ( Keypad, Front_Door, Rear_Door, Window ) begin if (Front_Door or Rear_Door or Window ) then If (Keypad = “0011”) then Alarm_siren <= false ; else Alarm_Siren <= true after Delay_Period ; end if ; end if ; end process ; end Behave ; Reset Page 6

RTL Coding Coding at the RTL (Register Transfer Level) requires more detailed description, with synthesizable constructs only. RTL level code is inherently synchronous as we describe the transformations (logic) between clock-edges (registers) Model register operation Asynchronous initialization conditions Synchronous initialization conditions Consider propagation delays Clocked processes Combinatorial processes Portability Combinatorial process Clocked process Page 7

Combinatorial Logic RTL For synthesis of combinatorial logic , all signals “read” in the process must be included in the process sensitivity list. A signal is considered to be “read” if its value must be determined in the execution of the sequential statement. i.e. Z <= A ;, the current value of A is determined, and scheduled to be driven onto Z. process (A,B) begin Z <= A or B ; end process ; A Z B What is the behavior (simulation) if “B” is not in the sensitivity list ? Gate level simulation Behavioral simulation A A B B Z Z Page 8

Inferring Latches For combinatorial logic described with an“If” statement, default assignments are necessary to prevent latch inference in logic synthesis. - -This is especially important in Xilinx devices that do support internal latches ! process ( D, En ) begin if (En = ‘1’) then Q <= D ; end if ; end process ; D Q En What happens when En /= ‘1’ ? The current value of Q will need to be maintained . D Q En Page 9

Detecting Rising Edges For synthesis of registered logic (clocked processes), we start by by detecting the rising or falling edge of the signal that will trigger the register. Its important to follow industry standards to maintain the utmost source code portability. Note that for a clocked process, only the Clock signal and reset need be in the sensitivity list, not the data inputs to the register. process ( Clk, reset ) begin if reset = ‘1’ then Q <= ‘0’ ; elsif ( Clk`event and Clk = ‘1’) then Q <= D ; end if ; end process ; The `event is a VHDL signal attribute that returns a boolean “true” if there was a event (change) on that signal during the current simulation cycle. Page 10

Inferring Registers All signals assigned within a clocked process will be registered. Consequently, you should not assign a signal within a clocked process unless you intend to register it. D Q process ( Clk, Reset ) begin if Reset = ‘1’ then Q <= ‘0’ ; Z <= ‘0’ ; M <= ‘0’ ; Y <= ‘0’; elsif (Clk’event and Clk = ‘1’) then Q <= D ; Z <= A ; M <= Z ; Y <= X; end if ; end process ; Clk Reset Z A M X Y Page 11

Rising Edge Function Call The VHDL Std_logic_1164 package provides a simple function call (sub-program) for the detection of a rising edge. There is a corresponding utility called “ falling edge”. process ( Clk, Reset ) begin if Reset = ‘1’ then Q <= ‘0’ ; elsif rising_edge (Clk) then Q <= D ; end if ; end process ; package std_logic_1164 is . . . function rising_edge ( signal Clk : std_logic ) return boolean; begin If ( Clk’event and Clk= ‘1’ and Clk’last_ value = ‘0’ ) then return true ; else return false ; end if ; end rising edge ; . . . Page 12

RTL Description Keypad Security_1 Front_Door Rear_Door Alarm_Siren architecture RTL of Security_1 is type Alarm_State is ( Waiting, Armed, Dis-Armed ) ; signal State : Alarm_State ; begin process ( Clk, Reset ) begin If (Reset = ‘1’ ) then State <= Dis-armed ; Alarm_Siren <= false ; elsif ( Clk’event and Clk = ‘1’ ) then case State when Waiting => if Keypad = “0011” then State <= Dis-Armed ; else State <= Armed ; end if ; when Armed => if ( Front_door or Rear_door or Window ) then if Keypad /= “0011” then Alarm_Siren <= true ; else State <= Waiting ; end if ; end if ; when Dis-armed => Alarm_Siren <= false ; State <= Waiting ; end case ; end if ; end process ; end architecture RTL ; Keypad Security_1 Front_Door Rear_Door Alarm_Siren Window Clk Reset entity Security_1 is port (Clk, Reset : in std_logic ; Keypad : in std_logic_vector (3 downto 0) ; Front_Door, Rear_Door, Window : in boolean ; Alarm_Siren : out boolean ) ; end entity Security_1 ; Page 13

Simulation or Synthesis Module (entity&Arch) Technology Library i.e. XC4000XL RTL Coding Flow Behavioral Coding Flow Netlist Analysis Work Library Elaboration Synthesis Top Level Simulation Execution (simulation) Page 14

Summary Behavioral constructs allow for detailed modeling. RTL code should contain only synthesizable constructs. For combinatorial logic, all signals read in the process must be included in the sensitivity list. For clocked processes, only the clocking signal and an asynchronous initialization, if present, should be in the sensitivity list. Avoid inadvertent latch inference. Follow the rules, maintain the utmost code portability. Page 15