Custom Designed Integrated Circuits

Slides:



Advertisements
Similar presentations
ENG6530 RCS ENG6530 Reconfigurable Computing Systems Hardware Description Languages Synthesis.
Advertisements

History TTL-logic PAL (Programmable Array Logic)
ECE C03 Lecture 18ECE C03 Lecture 61 Lecture 18 VHDL Modeling of Sequential Machines Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
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)
ENG3050 Embedded Reconfigurable Computing Systems
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
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.
RTL Hardware Design by P. Chu Chapter Basic VHDL program 2. Lexical elements and program format 3. Objects 4. Data type and operators RTL Hardware.
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
Copyright(c) 1996 W. B. Ligon III1 Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
EE3A1 Computer Hardware and Digital Design Lecture 2 Introduction to VHDL.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
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.
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 Discussion Subprograms IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VHDL Coding for Synthesis ECE 448 Lecture 12.
VHDL Programming Fundamentals Presented By Dr. Pradyut Kumar Biswal Department of Electronics, IIIT Bhubaneswar.
CDA 4253 FPGA System Design Sequential Circuit Building Blocks Hao Zheng Dept of Comp Sci & Eng USF.
VHDL 7: use of signals v.5a1 VHDL 7 Use of signals In processes and concurrent statements.
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.
An Introduction to V.H.D.L.. Need of a Compiler… main( ) { int x=10,y=20,z; z = x + y ; printf ( “ %d “, z ); getch( ) ; } What’s That ? Give me only.
Sequential statements (1) process
Combinational logic circuit
Introduction To VHDL 홍 원 의.
Behavioral Style Combinational Design with VHDL
B e h a v i o r a l to R T L Coding
Part II A workshop by Dr. Junaid Ahmed Zubairi
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Dataflow Style Combinational Design with VHDL
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
ECE 4110–5110 Digital System Design
Behavioral Style Combinational Design with VHDL
VHDL 5 FINITE STATE MACHINES (FSM)
In processes and concurrent statements
IAS 0600 Digital Systems Design
Sequential-Circuit Building Blocks
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
IAS 0600 Digital Systems Design
Non-synthesizable VHDL Poor Design Practices
Synthesis مرتضي صاحب الزماني.
VHDL Discussion Subprograms
VHDL Introduction.
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
VHDL Discussion Subprograms
IAS 0600 Digital Systems Design
Figure 8.1. The general form of a sequential circuit.
Modeling Complex Behavior
Variables variable variable_name: variable_type
CprE / ComS 583 Reconfigurable Computing
Sequntial-Circuit Building Blocks
(Sequential-Circuit Building Blocks)
EEL4712 Digital Design (VHDL Tutorial).
EEL4712 Digital Design (Midterm 1 Review).
Presentation transcript:

Custom Designed Integrated Circuits Constructs for synthesis (IEEE 1076.6) Custom Designed Integrated Circuits Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Custom Designed Integrated Circuits Construct Comments Library Supported IEEE package Supported: std_logic_1164, std_logic_unsigned, std_logic_signed, std_logic_arith Package Std TextIO Not supported Entity Architecture Signal, variable, generic Types and subtypes Supported: integer,enumeration, bit, std_logic, bit_vector, std_logic_vector, boolean. One dimensional arrays of above Records Ignored: physical types Not supported: time, real, multidim arrays Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Custom Designed Integrated Circuits Construct Comments Alias Not Supported Signal, Variable initialization Signal and Variable initialization is not allowed Object classes Constants, signals and variables are allowed Operators Logical: (e.g. and ,or), relational (e.g. =, /=,>) concatenation (&) Arithmetic:+,-,[*, /, mod allowed but generates a lot of combinational hw] if package is used Subprograms Supported if declared in a package or in declaration part of architecture Multiple wait statements not allowed Now function not supported User defined resolution function not supported Attributes Subset is supported (e.g. ’event, ’right, ’left, ’range) Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Custom Designed Integrated Circuits Construct Comments Sequential statements Wait, signal assignment, variable assignment, procedure call,if, case, loop, next exit, return, null Assert and after not supported Concurrent statements - Process - Concurrent signal assignment - Components - Block - Configuration Process with sensitivity list must contain all signals on the right hand side of signal assignments (sensitivity list is ignored) Supported Not supported Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Register inference (interpreted by synthesis tool) A clocked process is defined as a process having one and only one of the following statements: wait until clk=’1’; -- rising edge wait until clk’event and clk=’1’; -- rising edge of clk wait until rising_edge(clk); if clk’event and clk=’1’ then -- clk in sensitivity list elsif clk’event and clk=’1’ then -- clk in sensitivity list wait until clk=’0’; -- falling edge wait until clk’event and clk=’0’; -- falling edge of clk wait until falling_edge(clk); if clk’event and clk=’0’ then -- clk in sensitivity list elsif clk’event and clk=’0’ then -- clk in sensitivity list Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Signal Assignments in Clocked Processes A register is always inferred when a signal is assigned a value in a clocked process library ieee; use ieee.std_logic_1164.all; entity ff is port(clk, reset,d: in std_logic; q: out std_logic); end ff; architecture rtl of ff is begin process(clk,reset) if reset=’1’ then q<=’0’; elsif clk’event and clk=’1’ then q<=d; end if; end process; end rtl; Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Variable Assignments in Clocked Processes Reading a variable before assigning a value to that variable means reading the old value i.e. a register is used for that variable If a variable is assigned before it is read no register is inferred process begin counter:=counter+1; -- inferred register -- Avoid variables in clocked processes Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Asynchronous reset and set process(clk,reset,set) begin if reset=’1’ then -- asynchronous part q<=’0’; elsif set=’1’ then -- asynchronous part q<=’1’; elsif clk’event and clk=’1’ then -- synchronous part q<=d; end if; end process; Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Synchronous reset and set process(clk) begin if clk’event and clk=’1’ then -- synchronous part if reset=’1’ then q<=’0’; elsif set=’1’ then q<=’1’; else q<=d; end if; end process; Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Combinational logic inference The easiest way to imply combinational logic is to use concurrent signal assignments Processes are convenient to describe complex combinational logic Clocked processes can also infer combinational logic that drives the registers. Remember: All signal assignments in clocked processes will generate registers but combinational logic drives (on register inputs) the registers. cnter if clk’event and clk=‘1’ then cnter<=cnter+1; end if; + Register clk 1 Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Latch inference and avoidance (in combinational processes) A latch is inferred for signals when they are not assigned under all conditional statements. if signal_x=‘1’ then signal_y<=‘0’; end if; ( a latch is inferred for signal_y) Latches must be avoided in synchronous designs. Latches infer feedback, cause difficulties in timing analysis (timing is ambiguous). Avoid latches by using one of the methods: Assign a default value at the beginning of a process Assign outputs for all input conditions Use else instead of elsif in the final priority branch Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Latch inference and avoidance (in combinational processes) 1) signal_y<=‘0’; if signal_x=‘1’ then signal_y<=‘1’; end if; 2) if signal_x=‘0’ then signal_y<=‘0’; 3) else Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Variables in Combinational Processes In a clocked process the variables must be updated before they are written. If a variable is read before it is assigned a value, then simulation mismatch will result between RTL model and synthesized model. Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Variables in Combinational Processes entity VarError is port(A : in Bit; B : in Bit; C : in Bit_Vector(3 downto 0); Q : out Bit_Vector(1 downto 0)); end VarError; architecture VarError_a of VarError is begin Var_Proc : process (A, B, C) variable Var : Bit_Vector(1 downto 0); begin -- process Var_Proc if Var = "00" then Q <= C(1 downto 0); else Q <= C(3 downto 2); end if; var := A & B; end process Var_Proc; end VarError_a; Not OK Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Variables in Combinational Processes entity VarOK is port(A : in Bit; B : in Bit; C : in Bit_Vector(3 downto 0); Q : out Bit_Vector(1 downto 0)); end VarOK; architecture VarOK_a of VarOK is begin Var_Proc : process (A, B, C) variable Var : Bit_Vector(1 downto 0); begin -- process Var_Proc var := A & B; if Var = "00" then Q <= C(1 downto 0); else Q <= C(3 downto 2); end if; end process Var_Proc; end VarOK_a; OK Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Variables in Combinational Processes Synthesized result in booth cases = A,B C(3:0) Q(0) Q(1) Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Custom Designed Integrated Circuits State machines Design rules Provide two processes, one for the state register and one for combinational logic (next state) Add a combinational process for outputs. This process can be clocked or not ( or even assignments in concurrent part) As a first choice use enumerated data type for state Safe FSM with No Lock Up Define the number of enumeration for states to be a power of two. In the case statement use when others for not used states. type state is (s0,s1,s2,s3,s4,s5,s6,s7); -- 5 states used -- case state is when s0 => when s4 => when others => Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Common design errors Signals and variables process (a,b,c,d,int) begin int<=a and b and c; q<=int and d; end process; required process (a,b,c,d) variable int: std_logic; begin int:=a and b and c; q<=int and d; end process; Best method for intermediate storage!! Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Common design errors Logic synthesis and sensitivity list Some synthesis tools don’t care what is in sensitivity list (all signals are assumed to be in the list)! This can lead to mismatch between simulation and synthesis! Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Common design errors Buffers and internal dummy signals If you want to reread an output signal: Declare the signal as buffer Use an internal dummy signal Use (VHDL-93) signal attribute ‘driving_value If buffer is used it can give problems if you only want out on higher levels! top C1 out buffer Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Common design errors Declaring vectors with downto or to signal a: std_logic_vector(0 to 3); signal b: std_logic_vector(3 downto 0); It is recommended that downto is used because index 0 will be LSB and highest index MSB. If to is used then index 0 is MSB Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Common design errors Incomplete combinational process In combinational processes the output signals must always be assigned a value when the process is running. Otherwise latches are created (normally not wanted) Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Custom Designed Integrated Circuits Design tips Vector multiplier It is possible to use the “*” to multiply two vectors. Note that only combinational logic is created at synthesis (many gates used). library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity v_mult is port(a,b: in std_logic_vector(3 downto 0); c: out std_logic_vector(7 downto 0)); end; architecture rtl of v_mult is begin c<=a*b; end rtl; Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

Custom Designed Integrated Circuits VHDL Modelling Guidelines (Reference: European Space Research and Technology Centre) Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

To be used in projects (and later?) General All models shall be compliant with VHDL-93 All documentation, identifiers, comments, messages, file names etc. shall use English language The code shall be consistent in writing style and naming conventions. The reserved VHDL words shall appear in uniform casing: Follow casing used in FPGA Advantage HDL Design Browser Identifiers shall be written using mixed casing The code shall emphasize good readability The code shall be properly intended. Use 3 spaces. Don’t use TAB, as TAB is environment dependent Maximum one statement per line Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

To be used in projects (and later?) Names Meaningful non-cryptic identifier names shall be used, based on the English language For signals and variables that are active low use suffix _N as in Reset_N The name shall indicate the purpose of the object and not its type e.g. AddressCounter rather than CountLoad8. Use mixed casing for names Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

To be used in projects (and later?) Comments The purpose of comments is to allow the function of a model or testbench to be understood by a designer not involved in the design of the VHDL code All models shall be fuly documented with explanatory comments in English. The comments shall be placed close to the part of the code they describe. All comments shall be intended and aligned for good readability. Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

To be used in projects (and later?) Header Each file shall contain a header with the following information Name of the design unit in the file File name Purpose of the code, description of hardware modeled Author(s) Change list, containing version numbers, authors(s), the dates and a list of all changes performed Each subprogram declaration, subprogram, process, block etc. shall be immediately preceded by a description of its function Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3

To be used in projects (and later?) Signals and ports The same name shall be used for a signal throughout all levels of the model, wherever possible. In cases where exactly the same name cannot be used e.g. when two identical sub-components have been instantiated, name derived from the same base name should be used The buffer mode shall never appear in the port of the model’s top-level entity declaration Subprograms All processes shall be associated with a descriptive label All processes with only one wait statement (e.g. typical for synthesizable processes) should use sensitivity list instead of wait statements, since this increases readability. Custom Designed Integrated Circuits ©joal 2005 HT:1 Em3