EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10.

Slides:



Advertisements
Similar presentations
Digital System Design-II (CSEB312)
Advertisements

VERILOG: Synthesis - Combinational Logic Combination logic function can be expressed as: logic_output(t) = f(logic_inputs(t)) Rules Avoid technology dependent.
Counters Discussion D8.3.
CDA 3100 Recitation Week 11.
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Sequential Logic in Verilog
Synchronous Sequential Logic
Combinational Logic.
Table 7.1 Verilog Operators.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
Verilog. 2 Behavioral Description initial:  is executed once at the beginning. always:  is repeated until the end of simulation.
ECE 551 Digital System Design & Synthesis Lecture 08 The Synthesis Process Constraints and Design Rules High-Level Synthesis Options.
Slide 1 7. Verilog: Combinational always statements. VHDL: Combinational Processes: To avoid (I.E. DO NOT What in your HDL code?) Cases that generate Synthesis.
1 COMP541 Sequential Circuits Montek Singh Sep 17, 2014.
Useful Things to Know Norm. Administrative Midterm Grading Finished –Stats on course homepage –Pickup after this lab lec. –Regrade requests within 1wk.
Digital System Design by Verilog University of Maryland ENEE408C.
Verilog Sequential Circuits Ibrahim Korpeoglu. Verilog can be used to describe storage elements and sequential circuits as well. So far continuous assignment.
ELEN 468 Advanced Logic Design
Introduction to Counter in VHDL
ECE 2372 Modern Digital System Design
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
ECE 551 Digital System Design & Synthesis Fall 2011 Midterm Exam Overview.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Slide 1 6. VHDL/Verilog Behavioral Description. Slide 2 Verilog for Synthesis: Behavioral description Instead of instantiating components, describe them.
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
Verilog for Synthesis Ing. Pullini Antonio
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
3/4/20031 ECE 551: Digital System Design * & Synthesis Lecture Set 3 3.1: Verilog - User-Defined Primitives (UDPs) (In separate file) 3.2: Verilog – Operators,
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
Verilog A Hardware Description Language (HDL ) is a machine readable and human readable language for describing hardware. Verilog and VHDL are HDLs.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Introduction to ASIC flow and Verilog HDL
COMP541 Sequential Circuits
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 99-1 Under-Graduate Project Design of Datapath Controllers Speaker: Shao-Wei Feng Adviser:
1 Modeling Synchronous Logic Circuits Debdeep Mukhopadhyay Associate Professor Dept of Computer Science and Engineering NYU Shanghai and IIT Kharagpur.
EMT 351/4 DIGITAL IC DESIGN Verilog Behavioral Modeling  Finite State Machine -Moore & Mealy Machine -State Encoding Techniques.
Pusat Pengajian Kejuruteraan Mikroelektronik EMT 351/4 DIGITAL IC DESIGN Verilog Behavioural Modeling (Part 4) Week #
Structural Description
Overview Logistics Last lecture Today HW5 due today
Hardware Description Languages: Verilog
Lecture 10 Flip-Flops/Latches
Verilog Tutorial Fall
Supplement on Verilog FF circuit examples
Class Exercise 1B.
Figure 8.1. The general form of a sequential circuit.
Last Lecture Talked about combinational logic always statements. e.g.,
ELEN 468 Advanced Logic Design
Reg and Wire:.
Problems with “Inferred Latches” in Verilog
‘if-else’ & ‘case’ Statements
Learning Outcome By the end of this chapter, students are expected to be able to: Design State Machine Write Verilog State Machine by Boolean Algebra and.
Part III A workshop by Dr. Junaid Ahmed Zubairi
Hardware Description Languages: Verilog
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Field Programmable Gate Array
Field Programmable Gate Array
Field Programmable Gate Array
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
Lecture Part A Combinational Logic Design & Flip Flop
SYNTHESIS OF SEQUENTIAL LOGIC
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
332:437 Lecture 8 Verilog and Finite State Machines
COE 202 Introduction to Verilog
The Verilog Hardware Description Language
Dr. Tassadaq Hussain Introduction to Verilog – Part-3 Expressing Sequential Circuits and FSM.
The Verilog Hardware Description Language
ECE 551: Digital System Design & Synthesis
332:437 Lecture 8 Verilog and Finite State Machines
Sequntial-Circuit Building Blocks
Presentation transcript:

EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10

Contents Introduction Coding Styles of Sequential Synthesis Latch Models Flip-flop Models Memory Initialization General Sequential Circuit Synthesis

Introduction The target library used in synthesis has combinational and sequential components The target library will control the translation of a synthesizable Verilog code to hardware Example: If a description involves a latch and the target library does not have a latch, a latch will be built using gates or logic functions that available in the target library

Coding Styles of Sequential Synthesis Several typical styles of coding that will be discussed on what kind of hardware that they synthesized to: Latch models Flip-flop models Memory initialization General sequential circuit synthesis

Latch Models Level-sensitive (latched) behavior is characterized by an output which affected by input only while a control signal is asserted At other times, the input is ignored and the output remains its residual value Latches also inferred by the synthesis tool when it detects an incomplete ‘if’ / ‘case’ statement in a behavior

Example: Unwanted latch Synthesis result Incomplete statement based on 3 inputs Latch results from incomplete case statement Synthesis result

Latch Models Note: Use the right side code as an example Consider that the D-type latch is implemented on FPGA If the target library contains D-latch, it will be used to map the description, otherwise it will be built by wiring available target library hardware parts module latch (d, c, q, q_b) input d, c; output q, q_b; reg q, q_b; always@(c or d) if (c) begin q = d; q_b = ~d; end endmodule A D-type Latch

Representation of D-latch realization on Altera FPGA Latch Models (Cont..) LUT Flip-flop Logic gates Representation of D-latch realization on Altera FPGA (highlighted in gray)

Latch Models (Cont..) The FPGA consists of several logic gates, a look-up table (LUT), & a flip-flop (FF) The gray areas are parts of logic elements (LE) are used to implement the latch Implemented using programmed LUT Note that the FF (rectangular box on the right) is not used in this design

Flip-flop Models Register variable will be synthesized as the output of a flip-flop when its value is assigned synchronously with the edge of a signal If the event control expression is sensitive to the edge of more than one signal, an ‘if’ statement must be the first statement in the behavior The control signal (reset or set) must be declared explicitly in the branches of the ‘if’ statement (e.g. decode the reset condition first), whereas the synchronizing signal declared implicitly in the branches

Both red boxes cases generates the same synthesis product module jk_flop_1 (j, k, clock, rst, q, qb); input j, k, clock, rst; output q, qb; reg q; assign qb = ~q; always @ (posedge rst or posedge clock) begin if (rst == 1'b1) q = 1'b0; else // rst first if (j == 1'b0 && k == 1'b0) q = q; else if (j == 1'b0 && k == 1'b1) q = 1'b0; else if (j == 1'b1 && k == 1'b0) q = 1'b1; else if (j == 1'b1 && k == 1'b1) q = ~q; end endmodule Example: J-K Flip Flop case {j, k} 2'b00: q = q; 2'b01: q = 1'b0; 2'b10: q = 1'b1; 2'b11: q = ~q; Both red boxes cases generates the same synthesis product Synthesis result

Flip-flop Models (Cont..) Note: Use the right side code as an example Consider that this synthesizable code is implemented onto an FPGA If the FPGA FF does not meet the required behaviour, the logic around the FF would be used to realize the correct behaviour module latch (d, clk, q, q_b) input d, clk; output q, q_b; reg q, q_b; always@(posedge clk) begin q = d; q_b = ~d; end endmodule Positive-edge triggered DFF

Flip-flop Models (Cont..) The implementation of D-FF with synchronous reset on Altera FPGA (highlighted in gray)

Flip-flop Models (Cont..) Based on Figure A, the FF of the LE has asynchronous preset and clear inputs, & will be utilized if the input of the Verilog code required them However, if a synchronous control is required, the logic in FPGA’s LE i.e. LUT will be used (shown in Figure B)

Flip-flop Models (Cont..) The implementation of D-FF with asynchronous reset on Altera FPGA (highlighted in gray)

Memory Initialization Remember: ‘initial’ statements & memory initialization tasks are not synthesizable Most synthesis tool provide a mechanism for specifying ROM-based logic Example: Altera’s Quartus offers a memory block & its initialization file can be specified outside a Verilog module (separated)  this memory is directly mapped to the FPGA memory

Memory Initialization module gray_counter (d_in, clk, rst, ld, q); input [3:0] d_in; input clk, rst, ld; output q; reg [3:0] q, im_q; initial $readmemb (“mem.dat”, mem); always@(d_in or ld) begin if (ld) im_q = d_in; else im_q = mem[q]; end always@(posedge clk) if (rst) q <= 4’b0000; else q <= im_q; endmodule Example: Gary Code Counter Not synthesizable memory initialization Put memory file separately outside the module

General Sequential Circuit Synthesis Sequential circuit consist of combinational & register part For combinational part synthesis, must follow the rules for combinational logic synthesis For register parts, clocking rules & rules regarding to synchronous & asynchronous controls must be observed Individual bits of register parts in sequential circuit should refer to FF synthesis END