12004 MAPLDSynthesis Issues Synthesis Issues Demonstrated with a Simple Finite State Machine Using Gray Codes.

Slides:



Advertisements
Similar presentations
Basic Finite State Machines 1. 2 Finite State Machines Binary encoded state machines –The number of flip-flops is the smallest number m such that 2 m.
Advertisements

Sequential Circuits Storage elements
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
Logic Synthesis – 3 Optimization Ahmed Hemani Sources: Synopsys Documentation.
1 Lecture 13 VHDL 3/16/09. 2 VHDL VHDL is a hardware description language. The behavior of a digital system can be described (specified) by writing a.
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
L18 – VHDL for other counters and controllers. Other counters  More examples Gray Code counter Controlled counters  Up down counter  Ref: text Unit.
Arbitrary Waveform Discussion 5.5 Example 34.
1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Simple Sequential Circuits in VHDL. Contents Sequential circuit examples: - SR latch in dataflow style - D flip-flop in behavioral style - shift register.
6/12/20151 Sequence Detectors Lecture Notes – Lab 4 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
Dr. Turki F. Al-Somani VHDL synthesis and simulation – Part 3 Microcomputer Systems Design (Embedded Systems)
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.
HDL-Based Digital Design Part I: Introduction to VHDL (I) Dr. Yingtao Jiang Department Electrical and Computer Engineering University of Nevada Las Vegas.
VHDL And Synthesis Review. VHDL In Detail Things that we will look at: –Port and Types –Arithmetic Operators –Design styles for Synthesis.
Algorithmic State Machine (ASM) Charts
Dr. H.v.d.Biggelaar / Mar3-Ver2 / 1 Engineering Technology Dr. H.v.d.Biggelaar March 22, 2000 State Machines in VHDL.
Finite State Machines. Binary encoded state machines –The number of flip-flops is the smallest number m such that 2 m  n, where n is the number of states.
12004 MAPLDVHDL Synthesis Introduction VHDL Synthesis for High-Reliability Systems (Vol. 2 of 2) 2004 MAPLD International Conference Washington, D.C. September.
Synthesis Presented by: Ms. Sangeeta L. Mahaddalkar ME(Microelectronics) Sem II Subject: Subject:ASIC Design and FPGA.
Graduate Computer Architecture I VHDL Structure and Testing Michael Sorensen.
Chapter 10 State Machine Design. 2 State Machine Definitions State Machine: A synchronous sequential circuit consisting of a sequential logic section.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Ders 8: FSM Gerçekleme ve.
George Mason University ECE 545 – Introduction to VHDL ECE 545 Lecture 5 Finite State Machines.
CprE / ComS 583 Reconfigurable Computing
1 ECE 545—Digital System Design with VHDL Lecture 6 Behavioral VHDL Coding (for Synthesis): Finite State Machines and ASMs 9/30/08.
ENG2410 Digital Design LAB #6 LAB #6 Sequential Logic Design (Flip Flops)
L16 – VHDL for State Machines with binary encoding.
ENG241 Digital Design Week #8 Registers and Counters.
Reconfigurable Computing - VHDL - Types John Morris Chung-Ang University The University of Auckland.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Introduction to FPGA Tools
Lecture 7 Chap 9: Registers Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
VHDL Discussion Finite State Machines
VHDL for Finite State Machines. Sorry – no standard way One way –Use TYPE and SIGNAL ARCHITECTURE Behavior OF two_ones_fsm IS TYPE State_type IS ( A,
VHDL Discussion Finite State Machines IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
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.
9/9/2006DSD,USIT,GGSIPU1 Concurrent vs Sequential Combinational vs Sequential logic –Combinational logic is that in which the output of the circuit depends.
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.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VHDL Coding for Synthesis ECE 448 Lecture 12.
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
ECE DIGITAL LOGIC LECTURE 20: REGISTERS AND COUNTERS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/19/2015.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Sequential statements (1) process
Describing Combinational Logic Using Processes
Registers and Counters
B e h a v i o r a l to R T L Coding
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Algorithmic State Machine (ASM) Charts: VHDL Code & Timing Diagrams
ECE 434 Advanced Digital System L08
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
VHDL (VHSIC Hardware Description Language)
VHDL Structural Architecture
Concurrent vs Sequential
VHDL Introduction.
Figure 8.1. The general form of a sequential circuit.
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.
Sequntial-Circuit Building Blocks
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
(Sequential-Circuit Building Blocks)
Presentation transcript:

12004 MAPLDSynthesis Issues Synthesis Issues Demonstrated with a Simple Finite State Machine Using Gray Codes

22004 MAPLDSynthesis Issues Gray Codes “This is rookie stuff, so I can duck out of this module, get some cookies, and come back later, right?”

32004 MAPLDSynthesis Issues History of the Gray Code Invented by Emile Baudot ( ) Originally called a “cyclic-permuted” code Telegraph - 5 bit codes –Bits stored on a code wheel in the receiver –Wheel connected to the printing disk –Matched pattern on wheel and received pattern and then actuated head to print. Exhibited at Universal Exposition, Paris (1878)

42004 MAPLDSynthesis Issues Binary Reflected Gray Code

52004 MAPLDSynthesis Issues Why Gray Codes? Single output changes at a time –Asynchronous sampling –Permits asynchronous combinational circuits to operate in fundamental mode –Potential for power savings Multiphase, multifrequency clock generator

62004 MAPLDSynthesis Issues Effects of Errors Lockup States –None if all states are used –Can’t use all states for one-hot Magnitude of Error –Reduced to one code word –Binary can jump 1/2 scale

72004 MAPLDSynthesis Issues Binary Counter + Gray Code Converter: Glitch Free? Binary Counter Binary to Gray Converter CLK

82004 MAPLDSynthesis Issues VHDL Code for a 4-Bit Gray Code Sequencer (1) Package Gray_Types Is Type States Is ( s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15 ); End Package Gray_Types;

92004 MAPLDSynthesis Issues VHDL Code for a 4-Bit Gray Code Sequencer (2) Library IEEE; Use IEEE.Std_Logic_1164.all; Library Work; Use Work.Gray_Types.All; Library synplify; Use synplify.attributes.all; Entity Gray_Code Is Port ( Clock : In Std_Logic; Reset_N : In Std_Logic; Q : Out States ); End Entity Gray_Code; Architecture RTL of Gray_Code Is Attribute syn_netlist_hierarchy of RTL : architecture is false; Signal IQ : States; Attribute syn_encoding of IQ : signal is "gray"; Begin GC: Process ( Clock, Reset_N ) Begin If ( Reset_N = '0' ) Then IQ <= s0; Else If Rising_Edge ( Clock ) Then Case IQ Is When s0 => IQ <= s1; When s1 => IQ <= s2; When s2 => IQ <= s3; When s3 => IQ <= s4; When s4 => IQ <= s5; When s5 => IQ <= s6; When s6 => IQ <= s7; When s7 => IQ <= s8; When s8 => IQ <= s9; When s9 => IQ <= s10; When s10 => IQ <= s11; When s11 => IQ <= s12; When s12 => IQ <= s13; When s13 => IQ <= s14; When s14 => IQ <= s15; When s15 => IQ <= s0; When Others => IQ <= s0; End Case; End If; End Process GC; Q <= IQ; End Architecture RTL;

MAPLDSynthesis Issues Synthesizer Output for a Gray Code Sequencer - SX Target Logic Equations: A: ~D2 ~S10+D2 ~S00 B: D0 ~S00 ~S10+D1 S00 ~S10+D1 ~S00 S10+D0 S00 S10 C: D0 ~S00 ~S10+D1 S00 ~S10+~D0 ~S00 S10+D0 S00 S10 D: D0 ~S01+D1 ~S00 S01+D0 S00 E: ~D0 ~S00 ~S10+D0 S00 ~S10+D0 ~S00 S10+~D0 S00 S10 F: D0 ~S00 ~S10 +~D0 S00 ~S10+~D0 ~S00 S10+D0 S00 S10 A B C D E F

MAPLDSynthesis Issues time = ns Q=0000 time = ns Q=1000 time = ns Q=1100 time = ns Q=0100 time = ns Q=0110 time = ns Q=1110 time = ns Q=1010 time = ns Q=0010 time = ns Q=0011 time = ns Q=1011 time = ns Q=1111 time = ns Q=0111 time = ns Q=0101 time = ns Q=1101 time = ns Q=1001 time = ns Q=0001 time = ns Q=0000 Simulation Output for a Gray Code Sequencer net -vsm "D:\designs\ sequencers\gray_code4.vsm" clock clock 1 0 stepsize 500ns vector q q_3 q_2 q_1 q_0 radix bin q watch q l reset_n cycle 8 h reset_n cycle 32

MAPLDSynthesis Issues Simulation Output for a Gray Code Sequencer

MAPLDSynthesis Issues Synthesizer Output for a Gray Code Sequencer Outputs are not always driven by a flip-flop

MAPLDSynthesis Issues Synplicity 1 Synthesis Issues Synthesizer ignored the command to make the state machine a Gray code and decided to make it a one-hot machine. Had to “fiddle” with the VHDL compiler settings for default FSM. – Signal IQ : States; – Attribute syn_encoding of IQ : signal is "gray"; Output glitches!!!!!!!! 1 Synplify version 5.1.5

MAPLDSynthesis Issues FSM Gray Codes and HDL The Saga Continues... We had another engineer (HDL specialist) run the same Gray coded FSM through his version of Synplicity and what did he get … … Yes, as the cynic would expect, a different answer!

MAPLDSynthesis Issues FSM Gray Codes and HDL The Saga Continues... Here's the key part of the output listing: Encoding state machine work.Gray_Code(rtl)- q_h.q[0:15] original code -> new code > > > 1000 … So far so good!

MAPLDSynthesis Issues FSM Gray Codes and HDL The Saga Continues... But then... Replicating q_h.q[3], fanout 13 segments 2 Replicating q_h.q[2], fanout 13 segments 2 Replicating q_h.q[1], fanout 12 segments 2 Replicating q_h.q[0], fanout 12 segments 2 Added 0 Buffers Added 4 Cells via replication Resource Usage Report of Gray_Code Sequential Cells: 8 of 1080 (1%) dfc1b: 8

MAPLDSynthesis Issues FSM Gray Codes and HDL The Saga Continues... Package Gray_Types Is Type States Is ( s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15); End Package Gray_Types; library IEEE; use IEEE.Std_Logic_1164.all; library Work; use Work.Gray_Types.all; library synplify; use synplify.attributes.all; entity Gray_Code is port ( Clock : in std_logic; Reset_N : in std_logic; Q : out States ); end entity Gray_Code; architecture RTL of Gray_Code is attribute syn_netlist_hierarchy of RTL : architecture is false; signal IQ : States; attribute syn_encoding of IQ : signal is "gray"; begin GC : process ( Clock, Reset_N ) begin if ( Reset_N = '0' ) then IQ <= s0; else if Rising_Edge ( Clock ) then case IQ is when s0 => IQ <= s1; when s1 => IQ <= s2; when s2 => IQ <= s3; when s3 => IQ <= s4; when s4 => IQ <= s5; when s5 => IQ <= s6; when s6 => IQ <= s7; when s7 => IQ <= s8; when s8 => IQ <= s9; when s9 => IQ <= s10; when s10 => IQ <= s11; when s11 => IQ <= s12; when s12 => IQ <= s13; when s13 => IQ <= s14; when s14 => IQ <= s15; when s15 => IQ <= s0; when others => IQ <= s0; end case; end if; end process GC; Q <= IQ; end architecture RTL; Synplicity VHDL Compiler, version 6.2.0

MAPLDSynthesis Issues FSM Gray Codes and HDL The Saga Continues... Automatic Flip-flop Replication

MAPLDSynthesis Issues 4-Bit Gray Code No Enumerations or FSM Optimization (1) library IEEE; use IEEE.Std_Logic_1164.all; entity graycntr_lookup is port ( Clk : in std_logic; Reset_N : in std_logic; Q : out std_logic_vector(3 downto 0)); end entity graycntr_lookup; architecture RTL of graycntr_lookup is signal IQ : std_logic_vector(3 downto 0); begin GC : process (Clk, Reset_N) begin if ( Reset_N = '0' ) then IQ <= "0000"; else if Rising_Edge ( Clk ) then case IQ is when "0000" => IQ <= "0001"; when "0001" => IQ <= "0011"; when "0011" => IQ <= "0010"; when "0010" => IQ <= "0110"; when "0110" => IQ <= "0111"; when "0111" => IQ <= "0101"; when "0101" => IQ <= "0100"; when "0100" => IQ <= "1100"; when "1100" => IQ <= "1101"; when "1101" => IQ <= "1111"; when "1111" => IQ <= "1110"; when "1110" => IQ <= "1010"; when "1010" => IQ <= "1011"; when "1011" => IQ <= "1001"; when "1001" => IQ <= "1000"; when "1000" => IQ <= "0000"; when others => IQ <= "0000"; end case; end if; end process GC; Q <= IQ; end architecture RTL; No enumerations Synplicity VHDL Compiler, version 6.2.0

MAPLDSynthesis Issues time = ns RESET_N=0 Q=0000 time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= time = ns RESET_N=1 Q= Bit Gray Code No Enumerations or FSM Optimization (1)

MAPLDSynthesis Issues 4-Bit Gray Code No Enumerations or FSM Optimization (1) Flip-flop outputs routed directly to outputs.

MAPLDSynthesis Issues References “Origins of the Binary Code,” F. G. Hearth, Scientific American, August 1972, pp