Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.

Slides:



Advertisements
Similar presentations
28/10/2007DSD,USIT,GGSIPU1 Latch & Register Inference.
Advertisements

History TTL-logic PAL (Programmable Array Logic)
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)
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Integer Square Root.
Simple Sequential Circuits in VHDL. Contents Sequential circuit examples: - SR latch in dataflow style - D flip-flop in behavioral style - shift register.
Counters Discussion D5.3 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
CSCI 660 EEGN-CSCI 660 Introduction to VLSI Design Lecture 3 Khurram Kazi Some of the slides were taken from K Gaj ’ s lecture slides from GMU ’ s 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.
Lab 3 & 4 Discussion EE414/514 VHDL Design September 25.
Shift Registers Discussion D5.2 Example Bit Shift Register qs(3) qs(2) qs(1) qs(0) if rising_edge(CLK) then for i in 0 to 2 loop s(i) := s(i+1);
Random-Access Memory Distributed and Block RAM Discussion D10.3 Example 41.
Lecture #5 In this lecture we will introduce the sequential circuits.
PS/2 Mouse/Keyboard Port Discussion D7.2. PS/2 Port.
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
1 Part V: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
1 Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
Graduate Computer Architecture I VHDL Structure and Testing Michael Sorensen.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
Active-HDL Interfaces Building VHPI Applications C Compilation Course 9.
1 Sequential Logic Lecture #7. 모바일컴퓨팅특강 2 강의순서 Latch FlipFlop Shift Register Counter.
ENG241 Digital Design Week #8 Registers and Counters.
Fall 08, Oct 31ELEC Lecture 8 (Updated) 1 Lecture 8: Design, Simulation Synthesis and Test Tools ELEC 2200: Digital Logic Circuits Nitin Yogi
George Mason University ECE 545 – Introduction to VHDL Variables, Functions, Memory, File I/O ECE 545 Lecture 7.
1 ECE 545 – Introduction to VHDL Dataflow Modeling of Combinational Logic Simple Testbenches ECE 656. Lecture 2.
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.
CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis Aleksandar Milenkovic
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
L19 – Resolved Signals. Resolved Signals  What are resolved signals In systems In VHDL Resolution – Isn’t that for resolving conflicts?  Ref: text Unit.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
George Mason University Controllers for Keccak_F and AES ECE 545 Lecture 11 Addendum.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
11 EENG 1920 Introduction to VHDL. 22 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VHDL Coding for Synthesis ECE 448 Lecture 12.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
Figure 9.1 Architecture of a Simple Computer System.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Lecture 11 Xilinx FPGA Memories Part 2
EGRE 6311 LHO 04 - Subprograms, Packages, and Libraries EGRE 631 1/26/09.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Combinational logic circuit
Registers and Counters
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Part IV: VHDL CODING.
ECE 4110–5110 Digital System Design
Cryptol aided formal verification of VHDL code
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Software Environment ISE 5.x Interaction with simple LCDs
VHDL (VHSIC Hardware Description Language)
Lecture #5 In this lecture we will introduce the sequential circuits.
Behavioral Modeling of Sequential-Circuit Building Blocks
Founded in Silicon Valley in 1984
Sequntial-Circuit Building Blocks
Figure 8.1. The general form of a sequential circuit.
Sequntial-Circuit Building Blocks
High-Low Guessing Game
(Sequential-Circuit Building Blocks)
Presentation transcript:

Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal

This schematic, which has already been considered in previous tutorials will be used to illustrate various simulation modes The block fsm_data will be verified with the aid of different simulation techniques 1 means YES S 0...S 7 Data can be entered from DIP switchers and the result can be displayed on LCD. Thus, the circuit can be not only verified in simulator but can also be tested in FPGA

This block permits to check if an 8-bit vector has 3 or more successive ones 1 0 S 0...S = x”A7” contains 3 successive ones 1 means YES 1 it means YES it contains at least 3 successive ones library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity fsm_data is Port ( rin : in std_logic_vector(7 downto 0); result : out std_logic_vector(3 downto 0); reset : in std_logic; clk : in std_logic); end fsm_data; Just one less-significant bit of the result is used. This was done to avoid changes in the remaining circuit that is also used for other examples that require all 4 bits of the result 0-NO 1-YES

architecture Behavioral of fsm_data is type STATE_TYPE is (start, one_one, two_ones, three_ones); signal CS, NS: STATE_TYPE; signal tmp : std_logic; signal index : integer range 0 to 8; begin process (clk,reset) begin if reset='1' then CS <= start; elsif (clk'event and clk = '1') then CS <= NS; end if; end process; Current State of FSM Next State of FSM 1 0 S 0...S 7 extra index temporary value for the result (either 1 – YES or 0 - NO)

process (CS,rin,index) begin if index = 8 then NS <= start; else case CS is when start => tmp <= '0'; if (rin(index) = '1') then NS <= one_one; else NS <= start; end if; when one_one => if (rin(index) = '1') then NS <= two_ones; else NS <= start; end if; when two_ones => if (rin(index) = '1') then NS <= three_ones; else NS <= start; end if; when three_ones => tmp <= '1'; if index = 0 then NS <= start; else NS <= three_ones; end if; end case; end if; end process; one_one two_ones start index = 0, i.e. start from the beginning three_ones There are 3 successive ones

process (clk,reset) begin if (reset='1') then index <= 0; result '0'); elsif falling_edge(clk) then if index = 7 then result <= "000" & tmp; end if; if index = 8 then index <= 0; else index <= index+1; end if; end process; end Behavioral; 1 0 S 0...S storing the result skipping one clock cycle for resynchronization between FSM and process (rising edge) end this process (falling edge) Just the less significant bit might be changed

right mouse button click right mouse button click

19 Set 1 and 0 with the aid of mouse (click left mouse button) left mouse button double click 9D 16 =

1 2 left mouse button double click 3

period The Input setup time defines when inputs must be valid The Output valid delay defines the time after active clock edge when the outputs must be valid

library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity VHDL_test is Port ( data_in : in std_logic_vector(7 downto 0); data_out : out std_logic_vector(3 downto 0); index_out: out std_logic_vector(3 downto 0)); end VHDL_test; architecture Behavioral of VHDL_test is function parity (input : std_logic_vector)return std_logic is variable temp : std_logic := '0'; begin for i in input'range loop temp := temp xor input(i); end loop; return temp; end parity; begin data_out <= "000" & parity(data_in); end Behavioral;

12

4 Workspace 1 325

library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity shift_r is Port ( CLK: in STD_LOGIC; RESET : in STD_LOGIC; DIN: in STD_LOGIC; DOUT: out STD_LOGIC_VECTOR(3 downto 0)); end shift_r; architecture Behavioral of shift_r is signal REG: STD_LOGIC_VECTOR(3 downto 0); begin process (CLK,RESET) begin if reset = '1' then REG '0'); elsif CLK'event and CLK='1' then REG <= DIN & REG(3 downto 1); end if; DOUT <= REG; end process; end Behavioral; BIT2BIT3BIT1BIT0 CLK RESET DIN DOUT

6 7 8 right mouse button click 9 the compiled design unit 10 left mouse button double click

15 left mouse button double click 16 17

Run Restart Run Continue Run Run All Break

see slides 2-6 This can be done just in ModelSim environment, i.e. without Xilinx ISE 5.x

Double click left mouse button to load the design

Main Window Workspace Transcript (command line) Dataflow window The Dataflow window allows to explore the "physical" connectivity of the design. It displays processes and signals, nets, and registers. Process window displays a list of processes Signals window The left pane shows the names of HDL items. The left pane shows the values of the associated HDL items at the end of the current run Source window The Source window allows to view and edit HDL source code Variables window Wave window allows to view the results of simulation.

force clk 0 0, repeat force reset 1 0, force rin rin = clk reset

The value of rin specified in the file stimulus current state (CS)next state (NS) After one iteration (index is changed from 0 to 8) the result is equal to 1 (YES) reset clock tmp keeps intermediate result

left mouse button click break can be set only for blue numbers click left mouse button to disable (to enable break point)

To delete the breakpoint or to change its options, click the line number with the right mouse button 43 breakpoint step 44 Step inserting a cursor deleting a cursor

The first cursor The second cursor Time between the cursors Point to a wave with the mouse in order to see the value Point to a wave with the mouse in order to see the value find previous transition find next transition

Zoom with mouse specifying zoom area

to quit simulation to quit ModelSim

list window shows all changes of signals step by step You can use list window much like wave window this vector contains 5 values “1” compare this two pictures