Generic constants Generate statements. Generic constant declaration entity identifier is [generic (generic_interface_list);] [port (port_interface_list);

Slides:



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

28/10/2007DSD,USIT,GGSIPU1 Latch & Register Inference.
History TTL-logic PAL (Programmable Array Logic)
Arbitrary Waveform Discussion 5.5 Example 34.
Multiplexer as a Universal Element Discussion D2.6 Example 9.
Latches and Flip-Flops
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)
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Single-Cycle Instructions VHDL Tutorial R. E. Haskell and D. M. Hanna T5: VHDL ROM.
FPGAs and VHDL Lecture L12.1. FPGAs and VHDL Field Programmable Gate Arrays (FPGAs) VHDL –2 x 1 MUX –4 x 1 MUX –An Adder –Binary-to-BCD Converter –A 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.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
Topics of Lecture Structural Model Procedures Functions Overloading.
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.
FPGAs and VHDL Lecture L13.1 Sections 13.1 – 13.3.
Latches and Flip-Flops Discussion D4.1 Appendix J.
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.
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);
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
1 Part V: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
DSD,USIT,GGSIPU1 Entity declaration –describes the input/output ports of a module entity reg4 is port ( d0, d1, d2, d3, en, clk : in std_logic; q0, q1,
Graduate Computer Architecture I VHDL Structure and Testing Michael Sorensen.
ENG6090 RCS1 ENG6090 Reconfigurable Computing Systems Hardware Description Languages Part 5: Modeling Structure.
The Xilinx Spartan-3E FPGA family. Field Programmable Gate Array (FPGA) Configurable Logic Block (CLB) –Look-up table (LUT) –Register –Logic circuit Adder.
7/10/2007DSD,USIT,GGSIPU1 Basic concept of Sequential Design.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
George Mason University Modeling of Circuits with a Regular Structure Aliases, Attributes, Packages Mixing Design Styles ECE 545 Lecture 7.
VHDL for Combinational Circuits. VHDL We Know Simple assignment statements –f
Main Project : Simple Processor Mini-Project : 3-bit binary counter (using 7400 series) Memory By Oluwayomi B. Adamo.
George Mason University ECE 545 – Introduction to VHDL Variables, Functions, Memory, File I/O ECE 545 Lecture 7.
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.
Generate Statements Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Mixed Style RTL Modeling
Generate Statement A generate statement provides a mechanism for iterative or conditional elaboration of a portion of description. The iterative elaboration.
15-Dec-15EE5141 Chapter 4 Sequential Statements ä Variable assignment statement ä Signal assignment statement ä If statement ä Case statement ä Loop statement.
1 Introduction to VHDL Part 2 Fall We will use Std_logic And, Or have same precedence See slide 8 of part 1.
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
Data Storage VHDL ET062G & ET063G Lecture 4 Najeem Lawal 2012.
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.
ASIC 120: Digital Systems and Standard-Cell ASIC Design Tutorial 3: Intermediate VHDL November 9, 2005.
VHDL Programming Fundamentals Presented By Dr. Pradyut Kumar Biswal Department of Electronics, IIIT Bhubaneswar.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
Subprograms Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
(1) Modeling Structure © Sudhakar Yalamanchili, Georgia Institute of Technology, 2006.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Sequential statements (1) process
Main Project : Simple Processor Mini-Project : Vending Machine Memory
Figure 7.1 Control of an alarm system
Hardware Description Languages
Modeling of Circuits with a Regular Structure
Fibonacci Sequence Lecture L4.1 Lab 3.
Behavioral Modeling of Sequential-Circuit Building Blocks
Modeling of Circuits with a Regular Structure
Modeling of Circuits with Regular Structure
Sequntial-Circuit Building Blocks
High-Low Guessing Game
4-Input Gates VHDL for Loops
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
Digital Logic with VHDL
(Sequential-Circuit Building Blocks)
Presentation transcript:

Generic constants Generate statements

Generic constant declaration entity identifier is [generic (generic_interface_list);] [port (port_interface_list); end [entity] [identifier];

Generic constant example entity myand2 is generic ( Tpd : time ); port ( a, b : in bit; y : out bit ); end entity myand2; architecture simple of myand2 is begin and2_function : y <= a and b after Tpd; end architecture simple; gate1 : myand2 generic map ( Tpd => 2 ns ) port map ( a => sig1, b => sig2, y => sig_out ); gate2 : myand2 generic map ( Tpd => 3 ns ) port map ( a => a1, b => b1, y => sig1 );

Generic constant example entity D_flipflop is generic ( Tpd_clk_q, Tsu_d_clk, Th_d_clk : delay_length ); port ( clk, d : in bit; q : out bit ); end entity D_flipflop; architecture basic of D_flipflop is begin behavior : q <= d after Tpd_clk_q when clk = '1' and clk'event; check_setup : process is begin wait until clk = '1'; assert d'last_event >= Tsu_d_clk report "setup violation"; end process check_setup; check_hold : process is begin wait until clk'delayed(Th_d_clk) = '1'; assert d'delayed'last_event >= Th_d_clk report "hold violation"; end process check_hold; end architecture basic; entity fg_12_02 is end entity fg_12_02; architecture test of fg_12_02 is signal system_clock, request, request_pending : bit := '0'; begin request_flipflop : D_flipflop generic map ( Tpd_clk_q => 4 ns, Tsu_d_clk => 3 ns, Th_d_clk => 1 ns ) port map ( clk => system_clock, d => request, q => request_pending); clock_gen : system_clock <= '1' after 10 ns, '0' after 20 ns when system_clock = '0'; stimulus : request <= '1' after 25 ns, '0' after 35 ns, '1' after 67 ns, '0' after 71 ns, '1' after 108 ns, '0' after ns; end architecture test;

Parametrizing structure entity reg is generic(width : positive); port(d : in bit_vector(0 to width-1); q : out bit_vector(0 to width-1); clk, reset : in bit); end entity reg; architecture behavioral of reg is begin behavior : process (clk, reset) is constant zero : bit_vector(0 to width-1) := (others => '0'); begin if reset = '1' then q <= zero; elsif clk'event and clk = '1' then q <= d; end if; end process behavior; end architecture behavioral; subtype state_vector is bit_vector(1 to 5); signal clk, reset : bit := '0'; signal word_in, word_out : bit_vector(0 to 31); signal state_in, state_out : state_vector; begin word_reg : reg generic map ( width => 32 ) port map (d => word_in, q => word_out, clk => clk, reset => reset); state_reg : reg generic map ( width => state_vector'length ) port map (d => state_in, q => state_out, clk => clk, reset => reset );

Generate statements generate_label: for identifier in discrete_range generate [{block_declarative_item} begin] {concurrent_statement} end generate [generate_label]

Example library ieee; use ieee.std_logic_1164.all; entity register_tristate is generic ( width : positive ); port ( clock : in std_logic; out_enable : in std_logic; data_in : in std_logic_vector(0 to width - 1); data_out : out std_logic_vector(0 to width - 1) ); end entity register_tristate; architecture cell_level of register_tristate is component D_flipflop is port ( clk : in std_logic; d : in std_logic; q : out std_logic ); end component D_flipflop; component tristate_buffer is port ( a : in std_logic; en : in std_logic; y : out std_logic ); end component tristate_buffer; begin cell_array : for bit_index in 0 to width - 1 generate signal data_unbuffered : std_logic; begin cell_storage : D_flipflop port map(clk => clock, d => data_in(bit_index), q => data_unbuffered); cell_buffer : tristate_buffer port map(a => data_unbuffered, en => out_enable, y => data_out(bit_index)); end generate cell_array; end architecture cell_level;

Example architecture behavioral of graphics_engine is type point is array (1 to 3) of real; type transformation_matrix is array (1 to 3, 1 to 3) of real; signal p, transformed_p : point; signal a : transformation_matrix; signal clock : bit; begin transform_stage : for i in 1 to 3 generate begin cross_product_transform : process is variable result1, result2, result3 : real := 0.0; begin wait until clock = '1'; transformed_p(i) <= result3; result3 := result2; result2 := result1; result1 := a(i,1) * p(1) + a(i,2) * p(2) + a(i,3) * p(3); end process cross_product_transform; end generate transform_stage; other stages in the pipeline, etc

Conditional generate generate_label: if boolean_expression generate [{block_declarative_item} begin] {concurrent_statement} end generate [generate_label]

Example library ieee; use ieee.std_logic_1164.all; entity shift_reg is port ( phi1, phi2 : in std_logic; serial_data_in : in std_logic; parallel_data : inout std_logic_vector ); end entity shift_reg; architecture cell_level of shift_reg is alias normalized_parallel_data : std_logic_vector(0 to parallel_data'length - 1) is parallel_data; component master_slave_flipflop is port ( phi1, phi2 : in std_logic; d : in std_logic; q : out std_logic ); end component master_slave_flipflop; begin reg_array : for index in normalized_parallel_data'range generate begin first_cell : if index = 0 generate begin cell : master_slave_flipflop port map ( phi1, phi2, d => serial_data_in, q => normalized_parallel_data(index) ); end generate first_cell; other_cell : if index /= 0 generate begin cell : master_slave_flipflop port map ( phi1, phi2, d => normalized_parallel_data(index - 1), q => normalized_parallel_data(index) ); end generate other_cell; end generate reg_array; end architecture cell_level;