content
stringlengths
1
1.04M
architecture RTL of FIFO is begin process begin if a = '1' then b <= '0'; elsif c = '1' then b <= '1'; ELSE if x = '1' then z <= '0'; elsif x = '0' then z <= '1'; ELSE z <= 'Z'; end if; end if; -- Violations below if a = '1' then b <= '0'; elsif c = '1' then b <= '1'; ELSE if x = '1' then z <= '0'; elsif x = '0' then z <= '1'; ELSE z <= 'Z'; end if; end if; end process; end architecture RTL;
-- ------------------------------------------------------------- -- -- Entity Declaration for inst_ec_e -- -- Generated -- by: wig -- on: Wed Jun 7 17:05:33 2006 -- cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl -nodelta -bak ../../bitsplice.xls -- -- !!! Do not edit this file! Autogenerated by MIX !!! -- $Author: wig $ -- $Id: inst_ec_e-e.vhd,v 1.2 2006/06/22 07:19:59 wig Exp $ -- $Date: 2006/06/22 07:19:59 $ -- $Log: inst_ec_e-e.vhd,v $ -- Revision 1.2 2006/06/22 07:19:59 wig -- Updated testcases and extended MixTest.pl to also verify number of created files. -- -- -- Based on Mix Entity Template built into RCSfile: MixWriter.pm,v -- Id: MixWriter.pm,v 1.89 2006/05/23 06:48:05 wig Exp -- -- Generator: mix_0.pl Version: Revision: 1.45 , [email protected] -- (C) 2003,2005 Micronas GmbH -- -- -------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; -- No project specific VHDL libraries/enty -- -- -- Start of Generated Entity inst_ec_e -- entity inst_ec_e is -- Generics: -- No Generated Generics for Entity inst_ec_e -- Generated Port Declaration: port( -- Generated Port for Entity inst_ec_e p_mix_v_select_2_2_gi : in std_ulogic; p_mix_v_select_5_5_gi : in std_ulogic; p_mix_c_addr_12_0_gi : in std_ulogic_vector(12 downto 0); p_mix_c_bus_in_31_0_gi : in std_ulogic_vector(31 downto 0) -- End of Generated Port for Entity inst_ec_e ); end inst_ec_e; -- -- End of Generated Entity inst_ec_e -- -- --!End of Entity/ies -- --------------------------------------------------------------
------------------------------------------------------------------------------- -- Title : Top Level Test Bench -- Project : fpga_logic_analyzer ------------------------------------------------------------------------------- -- File : tb_top.vhd -- Created : 2016-02-22 -- Last update: 2016-02-22 -- Standard : VHDL'08 ------------------------------------------------------------------------------- -- Description: Testbench for la_top ------------------------------------------------------------------------------- -- Copyright (c) 2016 Ashton Johnson, Paul Henny, Ian Swepston, David Hurt ------------------------------------------------------------------------------- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License along -- with this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ------------------------------------------------------------------------------- -- Revisions : -- Date Version Author Description -- 2016-02-22 0.1 henny Created UART Transmitter ------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity tb_top is end tb_top; architecture behav of tb_top is signal clk : std_logic := '0'; signal rst : std_logic; signal logic_in : std_logic_vector(31 downto 0) := x"deadbeef"; signal msg_finish : std_logic; signal poll_count : integer; signal poll_enable : std_logic; signal poll_start : std_logic; signal uart_rx : std_logic := '1'; signal uart_tx : std_logic := '1'; constant BAUD_DIVIDER : integer := 100; -- Data type type slv8_arr is array (natural range <>) of std_logic_vector(7 downto 0); type cmd_record is record mess : slv8_arr(0 to 4); length : integer range 0 to 5; end record cmd_record; begin -- LA Top instance la_top_inst : entity work.la_top port map ( clk => clk, rst => rst, --data input. default to zeros so you don't have to hook all 32 lines up. din(31 downto 0) => logic_in, --UART INTERFACES uart_rx => uart_rx, -- UART Receive Data uart_tx => uart_tx); -- UART Transmit Data clk_proc : process variable counter: natural range 0 to 256; begin clk <= '0'; wait for 5ns; loop wait for 5ns; clk <= '1'; wait for 5ns; clk <= '0'; counter:=(counter+1) mod 256; logic_in<=std_logic_vector(to_unsigned(counter,32)); end loop; end process clk_proc; ------------------------------------------------------- -- Baudrate Generator ------------------------------------------------------- output_bl : block is signal baud_counter : integer; signal baud_enable : std_logic; constant c_reset : cmd_record := ((x"00", others => x"00"), 1); constant c_run : cmd_record := ((x"01", others => x"00"), 1); constant c_test_byte : cmd_record := ((x"A5", others => x"00"), 1); constant c_trig_mask : cmd_record := ((x"C0", x"0C", x"00", x"00", x"00", others => x"00"), 5); constant c_trig_val : cmd_record := ((x"C1", x"07", x"00", x"00", x"00", others => x"00"), 5); constant c_read_cnt : cmd_record := ((x"81", x"04", x"00", x"04", x"00", others => x"00"), 5); constant c_set_divide : cmd_record := ((x"80", x"08", x"00", x"00", x"00", others => x"00"), 5); signal resp_to_send : cmd_record; begin baudrate_p : process(clk) is begin if rising_edge(clk) then if rst='1' then baud_enable <= '0'; baud_counter <= BAUD_DIVIDER-1; else if baud_counter=0 then baud_enable <= '1'; baud_counter <= BAUD_DIVIDER-1; else baud_counter <= baud_counter - 1; baud_enable <= '0'; end if; end if; end if; end process baudrate_p; --------------------------------------------------------------- -- Rx Control Block --------------------------------------------------------------- status_out_p : process(clk) is variable count : integer range -1 to 9; variable byte_count : integer; variable resp_count : integer; begin if rising_edge(clk) then if rst='1' then count := 8; byte_count := 0; uart_rx <= '1'; resp_count := 0; msg_finish <= '1'; else -- Where you control what messages are sent case resp_count is when 0 => resp_to_send <= c_reset; when 1 => resp_to_send <= c_trig_mask; when 2 => resp_to_send <= c_trig_val; when 3 => resp_to_send <= c_read_cnt; when 4 => resp_to_send <= c_set_divide; when 5 => resp_to_send <= c_run; when 6 => resp_to_send <= c_trig_mask; when 7 => resp_to_send <= c_reset; when 8 => resp_to_send <= c_reset; when others => end case; if msg_finish='0' then if baud_enable='1' then if count=8 then uart_rx <= '0'; elsif count=-1 then uart_rx <= '1'; byte_count := byte_count + 1; count := 9; if byte_count=resp_to_send.length then byte_count := 0; resp_count := resp_count+1; msg_finish <= '1'; end if; else uart_rx <= resp_to_send.mess(byte_count)(7-count); end if; count := count-1; end if; else poll_start <= '1'; if poll_enable='1' then poll_start <= '0'; msg_finish <= '0'; end if; end if; end if; end if; end process status_out_p; end block output_bl; --------------------------------------------------------------- -- How often commands are sent to the LA --------------------------------------------------------------- polling_p : process(clk) is constant poll_max : integer := 100; begin if rising_edge(clk) then if rst='1' then poll_enable <= '0'; poll_count <= poll_max; else if poll_start='1' then if poll_count=0 then poll_enable <= '1'; poll_count <= poll_max; else poll_enable <= '0'; poll_count <= poll_count - 1; end if; else poll_enable <= '0'; poll_count <= poll_max; end if; end if; end if; end process polling_p; --------------------------------------------------------------- -- Main Control of Testbench --------------------------------------------------------------- main_p : process begin rst <= '1'; wait for 20ns; rst <= '0'; wait; end process main_p; end architecture behav;
-- Copyright 1986-2018 Xilinx, Inc. All Rights Reserved. -- -------------------------------------------------------------------------------- -- Tool Version: Vivado v.2018.2 (win64) Build 2258646 Thu Jun 14 20:03:12 MDT 2018 -- Date : Sun Sep 22 03:32:35 2019 -- Host : varun-laptop running 64-bit Service Pack 1 (build 7601) -- Command : write_vhdl -force -mode synth_stub -- d:/github/Digital-Hardware-Modelling/xilinx-vivado/gcd/gcd.srcs/sources_1/bd/gcd_block_design/ip/gcd_block_design_rst_ps7_0_100M_0/gcd_block_design_rst_ps7_0_100M_0_stub.vhdl -- Design : gcd_block_design_rst_ps7_0_100M_0 -- Purpose : Stub declaration of top-level module interface -- Device : xc7z010clg400-1 -- -------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity gcd_block_design_rst_ps7_0_100M_0 is Port ( slowest_sync_clk : in STD_LOGIC; ext_reset_in : in STD_LOGIC; aux_reset_in : in STD_LOGIC; mb_debug_sys_rst : in STD_LOGIC; dcm_locked : in STD_LOGIC; mb_reset : out STD_LOGIC; bus_struct_reset : out STD_LOGIC_VECTOR ( 0 to 0 ); peripheral_reset : out STD_LOGIC_VECTOR ( 0 to 0 ); interconnect_aresetn : out STD_LOGIC_VECTOR ( 0 to 0 ); peripheral_aresetn : out STD_LOGIC_VECTOR ( 0 to 0 ) ); end gcd_block_design_rst_ps7_0_100M_0; architecture stub of gcd_block_design_rst_ps7_0_100M_0 is attribute syn_black_box : boolean; attribute black_box_pad_pin : string; attribute syn_black_box of stub : architecture is true; attribute black_box_pad_pin of stub : architecture is "slowest_sync_clk,ext_reset_in,aux_reset_in,mb_debug_sys_rst,dcm_locked,mb_reset,bus_struct_reset[0:0],peripheral_reset[0:0],interconnect_aresetn[0:0],peripheral_aresetn[0:0]"; attribute x_core_info : string; attribute x_core_info of stub : architecture is "proc_sys_reset,Vivado 2018.2"; begin end;
---------------------------------------------------------------------------- --! @file --! @copyright Copyright 2015 GNSS Sensor Ltd. All right reserved. --! @author Sergey Khabarov --! @brief Gigabits buffer with the differential signals. ---------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; library unisim; use unisim.vcomponents.all; entity igdsbuf_virtex6 is generic ( generic_tech : integer := 0 ); port ( gclk_p : in std_logic; gclk_n : in std_logic; o_clk : out std_logic ); end; architecture rtl of igdsbuf_virtex6 is begin x1 : IBUFDS_GTXE1 port map ( I => gclk_p, IB => gclk_n, CEB => '0', O => o_clk, ODIV2 => open ); end;
---------------------------------------------------------------------------- --! @file --! @copyright Copyright 2015 GNSS Sensor Ltd. All right reserved. --! @author Sergey Khabarov --! @brief Gigabits buffer with the differential signals. ---------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; library unisim; use unisim.vcomponents.all; entity igdsbuf_virtex6 is generic ( generic_tech : integer := 0 ); port ( gclk_p : in std_logic; gclk_n : in std_logic; o_clk : out std_logic ); end; architecture rtl of igdsbuf_virtex6 is begin x1 : IBUFDS_GTXE1 port map ( I => gclk_p, IB => gclk_n, CEB => '0', O => o_clk, ODIV2 => open ); end;
---------------------------------------------------------------------------- --! @file --! @copyright Copyright 2015 GNSS Sensor Ltd. All right reserved. --! @author Sergey Khabarov --! @brief Gigabits buffer with the differential signals. ---------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; library unisim; use unisim.vcomponents.all; entity igdsbuf_virtex6 is generic ( generic_tech : integer := 0 ); port ( gclk_p : in std_logic; gclk_n : in std_logic; o_clk : out std_logic ); end; architecture rtl of igdsbuf_virtex6 is begin x1 : IBUFDS_GTXE1 port map ( I => gclk_p, IB => gclk_n, CEB => '0', O => o_clk, ODIV2 => open ); end;
-- Copyright (C) 2014 Roland Dobai -- -- This file is part of ZyEHW. -- -- ZyEHW is free software: you can redistribute it and/or modify it under the -- terms of the GNU General Public License as published by the Free Software -- Foundation, either version 3 of the License, or (at your option) any later -- version. -- -- ZyEHW is distributed in the hope that it will be useful, but WITHOUT ANY -- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -- details. -- -- You should have received a copy of the GNU General Public License along -- with ZyEHW. If not, see <http://www.gnu.org/licenses/>. library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity ram_oen is generic ( AWIDTH: integer:= 4; DWIDTH: integer:= 8 ); port ( rdclk: in std_logic; rden: in std_logic; rdaddr: in std_logic_vector(AWIDTH-1 downto 0); oen: in std_logic; do: out std_logic_vector(DWIDTH-1 downto 0); wrclk: in std_logic; wren: in std_logic; wraddr: in std_logic_vector(AWIDTH-1 downto 0); di: in std_logic_vector(DWIDTH-1 downto 0) ); end ram_oen; architecture behav_ram of ram_oen is subtype data_t is std_logic_vector(DWIDTH-1 downto 0); type ram_t is array(0 to (2**AWIDTH)-1) of data_t; signal content: ram_t; signal do_reg: data_t; begin process (wrclk) begin if wrclk'event and wrclk = '1' then if wren = '1' then content(to_integer(unsigned(wraddr))) <= di; end if; end if; end process; process (rdclk) begin if rdclk'event and rdclk = '1' then if rden = '1' then do_reg <= content(to_integer(unsigned(rdaddr))); end if; if oen = '1' then do <= do_reg; end if; end if; end process; end behav_ram;
--***************************************************************************** -- (c) Copyright 2009 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- --***************************************************************************** -- ____ ____ -- / /\/ / -- /___/ \ / Vendor : Xilinx -- \ \ \/ Version : 3.5 -- \ \ Application : MIG -- / / Filename : memc3_wrapper.vhd -- /___/ /\ Date Last Modified : $Date: 2010/06/04 11:24:37 $ -- \ \ / \ Date Created : Jul 03 2009 -- \___\/\___\ -- --Device : Spartan-6 --Design Name : DDR/DDR2/DDR3/LPDDR --Purpose : This module instantiates mcb_raw_wrapper module. --Reference : --Revision History : --***************************************************************************** library ieee; use ieee.std_logic_1164.all; entity memc3_wrapper is generic ( C_MEMCLK_PERIOD : integer := 2500; C_P0_MASK_SIZE : integer := 4; C_P0_DATA_PORT_SIZE : integer := 32; C_P1_MASK_SIZE : integer := 4; C_P1_DATA_PORT_SIZE : integer := 32; C_ARB_NUM_TIME_SLOTS : integer := 12; C_ARB_TIME_SLOT_0 : bit_vector := "000"; C_ARB_TIME_SLOT_1 : bit_vector := "000"; C_ARB_TIME_SLOT_2 : bit_vector := "000"; C_ARB_TIME_SLOT_3 : bit_vector := "000"; C_ARB_TIME_SLOT_4 : bit_vector := "000"; C_ARB_TIME_SLOT_5 : bit_vector := "000"; C_ARB_TIME_SLOT_6 : bit_vector := "000"; C_ARB_TIME_SLOT_7 : bit_vector := "000"; C_ARB_TIME_SLOT_8 : bit_vector := "000"; C_ARB_TIME_SLOT_9 : bit_vector := "000"; C_ARB_TIME_SLOT_10 : bit_vector := "000"; C_ARB_TIME_SLOT_11 : bit_vector := "000"; C_MEM_TRAS : integer := 45000; C_MEM_TRCD : integer := 12500; C_MEM_TREFI : integer := 7800000; C_MEM_TRFC : integer := 127500; C_MEM_TRP : integer := 12500; C_MEM_TWR : integer := 15000; C_MEM_TRTP : integer := 7500; C_MEM_TWTR : integer := 7500; C_MEM_ADDR_ORDER : string :="ROW_BANK_COLUMN"; C_MEM_TYPE : string :="DDR2"; C_MEM_DENSITY : string :="1Gb"; C_NUM_DQ_PINS : integer := 4; C_MEM_BURST_LEN : integer := 8; C_MEM_CAS_LATENCY : integer := 5; C_MEM_ADDR_WIDTH : integer := 14; C_MEM_BANKADDR_WIDTH : integer := 3; C_MEM_NUM_COL_BITS : integer := 11; C_MEM_DDR1_2_ODS : string := "FULL"; C_MEM_DDR2_RTT : string := "50OHMS"; C_MEM_DDR2_DIFF_DQS_EN : string := "YES"; C_MEM_DDR2_3_PA_SR : string := "FULL"; C_MEM_DDR2_3_HIGH_TEMP_SR : string := "NORMAL"; C_MEM_DDR3_CAS_LATENCY : integer:= 7; C_MEM_DDR3_CAS_WR_LATENCY : integer:= 5; C_MEM_DDR3_ODS : string := "DIV6"; C_MEM_DDR3_RTT : string := "DIV2"; C_MEM_DDR3_AUTO_SR : string := "ENABLED"; C_MEM_DDR3_DYN_WRT_ODT : string := "OFF"; C_MEM_MOBILE_PA_SR : string := "FULL"; C_MEM_MDDR_ODS : string := "FULL"; C_MC_CALIB_BYPASS : string := "NO"; C_LDQSP_TAP_DELAY_VAL : integer := 0; C_UDQSP_TAP_DELAY_VAL : integer := 0; C_LDQSN_TAP_DELAY_VAL : integer := 0; C_UDQSN_TAP_DELAY_VAL : integer := 0; C_DQ0_TAP_DELAY_VAL : integer := 0; C_DQ1_TAP_DELAY_VAL : integer := 0; C_DQ2_TAP_DELAY_VAL : integer := 0; C_DQ3_TAP_DELAY_VAL : integer := 0; C_DQ4_TAP_DELAY_VAL : integer := 0; C_DQ5_TAP_DELAY_VAL : integer := 0; C_DQ6_TAP_DELAY_VAL : integer := 0; C_DQ7_TAP_DELAY_VAL : integer := 0; C_DQ8_TAP_DELAY_VAL : integer := 0; C_DQ9_TAP_DELAY_VAL : integer := 0; C_DQ10_TAP_DELAY_VAL : integer := 0; C_DQ11_TAP_DELAY_VAL : integer := 0; C_DQ12_TAP_DELAY_VAL : integer := 0; C_DQ13_TAP_DELAY_VAL : integer := 0; C_DQ14_TAP_DELAY_VAL : integer := 0; C_DQ15_TAP_DELAY_VAL : integer := 0; C_SKIP_IN_TERM_CAL : integer := 0; C_SKIP_DYNAMIC_CAL : integer := 0; C_SIMULATION : string := "FALSE"; C_MC_CALIBRATION_MODE : string := "CALIBRATION"; C_MC_CALIBRATION_DELAY : string := "QUARTER"; C_CALIB_SOFT_IP : string := "TRUE" ); port ( -- high-speed PLL clock interface sysclk_2x : in std_logic; sysclk_2x_180 : in std_logic; pll_ce_0 : in std_logic; pll_ce_90 : in std_logic; pll_lock : in std_logic; async_rst : in std_logic; --User Port0 Interface Signals p0_cmd_clk : in std_logic; p0_cmd_en : in std_logic; p0_cmd_instr : in std_logic_vector(2 downto 0) ; p0_cmd_bl : in std_logic_vector(5 downto 0) ; p0_cmd_byte_addr : in std_logic_vector(29 downto 0) ; p0_cmd_empty : out std_logic; p0_cmd_full : out std_logic; -- Data Wr Port signals p0_wr_clk : in std_logic; p0_wr_en : in std_logic; p0_wr_mask : in std_logic_vector(C_P0_MASK_SIZE - 1 downto 0) ; p0_wr_data : in std_logic_vector(C_P0_DATA_PORT_SIZE - 1 downto 0) ; p0_wr_full : out std_logic; p0_wr_empty : out std_logic; p0_wr_count : out std_logic_vector(6 downto 0) ; p0_wr_underrun : out std_logic; p0_wr_error : out std_logic; --Data Rd Port signals p0_rd_clk : in std_logic; p0_rd_en : in std_logic; p0_rd_data : out std_logic_vector(C_P0_DATA_PORT_SIZE - 1 downto 0) ; p0_rd_full : out std_logic; p0_rd_empty : out std_logic; p0_rd_count : out std_logic_vector(6 downto 0) ; p0_rd_overflow : out std_logic; p0_rd_error : out std_logic; --User Port1 Interface Signals p1_cmd_clk : in std_logic; p1_cmd_en : in std_logic; p1_cmd_instr : in std_logic_vector(2 downto 0) ; p1_cmd_bl : in std_logic_vector(5 downto 0) ; p1_cmd_byte_addr : in std_logic_vector(29 downto 0) ; p1_cmd_empty : out std_logic; p1_cmd_full : out std_logic; -- Data Wr Port signals p1_wr_clk : in std_logic; p1_wr_en : in std_logic; p1_wr_mask : in std_logic_vector(C_P1_MASK_SIZE - 1 downto 0) ; p1_wr_data : in std_logic_vector(C_P1_DATA_PORT_SIZE - 1 downto 0) ; p1_wr_full : out std_logic; p1_wr_empty : out std_logic; p1_wr_count : out std_logic_vector(6 downto 0) ; p1_wr_underrun : out std_logic; p1_wr_error : out std_logic; --Data Rd Port signals p1_rd_clk : in std_logic; p1_rd_en : in std_logic; p1_rd_data : out std_logic_vector(C_P1_DATA_PORT_SIZE - 1 downto 0) ; p1_rd_full : out std_logic; p1_rd_empty : out std_logic; p1_rd_count : out std_logic_vector(6 downto 0) ; p1_rd_overflow : out std_logic; p1_rd_error : out std_logic; --User Port2 Interface Signals p2_cmd_clk : in std_logic; p2_cmd_en : in std_logic; p2_cmd_instr : in std_logic_vector(2 downto 0) ; p2_cmd_bl : in std_logic_vector(5 downto 0) ; p2_cmd_byte_addr : in std_logic_vector(29 downto 0) ; p2_cmd_empty : out std_logic; p2_cmd_full : out std_logic; --Data Wr Port signals p2_wr_clk : in std_logic; p2_wr_en : in std_logic; p2_wr_mask : in std_logic_vector(3 downto 0) ; p2_wr_data : in std_logic_vector(31 downto 0) ; p2_wr_full : out std_logic; p2_wr_empty : out std_logic; p2_wr_count : out std_logic_vector(6 downto 0) ; p2_wr_underrun : out std_logic; p2_wr_error : out std_logic; --User Port3 Interface Signals p3_cmd_clk : in std_logic; p3_cmd_en : in std_logic; p3_cmd_instr : in std_logic_vector(2 downto 0) ; p3_cmd_bl : in std_logic_vector(5 downto 0) ; p3_cmd_byte_addr : in std_logic_vector(29 downto 0) ; p3_cmd_empty : out std_logic; p3_cmd_full : out std_logic; --Data Rd Port signals p3_rd_clk : in std_logic; p3_rd_en : in std_logic; p3_rd_data : out std_logic_vector(31 downto 0) ; p3_rd_full : out std_logic; p3_rd_empty : out std_logic; p3_rd_count : out std_logic_vector(6 downto 0) ; p3_rd_overflow : out std_logic; p3_rd_error : out std_logic; --User Port4 Interface Signals p4_cmd_clk : in std_logic; p4_cmd_en : in std_logic; p4_cmd_instr : in std_logic_vector(2 downto 0) ; p4_cmd_bl : in std_logic_vector(5 downto 0) ; p4_cmd_byte_addr : in std_logic_vector(29 downto 0) ; p4_cmd_empty : out std_logic; p4_cmd_full : out std_logic; --Data Wr Port signals p4_wr_clk : in std_logic; p4_wr_en : in std_logic; p4_wr_mask : in std_logic_vector(3 downto 0) ; p4_wr_data : in std_logic_vector(31 downto 0) ; p4_wr_full : out std_logic; p4_wr_empty : out std_logic; p4_wr_count : out std_logic_vector(6 downto 0) ; p4_wr_underrun : out std_logic; p4_wr_error : out std_logic; --User Port5 Interface Signals p5_cmd_clk : in std_logic; p5_cmd_en : in std_logic; p5_cmd_instr : in std_logic_vector(2 downto 0) ; p5_cmd_bl : in std_logic_vector(5 downto 0) ; p5_cmd_byte_addr : in std_logic_vector(29 downto 0) ; p5_cmd_empty : out std_logic; p5_cmd_full : out std_logic; --Data Rd Port signals p5_rd_clk : in std_logic; p5_rd_en : in std_logic; p5_rd_data : out std_logic_vector(31 downto 0) ; p5_rd_full : out std_logic; p5_rd_empty : out std_logic; p5_rd_count : out std_logic_vector(6 downto 0) ; p5_rd_overflow : out std_logic; p5_rd_error : out std_logic; -- memory interface signals mcb3_dram_ck : out std_logic; mcb3_dram_ck_n : out std_logic; mcb3_dram_a : out std_logic_vector(C_MEM_ADDR_WIDTH-1 downto 0); mcb3_dram_ba : out std_logic_vector(C_MEM_BANKADDR_WIDTH-1 downto 0); mcb3_dram_ras_n : out std_logic; mcb3_dram_cas_n : out std_logic; mcb3_dram_we_n : out std_logic; mcb3_dram_cke : out std_logic; mcb3_dram_dq : inout std_logic_vector(C_NUM_DQ_PINS-1 downto 0); mcb3_dram_dqs : inout std_logic; mcb3_dram_udqs : inout std_logic; mcb3_dram_udm : out std_logic; mcb3_dram_dm : out std_logic; mcb3_rzq : inout std_logic; -- Calibration signals mcb_drp_clk : in std_logic; calib_done : out std_logic; selfrefresh_enter : in std_logic; selfrefresh_mode : out std_logic ); end entity; architecture acch of memc3_wrapper is component mcb_raw_wrapper IS GENERIC ( C_MEMCLK_PERIOD : integer; C_PORT_ENABLE : std_logic_vector(5 downto 0); C_MEM_ADDR_ORDER : string; C_ARB_NUM_TIME_SLOTS : integer; C_ARB_TIME_SLOT_0 : bit_vector(17 downto 0); C_ARB_TIME_SLOT_1 : bit_vector(17 downto 0); C_ARB_TIME_SLOT_2 : bit_vector(17 downto 0); C_ARB_TIME_SLOT_3 : bit_vector(17 downto 0); C_ARB_TIME_SLOT_4 : bit_vector(17 downto 0); C_ARB_TIME_SLOT_5 : bit_vector(17 downto 0); C_ARB_TIME_SLOT_6 : bit_vector(17 downto 0); C_ARB_TIME_SLOT_7 : bit_vector(17 downto 0); C_ARB_TIME_SLOT_8 : bit_vector(17 downto 0); C_ARB_TIME_SLOT_9 : bit_vector(17 downto 0); C_ARB_TIME_SLOT_10 : bit_vector(17 downto 0); C_ARB_TIME_SLOT_11 : bit_vector(17 downto 0); C_PORT_CONFIG : string; C_MEM_TRAS : integer; C_MEM_TRCD : integer; C_MEM_TREFI : integer; C_MEM_TRFC : integer; C_MEM_TRP : integer; C_MEM_TWR : integer; C_MEM_TRTP : integer; C_MEM_TWTR : integer; C_NUM_DQ_PINS : integer; C_MEM_TYPE : string; C_MEM_DENSITY : string; C_MEM_BURST_LEN : integer; C_MEM_CAS_LATENCY : integer; C_MEM_ADDR_WIDTH : integer; C_MEM_BANKADDR_WIDTH : integer; C_MEM_NUM_COL_BITS : integer; C_MEM_DDR3_CAS_LATENCY : integer; C_MEM_MOBILE_PA_SR : string; C_MEM_DDR1_2_ODS : string; C_MEM_DDR3_ODS : string; C_MEM_DDR2_RTT : string; C_MEM_DDR3_RTT : string; C_MEM_MDDR_ODS : string; C_MEM_DDR2_DIFF_DQS_EN : string; C_MEM_DDR2_3_PA_SR : string; C_MEM_DDR3_CAS_WR_LATENCY : integer; C_MEM_DDR3_AUTO_SR : string; C_MEM_DDR2_3_HIGH_TEMP_SR : string; C_MEM_DDR3_DYN_WRT_ODT : string; C_MC_CALIB_BYPASS : string; C_MC_CALIBRATION_RA : bit_vector(15 DOWNTO 0); C_MC_CALIBRATION_BA : bit_vector(2 DOWNTO 0); C_CALIB_SOFT_IP : string; C_MC_CALIBRATION_CA : bit_vector(11 DOWNTO 0); C_MC_CALIBRATION_CLK_DIV : integer; C_MC_CALIBRATION_MODE : string; C_MC_CALIBRATION_DELAY : string; LDQSP_TAP_DELAY_VAL : integer; UDQSP_TAP_DELAY_VAL : integer; LDQSN_TAP_DELAY_VAL : integer; UDQSN_TAP_DELAY_VAL : integer; DQ0_TAP_DELAY_VAL : integer; DQ1_TAP_DELAY_VAL : integer; DQ2_TAP_DELAY_VAL : integer; DQ3_TAP_DELAY_VAL : integer; DQ4_TAP_DELAY_VAL : integer; DQ5_TAP_DELAY_VAL : integer; DQ6_TAP_DELAY_VAL : integer; DQ7_TAP_DELAY_VAL : integer; DQ8_TAP_DELAY_VAL : integer; DQ9_TAP_DELAY_VAL : integer; DQ10_TAP_DELAY_VAL : integer; DQ11_TAP_DELAY_VAL : integer; DQ12_TAP_DELAY_VAL : integer; DQ13_TAP_DELAY_VAL : integer; DQ14_TAP_DELAY_VAL : integer; DQ15_TAP_DELAY_VAL : integer; C_P0_MASK_SIZE : integer; C_P0_DATA_PORT_SIZE : integer; C_P1_MASK_SIZE : integer; C_P1_DATA_PORT_SIZE : integer; C_SIMULATION : string ; C_SKIP_IN_TERM_CAL : integer; C_SKIP_DYNAMIC_CAL : integer; C_SKIP_DYN_IN_TERM : integer; C_MEM_TZQINIT_MAXCNT : std_logic_vector(9 downto 0) ); PORT ( -- HIGH-SPEED PLL clock interface sysclk_2x : in std_logic; sysclk_2x_180 : in std_logic; pll_ce_0 : in std_logic; pll_ce_90 : in std_logic; pll_lock : in std_logic; sys_rst : in std_logic; p0_arb_en : in std_logic; p0_cmd_clk : in std_logic; p0_cmd_en : in std_logic; p0_cmd_instr : in std_logic_vector(2 DOWNTO 0); p0_cmd_bl : in std_logic_vector(5 DOWNTO 0); p0_cmd_byte_addr : in std_logic_vector(29 DOWNTO 0); p0_cmd_empty : out std_logic; p0_cmd_full : out std_logic; p0_wr_clk : in std_logic; p0_wr_en : in std_logic; p0_wr_mask : in std_logic_vector(C_P0_MASK_SIZE - 1 DOWNTO 0); p0_wr_data : in std_logic_vector(C_P0_DATA_PORT_SIZE - 1 DOWNTO 0); p0_wr_full : out std_logic; p0_wr_empty : out std_logic; p0_wr_count : out std_logic_vector(6 DOWNTO 0); p0_wr_underrun : out std_logic; p0_wr_error : out std_logic; p0_rd_clk : in std_logic; p0_rd_en : in std_logic; p0_rd_data : out std_logic_vector(C_P0_DATA_PORT_SIZE - 1 DOWNTO 0); p0_rd_full : out std_logic; p0_rd_empty : out std_logic; p0_rd_count : out std_logic_vector(6 DOWNTO 0); p0_rd_overflow : out std_logic; p0_rd_error : out std_logic; p1_arb_en : in std_logic; p1_cmd_clk : in std_logic; p1_cmd_en : in std_logic; p1_cmd_instr : in std_logic_vector(2 DOWNTO 0); p1_cmd_bl : in std_logic_vector(5 DOWNTO 0); p1_cmd_byte_addr : in std_logic_vector(29 DOWNTO 0); p1_cmd_empty : out std_logic; p1_cmd_full : out std_logic; p1_wr_clk : in std_logic; p1_wr_en : in std_logic; p1_wr_mask : in std_logic_vector(C_P1_MASK_SIZE - 1 DOWNTO 0); p1_wr_data : in std_logic_vector(C_P1_DATA_PORT_SIZE - 1 DOWNTO 0); p1_wr_full : out std_logic; p1_wr_empty : out std_logic; p1_wr_count : out std_logic_vector(6 DOWNTO 0); p1_wr_underrun : out std_logic; p1_wr_error : out std_logic; p1_rd_clk : in std_logic; p1_rd_en : in std_logic; p1_rd_data : out std_logic_vector(C_P1_DATA_PORT_SIZE - 1 DOWNTO 0); p1_rd_full : out std_logic; p1_rd_empty : out std_logic; p1_rd_count : out std_logic_vector(6 DOWNTO 0); p1_rd_overflow : out std_logic; p1_rd_error : out std_logic; p2_arb_en : in std_logic; p2_cmd_clk : in std_logic; p2_cmd_en : in std_logic; p2_cmd_instr : in std_logic_vector(2 DOWNTO 0); p2_cmd_bl : in std_logic_vector(5 DOWNTO 0); p2_cmd_byte_addr : in std_logic_vector(29 DOWNTO 0); p2_cmd_empty : out std_logic; p2_cmd_full : out std_logic; p2_wr_clk : in std_logic; p2_wr_en : in std_logic; p2_wr_mask : in std_logic_vector(3 DOWNTO 0); p2_wr_data : in std_logic_vector(31 DOWNTO 0); p2_wr_full : out std_logic; p2_wr_empty : out std_logic; p2_wr_count : out std_logic_vector(6 DOWNTO 0); p2_wr_underrun : out std_logic; p2_wr_error : out std_logic; p2_rd_clk : in std_logic; p2_rd_en : in std_logic; p2_rd_data : out std_logic_vector(31 DOWNTO 0); p2_rd_full : out std_logic; p2_rd_empty : out std_logic; p2_rd_count : out std_logic_vector(6 DOWNTO 0); p2_rd_overflow : out std_logic; p2_rd_error : out std_logic; p3_arb_en : in std_logic; p3_cmd_clk : in std_logic; p3_cmd_en : in std_logic; p3_cmd_instr : in std_logic_vector(2 DOWNTO 0); p3_cmd_bl : in std_logic_vector(5 DOWNTO 0); p3_cmd_byte_addr : in std_logic_vector(29 DOWNTO 0); p3_cmd_empty : out std_logic; p3_cmd_full : out std_logic; p3_wr_clk : in std_logic; p3_wr_en : in std_logic; p3_wr_mask : in std_logic_vector(3 DOWNTO 0); p3_wr_data : in std_logic_vector(31 DOWNTO 0); p3_wr_full : out std_logic; p3_wr_empty : out std_logic; p3_wr_count : out std_logic_vector(6 DOWNTO 0); p3_wr_underrun : out std_logic; p3_wr_error : out std_logic; p3_rd_clk : in std_logic; p3_rd_en : in std_logic; p3_rd_data : out std_logic_vector(31 DOWNTO 0); p3_rd_full : out std_logic; p3_rd_empty : out std_logic; p3_rd_count : out std_logic_vector(6 DOWNTO 0); p3_rd_overflow : out std_logic; p3_rd_error : out std_logic; p4_arb_en : in std_logic; p4_cmd_clk : in std_logic; p4_cmd_en : in std_logic; p4_cmd_instr : in std_logic_vector(2 DOWNTO 0); p4_cmd_bl : in std_logic_vector(5 DOWNTO 0); p4_cmd_byte_addr : in std_logic_vector(29 DOWNTO 0); p4_cmd_empty : out std_logic; p4_cmd_full : out std_logic; p4_wr_clk : in std_logic; p4_wr_en : in std_logic; p4_wr_mask : in std_logic_vector(3 DOWNTO 0); p4_wr_data : in std_logic_vector(31 DOWNTO 0); p4_wr_full : out std_logic; p4_wr_empty : out std_logic; p4_wr_count : out std_logic_vector(6 DOWNTO 0); p4_wr_underrun : out std_logic; p4_wr_error : out std_logic; p4_rd_clk : in std_logic; p4_rd_en : in std_logic; p4_rd_data : out std_logic_vector(31 DOWNTO 0); p4_rd_full : out std_logic; p4_rd_empty : out std_logic; p4_rd_count : out std_logic_vector(6 DOWNTO 0); p4_rd_overflow : out std_logic; p4_rd_error : out std_logic; p5_arb_en : in std_logic; p5_cmd_clk : in std_logic; p5_cmd_en : in std_logic; p5_cmd_instr : in std_logic_vector(2 DOWNTO 0); p5_cmd_bl : in std_logic_vector(5 DOWNTO 0); p5_cmd_byte_addr : in std_logic_vector(29 DOWNTO 0); p5_cmd_empty : out std_logic; p5_cmd_full : out std_logic; p5_wr_clk : in std_logic; p5_wr_en : in std_logic; p5_wr_mask : in std_logic_vector(3 DOWNTO 0); p5_wr_data : in std_logic_vector(31 DOWNTO 0); p5_wr_full : out std_logic; p5_wr_empty : out std_logic; p5_wr_count : out std_logic_vector(6 DOWNTO 0); p5_wr_underrun : out std_logic; p5_wr_error : out std_logic; p5_rd_clk : in std_logic; p5_rd_en : in std_logic; p5_rd_data : out std_logic_vector(31 DOWNTO 0); p5_rd_full : out std_logic; p5_rd_empty : out std_logic; p5_rd_count : out std_logic_vector(6 DOWNTO 0); p5_rd_overflow : out std_logic; p5_rd_error : out std_logic; mcbx_dram_addr : out std_logic_vector(C_MEM_ADDR_WIDTH - 1 DOWNTO 0); mcbx_dram_ba : out std_logic_vector(C_MEM_BANKADDR_WIDTH - 1 DOWNTO 0); mcbx_dram_ras_n : out std_logic; mcbx_dram_cas_n : out std_logic; mcbx_dram_we_n : out std_logic; mcbx_dram_cke : out std_logic; mcbx_dram_clk : out std_logic; mcbx_dram_clk_n : out std_logic; mcbx_dram_dq : inout std_logic_vector(C_NUM_DQ_PINS-1 DOWNTO 0); mcbx_dram_dqs : inout std_logic; mcbx_dram_dqs_n : inout std_logic; mcbx_dram_udqs : inout std_logic; mcbx_dram_udqs_n : inout std_logic; mcbx_dram_udm : out std_logic; mcbx_dram_ldm : out std_logic; mcbx_dram_odt : out std_logic; mcbx_dram_ddr3_rst : out std_logic; calib_recal : in std_logic; rzq : inout std_logic; zio : inout std_logic; ui_read : in std_logic; ui_add : in std_logic; ui_cs : in std_logic; ui_clk : in std_logic; ui_sdi : in std_logic; ui_addr : in std_logic_vector(4 DOWNTO 0); ui_broadcast : in std_logic; ui_drp_update : in std_logic; ui_done_cal : in std_logic; ui_cmd : in std_logic; ui_cmd_in : in std_logic; ui_cmd_en : in std_logic; ui_dqcount : in std_logic_vector(3 DOWNTO 0); ui_dq_lower_dec : in std_logic; ui_dq_lower_inc : in std_logic; ui_dq_upper_dec : in std_logic; ui_dq_upper_inc : in std_logic; ui_udqs_inc : in std_logic; ui_udqs_dec : in std_logic; ui_ldqs_inc : in std_logic; ui_ldqs_dec : in std_logic; uo_data : out std_logic_vector(7 DOWNTO 0); uo_data_valid : out std_logic; uo_done_cal : out std_logic; uo_cmd_ready_in : out std_logic; uo_refrsh_flag : out std_logic; uo_cal_start : out std_logic; uo_sdo : out std_logic; status : out std_logic_vector(31 DOWNTO 0); selfrefresh_enter : in std_logic; selfrefresh_mode : out std_logic ); end component; signal uo_data : std_logic_vector(7 downto 0); constant C_PORT_ENABLE : std_logic_vector(5 downto 0) := "111111"; constant C_PORT_CONFIG : string := "B32_B32_W32_R32_W32_R32"; constant ARB_TIME_SLOT_0 : bit_vector(17 downto 0) := (C_ARB_TIME_SLOT_0(2 downto 0) & C_ARB_TIME_SLOT_0(5 downto 3) & C_ARB_TIME_SLOT_0(8 downto 6) & C_ARB_TIME_SLOT_0(11 downto 9) & C_ARB_TIME_SLOT_0(14 downto 12) & C_ARB_TIME_SLOT_0(17 downto 15)); constant ARB_TIME_SLOT_1 : bit_vector(17 downto 0) := (C_ARB_TIME_SLOT_1(2 downto 0) & C_ARB_TIME_SLOT_1(5 downto 3) & C_ARB_TIME_SLOT_1(8 downto 6) & C_ARB_TIME_SLOT_1(11 downto 9) & C_ARB_TIME_SLOT_1(14 downto 12) & C_ARB_TIME_SLOT_1(17 downto 15)); constant ARB_TIME_SLOT_2 : bit_vector(17 downto 0) := (C_ARB_TIME_SLOT_2(2 downto 0) & C_ARB_TIME_SLOT_2(5 downto 3) & C_ARB_TIME_SLOT_2(8 downto 6) & C_ARB_TIME_SLOT_2(11 downto 9) & C_ARB_TIME_SLOT_2(14 downto 12) & C_ARB_TIME_SLOT_2(17 downto 15)); constant ARB_TIME_SLOT_3 : bit_vector(17 downto 0) := (C_ARB_TIME_SLOT_3(2 downto 0) & C_ARB_TIME_SLOT_3(5 downto 3) & C_ARB_TIME_SLOT_3(8 downto 6) & C_ARB_TIME_SLOT_3(11 downto 9) & C_ARB_TIME_SLOT_3(14 downto 12) & C_ARB_TIME_SLOT_3(17 downto 15)); constant ARB_TIME_SLOT_4 : bit_vector(17 downto 0) := (C_ARB_TIME_SLOT_4(2 downto 0) & C_ARB_TIME_SLOT_4(5 downto 3) & C_ARB_TIME_SLOT_4(8 downto 6) & C_ARB_TIME_SLOT_4(11 downto 9) & C_ARB_TIME_SLOT_4(14 downto 12) & C_ARB_TIME_SLOT_4(17 downto 15)); constant ARB_TIME_SLOT_5 : bit_vector(17 downto 0) := (C_ARB_TIME_SLOT_5(2 downto 0) & C_ARB_TIME_SLOT_5(5 downto 3) & C_ARB_TIME_SLOT_5(8 downto 6) & C_ARB_TIME_SLOT_5(11 downto 9) & C_ARB_TIME_SLOT_5(14 downto 12) & C_ARB_TIME_SLOT_5(17 downto 15)); constant ARB_TIME_SLOT_6 : bit_vector(17 downto 0) := (C_ARB_TIME_SLOT_6(2 downto 0) & C_ARB_TIME_SLOT_6(5 downto 3) & C_ARB_TIME_SLOT_6(8 downto 6) & C_ARB_TIME_SLOT_6(11 downto 9) & C_ARB_TIME_SLOT_6(14 downto 12) & C_ARB_TIME_SLOT_6(17 downto 15)); constant ARB_TIME_SLOT_7 : bit_vector(17 downto 0) := (C_ARB_TIME_SLOT_7(2 downto 0) & C_ARB_TIME_SLOT_7(5 downto 3) & C_ARB_TIME_SLOT_7(8 downto 6) & C_ARB_TIME_SLOT_7(11 downto 9) & C_ARB_TIME_SLOT_7(14 downto 12) & C_ARB_TIME_SLOT_7(17 downto 15)); constant ARB_TIME_SLOT_8 : bit_vector(17 downto 0) := (C_ARB_TIME_SLOT_8(2 downto 0) & C_ARB_TIME_SLOT_8(5 downto 3) & C_ARB_TIME_SLOT_8(8 downto 6) & C_ARB_TIME_SLOT_8(11 downto 9) & C_ARB_TIME_SLOT_8(14 downto 12) & C_ARB_TIME_SLOT_8(17 downto 15)); constant ARB_TIME_SLOT_9 : bit_vector(17 downto 0) := (C_ARB_TIME_SLOT_9(2 downto 0) & C_ARB_TIME_SLOT_9(5 downto 3) & C_ARB_TIME_SLOT_9(8 downto 6) & C_ARB_TIME_SLOT_9(11 downto 9) & C_ARB_TIME_SLOT_9(14 downto 12) & C_ARB_TIME_SLOT_9(17 downto 15)); constant ARB_TIME_SLOT_10 : bit_vector(17 downto 0) := (C_ARB_TIME_SLOT_10(2 downto 0) & C_ARB_TIME_SLOT_10(5 downto 3) & C_ARB_TIME_SLOT_10(8 downto 6) & C_ARB_TIME_SLOT_10(11 downto 9) & C_ARB_TIME_SLOT_10(14 downto 12) & C_ARB_TIME_SLOT_10(17 downto 15)); constant ARB_TIME_SLOT_11 : bit_vector(17 downto 0) := (C_ARB_TIME_SLOT_11(2 downto 0) & C_ARB_TIME_SLOT_11(5 downto 3) & C_ARB_TIME_SLOT_11(8 downto 6) & C_ARB_TIME_SLOT_11(11 downto 9) & C_ARB_TIME_SLOT_11(14 downto 12) & C_ARB_TIME_SLOT_11(17 downto 15)); constant C_MC_CALIBRATION_CLK_DIV : integer := 1; constant C_MEM_TZQINIT_MAXCNT : std_logic_vector(9 downto 0) := "1000000000"; constant C_SKIP_DYN_IN_TERM : integer := 1; constant C_MC_CALIBRATION_RA : bit_vector(15 downto 0) := X"0000"; constant C_MC_CALIBRATION_BA : bit_vector(2 downto 0) := o"0"; constant C_MC_CALIBRATION_CA : bit_vector(11 downto 0) := X"000"; signal status : std_logic_vector(31 downto 0); signal uo_data_valid : std_logic; signal uo_cmd_ready_in : std_logic; signal uo_refrsh_flag : std_logic; signal uo_cal_start : std_logic; signal uo_sdo : std_logic; signal mcb3_zio : std_logic; attribute X_CORE_INFO : string; attribute X_CORE_INFO of acch : architecture IS "mig_v3_5_ddr_s6, Coregen 12.2"; attribute CORE_GENERATION_INFO : string; attribute CORE_GENERATION_INFO of acch : architecture IS "mcb3_ddr_s6,mig_v3_5,{LANGUAGE=VHDL, SYNTHESIS_TOOL=ISE, NO_OF_CONTROLLERS=1, AXI_ENABLE=0, MEM_INTERFACE_TYPE=DDR_SDRAM,CLK_PERIOD=5000, MEMORY_PART=mt46v32m16xx-5b-it, OUTPUT_DRV=FULL, PORT_CONFIG=Two 32-bit bi-directional and four 32-bit unidirectional ports, MEM_ADDR_ORDER=ROW_BANK_COLUMN, PORT_ENABLE=Port0_Port1_Port2_Port3_Port4_Port5, CLASS_ADDR=II, CLASS_DATA=II, INPUT_PIN_TERMINATION=UNCALIB_TERM, DATA_TERMINATION=50 Ohms, CLKFBOUT_MULT_F=4, CLKOUT_DIVIDE=2, DEBUG_PORT=0, INPUT_CLK_TYPE=Single-Ended}"; begin memc3_mcb_raw_wrapper_inst : mcb_raw_wrapper generic map ( C_MEMCLK_PERIOD => C_MEMCLK_PERIOD, C_P0_MASK_SIZE => C_P0_MASK_SIZE, C_P0_DATA_PORT_SIZE => C_P0_DATA_PORT_SIZE, C_P1_MASK_SIZE => C_P1_MASK_SIZE, C_P1_DATA_PORT_SIZE => C_P1_DATA_PORT_SIZE, C_ARB_NUM_TIME_SLOTS => C_ARB_NUM_TIME_SLOTS, C_ARB_TIME_SLOT_0 => ARB_TIME_SLOT_0, C_ARB_TIME_SLOT_1 => ARB_TIME_SLOT_1, C_ARB_TIME_SLOT_2 => ARB_TIME_SLOT_2, C_ARB_TIME_SLOT_3 => ARB_TIME_SLOT_3, C_ARB_TIME_SLOT_4 => ARB_TIME_SLOT_4, C_ARB_TIME_SLOT_5 => ARB_TIME_SLOT_5, C_ARB_TIME_SLOT_6 => ARB_TIME_SLOT_6, C_ARB_TIME_SLOT_7 => ARB_TIME_SLOT_7, C_ARB_TIME_SLOT_8 => ARB_TIME_SLOT_8, C_ARB_TIME_SLOT_9 => ARB_TIME_SLOT_9, C_ARB_TIME_SLOT_10 => ARB_TIME_SLOT_10, C_ARB_TIME_SLOT_11 => ARB_TIME_SLOT_11, C_PORT_CONFIG => C_PORT_CONFIG, C_PORT_ENABLE => C_PORT_ENABLE, C_MEM_TRAS => C_MEM_TRAS, C_MEM_TRCD => C_MEM_TRCD, C_MEM_TREFI => C_MEM_TREFI, C_MEM_TRFC => C_MEM_TRFC, C_MEM_TRP => C_MEM_TRP, C_MEM_TWR => C_MEM_TWR, C_MEM_TRTP => C_MEM_TRTP, C_MEM_TWTR => C_MEM_TWTR, C_MEM_ADDR_ORDER => C_MEM_ADDR_ORDER, C_NUM_DQ_PINS => C_NUM_DQ_PINS, C_MEM_TYPE => C_MEM_TYPE, C_MEM_DENSITY => C_MEM_DENSITY, C_MEM_BURST_LEN => C_MEM_BURST_LEN, C_MEM_CAS_LATENCY => C_MEM_CAS_LATENCY, C_MEM_ADDR_WIDTH => C_MEM_ADDR_WIDTH, C_MEM_BANKADDR_WIDTH => C_MEM_BANKADDR_WIDTH, C_MEM_NUM_COL_BITS => C_MEM_NUM_COL_BITS, C_MEM_DDR1_2_ODS => C_MEM_DDR1_2_ODS, C_MEM_DDR2_RTT => C_MEM_DDR2_RTT, C_MEM_DDR2_DIFF_DQS_EN => C_MEM_DDR2_DIFF_DQS_EN, C_MEM_DDR2_3_PA_SR => C_MEM_DDR2_3_PA_SR, C_MEM_DDR2_3_HIGH_TEMP_SR => C_MEM_DDR2_3_HIGH_TEMP_SR, C_MEM_DDR3_CAS_LATENCY => C_MEM_DDR3_CAS_LATENCY, C_MEM_DDR3_ODS => C_MEM_DDR3_ODS, C_MEM_DDR3_RTT => C_MEM_DDR3_RTT, C_MEM_DDR3_CAS_WR_LATENCY => C_MEM_DDR3_CAS_WR_LATENCY, C_MEM_DDR3_AUTO_SR => C_MEM_DDR3_AUTO_SR, C_MEM_DDR3_DYN_WRT_ODT => C_MEM_DDR3_DYN_WRT_ODT, C_MEM_MOBILE_PA_SR => C_MEM_MOBILE_PA_SR, C_MEM_MDDR_ODS => C_MEM_MDDR_ODS, C_MC_CALIBRATION_CLK_DIV => C_MC_CALIBRATION_CLK_DIV, C_MC_CALIBRATION_MODE => C_MC_CALIBRATION_MODE, C_MC_CALIBRATION_DELAY => C_MC_CALIBRATION_DELAY, C_MC_CALIB_BYPASS => C_MC_CALIB_BYPASS, C_MC_CALIBRATION_RA => C_MC_CALIBRATION_RA, C_MC_CALIBRATION_BA => C_MC_CALIBRATION_BA, C_MC_CALIBRATION_CA => C_MC_CALIBRATION_CA, C_CALIB_SOFT_IP => C_CALIB_SOFT_IP, C_SIMULATION => C_SIMULATION, C_SKIP_IN_TERM_CAL => C_SKIP_IN_TERM_CAL, C_SKIP_DYNAMIC_CAL => C_SKIP_DYNAMIC_CAL, C_SKIP_DYN_IN_TERM => C_SKIP_DYN_IN_TERM, C_MEM_TZQINIT_MAXCNT => C_MEM_TZQINIT_MAXCNT, LDQSP_TAP_DELAY_VAL => C_LDQSP_TAP_DELAY_VAL, UDQSP_TAP_DELAY_VAL => C_UDQSP_TAP_DELAY_VAL, LDQSN_TAP_DELAY_VAL => C_LDQSN_TAP_DELAY_VAL, UDQSN_TAP_DELAY_VAL => C_UDQSN_TAP_DELAY_VAL, DQ0_TAP_DELAY_VAL => C_DQ0_TAP_DELAY_VAL, DQ1_TAP_DELAY_VAL => C_DQ1_TAP_DELAY_VAL, DQ2_TAP_DELAY_VAL => C_DQ2_TAP_DELAY_VAL, DQ3_TAP_DELAY_VAL => C_DQ3_TAP_DELAY_VAL, DQ4_TAP_DELAY_VAL => C_DQ4_TAP_DELAY_VAL, DQ5_TAP_DELAY_VAL => C_DQ5_TAP_DELAY_VAL, DQ6_TAP_DELAY_VAL => C_DQ6_TAP_DELAY_VAL, DQ7_TAP_DELAY_VAL => C_DQ7_TAP_DELAY_VAL, DQ8_TAP_DELAY_VAL => C_DQ8_TAP_DELAY_VAL, DQ9_TAP_DELAY_VAL => C_DQ9_TAP_DELAY_VAL, DQ10_TAP_DELAY_VAL => C_DQ10_TAP_DELAY_VAL, DQ11_TAP_DELAY_VAL => C_DQ11_TAP_DELAY_VAL, DQ12_TAP_DELAY_VAL => C_DQ12_TAP_DELAY_VAL, DQ13_TAP_DELAY_VAL => C_DQ13_TAP_DELAY_VAL, DQ14_TAP_DELAY_VAL => C_DQ14_TAP_DELAY_VAL, DQ15_TAP_DELAY_VAL => C_DQ15_TAP_DELAY_VAL ) port map ( sys_rst => async_rst, sysclk_2x => sysclk_2x, sysclk_2x_180 => sysclk_2x_180, pll_ce_0 => pll_ce_0, pll_ce_90 => pll_ce_90, pll_lock => pll_lock, mcbx_dram_addr => mcb3_dram_a, mcbx_dram_ba => mcb3_dram_ba, mcbx_dram_ras_n => mcb3_dram_ras_n, mcbx_dram_cas_n => mcb3_dram_cas_n, mcbx_dram_we_n => mcb3_dram_we_n, mcbx_dram_cke => mcb3_dram_cke, mcbx_dram_clk => mcb3_dram_ck, mcbx_dram_clk_n => mcb3_dram_ck_n, mcbx_dram_dq => mcb3_dram_dq, mcbx_dram_odt => open, mcbx_dram_ldm => mcb3_dram_dm, mcbx_dram_udm => mcb3_dram_udm, mcbx_dram_dqs => mcb3_dram_dqs, mcbx_dram_dqs_n => open, mcbx_dram_udqs => mcb3_dram_udqs, mcbx_dram_udqs_n => open, mcbx_dram_ddr3_rst => open, calib_recal => '0', rzq => mcb3_rzq, zio => mcb3_zio, ui_read => '0', ui_add => '0', ui_cs => '0', ui_clk => mcb_drp_clk, ui_sdi => '0', ui_addr => (others => '0'), ui_broadcast => '0', ui_drp_update => '0', ui_done_cal => '1', ui_cmd => '0', ui_cmd_in => '0', ui_cmd_en => '0', ui_dqcount => (others => '0'), ui_dq_lower_dec => '0', ui_dq_lower_inc => '0', ui_dq_upper_dec => '0', ui_dq_upper_inc => '0', ui_udqs_inc => '0', ui_udqs_dec => '0', ui_ldqs_inc => '0', ui_ldqs_dec => '0', uo_data => uo_data, uo_data_valid => uo_data_valid, uo_done_cal => calib_done, uo_cmd_ready_in => uo_cmd_ready_in, uo_refrsh_flag => uo_refrsh_flag, uo_cal_start => uo_cal_start, uo_sdo => uo_sdo, status => status, selfrefresh_enter => '0', selfrefresh_mode => selfrefresh_mode, p0_arb_en => '1', p0_cmd_clk => p0_cmd_clk, p0_cmd_en => p0_cmd_en, p0_cmd_instr => p0_cmd_instr, p0_cmd_bl => p0_cmd_bl, p0_cmd_byte_addr => p0_cmd_byte_addr, p0_cmd_empty => p0_cmd_empty, p0_cmd_full => p0_cmd_full, p0_wr_clk => p0_wr_clk, p0_wr_en => p0_wr_en, p0_wr_mask => p0_wr_mask, p0_wr_data => p0_wr_data, p0_wr_full => p0_wr_full, p0_wr_empty => p0_wr_empty, p0_wr_count => p0_wr_count, p0_wr_underrun => p0_wr_underrun, p0_wr_error => p0_wr_error, p0_rd_clk => p0_rd_clk, p0_rd_en => p0_rd_en, p0_rd_data => p0_rd_data, p0_rd_full => p0_rd_full, p0_rd_empty => p0_rd_empty, p0_rd_count => p0_rd_count, p0_rd_overflow => p0_rd_overflow, p0_rd_error => p0_rd_error, p1_arb_en => '1', p1_cmd_clk => p1_cmd_clk, p1_cmd_en => p1_cmd_en, p1_cmd_instr => p1_cmd_instr, p1_cmd_bl => p1_cmd_bl, p1_cmd_byte_addr => p1_cmd_byte_addr, p1_cmd_empty => p1_cmd_empty, p1_cmd_full => p1_cmd_full, p1_wr_clk => p1_wr_clk, p1_wr_en => p1_wr_en, p1_wr_mask => p1_wr_mask, p1_wr_data => p1_wr_data, p1_wr_full => p1_wr_full, p1_wr_empty => p1_wr_empty, p1_wr_count => p1_wr_count, p1_wr_underrun => p1_wr_underrun, p1_wr_error => p1_wr_error, p1_rd_clk => p1_rd_clk, p1_rd_en => p1_rd_en, p1_rd_data => p1_rd_data, p1_rd_full => p1_rd_full, p1_rd_empty => p1_rd_empty, p1_rd_count => p1_rd_count, p1_rd_overflow => p1_rd_overflow, p1_rd_error => p1_rd_error, p2_arb_en => '1', p2_cmd_clk => p2_cmd_clk, p2_cmd_en => p2_cmd_en, p2_cmd_instr => p2_cmd_instr, p2_cmd_bl => p2_cmd_bl, p2_cmd_byte_addr => p2_cmd_byte_addr, p2_cmd_empty => p2_cmd_empty, p2_cmd_full => p2_cmd_full, p2_rd_clk => '0', p2_rd_en => '0', p2_rd_data => open, p2_rd_full => open, p2_rd_empty => open, p2_rd_count => open, p2_rd_overflow => open, p2_rd_error => open, p2_wr_clk => p2_wr_clk, p2_wr_en => p2_wr_en, p2_wr_mask => p2_wr_mask, p2_wr_data => p2_wr_data, p2_wr_full => p2_wr_full, p2_wr_empty => p2_wr_empty, p2_wr_count => p2_wr_count, p2_wr_underrun => p2_wr_underrun, p2_wr_error => p2_wr_error, p3_arb_en => '1', p3_cmd_clk => p3_cmd_clk, p3_cmd_en => p3_cmd_en, p3_cmd_instr => p3_cmd_instr, p3_cmd_bl => p3_cmd_bl, p3_cmd_byte_addr => p3_cmd_byte_addr, p3_cmd_empty => p3_cmd_empty, p3_cmd_full => p3_cmd_full, p3_rd_clk => p3_rd_clk, p3_rd_en => p3_rd_en, p3_rd_data => p3_rd_data, p3_rd_full => p3_rd_full, p3_rd_empty => p3_rd_empty, p3_rd_count => p3_rd_count, p3_rd_overflow => p3_rd_overflow, p3_rd_error => p3_rd_error, p3_wr_clk => '0', p3_wr_en => '0', p3_wr_mask => (others => '0'), p3_wr_data => (others => '0'), p3_wr_full => open, p3_wr_empty => open, p3_wr_count => open, p3_wr_underrun => open, p3_wr_error => open, p4_arb_en => '1', p4_cmd_clk => p4_cmd_clk, p4_cmd_en => p4_cmd_en, p4_cmd_instr => p4_cmd_instr, p4_cmd_bl => p4_cmd_bl, p4_cmd_byte_addr => p4_cmd_byte_addr, p4_cmd_empty => p4_cmd_empty, p4_cmd_full => p4_cmd_full, p4_rd_clk => '0', p4_rd_en => '0', p4_rd_data => open, p4_rd_full => open, p4_rd_empty => open, p4_rd_count => open, p4_rd_overflow => open, p4_rd_error => open, p4_wr_clk => p4_wr_clk, p4_wr_en => p4_wr_en, p4_wr_mask => p4_wr_mask, p4_wr_data => p4_wr_data, p4_wr_full => p4_wr_full, p4_wr_empty => p4_wr_empty, p4_wr_count => p4_wr_count, p4_wr_underrun => p4_wr_underrun, p4_wr_error => p4_wr_error, p5_arb_en => '1', p5_cmd_clk => p5_cmd_clk, p5_cmd_en => p5_cmd_en, p5_cmd_instr => p5_cmd_instr, p5_cmd_bl => p5_cmd_bl, p5_cmd_byte_addr => p5_cmd_byte_addr, p5_cmd_empty => p5_cmd_empty, p5_cmd_full => p5_cmd_full, p5_rd_clk => p5_rd_clk, p5_rd_en => p5_rd_en, p5_rd_data => p5_rd_data, p5_rd_full => p5_rd_full, p5_rd_empty => p5_rd_empty, p5_rd_count => p5_rd_count, p5_rd_overflow => p5_rd_overflow, p5_rd_error => p5_rd_error, p5_wr_clk => '0', p5_wr_en => '0', p5_wr_mask => (others => '0'), p5_wr_data => (others => '0'), p5_wr_full => open, p5_wr_empty => open, p5_wr_count => open, p5_wr_underrun => open, p5_wr_error => open ); end architecture;
-- $Id: serport_2clock.vhd 476 2013-01-26 22:23:53Z mueller $ -- -- Copyright 2011- by Walter F.J. Mueller <[email protected]> -- -- This program is free software; you may redistribute and/or modify it under -- the terms of the GNU General Public License as published by the Free -- Software Foundation, either version 2, or at your option any later version. -- -- This program is distributed in the hope that it will be useful, but -- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for complete details. -- ------------------------------------------------------------------------------ -- Module Name: serport_2clock - syn -- Description: serial port: serial port module, 2 clock domain -- -- Dependencies: genlib/cdc_pulse -- serport_uart_rxtx_ab -- serport_xonrx -- serport_xontx -- memlib/fifo_2c_dram -- Test bench: - -- Target Devices: generic -- Tool versions: xst 13.1; ghdl 0.29 -- -- Synthesized (xst): -- Date Rev ise Target flop lutl lutm slic t peri -- 2011-11-13 424 13.1 O40d xc3s1000-4 224 362 64 295 s 8.6/10.1 -- -- Revision History: -- Date Rev Version Comment -- 2011-12-10 438 1.0.2 internal reset on abact -- 2011-12-09 437 1.0.1 rename stat->moni port -- 2011-11-13 424 1.0 Initial version -- 2011-11-07 421 0.5 First draft ------------------------------------------------------------------------------ library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use work.slvtypes.all; use work.serportlib.all; use work.genlib.all; use work.memlib.all; entity serport_2clock is -- serial port module, 2 clock domain generic ( CDWIDTH : positive := 13; -- clk divider width CDINIT : natural := 15; -- clk divider initial/reset setting RXFAWIDTH : natural := 5; -- rx fifo address width TXFAWIDTH : natural := 5); -- tx fifo address width port ( CLKU : in slbit; -- clock (backend:user) RESET : in slbit; -- reset CLKS : in slbit; -- clock (frontend:serial) CES_MSEC : in slbit; -- S|1 msec clock enable ENAXON : in slbit; -- U|enable xon/xoff handling ENAESC : in slbit; -- U|enable xon/xoff escaping RXDATA : out slv8; -- U|receiver data out RXVAL : out slbit; -- U|receiver data valid RXHOLD : in slbit; -- U|receiver data hold TXDATA : in slv8; -- U|transmit data in TXENA : in slbit; -- U|transmit data enable TXBUSY : out slbit; -- U|transmit busy MONI : out serport_moni_type; -- U|serport monitor port RXSD : in slbit; -- S|receive serial data (uart view) TXSD : out slbit; -- S|transmit serial data (uart view) RXRTS_N : out slbit; -- S|receive rts (uart view, act.low) TXCTS_N : in slbit -- S|transmit cts (uart view, act.low) ); end serport_2clock; architecture syn of serport_2clock is type synu_type is record rxact_c : slbit; -- rxact (capt from CLKS->CLKU) rxact_s : slbit; -- rxact (sync in CLKU) txact_c : slbit; -- txact (capt from CLKS->CLKU) txact_s : slbit; -- txact (sync in CLKU) abact_c : slbit; -- abact (capt from CLKS->CLKU) abact_s : slbit; -- abact (sync in CLKU) rxok_c : slbit; -- rxok (capt from CLKS->CLKU) rxok_s : slbit; -- rxok (sync in CLKU) txok_c : slbit; -- txok (capt from CLKS->CLKU) txok_s : slbit; -- txok (sync in CLKU) abclkdiv_c : slv(CDWIDTH-1 downto 0); -- abclkdiv (capt from CLKS->CLKU) abclkdiv_s : slv(CDWIDTH-1 downto 0); -- abclkdiv (sync in CLKU) end record synu_type; constant synu_init : synu_type := ( '0','0', -- rxact_c,_s '0','0', -- txact_c,_s '0','0', -- abact_c,_s '0','0', -- rxok_c,_s '0','0', -- txok_c,_s slv(to_unsigned(0,CDWIDTH)), -- abclkdiv_c slv(to_unsigned(0,CDWIDTH)) -- abclkdiv_s ); type syns_type is record enaxon_c : slbit; -- enaxon (capt from CLKU->CLKS) enaxon_s : slbit; -- enaxon (sync in CLKS) enaesc_c : slbit; -- enaesc (capt from CLKU->CLKS) enaesc_s : slbit; -- enaesc (sync in CLKS) end record syns_type; constant syns_init : syns_type := ( '0','0', -- enaxon_c,_s '0','0' -- enaxon_c,_s ); signal R_SYNU : synu_type := synu_init; -- sync registers (clku) signal R_SYNS : syns_type := syns_init; -- sync registers (clks) signal R_RXOK : slbit := '1'; signal RESET_INT : slbit := '0'; signal RESET_CLKS : slbit := '0'; signal UART_RXDATA : slv8 := (others=>'0'); signal UART_RXVAL : slbit := '0'; signal UART_TXDATA : slv8 := (others=>'0'); signal UART_TXENA : slbit := '0'; signal UART_TXBUSY : slbit := '0'; signal XONTX_TXENA : slbit := '0'; signal XONTX_TXBUSY : slbit := '0'; signal RXFIFO_DI : slv8 := (others=>'0'); signal RXFIFO_ENA : slbit := '0'; signal RXFIFO_BUSY : slbit := '0'; signal RXFIFO_SIZEW : slv(RXFAWIDTH-1 downto 0) := (others=>'0'); signal TXFIFO_DO : slv8 := (others=>'0'); signal TXFIFO_VAL : slbit := '0'; signal TXFIFO_HOLD : slbit := '0'; signal RXERR : slbit := '0'; signal RXOVR : slbit := '0'; signal RXACT : slbit := '0'; signal ABACT : slbit := '0'; signal ABDONE : slbit := '0'; signal ABCLKDIV : slv(CDWIDTH-1 downto 0) := (others=>'0'); signal TXOK : slbit := '0'; signal RXOK : slbit := '0'; signal RXERR_CLKU : slbit := '0'; signal RXOVR_CLKU : slbit := '0'; signal ABDONE_CLKU : slbit := '0'; begin assert CDWIDTH<=16 report "assert(CDWIDTH<=16): max width of UART clock divider" severity failure; CDC_RESET : cdc_pulse generic map ( POUT_SINGLE => false, BUSY_WACK => false) port map ( CLKM => CLKU, RESET => '0', CLKS => CLKS, PIN => RESET, BUSY => open, POUT => RESET_CLKS ); UART : serport_uart_rxtx_ab -- uart, rx+tx+autobauder combo generic map ( CDWIDTH => CDWIDTH, CDINIT => CDINIT) port map ( CLK => CLKS, CE_MSEC => CES_MSEC, RESET => RESET_CLKS, RXSD => RXSD, RXDATA => UART_RXDATA, RXVAL => UART_RXVAL, RXERR => RXERR, RXACT => RXACT, TXSD => TXSD, TXDATA => UART_TXDATA, TXENA => UART_TXENA, TXBUSY => UART_TXBUSY, ABACT => ABACT, ABDONE => ABDONE, ABCLKDIV => ABCLKDIV ); RESET_INT <= RESET_CLKS or ABACT; XONRX : serport_xonrx -- xon/xoff logic rx path port map ( CLK => CLKS, RESET => RESET_INT, ENAXON => R_SYNS.enaxon_s, ENAESC => R_SYNS.enaesc_s, UART_RXDATA => UART_RXDATA, UART_RXVAL => UART_RXVAL, RXDATA => RXFIFO_DI, RXVAL => RXFIFO_ENA, RXHOLD => RXFIFO_BUSY, RXOVR => RXOVR, TXOK => TXOK ); XONTX : serport_xontx -- xon/xoff logic tx path port map ( CLK => CLKS, RESET => RESET_INT, ENAXON => R_SYNS.enaxon_s, ENAESC => R_SYNS.enaesc_s, UART_TXDATA => UART_TXDATA, UART_TXENA => XONTX_TXENA, UART_TXBUSY => XONTX_TXBUSY, TXDATA => TXFIFO_DO, TXENA => TXFIFO_VAL, TXBUSY => TXFIFO_HOLD, RXOK => RXOK, TXOK => TXOK ); RXFIFO : fifo_2c_dram -- input fifo, 2 clock, dram based generic map ( AWIDTH => RXFAWIDTH, DWIDTH => 8) port map ( CLKW => CLKS, CLKR => CLKU, RESETW => ABACT, -- clear fifo on abact RESETR => RESET, DI => RXFIFO_DI, ENA => RXFIFO_ENA, BUSY => RXFIFO_BUSY, DO => RXDATA, VAL => RXVAL, HOLD => RXHOLD, SIZEW => RXFIFO_SIZEW, SIZER => open ); TXFIFO : fifo_2c_dram -- output fifo, 2 clock, dram based generic map ( AWIDTH => TXFAWIDTH, DWIDTH => 8) port map ( CLKW => CLKU, CLKR => CLKS, RESETW => RESET, RESETR => ABACT, -- clear fifo on abact DI => TXDATA, ENA => TXENA, BUSY => TXBUSY, DO => TXFIFO_DO, VAL => TXFIFO_VAL, HOLD => TXFIFO_HOLD, SIZEW => open, SIZER => open ); -- receive back preasure -- on if fifo more than 3/4 full (less than 1/4 free) -- off if fifo less than 1/2 full (more than 1/2 free) proc_rxok: process (CLKS) constant rxsize_rxok_off : slv2 := "01"; constant rxsize_rxok_on : slv2 := "10"; variable rxsize_msb : slv2 := "00"; begin if rising_edge(CLKS) then if RESET_INT = '1' then R_RXOK <= '1'; else rxsize_msb := RXFIFO_SIZEW(RXFAWIDTH-1 downto RXFAWIDTH-2); if unsigned(rxsize_msb) < unsigned(rxsize_rxok_off) then R_RXOK <= '0'; elsif unsigned(RXSIZE_MSB) >= unsigned(rxsize_rxok_on) then R_RXOK <= '1'; end if; end if; end if; end process proc_rxok; RXOK <= R_RXOK; RXRTS_N <= not R_RXOK; proc_cts: process (TXCTS_N, XONTX_TXENA, UART_TXBUSY) begin if TXCTS_N = '0' then -- transmit cts asserted UART_TXENA <= XONTX_TXENA; XONTX_TXBUSY <= UART_TXBUSY; else -- transmit cts not asserted UART_TXENA <= '0'; XONTX_TXBUSY <= '1'; end if; end process proc_cts; proc_synu: process (CLKU) begin if rising_edge(CLKU) then R_SYNU.rxact_c <= RXACT; R_SYNU.rxact_s <= R_SYNU.rxact_c; R_SYNU.txact_c <= UART_TXBUSY; R_SYNU.txact_s <= R_SYNU.txact_c; R_SYNU.abact_c <= ABACT; R_SYNU.abact_s <= R_SYNU.abact_c; R_SYNU.rxok_c <= RXOK; R_SYNU.rxok_s <= R_SYNU.rxok_c; R_SYNU.txok_c <= TXOK; R_SYNU.txok_s <= R_SYNU.txok_c; R_SYNU.abclkdiv_c <= ABCLKDIV; R_SYNU.abclkdiv_s <= R_SYNU.abclkdiv_c; end if; end process proc_synu; proc_syns: process (CLKS) begin if rising_edge(CLKS) then R_SYNS.enaxon_c <= ENAXON; R_SYNS.enaxon_s <= R_SYNS.enaxon_c; R_SYNS.enaesc_c <= ENAESC; R_SYNS.enaesc_s <= R_SYNS.enaesc_c; end if; end process proc_syns; CDC_RXERR : cdc_pulse generic map ( POUT_SINGLE => true, BUSY_WACK => false) port map ( CLKM => CLKS, RESET => '0', CLKS => CLKU, PIN => RXERR, BUSY => open, POUT => RXERR_CLKU ); CDC_RXOVR : cdc_pulse generic map ( POUT_SINGLE => true, BUSY_WACK => false) port map ( CLKM => CLKS, RESET => '0', CLKS => CLKU, PIN => RXOVR, BUSY => open, POUT => RXOVR_CLKU ); CDC_ABDONE : cdc_pulse generic map ( POUT_SINGLE => true, BUSY_WACK => false) port map ( CLKM => CLKS, RESET => '0', CLKS => CLKU, PIN => ABDONE, BUSY => open, POUT => ABDONE_CLKU ); MONI.rxerr <= RXERR_CLKU; MONI.rxovr <= RXOVR_CLKU; MONI.rxact <= R_SYNU.rxact_s; MONI.txact <= R_SYNU.txact_s; MONI.abact <= R_SYNU.abact_s; MONI.abdone <= ABDONE_CLKU; MONI.rxok <= R_SYNU.rxok_s; MONI.txok <= R_SYNU.txok_s; proc_abclkdiv: process (R_SYNU.abclkdiv_s) begin MONI.abclkdiv <= (others=>'0'); MONI.abclkdiv(R_SYNU.abclkdiv_s'range) <= R_SYNU.abclkdiv_s; end process proc_abclkdiv; end syn;
entity ieee4 is end entity; library ieee; use ieee.math_real.all; architecture test of ieee4 is function approx(x, y : real; t : real := 0.001) return boolean is begin return abs(x - y) < t; end function; begin process is variable s1, s2 : integer; variable r : real; begin r := 6.8; wait for 0 ns; -- Prevent constant folding assert approx(sign(r), 1.0); r := 5.7; wait for 0 ns; assert approx(ceil(r), 6.0); r := 0.6; wait for 0 ns; assert approx(floor(r), 0.0); r := 0.5; wait for 0 ns; assert approx(round(r), 1.0); r := 6.4999; wait for 0 ns; assert approx(round(r), 6.0); r := 0.999; wait for 0 ns; assert approx(trunc(r), 0.0); r := 4.6; wait for 0 ns; assert approx(r mod 2.7, 1.9); s1 := 6; s2 := 883; uniform(s1, s2, r); assert approx(r, 0.983380); uniform(s1, s2, r); assert approx(r, 0.627369); uniform(s1, s2, r); assert approx(r, 0.883711); uniform(s1, s2, r); assert approx(r, 0.472620); uniform(s1, s2, r); assert approx(r, 0.582179); r := 4.0; wait for 0 ns; assert approx(sqrt(r), 2.0); r := 4.3; wait for 0 ns; assert approx(sqrt(r), 2.0736); r := 612.8; wait for 0 ns; assert approx(cbrt(r), 8.49388); r := 1.2; wait for 0 ns; assert approx(5 ** r, 6.8986); r := 2.0; wait for 0 ns; assert approx(r ** (-1.0), 0.5); r := 2.0; wait for 0 ns; assert approx(exp(r), 7.389056); r := 1.0; wait for 0 ns; assert approx(log(r), 0.0); r := MATH_E; wait for 0 ns; assert approx(log(r), 1.0); r := 5216.72; wait for 0 ns; assert approx(log(r), 8.5596); r := MATH_PI; wait for 0 ns; assert approx(sin(r), 0.0); r := 1.15251; wait for 0 ns; assert approx(cos(r), 0.406195); r := 0.5; wait for 0 ns; assert approx(arctan(r), 0.463648); wait; end process; end architecture;
entity ieee4 is end entity; library ieee; use ieee.math_real.all; architecture test of ieee4 is function approx(x, y : real; t : real := 0.001) return boolean is begin return abs(x - y) < t; end function; begin process is variable s1, s2 : integer; variable r : real; begin r := 6.8; wait for 0 ns; -- Prevent constant folding assert approx(sign(r), 1.0); r := 5.7; wait for 0 ns; assert approx(ceil(r), 6.0); r := 0.6; wait for 0 ns; assert approx(floor(r), 0.0); r := 0.5; wait for 0 ns; assert approx(round(r), 1.0); r := 6.4999; wait for 0 ns; assert approx(round(r), 6.0); r := 0.999; wait for 0 ns; assert approx(trunc(r), 0.0); r := 4.6; wait for 0 ns; assert approx(r mod 2.7, 1.9); s1 := 6; s2 := 883; uniform(s1, s2, r); assert approx(r, 0.983380); uniform(s1, s2, r); assert approx(r, 0.627369); uniform(s1, s2, r); assert approx(r, 0.883711); uniform(s1, s2, r); assert approx(r, 0.472620); uniform(s1, s2, r); assert approx(r, 0.582179); r := 4.0; wait for 0 ns; assert approx(sqrt(r), 2.0); r := 4.3; wait for 0 ns; assert approx(sqrt(r), 2.0736); r := 612.8; wait for 0 ns; assert approx(cbrt(r), 8.49388); r := 1.2; wait for 0 ns; assert approx(5 ** r, 6.8986); r := 2.0; wait for 0 ns; assert approx(r ** (-1.0), 0.5); r := 2.0; wait for 0 ns; assert approx(exp(r), 7.389056); r := 1.0; wait for 0 ns; assert approx(log(r), 0.0); r := MATH_E; wait for 0 ns; assert approx(log(r), 1.0); r := 5216.72; wait for 0 ns; assert approx(log(r), 8.5596); r := MATH_PI; wait for 0 ns; assert approx(sin(r), 0.0); r := 1.15251; wait for 0 ns; assert approx(cos(r), 0.406195); r := 0.5; wait for 0 ns; assert approx(arctan(r), 0.463648); wait; end process; end architecture;
-- NEED RESULT: ARCH00401.P1: Multi inertial transactions occurred on concurrent signal asg passed -- NEED RESULT: ARCH00401: One inertial transaction occurred on a concurrent signal asg passed -- NEED RESULT: ARCH00401: Old transactions were removed on a concurrent signal asg passed -- NEED RESULT: ARCH00401: One inertial transaction occurred on a concurrent signal asg passed -- NEED RESULT: ARCH00401: Inertial semantics check on a concurrent signal asg passed -- NEED RESULT: P1: Inertial transactions completed entirely passed ------------------------------------------------------------------------------- -- -- Copyright (c) 1989 by Intermetrics, Inc. -- All rights reserved. -- ------------------------------------------------------------------------------- -- -- TEST NAME: -- -- CT00401 -- -- AUTHOR: -- -- G. Tominovich -- -- TEST OBJECTIVES: -- -- 9.5 (3) -- 9.5.2 (1) -- -- DESIGN UNIT ORDERING: -- -- ENT00401(ARCH00401) -- ENT00401_Test_Bench(ARCH00401_Test_Bench) -- -- REVISION HISTORY: -- -- 30-JUL-1987 - initial revision -- -- NOTES: -- -- self-checking -- automatically generated -- use WORK.STANDARD_TYPES.all ; entity ENT00401 is end ENT00401 ; -- -- architecture ARCH00401 of ENT00401 is subtype chk_sig_type is integer range -1 to 100 ; signal chk_st_arr1_vector : chk_sig_type := -1 ; -- subtype chk_time_type is Time ; signal s_st_arr1_vector_savt : chk_time_type := 0 ns ; -- subtype chk_cnt_type is Integer ; signal s_st_arr1_vector_cnt : chk_cnt_type := 0 ; -- type select_type is range 1 to 6 ; signal st_arr1_vector_select : select_type := 1 ; -- signal s_st_arr1_vector : st_arr1_vector := c_st_arr1_vector_1 ; -- begin CHG1 : process variable correct : boolean ; begin case s_st_arr1_vector_cnt is when 0 => null ; -- s_st_arr1_vector(highb)(lowb to highb-1) <= -- c_st_arr1_vector_2(highb)(lowb to highb-1) after 10 ns, -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 20 ns ; -- when 1 => correct := s_st_arr1_vector(highb)(lowb to highb-1) = c_st_arr1_vector_2(highb)(lowb to highb-1) and (s_st_arr1_vector_savt + 10 ns) = Std.Standard.Now ; -- when 2 => correct := correct and s_st_arr1_vector(highb)(lowb to highb-1) = c_st_arr1_vector_1(highb)(lowb to highb-1) and (s_st_arr1_vector_savt + 10 ns) = Std.Standard.Now ; test_report ( "ARCH00401.P1" , "Multi inertial transactions occurred on " & "concurrent signal asg", correct ) ; -- st_arr1_vector_select <= transport 2 ; -- s_st_arr1_vector(highb)(lowb to highb-1) <= -- c_st_arr1_vector_2(highb)(lowb to highb-1) after 10 ns , -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 20 ns , -- c_st_arr1_vector_2(highb)(lowb to highb-1) after 30 ns , -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 40 ns ; -- when 3 => correct := s_st_arr1_vector(highb)(lowb to highb-1) = c_st_arr1_vector_2(highb)(lowb to highb-1) and (s_st_arr1_vector_savt + 10 ns) = Std.Standard.Now ; st_arr1_vector_select <= transport 3 ; -- s_st_arr1_vector(highb)(lowb to highb-1) <= -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 5 ns ; -- when 4 => correct := correct and s_st_arr1_vector(highb)(lowb to highb-1) = c_st_arr1_vector_1(highb)(lowb to highb-1) and (s_st_arr1_vector_savt + 5 ns) = Std.Standard.Now ; test_report ( "ARCH00401" , "One inertial transaction occurred on a " & "concurrent signal asg", correct ) ; st_arr1_vector_select <= transport 4 ; -- s_st_arr1_vector(highb)(lowb to highb-1) <= -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 100 ns ; -- when 5 => correct := correct and s_st_arr1_vector(highb)(lowb to highb-1) = c_st_arr1_vector_1(highb)(lowb to highb-1) and (s_st_arr1_vector_savt + 100 ns) = Std.Standard.Now ; test_report ( "ARCH00401" , "Old transactions were removed on a " & "concurrent signal asg", correct ) ; st_arr1_vector_select <= transport 5 ; -- s_st_arr1_vector(highb)(lowb to highb-1) <= -- c_st_arr1_vector_2(highb)(lowb to highb-1) after 10 ns , -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 20 ns , -- c_st_arr1_vector_2(highb)(lowb to highb-1) after 30 ns , -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 40 ns ; -- when 6 => correct := correct and s_st_arr1_vector(highb)(lowb to highb-1) = c_st_arr1_vector_2(highb)(lowb to highb-1) and (s_st_arr1_vector_savt + 10 ns) = Std.Standard.Now ; test_report ( "ARCH00401" , "One inertial transaction occurred on a " & "concurrent signal asg", correct ) ; st_arr1_vector_select <= transport 6 ; -- Last transaction above is marked -- s_st_arr1_vector(highb)(lowb to highb-1) <= -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 40 ns ; -- when 7 => correct := correct and s_st_arr1_vector(highb)(lowb to highb-1) = c_st_arr1_vector_1(highb)(lowb to highb-1) and (s_st_arr1_vector_savt + 30 ns) = Std.Standard.Now ; -- when 8 => correct := correct and s_st_arr1_vector(highb)(lowb to highb-1) = c_st_arr1_vector_1(highb)(lowb to highb-1) and (s_st_arr1_vector_savt + 10 ns) = Std.Standard.Now ; test_report ( "ARCH00401" , "Inertial semantics check on a concurrent " & "signal asg", correct ) ; -- when others => -- No more transactions should have occurred test_report ( "ARCH00401" , "Inertial semantics check on a concurrent " & "signal asg", false ) ; -- end case ; -- s_st_arr1_vector_savt <= transport Std.Standard.Now ; chk_st_arr1_vector <= transport s_st_arr1_vector_cnt after (1 us - Std.Standard.Now) ; s_st_arr1_vector_cnt <= transport s_st_arr1_vector_cnt + 1 ; wait until (not s_st_arr1_vector(highb)(lowb to highb-1)'Quiet) and (s_st_arr1_vector_savt /= Std.Standard.Now) ; -- end process CHG1 ; -- PGEN_CHKP_1 : process ( chk_st_arr1_vector ) begin if Std.Standard.Now > 0 ns then test_report ( "P1" , "Inertial transactions completed entirely", chk_st_arr1_vector = 8 ) ; end if ; end process PGEN_CHKP_1 ; -- -- with st_arr1_vector_select select s_st_arr1_vector(highb)(lowb to highb-1) <= c_st_arr1_vector_2(highb)(lowb to highb-1) after 10 ns, c_st_arr1_vector_1(highb)(lowb to highb-1) after 20 ns when 1, -- c_st_arr1_vector_2(highb)(lowb to highb-1) after 10 ns , c_st_arr1_vector_1(highb)(lowb to highb-1) after 20 ns , c_st_arr1_vector_2(highb)(lowb to highb-1) after 30 ns , c_st_arr1_vector_1(highb)(lowb to highb-1) after 40 ns when 2, -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 5 ns when 3, -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 100 ns when 4, -- c_st_arr1_vector_2(highb)(lowb to highb-1) after 10 ns , c_st_arr1_vector_1(highb)(lowb to highb-1) after 20 ns , c_st_arr1_vector_2(highb)(lowb to highb-1) after 30 ns , c_st_arr1_vector_1(highb)(lowb to highb-1) after 40 ns when 5, -- -- Last transaction above is marked c_st_arr1_vector_1(highb)(lowb to highb-1) after 40 ns when 6 ; -- end ARCH00401 ; -- -- use WORK.STANDARD_TYPES.all ; entity ENT00401_Test_Bench is end ENT00401_Test_Bench ; -- -- architecture ARCH00401_Test_Bench of ENT00401_Test_Bench is begin L1: block component UUT end component ; -- for CIS1 : UUT use entity WORK.ENT00401 ( ARCH00401 ) ; begin CIS1 : UUT ; end block L1 ; end ARCH00401_Test_Bench ;
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc3017.vhd,v 1.2 2001-10-26 16:30:24 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- library lib01; use lib01.c11s02b00x00p05n03i03017pkg.all; ENTITY c11s02b00x00p05n03i03017ent IS assert my_bool report "Library clause preceeding entity is valid in entity scope." severity note; END c11s02b00x00p05n03i03017ent; use lib01.c11s02b00x00p05n03i03017pkg.all; -- lib01 unknown Failed_here ENTITY c11s02b00x00p05n03i03017ent IS assert my_bool report "Library clause is valid outside entity scope - test fails." severity note ; END c11s02b00x00p05n03i03017ent; ARCHITECTURE c11s02b00x00p05n03i03017arch OF c11s02b00x00p05n03i03017ent IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c11s02b00x00p05n03i03017 - Library clause only extends to the end of the declatative region associated with the design unit" severity ERROR; wait; END PROCESS TESTING; END c11s02b00x00p05n03i03017arch;
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc3017.vhd,v 1.2 2001-10-26 16:30:24 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- library lib01; use lib01.c11s02b00x00p05n03i03017pkg.all; ENTITY c11s02b00x00p05n03i03017ent IS assert my_bool report "Library clause preceeding entity is valid in entity scope." severity note; END c11s02b00x00p05n03i03017ent; use lib01.c11s02b00x00p05n03i03017pkg.all; -- lib01 unknown Failed_here ENTITY c11s02b00x00p05n03i03017ent IS assert my_bool report "Library clause is valid outside entity scope - test fails." severity note ; END c11s02b00x00p05n03i03017ent; ARCHITECTURE c11s02b00x00p05n03i03017arch OF c11s02b00x00p05n03i03017ent IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c11s02b00x00p05n03i03017 - Library clause only extends to the end of the declatative region associated with the design unit" severity ERROR; wait; END PROCESS TESTING; END c11s02b00x00p05n03i03017arch;
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc3017.vhd,v 1.2 2001-10-26 16:30:24 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- library lib01; use lib01.c11s02b00x00p05n03i03017pkg.all; ENTITY c11s02b00x00p05n03i03017ent IS assert my_bool report "Library clause preceeding entity is valid in entity scope." severity note; END c11s02b00x00p05n03i03017ent; use lib01.c11s02b00x00p05n03i03017pkg.all; -- lib01 unknown Failed_here ENTITY c11s02b00x00p05n03i03017ent IS assert my_bool report "Library clause is valid outside entity scope - test fails." severity note ; END c11s02b00x00p05n03i03017ent; ARCHITECTURE c11s02b00x00p05n03i03017arch OF c11s02b00x00p05n03i03017ent IS BEGIN TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c11s02b00x00p05n03i03017 - Library clause only extends to the end of the declatative region associated with the design unit" severity ERROR; wait; END PROCESS TESTING; END c11s02b00x00p05n03i03017arch;
----------------------------------------------------------------------------- -- LEON3 Demonstration design -- Copyright (C) 2004 Jiri Gaisler, Gaisler Research ------------------------------------------------------------------------------ -- This file is a part of the GRLIB VHDL IP LIBRARY -- Copyright (C) 2003 - 2008, Gaisler Research -- Copyright (C) 2008 - 2014, Aeroflex Gaisler -- Copyright (C) 2015, Cobham Gaisler -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------------------ library ieee; use ieee.std_logic_1164.all; library grlib, techmap; use grlib.amba.all; use grlib.devices.all; use grlib.stdlib.all; use techmap.gencomp.all; use techmap.allclkgen.all; library gaisler; use gaisler.memctrl.all; use gaisler.leon3.all; use gaisler.uart.all; use gaisler.misc.all; use gaisler.i2c.all; use gaisler.net.all; use gaisler.jtag.all; use gaisler.spacewire.all; use gaisler.ddrpkg.all; library esa; use esa.memoryctrl.all; use work.config.all; entity leon3mp is generic ( fabtech : integer := CFG_FABTECH; memtech : integer := CFG_MEMTECH; padtech : integer := CFG_PADTECH; ncpu : integer := CFG_NCPU; disas : integer := CFG_DISAS; -- Enable disassembly to console dbguart : integer := CFG_DUART; -- Print UART on console pclow : integer := CFG_PCLOW ); port ( sys_rst_in : in std_ulogic; sys_clk : in std_ulogic; -- 100 MHz main clock sysace_clk_in : in std_ulogic; -- System ACE clock plb_error : out std_logic; -- IU error mode opb_error : out std_logic; -- DSU active flash_a23 : out std_ulogic; sram_flash_addr : out std_logic_vector(22 downto 0); sram_flash_data : inout std_logic_vector(31 downto 0); sram_cen : out std_logic; sram_bw : out std_logic_vector (0 to 3); sram_flash_oe_n : out std_ulogic; sram_flash_we_n : out std_ulogic; flash_ce : out std_logic; sram_clk : out std_ulogic; sram_clk_fb : in std_ulogic; sram_mode : out std_ulogic; sram_adv_ld_n : out std_ulogic; --pragma translate_off iosn : out std_ulogic; --pragma translate_on ddr_clk : out std_logic; ddr_clkb : out std_logic; ddr_clk_fb : in std_logic; ddr_cke : out std_logic; ddr_csb : out std_logic; ddr_web : out std_ulogic; -- ddr write enable ddr_rasb : out std_ulogic; -- ddr ras ddr_casb : out std_ulogic; -- ddr cas ddr_dm : out std_logic_vector (3 downto 0); -- ddr dm ddr_dqs : inout std_logic_vector (3 downto 0); -- ddr dqs ddr_ad : out std_logic_vector (12 downto 0); -- ddr address ddr_ba : out std_logic_vector (1 downto 0); -- ddr bank address ddr_dq : inout std_logic_vector (31 downto 0); -- ddr data txd1 : out std_ulogic; -- UART1 tx data rxd1 : in std_ulogic; -- UART1 rx data gpio : inout std_logic_vector(26 downto 0); -- I/O port phy_gtx_clk : out std_logic; phy_mii_data: inout std_logic; -- ethernet PHY interface phy_tx_clk : in std_ulogic; phy_rx_clk : in std_ulogic; phy_rx_data : in std_logic_vector(7 downto 0); phy_dv : in std_ulogic; phy_rx_er : in std_ulogic; phy_col : in std_ulogic; phy_crs : in std_ulogic; phy_int_n : in std_ulogic; phy_tx_data : out std_logic_vector(7 downto 0); phy_tx_en : out std_ulogic; phy_tx_er : out std_ulogic; phy_mii_clk : out std_ulogic; phy_rst_n : out std_ulogic; ps2_keyb_clk : inout std_logic; ps2_keyb_data : inout std_logic; ps2_mouse_clk : inout std_logic; ps2_mouse_data : inout std_logic; tft_lcd_clk : out std_ulogic; vid_blankn : out std_ulogic; vid_syncn : out std_ulogic; vid_hsync : out std_ulogic; vid_vsync : out std_ulogic; vid_r : out std_logic_vector(7 downto 0); vid_g : out std_logic_vector(7 downto 0); vid_b : out std_logic_vector(7 downto 0); usb_csn : out std_logic; iic_scl : inout std_ulogic; iic_sda : inout std_ulogic; sace_usb_a : out std_logic_vector(6 downto 0); sace_mpce : out std_ulogic; sace_usb_d : inout std_logic_vector(15 downto 0); sace_usb_oen : out std_ulogic; sace_usb_wen : out std_ulogic; sysace_mpirq : in std_ulogic ); end; architecture rtl of leon3mp is constant blength : integer := 12; constant fifodepth : integer := 8; constant maxahbm : integer := NCPU+CFG_AHB_UART +CFG_GRETH+CFG_AHB_JTAG+CFG_SVGA_ENABLE; signal vcc, gnd : std_logic_vector(4 downto 0); signal memi : memory_in_type; signal memo : memory_out_type; signal wpo : wprot_out_type; signal sdi : sdctrl_in_type; signal sdo : sdctrl_out_type; signal apbi : apb_slv_in_type; signal apbo : apb_slv_out_vector := (others => apb_none); signal ahbsi : ahb_slv_in_type; signal ahbso : ahb_slv_out_vector := (others => ahbs_none); signal ahbmi : ahb_mst_in_type; signal ahbmo : ahb_mst_out_vector := (others => ahbm_none); signal clkm, rstn, rstraw, srclkl : std_ulogic; signal clkm_90, clkm_180, clkm_270 : std_ulogic; signal cgi, cgi2 : clkgen_in_type; signal cgo, cgo2 : clkgen_out_type; signal u1i, u2i, dui : uart_in_type; signal u1o, u2o, duo : uart_out_type; signal irqi : irq_in_vector(0 to NCPU-1); signal irqo : irq_out_vector(0 to NCPU-1); signal dbgi : l3_debug_in_vector(0 to NCPU-1); signal dbgo : l3_debug_out_vector(0 to NCPU-1); signal dsui : dsu_in_type; signal dsuo : dsu_out_type; signal ethi, ethi1, ethi2 : eth_in_type; signal etho, etho1, etho2 : eth_out_type; signal gpti : gptimer_in_type; signal gpioi : gpio_in_type; signal gpioo : gpio_out_type; signal clklock, lock, lclk, clkml, rst, ndsuact : std_ulogic; signal tck, tckn, tms, tdi, tdo : std_ulogic; signal ddrclk, ddrrst : std_ulogic; signal ethclk, egtx_clk_fb : std_ulogic; signal egtx_clk, legtx_clk, l2egtx_clk : std_ulogic; signal kbdi : ps2_in_type; signal kbdo : ps2_out_type; signal moui : ps2_in_type; signal mouo : ps2_out_type; signal vgao : apbvga_out_type; signal clk_sel : std_logic_vector(1 downto 0); signal clkval : std_logic_vector(1 downto 0); signal clkvga, clk1x, video_clk, dac_clk : std_ulogic; signal i2ci : i2c_in_type; signal i2co : i2c_out_type; constant BOARD_FREQ : integer := 100000; -- input frequency in KHz constant CPU_FREQ : integer := BOARD_FREQ * CFG_CLKMUL / CFG_CLKDIV; -- cpu frequency in KHz constant I2C_FILTER : integer := (CPU_FREQ*5+50000)/100000+1; constant IOAEN : integer := CFG_DDRSP; signal stati : ahbstat_in_type; signal ddrclkfb, ssrclkfb, ddr_clkl, ddr_clk90l, ddr_clknl, ddr_clk270l : std_ulogic; signal ddr_clkv : std_logic_vector(2 downto 0); signal ddr_clkbv : std_logic_vector(2 downto 0); signal ddr_ckev : std_logic_vector(1 downto 0); signal ddr_csbv : std_logic_vector(1 downto 0); signal ddr_adl : std_logic_vector (13 downto 0); signal clkace : std_ulogic; signal acei : gracectrl_in_type; signal aceo : gracectrl_out_type; attribute syn_keep : boolean; attribute syn_preserve : boolean; attribute syn_keep of lock : signal is true; attribute syn_preserve of lock : signal is true; attribute syn_keep of clkml : signal is true; attribute syn_preserve of clkml : signal is true; attribute syn_keep of egtx_clk : signal is true; attribute syn_preserve of egtx_clk : signal is true; attribute keep : boolean; attribute keep of lock : signal is true; attribute keep of clkml : signal is true; attribute keep of clkm : signal is true; attribute keep of egtx_clk : signal is true; attribute syn_noprune : boolean; attribute syn_noprune of sysace_clk_in_pad : label is true; signal romsn : std_ulogic; constant SPW_LOOP_BACK : integer := 0; begin usb_csn <= '1'; ---------------------------------------------------------------------- --- Reset and Clock generation ------------------------------------- ---------------------------------------------------------------------- vcc <= (others => '1'); gnd <= (others => '0'); cgi.pllctrl <= "00"; cgi.pllrst <= rstraw; cgi.pllref <= ssrclkfb; ssrref_pad : clkpad generic map (tech => padtech) port map (sram_clk_fb, ssrclkfb); clk_pad : clkpad generic map (tech => padtech, arch => 2) port map (sys_clk, lclk); srclk_pad : outpad generic map (tech => padtech, slew => 1, strength => 24) port map (sram_clk, srclkl); sysace_clk_in_pad : clkpad generic map (tech => padtech) port map (sysace_clk_in, clkace); clkgen0 : clkgen -- system clock generator generic map (CFG_FABTECH, CFG_CLKMUL, CFG_CLKDIV, 1, 0, 0, 0, 0, BOARD_FREQ, 0) port map (lclk, gnd(0), clkm, open, open, srclkl, open, cgi, cgo, open, clk1x); clkgen1 : clkgen -- Ethernet 1G PHY clock generator generic map (CFG_FABTECH, 5, 4, 0, 0, 0, 0, 0, BOARD_FREQ, 0) port map (lclk, gnd(0), egtx_clk, open, open, open, open, cgi2, cgo2); cgi2.pllctrl <= "00"; cgi2.pllrst <= rstraw; --cgi2.pllref <= egtx_clk_fb; egtx_clk_pad : outpad generic map (tech => padtech) port map (phy_gtx_clk, egtx_clk); resetn_pad : inpad generic map (tech => padtech) port map (sys_rst_in, rst); rst0 : rstgen -- reset generator port map (rst, clkm, clklock, rstn, rstraw); clklock <= lock and cgo2.clklock; ---------------------------------------------------------------------- --- AHB CONTROLLER -------------------------------------------------- ---------------------------------------------------------------------- ahb0 : ahbctrl -- AHB arbiter/multiplexer generic map (defmast => CFG_DEFMST, split => CFG_SPLIT, rrobin => CFG_RROBIN, ioaddr => CFG_AHBIO, devid => XILINX_ML401, ioen => IOAEN, nahbm => maxahbm, nahbs => 8) port map (rstn, clkm, ahbmi, ahbmo, ahbsi, ahbso); ---------------------------------------------------------------------- --- LEON3 processor and DSU ----------------------------------------- ---------------------------------------------------------------------- l3 : if CFG_LEON3 = 1 generate cpu : for i in 0 to NCPU-1 generate u0 : leon3s -- LEON3 processor generic map (i, fabtech, memtech, CFG_NWIN, CFG_DSU, CFG_FPU, CFG_V8, 0, CFG_MAC, pclow, CFG_NOTAG, CFG_NWP, CFG_ICEN, CFG_IREPL, CFG_ISETS, CFG_ILINE, CFG_ISETSZ, CFG_ILOCK, CFG_DCEN, CFG_DREPL, CFG_DSETS, CFG_DLINE, CFG_DSETSZ, CFG_DLOCK, CFG_DSNOOP, CFG_ILRAMEN, CFG_ILRAMSZ, CFG_ILRAMADDR, CFG_DLRAMEN, CFG_DLRAMSZ, CFG_DLRAMADDR, CFG_MMUEN, CFG_ITLBNUM, CFG_DTLBNUM, CFG_TLB_TYPE, CFG_TLB_REP, CFG_LDDEL, disas, CFG_ITBSZ, CFG_PWD, CFG_SVT, CFG_RSTADDR, NCPU-1, CFG_DFIXED, CFG_SCAN, CFG_MMU_PAGE, CFG_BP, CFG_NP_ASI, CFG_WRPSR) port map (clkm, rstn, ahbmi, ahbmo(i), ahbsi, ahbso, irqi(i), irqo(i), dbgi(i), dbgo(i)); end generate; errorn_pad : odpad generic map (tech => padtech) port map (plb_error, dbgo(0).error); dsugen : if CFG_DSU = 1 generate dsu0 : dsu3 -- LEON3 Debug Support Unit generic map (hindex => 2, haddr => 16#900#, hmask => 16#F00#, ncpu => NCPU, tbits => 30, tech => memtech, irq => 0, kbytes => CFG_ATBSZ) port map (rstn, clkm, ahbmi, ahbsi, ahbso(2), dbgo, dbgi, dsui, dsuo); -- dsuen_pad : inpad generic map (tech => padtech) port map (dsuen, dsui.enable); dsui.enable <= '1'; -- dsubre_pad : inpad generic map (tech => padtech) port map (dsubre, dsui.break); dsui.break <= gpioo.val(11); -- South Button -- dsuact_pad : outpad generic map (tech => padtech) port map (dsuact, ndsuact); dsuact_pad : outpad generic map (tech => padtech) port map (opb_error, ndsuact); ndsuact <= not dsuo.active; end generate; end generate; nodsu : if CFG_DSU = 0 generate dsuo.tstop <= '0'; dsuo.active <= '0'; end generate; dcomgen : if CFG_AHB_UART = 1 generate dcom0: ahbuart -- Debug UART generic map (hindex => NCPU, pindex => 7, paddr => 7) port map (rstn, clkm, dui, duo, apbi, apbo(7), ahbmi, ahbmo(NCPU)); -- dsurx_pad : inpad generic map (tech => padtech) port map (rxd1, dui.rxd); -- dsutx_pad : outpad generic map (tech => padtech) port map (txd1, duo.txd); dui.rxd <= rxd1 when gpioo.val(21) = '1' else '1'; end generate; txd1 <= duo.txd when gpioo.val(21) = '1' else u1o.txd; ahbjtaggen0 :if CFG_AHB_JTAG = 1 generate ahbjtag0 : ahbjtag generic map(tech => fabtech, hindex => NCPU+CFG_AHB_UART) port map(rstn, clkm, tck, tms, tdi, tdo, ahbmi, ahbmo(NCPU+CFG_AHB_UART), open, open, open, open, open, open, open, gnd(0)); end generate; ---------------------------------------------------------------------- --- Memory controllers ---------------------------------------------- ---------------------------------------------------------------------- memi.writen <= '1'; memi.wrn <= "1111"; memi.bwidth <= "10"; memi.brdyn <= '1'; memi.bexcn <= '1'; ssr0 : if CFG_SSCTRL = 1 generate ssrctrl0 : ssrctrl generic map (hindex => 3, pindex => 0, ramaddr => 16#600#) port map (rstn, clkm, ahbsi, ahbso(3), apbi, apbo(0), memi, memo); end generate; mctrl0 : if CFG_MCTRL_LEON2 = 1 generate mctrl0 : mctrl generic map (hindex => 3, pindex => 0, ramaddr => 16#C00#, rammask => 16#FF0#, paddr => 0, srbanks => 1, ram8 => CFG_MCTRL_RAM8BIT, ram16 => CFG_MCTRL_RAM16BIT, sden => CFG_MCTRL_SDEN, invclk => CFG_MCTRL_INVCLK, sepbus => CFG_MCTRL_SEPBUS) port map (rstn, clkm, memi, memo, ahbsi, ahbso(3), apbi, apbo(0), wpo, open); end generate; romsn <= not memo.romsn(0); sram_adv_ld_n_pad : outpad generic map (tech => padtech) port map (sram_adv_ld_n, gnd(0)); sram_mode_pad : outpad generic map (tech => padtech) port map (sram_mode, gnd(0)); addr_pad : outpadv generic map (width => 23, tech => padtech) port map (sram_flash_addr, memo.address(24 downto 2)); addr23_pad : outpad generic map (tech => padtech) port map (flash_a23, gnd(0)); rams_pad : outpad generic map ( tech => padtech) port map (sram_cen, memo.ramsn(0)); roms_pad : outpad generic map (tech => padtech) port map (flash_ce, romsn); oen_pad : outpad generic map (tech => padtech) port map (sram_flash_oe_n, memo.oen); --pragma translate_off iosn_pad : outpad generic map (tech => padtech) port map (iosn, memo.iosn); --pragma translate_on rwen_pad : outpadv generic map (width => 4, tech => padtech) port map (sram_bw, memo.wrn); wri_pad : outpad generic map (tech => padtech) port map (sram_flash_we_n, memo.writen); data_pads : iopadvv generic map (tech => padtech, width => 32) port map (sram_flash_data, memo.data, memo.vbdrive, memi.data); ddrsp0 : if (CFG_DDRSP /= 0) generate -- phyiconf => 1 = no diff pads for DDR clock pairs ddrc0 : ddrspa generic map ( fabtech => CFG_FABTECH, memtech => memtech, hindex => 0, haddr => 16#400#, hmask => 16#F00#, ioaddr => 1, pwron => CFG_DDRSP_INIT, MHz => BOARD_FREQ/1000, clkmul => CFG_DDRSP_FREQ/10, clkdiv => 10, ahbfreq => CPU_FREQ/1000, col => CFG_DDRSP_COL, Mbyte => CFG_DDRSP_SIZE, ddrbits => 32, phyiconf => 1) port map ( rst, rstn, lclk, clkm, lock, clkml, clkml, ahbsi, ahbso(0), ddr_clkv, ddr_clkbv, open, ddr_clk_fb, ddr_ckev, ddr_csbv, ddr_web, ddr_rasb, ddr_casb, ddr_dm, ddr_dqs, ddr_adl, ddr_ba, ddr_dq); ddr_ad <= ddr_adl(12 downto 0); ddr_clk <= ddr_clkv(0); ddr_clkb <= ddr_clkbv(0); ddr_cke <= ddr_ckev(0); ddr_csb <= ddr_csbv(0); end generate; noddr : if (CFG_DDRSP = 0) generate lock <= '1'; end generate; ---------------------------------------------------------------------- --- System ACE I/F Controller --------------------------------------- ---------------------------------------------------------------------- grace: if CFG_GRACECTRL = 1 generate grace0 : gracectrl generic map (hindex => 4, hirq => 10, haddr => 16#002#, hmask => 16#fff#, split => CFG_SPLIT) port map (rstn, clkm, clkace, ahbsi, ahbso(4), acei, aceo); end generate; nograce: if CFG_GRACECTRL /= 1 generate aceo <= gracectrl_none; end generate; sace_usb_a_pads : outpadv generic map (width => 7, tech => padtech) port map (sace_usb_a, aceo.addr); sace_mpce_pad : outpad generic map (tech => padtech) port map (sace_mpce, aceo.cen); sace_usb_d_pads : iopadv generic map (tech => padtech, width => 16) port map (sace_usb_d, aceo.do, aceo.doen, acei.di); sace_usb_oen_pad : outpad generic map (tech => padtech) port map (sace_usb_oen, aceo.oen); sace_usb_wen_pad : outpad generic map (tech => padtech) port map (sace_usb_wen, aceo.wen); sysace_mpirq_pad : inpad generic map (tech => padtech) port map (sysace_mpirq, acei.irq); ---------------------------------------------------------------------- --- APB Bridge and various periherals ------------------------------- ---------------------------------------------------------------------- bpromgen : if CFG_AHBROMEN /= 0 generate brom : entity work.ahbrom generic map (hindex => 6, haddr => CFG_AHBRODDR, pipe => CFG_AHBROPIP) port map ( rstn, clkm, ahbsi, ahbso(6)); end generate; ---------------------------------------------------------------------- --- APB Bridge and various periherals ------------------------------- ---------------------------------------------------------------------- apb0 : apbctrl -- AHB/APB bridge generic map (hindex => 1, haddr => CFG_APBADDR, nslaves => 16) port map (rstn, clkm, ahbsi, ahbso(1), apbi, apbo ); ua1 : if CFG_UART1_ENABLE /= 0 generate uart1 : apbuart -- UART 1 generic map (pindex => 1, paddr => 1, pirq => 2, console => dbguart, fifosize => CFG_UART1_FIFO) port map (rstn, clkm, apbi, apbo(1), u1i, u1o); u1i.extclk <= '0'; u1i.ctsn <= '0'; u1i.rxd <= rxd1 when gpioo.val(21) = '0' else '1'; end generate; irqctrl : if CFG_IRQ3_ENABLE /= 0 generate irqctrl0 : irqmp -- interrupt controller generic map (pindex => 2, paddr => 2, ncpu => NCPU) port map (rstn, clkm, apbi, apbo(2), irqo, irqi); end generate; irq3 : if CFG_IRQ3_ENABLE = 0 generate x : for i in 0 to NCPU-1 generate irqi(i).irl <= "0000"; end generate; apbo(2) <= apb_none; end generate; gpt : if CFG_GPT_ENABLE /= 0 generate timer0 : gptimer -- timer unit generic map (pindex => 3, paddr => 3, pirq => CFG_GPT_IRQ, sepirq => CFG_GPT_SEPIRQ, sbits => CFG_GPT_SW, ntimers => CFG_GPT_NTIM, nbits => CFG_GPT_TW) port map (rstn, clkm, apbi, apbo(3), gpti, open); gpti.dhalt <= dsuo.tstop; gpti.extclk <= '0'; end generate; nogpt : if CFG_GPT_ENABLE = 0 generate apbo(3) <= apb_none; end generate; kbd : if CFG_KBD_ENABLE /= 0 generate ps21 : apbps2 generic map(pindex => 4, paddr => 4, pirq => 4) port map(rstn, clkm, apbi, apbo(4), moui, mouo); ps20 : apbps2 generic map(pindex => 5, paddr => 5, pirq => 5) port map(rstn, clkm, apbi, apbo(5), kbdi, kbdo); end generate; nokbd : if CFG_KBD_ENABLE = 0 generate apbo(5) <= apb_none; kbdo <= ps2o_none; end generate; kbdclk_pad : iopad generic map (tech => padtech) port map (ps2_keyb_clk,kbdo.ps2_clk_o, kbdo.ps2_clk_oe, kbdi.ps2_clk_i); kbdata_pad : iopad generic map (tech => padtech) port map (ps2_keyb_data, kbdo.ps2_data_o, kbdo.ps2_data_oe, kbdi.ps2_data_i); mouclk_pad : iopad generic map (tech => padtech) port map (ps2_mouse_clk, mouo.ps2_clk_o, mouo.ps2_clk_oe, moui.ps2_clk_i); mouata_pad : iopad generic map (tech => padtech) port map (ps2_mouse_data, mouo.ps2_data_o, mouo.ps2_data_oe, moui.ps2_data_i); vga : if CFG_VGA_ENABLE /= 0 generate vga0 : apbvga generic map(memtech => memtech, pindex => 6, paddr => 6) port map(rstn, clkm, ethclk, apbi, apbo(6), vgao); clk_sel <= "00"; end generate; svga : if CFG_SVGA_ENABLE /= 0 generate svga0 : svgactrl generic map(memtech => memtech, pindex => 6, paddr => 6, hindex => CFG_NCPU+CFG_AHB_UART+CFG_AHB_JTAG, clk0 => 4*(1000000000/BOARD_FREQ), clk1 => 2*(1000000000/BOARD_FREQ), clk2 => 1000000000/CPU_FREQ, burstlen => 6) port map(rstn, clkm, clkvga, apbi, apbo(6), vgao, ahbmi, ahbmo(CFG_NCPU+CFG_AHB_UART+CFG_AHB_JTAG), clk_sel); end generate; vgadiv : if (CFG_VGA_ENABLE + CFG_SVGA_ENABLE) /= 0 generate clkdiv : process(clk1x, rstn) begin if rstn = '0' then clkval <= "00"; elsif rising_edge(clk1x) then clkval <= clkval + 1; end if; end process; video_clk <= clkval(1) when clk_sel = "00" else clkval(0) when clk_sel = "01" else clkm; b1 : techbuf generic map (2, CFG_FABTECH) port map (video_clk, clkvga); dac_clk <= not clkvga; end generate; novga : if (CFG_VGA_ENABLE + CFG_SVGA_ENABLE) = 0 generate apbo(6) <= apb_none; vgao <= vgao_none; end generate; blank_pad : outpad generic map (tech => padtech) port map (vid_blankn, vgao.blank); comp_sync_pad : outpad generic map (tech => padtech) port map (vid_syncn, vgao.comp_sync); vert_sync_pad : outpad generic map (tech => padtech) port map (vid_vsync, vgao.vsync); horiz_sync_pad : outpad generic map (tech => padtech) port map (vid_hsync, vgao.hsync); video_out_r_pad : outpadv generic map (width => 8, tech => padtech) port map (vid_r, vgao.video_out_r); video_out_g_pad : outpadv generic map (width => 8, tech => padtech) port map (vid_g, vgao.video_out_g); video_out_b_pad : outpadv generic map (width => 8, tech => padtech) port map (vid_b, vgao.video_out_b); video_clock_pad : outpad generic map ( tech => padtech) port map (tft_lcd_clk, dac_clk); gpio0 : if CFG_GRGPIO_ENABLE /= 0 generate -- GPIO unit grgpio0: grgpio generic map(pindex => 8, paddr => 8, imask => 16#00F0#, nbits => 27) port map(rst => rstn, clk => clkm, apbi => apbi, apbo => apbo(8), gpioi => gpioi, gpioo => gpioo); gpio_pads : iopadvv generic map (tech => padtech, width => 27) port map (gpio, gpioo.dout(26 downto 0), gpioo.oen(26 downto 0), gpioi.din(26 downto 0)); end generate; ahbs : if CFG_AHBSTAT = 1 generate -- AHB status register ahbstat0 : ahbstat generic map (pindex => 15, paddr => 15, pirq => 7, nftslv => CFG_AHBSTATN) port map (rstn, clkm, ahbmi, ahbsi, stati, apbi, apbo(15)); end generate; i2cm: if CFG_I2C_ENABLE = 1 generate -- I2C master i2c0 : i2cmst generic map (pindex => 12, paddr => 12, pmask => 16#FFF#, pirq => 11, filter => I2C_FILTER) port map (rstn, clkm, apbi, apbo(12), i2ci, i2co); i2c_scl_pad : iopad generic map (tech => padtech) port map (iic_scl, i2co.scl, i2co.scloen, i2ci.scl); i2c_sda_pad : iopad generic map (tech => padtech) port map (iic_sda, i2co.sda, i2co.sdaoen, i2ci.sda); end generate i2cm; ----------------------------------------------------------------------- --- ETHERNET --------------------------------------------------------- ----------------------------------------------------------------------- eth1 : if CFG_GRETH = 1 generate -- Gaisler ethernet MAC e1 : grethm generic map(hindex => NCPU+CFG_AHB_UART+CFG_AHB_JTAG+CFG_SVGA_ENABLE, pindex => 11, paddr => 11, pirq => 12, memtech => memtech, mdcscaler => CPU_FREQ/1000, enable_mdio => 1, fifosize => CFG_ETH_FIFO, nsync => 1, edcl => CFG_DSU_ETH, edclbufsz => CFG_ETH_BUF, macaddrh => CFG_ETH_ENM, macaddrl => CFG_ETH_ENL, enable_mdint => 1, ipaddrh => CFG_ETH_IPM, ipaddrl => CFG_ETH_IPL, giga => CFG_GRETH1G) port map( rst => rstn, clk => clkm, ahbmi => ahbmi, ahbmo => ahbmo(NCPU+CFG_AHB_UART+CFG_AHB_JTAG+CFG_SVGA_ENABLE), apbi => apbi, apbo => apbo(11), ethi => ethi, etho => etho); emdio_pad : iopad generic map (tech => padtech) port map (phy_mii_data, etho.mdio_o, etho.mdio_oe, ethi.mdio_i); etxc_pad : clkpad generic map (tech => padtech, arch => 2) port map (phy_tx_clk, ethi.tx_clk); erxc_pad : clkpad generic map (tech => padtech, arch => 2) port map (phy_rx_clk, ethi.rx_clk); erxd_pad : inpadv generic map (tech => padtech, width => 8) port map (phy_rx_data, ethi.rxd(7 downto 0)); erxdv_pad : inpad generic map (tech => padtech) port map (phy_dv, ethi.rx_dv); erxer_pad : inpad generic map (tech => padtech) port map (phy_rx_er, ethi.rx_er); erxco_pad : inpad generic map (tech => padtech) port map (phy_col, ethi.rx_col); erxcr_pad : inpad generic map (tech => padtech) port map (phy_crs, ethi.rx_crs); emdint_pad : inpad generic map (tech => padtech) port map (phy_int_n, ethi.mdint); etxd_pad : outpadv generic map (tech => padtech, width => 8) port map (phy_tx_data, etho.txd(7 downto 0)); etxen_pad : outpad generic map (tech => padtech) port map ( phy_tx_en, etho.tx_en); etxer_pad : outpad generic map (tech => padtech) port map (phy_tx_er, etho.tx_er); emdc_pad : outpad generic map (tech => padtech) port map (phy_mii_clk, etho.mdc); erst_pad : outpad generic map (tech => padtech) port map (phy_rst_n, rstn); ethi.gtx_clk <= egtx_clk; end generate; ----------------------------------------------------------------------- --- AHB RAM ---------------------------------------------------------- ----------------------------------------------------------------------- ocram : if CFG_AHBRAMEN = 1 generate ahbram0 : ahbram generic map (hindex => 7, haddr => CFG_AHBRADDR, tech => CFG_MEMTECH, kbytes => CFG_AHBRSZ, pipe => CFG_AHBRPIPE) port map ( rstn, clkm, ahbsi, ahbso(7)); end generate; ----------------------------------------------------------------------- --- AHB DEBUG -------------------------------------------------------- ----------------------------------------------------------------------- -- dma0 : ahbdma -- generic map (hindex => CFG_NCPU+CFG_AHB_UART+CFG_GRETH+CFG_AHB_JTAG, -- pindex => 13, paddr => 13, dbuf => 6) -- port map (rstn, clkm, apbi, apbo(13), ahbmi, -- ahbmo(CFG_NCPU+CFG_AHB_UART+CFG_GRETH+CFG_AHB_JTAG)); -- at0 : ahbtrace -- generic map ( hindex => 7, ioaddr => 16#200#, iomask => 16#E00#, -- tech => memtech, irq => 0, kbytes => 8) -- port map ( rstn, clkm, ahbmi, ahbsi, ahbso(7)); ----------------------------------------------------------------------- --- Drive unused bus elements --------------------------------------- ----------------------------------------------------------------------- -- nam1 : for i in (NCPU+CFG_AHB_UART+CFG_ETH+CFG_AHB_ETH+CFG_AHB_JTAG) to NAHBMST-1 generate -- ahbmo(i) <= ahbm_none; -- end generate; -- nap0 : for i in 11 to NAPBSLV-1 generate apbo(i) <= apb_none; end generate; -- nah0 : for i in 8 to NAHBSLV-1 generate ahbso(i) <= ahbs_none; end generate; ----------------------------------------------------------------------- --- Boot message ---------------------------------------------------- ----------------------------------------------------------------------- -- pragma translate_off x : report_design generic map ( msg1 => "LEON3 Avnet ML401 (Virtex4 LX25) Demonstration design", fabtech => tech_table(fabtech), memtech => tech_table(memtech), mdel => 1 ); -- pragma translate_on end;
--Módulo para contador de programa PC --Declaracao de bibliotecas library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity PC is generic (DATA_WIDTH : natural := 32); --ULA faz operacoes com dados de 32 bits port ( clk, rst : in std_logic; add_in: in std_logic_vector(DATA_WIDTH-1 downto 0) := (others => '0'); add_out: out std_logic_vector(DATA_WIDTH-1 downto 0) ); end entity PC; architecture Behavioral of PC is begin process(clk, rst) begin if (rst = '0') then add_out <= (others => '0'); --endereco inicial else if rising_edge(clk) then add_out <= add_in; --o valor da entrada ira passar para saida end if; end if; end process; end Behavioral;
--Módulo para contador de programa PC --Declaracao de bibliotecas library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity PC is generic (DATA_WIDTH : natural := 32); --ULA faz operacoes com dados de 32 bits port ( clk, rst : in std_logic; add_in: in std_logic_vector(DATA_WIDTH-1 downto 0) := (others => '0'); add_out: out std_logic_vector(DATA_WIDTH-1 downto 0) ); end entity PC; architecture Behavioral of PC is begin process(clk, rst) begin if (rst = '0') then add_out <= (others => '0'); --endereco inicial else if rising_edge(clk) then add_out <= add_in; --o valor da entrada ira passar para saida end if; end if; end process; end Behavioral;
------------------------------------------------------------------------------- -- Title : 16z091-00 PCIe test bench -- Project : 16z091-00 ------------------------------------------------------------------------------- -- File : types_pkg.vhd -- Author : [email protected] -- Organization: MEN Mikro Elektronik GmbH -- Created : 2012-08-21 ------------------------------------------------------------------------------- -- Simulator : ModelSim PE 6.6 Revision 2010.01 -- Synthesis : ------------------------------------------------------------------------------- -- Description : -- Constants and types common to all test bench files ------------------------------------------------------------------------------- -- Hierarchy : -- ------------------------------------------------------------------------------- -- Copyright (c) 2016, MEN Mikro Elektronik GmbH -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. ------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; package types_pkg is constant TST_PASS : integer := 1; constant TST_FAIL : integer := 2; -------------------------------------------------------- -- define all configurable settings in tst_config_type -------------------------------------------------------- type tst_config_type is record -- iter : integer; -- iram_max_size : integer; set_txt : integer; max_payload : integer; max_read : integer; -- msi_nbr : integer; -- msi_en : integer; -- min_loop : integer; -- max_loop : integer; -- len_wb_burst : integer; -- len_pcie_burst : integer; -- start_delay_iram : integer; -- wait_states_iram : integer; -- break_at_iram : integer; -- break_for_iram : integer; end record; -- type error_in_type is record -- wbm_err : integer; -- wbs_err : integer; -- wb_mon_err : integer; -- mon001_err : integer; -- end record; type watchdog_type is record wd_start : boolean; wd_time : time; end record; -- type mon001_ctrl_in_type is record -- busy : std_logic; -- end record; -- type mon001_ctrl_out_type is record -- ref_data : std_logic_vector(31 downto 0); -- ref_sel : std_logic_vector(3 downto 0); -- ref_addr : std_logic_vector(31 downto 0); -- new_val : boolean; -- edge states that ref_sel and ref_data have new values -- end record; type cfg_in_type is record wb_clk : std_logic; clk : std_logic; tstcfg : tst_config_type; --err_in : error_in_type; --mon001_ctrl_i : mon001_ctrl_in_type; end record; type cfg_out_type is record dut_rst : std_logic; tb_rst : std_logic; wb_rst : std_logic; watchdog : watchdog_type; --mon001_ctrl_o : mon001_ctrl_out_type; end record; end types_pkg; package body types_pkg is -- empty end;
------------------------------------------------------------------------------- -- Title : 16z091-00 PCIe test bench -- Project : 16z091-00 ------------------------------------------------------------------------------- -- File : types_pkg.vhd -- Author : [email protected] -- Organization: MEN Mikro Elektronik GmbH -- Created : 2012-08-21 ------------------------------------------------------------------------------- -- Simulator : ModelSim PE 6.6 Revision 2010.01 -- Synthesis : ------------------------------------------------------------------------------- -- Description : -- Constants and types common to all test bench files ------------------------------------------------------------------------------- -- Hierarchy : -- ------------------------------------------------------------------------------- -- Copyright (c) 2016, MEN Mikro Elektronik GmbH -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. ------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; package types_pkg is constant TST_PASS : integer := 1; constant TST_FAIL : integer := 2; -------------------------------------------------------- -- define all configurable settings in tst_config_type -------------------------------------------------------- type tst_config_type is record -- iter : integer; -- iram_max_size : integer; set_txt : integer; max_payload : integer; max_read : integer; -- msi_nbr : integer; -- msi_en : integer; -- min_loop : integer; -- max_loop : integer; -- len_wb_burst : integer; -- len_pcie_burst : integer; -- start_delay_iram : integer; -- wait_states_iram : integer; -- break_at_iram : integer; -- break_for_iram : integer; end record; -- type error_in_type is record -- wbm_err : integer; -- wbs_err : integer; -- wb_mon_err : integer; -- mon001_err : integer; -- end record; type watchdog_type is record wd_start : boolean; wd_time : time; end record; -- type mon001_ctrl_in_type is record -- busy : std_logic; -- end record; -- type mon001_ctrl_out_type is record -- ref_data : std_logic_vector(31 downto 0); -- ref_sel : std_logic_vector(3 downto 0); -- ref_addr : std_logic_vector(31 downto 0); -- new_val : boolean; -- edge states that ref_sel and ref_data have new values -- end record; type cfg_in_type is record wb_clk : std_logic; clk : std_logic; tstcfg : tst_config_type; --err_in : error_in_type; --mon001_ctrl_i : mon001_ctrl_in_type; end record; type cfg_out_type is record dut_rst : std_logic; tb_rst : std_logic; wb_rst : std_logic; watchdog : watchdog_type; --mon001_ctrl_o : mon001_ctrl_out_type; end record; end types_pkg; package body types_pkg is -- empty end;
package types_pkg is type generic_type is array(0 to 3) of integer; end package;
library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.NUMERIC_STD.all; library std; entity scharr_process is generic ( LINE_WIDTH_MAX : integer; CLK_PROC_FREQ : integer; IN_SIZE : integer; OUT_SIZE : integer; WEIGHT_SIZE : integer := 8 ); port ( clk_proc : in std_logic; reset_n : in std_logic; ---------------- dynamic parameters ports --------------- status_reg_enable_bit : in std_logic; widthimg_reg_width : in std_logic_vector(15 downto 0); ------------------------- in flow ----------------------- in_data : in std_logic_vector(IN_SIZE-1 downto 0); in_fv : in std_logic; in_dv : in std_logic; ------------------------ out flow ----------------------- out_data : out std_logic_vector(OUT_SIZE-1 downto 0); out_fv : out std_logic; out_dv : out std_logic ); end scharr_process; architecture rtl of scharr_process is component matrix_extractor generic ( LINE_WIDTH_MAX : integer; PIX_WIDTH : integer; OUTVALUE_WIDTH : integer ); port ( clk_proc : in std_logic; reset_n : in std_logic; ------------------------- in flow ----------------------- in_data : in std_logic_vector((PIX_WIDTH-1) downto 0); in_fv : in std_logic; in_dv : in std_logic; ------------------------ out flow ----------------------- out_data : out std_logic_vector((PIX_WIDTH-1) downto 0); out_fv : out std_logic; out_dv : out std_logic; ------------------------ matrix out --------------------- p00, p01, p02 : out std_logic_vector((PIX_WIDTH-1) downto 0); p10, p11, p12 : out std_logic_vector((PIX_WIDTH-1) downto 0); p20, p21, p22 : out std_logic_vector((PIX_WIDTH-1) downto 0); matrix_dv : out std_logic; ---------------------- computed value ------------------- value_data : in std_logic_vector((PIX_WIDTH-1) downto 0); value_dv : in std_logic; ------------------------- params ------------------------ enable_i : in std_logic; widthimg_i : in std_logic_vector(15 downto 0) ); end component; -- neighbors extraction signal p00, p01, p02 : std_logic_vector((IN_SIZE-1) downto 0); signal p10, p11, p12 : std_logic_vector((IN_SIZE-1) downto 0); signal p20, p21, p22 : std_logic_vector((IN_SIZE-1) downto 0); signal matrix_dv : std_logic; -- products calculation signal prod00, prod01, prod02 : signed((WEIGHT_SIZE + IN_SIZE) downto 0); signal prod10, prod11, prod12 : signed((WEIGHT_SIZE + IN_SIZE) downto 0); signal prod20, prod21, prod22 : signed((WEIGHT_SIZE + IN_SIZE) downto 0); signal prod_dv : std_logic; signal value_data : std_logic_vector((IN_SIZE-1) downto 0); signal value_dv : std_logic; signal out_fv_s : std_logic; signal enable_s : std_logic; begin matrix_extractor_inst : matrix_extractor generic map ( LINE_WIDTH_MAX => LINE_WIDTH_MAX, PIX_WIDTH => IN_SIZE, OUTVALUE_WIDTH => IN_SIZE ) port map ( clk_proc => clk_proc, reset_n => reset_n, in_data => in_data, in_fv => in_fv, in_dv => in_dv, p00 => p00, p01 => p01, p02 => p02, p10 => p10, p11 => p11, p12 => p12, p20 => p20, p21 => p21, p22 => p22, matrix_dv => matrix_dv, value_data => value_data, value_dv => value_dv, out_data => out_data, out_fv => out_fv_s, out_dv => out_dv, enable_i => status_reg_enable_bit, widthimg_i => widthimg_reg_width ); process (clk_proc, reset_n, matrix_dv) variable sum : signed((WEIGHT_SIZE + IN_SIZE) downto 0); begin if(reset_n='0') then enable_s <= '0'; prod_dv <= '0'; value_dv <= '0'; elsif(rising_edge(clk_proc)) then if(in_fv = '0') then enable_s <= status_reg_enable_bit; prod_dv <= '0'; value_dv <= '0'; end if; -- product calculation pipeline stage prod_dv <= '0'; if(matrix_dv = '1' and enable_s = '1') then prod00 <= "11111010" * signed('0' & p00); prod01 <= "11110110" * signed('0' & p01); prod02 <= "00000000" * signed('0' & p02); prod10 <= "11110110" * signed('0' & p10); prod11 <= "00000000" * signed('0' & p11); prod12 <= "00001010" * signed('0' & p12); prod20 <= "00000000" * signed('0' & p20); prod21 <= "00001010" * signed('0' & p21); prod22 <= "00000110" * signed('0' & p22); prod_dv <= '1'; end if; value_dv <= '0'; if(prod_dv='1' and enable_s = '1') then sum := prod00 + prod01 + prod02 + prod10 + prod11 + prod12 + prod20 + prod21 + prod22; if (sum(sum'left) = '1') then sum := (others => '0'); end if; value_data <= std_logic_vector(sum)(OUT_SIZE -1 downto 0); value_dv <= '1'; end if; end if; end process; out_fv <= enable_s and out_fv_s; end rtl;
-------------------------------------------------------------------------------- -- LGPL v2.1, Copyright (c) 2014 Johannes Walter <[email protected]> -- -- Description: -- Perform (right-)shift and add multiplication. -------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; library work; use work.lfsr_pkg.all; entity ads1281_filter_multiplier is port ( -- Clock and resets clk_i : in std_ulogic; rst_asy_n_i : in std_ulogic; rst_syn_i : in std_ulogic; -- Decoded data data_i : in signed(6 downto 0); -- Coefficient coeff_i : in unsigned(23 downto 0); coeff_en_i : in std_ulogic; -- Multiplier result res_o : out signed(30 downto 0); res_en_o : out std_ulogic); end entity ads1281_filter_multiplier; architecture rtl of ads1281_filter_multiplier is ------------------------------------------------------------------------------ -- Types and Constants ------------------------------------------------------------------------------ -- LFSR counter bit length constant len_c : natural := lfsr_length(coeff_i'length); -- LFSR counter initial value constant seed_c : std_ulogic_vector(len_c - 1 downto 0) := lfsr_seed(len_c); -- LFSR counter value after 23 shifts constant max_c : std_ulogic_vector(len_c - 1 downto 0) := lfsr_shift(seed_c, coeff_i'length - 1); ------------------------------------------------------------------------------ -- Internal Registers ------------------------------------------------------------------------------ signal lfsr : std_ulogic_vector(len_c - 1 downto 0); signal res : unsigned(30 downto 0); signal data : signed(data_i'range); signal busy : std_ulogic; signal en : std_ulogic; ------------------------------------------------------------------------------ -- Internal Wires ------------------------------------------------------------------------------ signal a : std_ulogic_vector(6 downto 0); signal b : std_ulogic_vector(6 downto 0); signal sum : unsigned(7 downto 0); signal shift : unsigned(30 downto 0); begin -- architecture rtl ------------------------------------------------------------------------------ -- Outputs ------------------------------------------------------------------------------ res_o <= signed(res); res_en_o <= en; ------------------------------------------------------------------------------ -- Signal Assignments ------------------------------------------------------------------------------ -- 1st adder input is data input when register's low bit is 1, otherwise 0 a <= std_ulogic_vector(data) when res(res'low) = '1' else (others => '0'); -- 2nd adder input is always the register's top section b <= std_ulogic_vector(res(res'high downto res'high - data'length + 1)); -- Adder with sign extension sum <= unsigned(a(a'high) & a) + unsigned(b(b'high) & b); -- Shift register and replace top section with adder output shift <= sum & res(res'high - sum'length + 1 downto res'low + 1); ------------------------------------------------------------------------------ -- Registers ------------------------------------------------------------------------------ regs : process (clk_i, rst_asy_n_i) is procedure reset is begin lfsr <= seed_c; res <= (others => '0'); data <= (others => '0'); busy <= '0'; en <= '0'; end procedure reset; begin -- process regs if rst_asy_n_i = '0' then reset; elsif rising_edge(clk_i) then -- Defaults en <= '0'; if rst_syn_i = '1' then reset; else if coeff_en_i = '1' then -- Store data data <= data_i; -- Store multiplier in shift register res <= (res'high downto coeff_i'length => '0') & coeff_i; -- Start calculation busy <= '1'; lfsr <= seed_c; end if; if lfsr = max_c then en <= '1'; busy <= '0'; end if; if busy = '1' then -- Shift LFSR and result lfsr <= lfsr_shift(lfsr); res <= shift; end if; end if; end if; end process regs; end architecture rtl;
-- Automatically generated VHDL-93 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; use IEEE.MATH_REAL.ALL; use std.textio.all; use work.all; use work.packetprocessordf_types.all; entity packetprocessordf_topentity_0 is port(i : in packetprocessordf_types.tup2; -- clock system1000 : in std_logic; -- asynchronous reset: active low system1000_rstn : in std_logic; result : out packetprocessordf_types.counterstate); end; architecture structural of packetprocessordf_topentity_0 is signal app_arg : std_logic_vector(28 downto 0); signal app_arg_0 : boolean; signal x : std_logic_vector(28 downto 0); signal y : boolean; begin app_arg <= x; app_arg_0 <= y; x <= i.tup2_sel0; y <= i.tup2_sel1; packetprocessordf_packetprocessor_result : entity packetprocessordf_packetprocessor port map (result => result ,system1000 => system1000 ,system1000_rstn => system1000_rstn ,memop => app_arg ,en => app_arg_0); end;
-- Automatically generated VHDL-93 library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; use IEEE.MATH_REAL.ALL; use std.textio.all; use work.all; use work.packetprocessordf_types.all; entity packetprocessordf_topentity_0 is port(i : in packetprocessordf_types.tup2; -- clock system1000 : in std_logic; -- asynchronous reset: active low system1000_rstn : in std_logic; result : out packetprocessordf_types.counterstate); end; architecture structural of packetprocessordf_topentity_0 is signal app_arg : std_logic_vector(28 downto 0); signal app_arg_0 : boolean; signal x : std_logic_vector(28 downto 0); signal y : boolean; begin app_arg <= x; app_arg_0 <= y; x <= i.tup2_sel0; y <= i.tup2_sel1; packetprocessordf_packetprocessor_result : entity packetprocessordf_packetprocessor port map (result => result ,system1000 => system1000 ,system1000_rstn => system1000_rstn ,memop => app_arg ,en => app_arg_0); end;
-- Copyright 1986-2017 Xilinx, Inc. All Rights Reserved. -- -------------------------------------------------------------------------------- -- Tool Version: Vivado v.2017.2 (win64) Build 1909853 Thu Jun 15 18:39:09 MDT 2017 -- Date : Sat Sep 23 13:26:00 2017 -- Host : DarkCube running 64-bit major release (build 9200) -- Command : write_vhdl -force -mode synth_stub -rename_top zqynq_lab_1_design_auto_pc_1 -prefix -- zqynq_lab_1_design_auto_pc_1_ zqynq_lab_1_design_auto_pc_1_stub.vhdl -- Design : zqynq_lab_1_design_auto_pc_1 -- Purpose : Stub declaration of top-level module interface -- Device : xc7z020clg484-1 -- -------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity zqynq_lab_1_design_auto_pc_1 is Port ( aclk : in STD_LOGIC; aresetn : in STD_LOGIC; s_axi_awaddr : in STD_LOGIC_VECTOR ( 31 downto 0 ); s_axi_awlen : in STD_LOGIC_VECTOR ( 7 downto 0 ); s_axi_awsize : in STD_LOGIC_VECTOR ( 2 downto 0 ); s_axi_awburst : in STD_LOGIC_VECTOR ( 1 downto 0 ); s_axi_awlock : in STD_LOGIC_VECTOR ( 0 to 0 ); s_axi_awcache : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_awprot : in STD_LOGIC_VECTOR ( 2 downto 0 ); s_axi_awregion : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_awqos : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_awvalid : in STD_LOGIC; s_axi_awready : out STD_LOGIC; s_axi_wdata : in STD_LOGIC_VECTOR ( 31 downto 0 ); s_axi_wstrb : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_wlast : in STD_LOGIC; s_axi_wvalid : in STD_LOGIC; s_axi_wready : out STD_LOGIC; s_axi_bresp : out STD_LOGIC_VECTOR ( 1 downto 0 ); s_axi_bvalid : out STD_LOGIC; s_axi_bready : in STD_LOGIC; s_axi_araddr : in STD_LOGIC_VECTOR ( 31 downto 0 ); s_axi_arlen : in STD_LOGIC_VECTOR ( 7 downto 0 ); s_axi_arsize : in STD_LOGIC_VECTOR ( 2 downto 0 ); s_axi_arburst : in STD_LOGIC_VECTOR ( 1 downto 0 ); s_axi_arlock : in STD_LOGIC_VECTOR ( 0 to 0 ); s_axi_arcache : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_arprot : in STD_LOGIC_VECTOR ( 2 downto 0 ); s_axi_arregion : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_arqos : in STD_LOGIC_VECTOR ( 3 downto 0 ); s_axi_arvalid : in STD_LOGIC; s_axi_arready : out STD_LOGIC; s_axi_rdata : out STD_LOGIC_VECTOR ( 31 downto 0 ); s_axi_rresp : out STD_LOGIC_VECTOR ( 1 downto 0 ); s_axi_rlast : out STD_LOGIC; s_axi_rvalid : out STD_LOGIC; s_axi_rready : in STD_LOGIC; m_axi_awaddr : out STD_LOGIC_VECTOR ( 31 downto 0 ); m_axi_awprot : out STD_LOGIC_VECTOR ( 2 downto 0 ); m_axi_awvalid : out STD_LOGIC; m_axi_awready : in STD_LOGIC; m_axi_wdata : out STD_LOGIC_VECTOR ( 31 downto 0 ); m_axi_wstrb : out STD_LOGIC_VECTOR ( 3 downto 0 ); m_axi_wvalid : out STD_LOGIC; m_axi_wready : in STD_LOGIC; m_axi_bresp : in STD_LOGIC_VECTOR ( 1 downto 0 ); m_axi_bvalid : in STD_LOGIC; m_axi_bready : out STD_LOGIC; m_axi_araddr : out STD_LOGIC_VECTOR ( 31 downto 0 ); m_axi_arprot : out STD_LOGIC_VECTOR ( 2 downto 0 ); m_axi_arvalid : out STD_LOGIC; m_axi_arready : in STD_LOGIC; m_axi_rdata : in STD_LOGIC_VECTOR ( 31 downto 0 ); m_axi_rresp : in STD_LOGIC_VECTOR ( 1 downto 0 ); m_axi_rvalid : in STD_LOGIC; m_axi_rready : out STD_LOGIC ); end zqynq_lab_1_design_auto_pc_1; architecture stub of zqynq_lab_1_design_auto_pc_1 is attribute syn_black_box : boolean; attribute black_box_pad_pin : string; attribute syn_black_box of stub : architecture is true; attribute black_box_pad_pin of stub : architecture is "aclk,aresetn,s_axi_awaddr[31:0],s_axi_awlen[7:0],s_axi_awsize[2:0],s_axi_awburst[1:0],s_axi_awlock[0:0],s_axi_awcache[3:0],s_axi_awprot[2:0],s_axi_awregion[3:0],s_axi_awqos[3:0],s_axi_awvalid,s_axi_awready,s_axi_wdata[31:0],s_axi_wstrb[3:0],s_axi_wlast,s_axi_wvalid,s_axi_wready,s_axi_bresp[1:0],s_axi_bvalid,s_axi_bready,s_axi_araddr[31:0],s_axi_arlen[7:0],s_axi_arsize[2:0],s_axi_arburst[1:0],s_axi_arlock[0:0],s_axi_arcache[3:0],s_axi_arprot[2:0],s_axi_arregion[3:0],s_axi_arqos[3:0],s_axi_arvalid,s_axi_arready,s_axi_rdata[31:0],s_axi_rresp[1:0],s_axi_rlast,s_axi_rvalid,s_axi_rready,m_axi_awaddr[31:0],m_axi_awprot[2:0],m_axi_awvalid,m_axi_awready,m_axi_wdata[31:0],m_axi_wstrb[3:0],m_axi_wvalid,m_axi_wready,m_axi_bresp[1:0],m_axi_bvalid,m_axi_bready,m_axi_araddr[31:0],m_axi_arprot[2:0],m_axi_arvalid,m_axi_arready,m_axi_rdata[31:0],m_axi_rresp[1:0],m_axi_rvalid,m_axi_rready"; attribute X_CORE_INFO : string; attribute X_CORE_INFO of stub : architecture is "axi_protocol_converter_v2_1_13_axi_protocol_converter,Vivado 2017.2"; begin end;
------------------------------------------------------------------------------------------------- -- Company : CNES -- Author : Mickael Carl (CNES) -- Copyright : Copyright (c) CNES. -- Licensing : GNU GPLv3 ------------------------------------------------------------------------------------------------- -- Version : V1 -- Version history : -- V1 : 2015-04-13 : Mickael Carl (CNES): Creation ------------------------------------------------------------------------------------------------- -- File name : STD_05600_good.vhd -- File Creation date : 2015-04-13 -- Project name : VHDL Handbook CNES Edition ------------------------------------------------------------------------------------------------- -- Softwares : Microsoft Windows (Windows 7) - Editor (Eclipse + VEditor) ------------------------------------------------------------------------------------------------- -- Description : Handbook example: Unsuitability of combinational feedbacks: good example -- -- Limitations : This file is an example of the VHDL handbook made by CNES. It is a stub aimed at -- demonstrating good practices in VHDL and as such, its design is minimalistic. -- It is provided as is, without any warranty. -- This example is compliant with the Handbook version 1. -- ------------------------------------------------------------------------------------------------- -- Naming conventions: -- -- i_Port: Input entity port -- o_Port: Output entity port -- b_Port: Bidirectional entity port -- g_My_Generic: Generic entity port -- -- c_My_Constant: Constant definition -- t_My_Type: Custom type definition -- -- My_Signal_n: Active low signal -- v_My_Variable: Variable -- sm_My_Signal: FSM signal -- pkg_Param: Element Param coming from a package -- -- My_Signal_re: Rising edge detection of My_Signal -- My_Signal_fe: Falling edge detection of My_Signal -- My_Signal_rX: X times registered My_Signal signal -- -- P_Process_Name: Process -- ------------------------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library work; use work.pkg_HBK.all; --CODE entity STD_05600_good is port ( i_Clock : in std_logic; -- Clock signal i_Reset_n : in std_logic; -- Reset signal i_A : in std_logic; -- First Mux input i_B : in std_logic; -- Second Mux input i_Sel : in std_logic; -- Mux selector o_O : out std_logic -- Mux output ); end STD_05600_good; architecture Behavioral of STD_05600_good is signal Mux_Sel : std_logic; -- Combinational select signal Mux_Sel_r : std_logic; -- Synchronized select signal O : std_logic; -- Module output begin Mux_Sel <= i_Sel and O; -- Synchronizes the Mux_Sel signal to avoid combinational feedback DFF : DFlipFlop port map ( i_Clock => i_Clock, i_Reset_n => i_Reset_n, i_D => Mux_Sel, o_Q => Mux_Sel_r ); -- Combinational Mux selecting A or B depending on Mux_Sel_r value Mux1 : Mux port map ( i_A => i_A, i_B => i_B, i_S => Mux_Sel_r, o_O => O ); o_O <= O; end Behavioral; --CODE
entity portlisttest is port ( signal a: in bit; signal b: out bit ); end entity; entity portlisttest is end entity; architecture foo of portlisttest is signal a: bit; signal b: bit; begin DUT: entity work.portlisttest(fum) port map ( a => a, b => b ); end architecture;
entity portlisttest is port ( signal a: in bit; signal b: out bit ); end entity; entity portlisttest is end entity; architecture foo of portlisttest is signal a: bit; signal b: bit; begin DUT: entity work.portlisttest(fum) port map ( a => a, b => b ); end architecture;
entity portlisttest is port ( signal a: in bit; signal b: out bit ); end entity; entity portlisttest is end entity; architecture foo of portlisttest is signal a: bit; signal b: bit; begin DUT: entity work.portlisttest(fum) port map ( a => a, b => b ); end architecture;
entity portlisttest is port ( signal a: in bit; signal b: out bit ); end entity; entity portlisttest is end entity; architecture foo of portlisttest is signal a: bit; signal b: bit; begin DUT: entity work.portlisttest(fum) port map ( a => a, b => b ); end architecture;
-- **** -- T80(b) core. In an effort to merge and maintain bug fixes .... -- -- -- Ver 300 started tidyup. Rmoved some auto_wait bits from 0247 which caused problems -- -- MikeJ March 2005 -- Latest version from www.fpgaarcade.com (original www.opencores.org) -- -- **** -- -- Z80 compatible microprocessor core -- -- Version : 0247 -- -- Copyright (c) 2001-2002 Daniel Wallner ([email protected]) -- -- All rights reserved -- -- Redistribution and use in source and synthezised forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- -- Redistributions in synthesized form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- Neither the name of the author nor the names of other contributors may -- be used to endorse or promote products derived from this software without -- specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. -- -- Please report bugs to the author, but before you do so, please -- make sure that this is not a derivative work and that -- you have the latest version of this file. -- -- The latest version of this file can be found at: -- http://www.opencores.org/cvsweb.shtml/t80/ -- -- Limitations : -- -- File history : -- -- 0208 : First complete release -- -- 0210 : Fixed wait and halt -- -- 0211 : Fixed Refresh addition and IM 1 -- -- 0214 : Fixed mostly flags, only the block instructions now fail the zex regression test -- -- 0232 : Removed refresh address output for Mode > 1 and added DJNZ M1_n fix by Mike Johnson -- -- 0235 : Added clock enable and IM 2 fix by Mike Johnson -- -- 0237 : Changed 8080 I/O address output, added IntE output -- -- 0238 : Fixed (IX/IY+d) timing and 16 bit ADC and SBC zero flag -- -- 0240 : Added interrupt ack fix by Mike Johnson, changed (IX/IY+d) timing and changed flags in GB mode -- -- 0242 : Added I/O wait, fixed refresh address, moved some registers to RAM -- -- 0247 : Fixed bus req/ack cycle -- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; use work.T80_Pack.all; entity T80 is generic( Mode : integer := 0; -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB IOWait : integer := 0; -- 1 => Single cycle I/O, 1 => Std I/O cycle Flag_C : integer := 0; Flag_N : integer := 1; Flag_P : integer := 2; Flag_X : integer := 3; Flag_H : integer := 4; Flag_Y : integer := 5; Flag_Z : integer := 6; Flag_S : integer := 7 ); port( RESET_n : in std_logic; CLK_n : in std_logic; CEN : in std_logic; WAIT_n : in std_logic; INT_n : in std_logic; NMI_n : in std_logic; BUSRQ_n : in std_logic; M1_n : out std_logic; IORQ : out std_logic; NoRead : out std_logic; Write : out std_logic; RFSH_n : out std_logic; HALT_n : out std_logic; BUSAK_n : out std_logic; A : out std_logic_vector(15 downto 0); DInst : in std_logic_vector(7 downto 0); DI : in std_logic_vector(7 downto 0); DO : out std_logic_vector(7 downto 0); MC : out std_logic_vector(2 downto 0); TS : out std_logic_vector(2 downto 0); IntCycle_n : out std_logic; IntE : out std_logic; Stop : out std_logic ); end T80; architecture rtl of T80 is constant aNone : std_logic_vector(2 downto 0) := "111"; constant aBC : std_logic_vector(2 downto 0) := "000"; constant aDE : std_logic_vector(2 downto 0) := "001"; constant aXY : std_logic_vector(2 downto 0) := "010"; constant aIOA : std_logic_vector(2 downto 0) := "100"; constant aSP : std_logic_vector(2 downto 0) := "101"; constant aZI : std_logic_vector(2 downto 0) := "110"; -- Registers signal ACC, F : std_logic_vector(7 downto 0); signal Ap, Fp : std_logic_vector(7 downto 0); signal I : std_logic_vector(7 downto 0); signal R : unsigned(7 downto 0); signal SP, PC : unsigned(15 downto 0); signal RegDIH : std_logic_vector(7 downto 0); signal RegDIL : std_logic_vector(7 downto 0); signal RegBusA : std_logic_vector(15 downto 0); signal RegBusB : std_logic_vector(15 downto 0); signal RegBusC : std_logic_vector(15 downto 0); signal RegAddrA_r : std_logic_vector(2 downto 0); signal RegAddrA : std_logic_vector(2 downto 0); signal RegAddrB_r : std_logic_vector(2 downto 0); signal RegAddrB : std_logic_vector(2 downto 0); signal RegAddrC : std_logic_vector(2 downto 0); signal RegWEH : std_logic; signal RegWEL : std_logic; signal Alternate : std_logic; -- Help Registers signal TmpAddr : std_logic_vector(15 downto 0); -- Temporary address register signal IR : std_logic_vector(7 downto 0); -- Instruction register signal ISet : std_logic_vector(1 downto 0); -- Instruction set selector signal RegBusA_r : std_logic_vector(15 downto 0); signal ID16 : signed(15 downto 0); signal Save_Mux : std_logic_vector(7 downto 0); signal TState : unsigned(2 downto 0); signal MCycle : std_logic_vector(2 downto 0); signal IntE_FF1 : std_logic; signal IntE_FF2 : std_logic; signal Halt_FF : std_logic; signal BusReq_s : std_logic; signal BusAck : std_logic; signal ClkEn : std_logic; signal NMI_s : std_logic; signal INT_s : std_logic; signal IStatus : std_logic_vector(1 downto 0); signal DI_Reg : std_logic_vector(7 downto 0); signal T_Res : std_logic; signal XY_State : std_logic_vector(1 downto 0); signal Pre_XY_F_M : std_logic_vector(2 downto 0); signal NextIs_XY_Fetch : std_logic; signal XY_Ind : std_logic; signal No_BTR : std_logic; signal BTR_r : std_logic; signal Auto_Wait : std_logic; signal Auto_Wait_t1 : std_logic; signal Auto_Wait_t2 : std_logic; signal IncDecZ : std_logic; -- ALU signals signal BusB : std_logic_vector(7 downto 0); signal BusA : std_logic_vector(7 downto 0); signal ALU_Q : std_logic_vector(7 downto 0); signal F_Out : std_logic_vector(7 downto 0); -- Registered micro code outputs signal Read_To_Reg_r : std_logic_vector(4 downto 0); signal Arith16_r : std_logic; signal Z16_r : std_logic; signal ALU_Op_r : std_logic_vector(3 downto 0); signal Save_ALU_r : std_logic; signal PreserveC_r : std_logic; signal MCycles : std_logic_vector(2 downto 0); -- Micro code outputs signal MCycles_d : std_logic_vector(2 downto 0); signal TStates : std_logic_vector(2 downto 0); signal IntCycle : std_logic; signal NMICycle : std_logic; signal Inc_PC : std_logic; signal Inc_WZ : std_logic; signal IncDec_16 : std_logic_vector(3 downto 0); signal Prefix : std_logic_vector(1 downto 0); signal Read_To_Acc : std_logic; signal Read_To_Reg : std_logic; signal Set_BusB_To : std_logic_vector(3 downto 0); signal Set_BusA_To : std_logic_vector(3 downto 0); signal ALU_Op : std_logic_vector(3 downto 0); signal Save_ALU : std_logic; signal PreserveC : std_logic; signal Arith16 : std_logic; signal Set_Addr_To : std_logic_vector(2 downto 0); signal Jump : std_logic; signal JumpE : std_logic; signal JumpXY : std_logic; signal Call : std_logic; signal RstP : std_logic; signal LDZ : std_logic; signal LDW : std_logic; signal LDSPHL : std_logic; signal IORQ_i : std_logic; signal Special_LD : std_logic_vector(2 downto 0); signal ExchangeDH : std_logic; signal ExchangeRp : std_logic; signal ExchangeAF : std_logic; signal ExchangeRS : std_logic; signal I_DJNZ : std_logic; signal I_CPL : std_logic; signal I_CCF : std_logic; signal I_SCF : std_logic; signal I_RETN : std_logic; signal I_BT : std_logic; signal I_BC : std_logic; signal I_BTR : std_logic; signal I_RLD : std_logic; signal I_RRD : std_logic; signal I_INRC : std_logic; signal SetDI : std_logic; signal SetEI : std_logic; signal IMode : std_logic_vector(1 downto 0); signal Halt : std_logic; begin mcode : T80_MCode generic map( Mode => Mode, Flag_C => Flag_C, Flag_N => Flag_N, Flag_P => Flag_P, Flag_X => Flag_X, Flag_H => Flag_H, Flag_Y => Flag_Y, Flag_Z => Flag_Z, Flag_S => Flag_S) port map( IR => IR, ISet => ISet, MCycle => MCycle, F => F, NMICycle => NMICycle, IntCycle => IntCycle, MCycles => MCycles_d, TStates => TStates, Prefix => Prefix, Inc_PC => Inc_PC, Inc_WZ => Inc_WZ, IncDec_16 => IncDec_16, Read_To_Acc => Read_To_Acc, Read_To_Reg => Read_To_Reg, Set_BusB_To => Set_BusB_To, Set_BusA_To => Set_BusA_To, ALU_Op => ALU_Op, Save_ALU => Save_ALU, PreserveC => PreserveC, Arith16 => Arith16, Set_Addr_To => Set_Addr_To, IORQ => IORQ_i, Jump => Jump, JumpE => JumpE, JumpXY => JumpXY, Call => Call, RstP => RstP, LDZ => LDZ, LDW => LDW, LDSPHL => LDSPHL, Special_LD => Special_LD, ExchangeDH => ExchangeDH, ExchangeRp => ExchangeRp, ExchangeAF => ExchangeAF, ExchangeRS => ExchangeRS, I_DJNZ => I_DJNZ, I_CPL => I_CPL, I_CCF => I_CCF, I_SCF => I_SCF, I_RETN => I_RETN, I_BT => I_BT, I_BC => I_BC, I_BTR => I_BTR, I_RLD => I_RLD, I_RRD => I_RRD, I_INRC => I_INRC, SetDI => SetDI, SetEI => SetEI, IMode => IMode, Halt => Halt, NoRead => NoRead, Write => Write); alu : T80_ALU generic map( Mode => Mode, Flag_C => Flag_C, Flag_N => Flag_N, Flag_P => Flag_P, Flag_X => Flag_X, Flag_H => Flag_H, Flag_Y => Flag_Y, Flag_Z => Flag_Z, Flag_S => Flag_S) port map( Arith16 => Arith16_r, Z16 => Z16_r, ALU_Op => ALU_Op_r, IR => IR(5 downto 0), ISet => ISet, BusA => BusA, BusB => BusB, F_In => F, Q => ALU_Q, F_Out => F_Out); ClkEn <= CEN and not BusAck; T_Res <= '1' when TState = unsigned(TStates) else '0'; NextIs_XY_Fetch <= '1' when XY_State /= "00" and XY_Ind = '0' and ((Set_Addr_To = aXY) or (MCycle = "001" and IR = "11001011") or (MCycle = "001" and IR = "00110110")) else '0'; Save_Mux <= BusB when ExchangeRp = '1' else DI_Reg when Save_ALU_r = '0' else ALU_Q; process (RESET_n, CLK_n) begin if RESET_n = '0' then PC <= (others => '0'); -- Program Counter A <= (others => '0'); TmpAddr <= (others => '0'); IR <= "00000000"; ISet <= "00"; XY_State <= "00"; IStatus <= "00"; MCycles <= "000"; DO <= "00000000"; ACC <= (others => '1'); F <= (others => '1'); Ap <= (others => '1'); Fp <= (others => '1'); I <= (others => '0'); R <= (others => '0'); SP <= (others => '1'); Alternate <= '0'; Read_To_Reg_r <= "00000"; F <= (others => '1'); Arith16_r <= '0'; BTR_r <= '0'; Z16_r <= '0'; ALU_Op_r <= "0000"; Save_ALU_r <= '0'; PreserveC_r <= '0'; XY_Ind <= '0'; elsif CLK_n'event and CLK_n = '1' then if ClkEn = '1' then ALU_Op_r <= "0000"; Save_ALU_r <= '0'; Read_To_Reg_r <= "00000"; MCycles <= MCycles_d; if IMode /= "11" then IStatus <= IMode; end if; Arith16_r <= Arith16; PreserveC_r <= PreserveC; if ISet = "10" and ALU_OP(2) = '0' and ALU_OP(0) = '1' and MCycle = "011" then Z16_r <= '1'; else Z16_r <= '0'; end if; if MCycle = "001" and TState(2) = '0' then -- MCycle = 1 and TState = 1, 2, or 3 if TState = 2 and Wait_n = '1' then if Mode < 2 then A(7 downto 0) <= std_logic_vector(R); A(15 downto 8) <= I; R(6 downto 0) <= R(6 downto 0) + 1; end if; if Jump = '0' and Call = '0' and NMICycle = '0' and IntCycle = '0' and not (Halt_FF = '1' or Halt = '1') then PC <= PC + 1; end if; if IntCycle = '1' and IStatus = "01" then IR <= "11111111"; elsif Halt_FF = '1' or (IntCycle = '1' and IStatus = "10") or NMICycle = '1' then IR <= "00000000"; else IR <= DInst; end if; ISet <= "00"; if Prefix /= "00" then if Prefix = "11" then if IR(5) = '1' then XY_State <= "10"; else XY_State <= "01"; end if; else if Prefix = "10" then XY_State <= "00"; XY_Ind <= '0'; end if; ISet <= Prefix; end if; else XY_State <= "00"; XY_Ind <= '0'; end if; end if; else -- either (MCycle > 1) OR (MCycle = 1 AND TState > 3) if MCycle = "110" then XY_Ind <= '1'; if Prefix = "01" then ISet <= "01"; end if; end if; if T_Res = '1' then BTR_r <= (I_BT or I_BC or I_BTR) and not No_BTR; if Jump = '1' then A(15 downto 8) <= DI_Reg; A(7 downto 0) <= TmpAddr(7 downto 0); PC(15 downto 8) <= unsigned(DI_Reg); PC(7 downto 0) <= unsigned(TmpAddr(7 downto 0)); elsif JumpXY = '1' then A <= RegBusC; PC <= unsigned(RegBusC); elsif Call = '1' or RstP = '1' then A <= TmpAddr; PC <= unsigned(TmpAddr); elsif MCycle = MCycles and NMICycle = '1' then A <= "0000000001100110"; PC <= "0000000001100110"; elsif MCycle = "011" and IntCycle = '1' and IStatus = "10" then A(15 downto 8) <= I; A(7 downto 0) <= TmpAddr(7 downto 0); PC(15 downto 8) <= unsigned(I); PC(7 downto 0) <= unsigned(TmpAddr(7 downto 0)); else case Set_Addr_To is when aXY => if XY_State = "00" then A <= RegBusC; else if NextIs_XY_Fetch = '1' then A <= std_logic_vector(PC); else A <= TmpAddr; end if; end if; when aIOA => if Mode = 3 then -- Memory map I/O on GBZ80 A(15 downto 8) <= (others => '1'); elsif Mode = 2 then -- Duplicate I/O address on 8080 A(15 downto 8) <= DI_Reg; else A(15 downto 8) <= ACC; end if; A(7 downto 0) <= DI_Reg; when aSP => A <= std_logic_vector(SP); when aBC => if Mode = 3 and IORQ_i = '1' then -- Memory map I/O on GBZ80 A(15 downto 8) <= (others => '1'); A(7 downto 0) <= RegBusC(7 downto 0); else A <= RegBusC; end if; when aDE => A <= RegBusC; when aZI => if Inc_WZ = '1' then A <= std_logic_vector(unsigned(TmpAddr) + 1); else A(15 downto 8) <= DI_Reg; A(7 downto 0) <= TmpAddr(7 downto 0); end if; when others => A <= std_logic_vector(PC); end case; end if; Save_ALU_r <= Save_ALU; ALU_Op_r <= ALU_Op; if I_CPL = '1' then -- CPL ACC <= not ACC; F(Flag_Y) <= not ACC(5); F(Flag_H) <= '1'; F(Flag_X) <= not ACC(3); F(Flag_N) <= '1'; end if; if I_CCF = '1' then -- CCF F(Flag_C) <= not F(Flag_C); F(Flag_Y) <= ACC(5); F(Flag_H) <= F(Flag_C); F(Flag_X) <= ACC(3); F(Flag_N) <= '0'; end if; if I_SCF = '1' then -- SCF F(Flag_C) <= '1'; F(Flag_Y) <= ACC(5); F(Flag_H) <= '0'; F(Flag_X) <= ACC(3); F(Flag_N) <= '0'; end if; end if; if TState = 2 and Wait_n = '1' then if ISet = "01" and MCycle = "111" then IR <= DInst; end if; if JumpE = '1' then PC <= unsigned(signed(PC) + signed(DI_Reg)); elsif Inc_PC = '1' then PC <= PC + 1; end if; if BTR_r = '1' then PC <= PC - 2; end if; if RstP = '1' then TmpAddr <= (others =>'0'); TmpAddr(5 downto 3) <= IR(5 downto 3); end if; end if; if TState = 3 and MCycle = "110" then TmpAddr <= std_logic_vector(signed(RegBusC) + signed(DI_Reg)); end if; if (TState = 2 and Wait_n = '1') or (TState = 4 and MCycle = "001") then if IncDec_16(2 downto 0) = "111" then if IncDec_16(3) = '1' then SP <= SP - 1; else SP <= SP + 1; end if; end if; end if; if LDSPHL = '1' then SP <= unsigned(RegBusC); end if; if ExchangeAF = '1' then Ap <= ACC; ACC <= Ap; Fp <= F; F <= Fp; end if; if ExchangeRS = '1' then Alternate <= not Alternate; end if; end if; if TState = 3 then if LDZ = '1' then TmpAddr(7 downto 0) <= DI_Reg; end if; if LDW = '1' then TmpAddr(15 downto 8) <= DI_Reg; end if; if Special_LD(2) = '1' then case Special_LD(1 downto 0) is when "00" => ACC <= I; F(Flag_P) <= IntE_FF2; when "01" => ACC <= std_logic_vector(R); F(Flag_P) <= IntE_FF2; when "10" => I <= ACC; when others => R <= unsigned(ACC); end case; end if; end if; if (I_DJNZ = '0' and Save_ALU_r = '1') or ALU_Op_r = "1001" then if Mode = 3 then F(6) <= F_Out(6); F(5) <= F_Out(5); F(7) <= F_Out(7); if PreserveC_r = '0' then F(4) <= F_Out(4); end if; else F(7 downto 1) <= F_Out(7 downto 1); if PreserveC_r = '0' then F(Flag_C) <= F_Out(0); end if; end if; end if; if T_Res = '1' and I_INRC = '1' then F(Flag_H) <= '0'; F(Flag_N) <= '0'; if DI_Reg(7 downto 0) = "00000000" then F(Flag_Z) <= '1'; else F(Flag_Z) <= '0'; end if; F(Flag_S) <= DI_Reg(7); F(Flag_P) <= not (DI_Reg(0) xor DI_Reg(1) xor DI_Reg(2) xor DI_Reg(3) xor DI_Reg(4) xor DI_Reg(5) xor DI_Reg(6) xor DI_Reg(7)); end if; if TState = 1 then DO <= BusB; if I_RLD = '1' then DO(3 downto 0) <= BusA(3 downto 0); DO(7 downto 4) <= BusB(3 downto 0); end if; if I_RRD = '1' then DO(3 downto 0) <= BusB(7 downto 4); DO(7 downto 4) <= BusA(3 downto 0); end if; end if; if T_Res = '1' then Read_To_Reg_r(3 downto 0) <= Set_BusA_To; Read_To_Reg_r(4) <= Read_To_Reg; if Read_To_Acc = '1' then Read_To_Reg_r(3 downto 0) <= "0111"; Read_To_Reg_r(4) <= '1'; end if; end if; if TState = 1 and I_BT = '1' then F(Flag_X) <= ALU_Q(3); F(Flag_Y) <= ALU_Q(1); F(Flag_H) <= '0'; F(Flag_N) <= '0'; end if; if I_BC = '1' or I_BT = '1' then F(Flag_P) <= IncDecZ; end if; if (TState = 1 and Save_ALU_r = '0') or (Save_ALU_r = '1' and ALU_OP_r /= "0111") then case Read_To_Reg_r is when "10111" => ACC <= Save_Mux; when "10110" => DO <= Save_Mux; when "11000" => SP(7 downto 0) <= unsigned(Save_Mux); when "11001" => SP(15 downto 8) <= unsigned(Save_Mux); when "11011" => F <= Save_Mux; when others => end case; end if; end if; end if; end process; --------------------------------------------------------------------------- -- -- BC('), DE('), HL('), IX and IY -- --------------------------------------------------------------------------- process (CLK_n) begin if CLK_n'event and CLK_n = '1' then if ClkEn = '1' then -- Bus A / Write RegAddrA_r <= Alternate & Set_BusA_To(2 downto 1); if XY_Ind = '0' and XY_State /= "00" and Set_BusA_To(2 downto 1) = "10" then RegAddrA_r <= XY_State(1) & "11"; end if; -- Bus B RegAddrB_r <= Alternate & Set_BusB_To(2 downto 1); if XY_Ind = '0' and XY_State /= "00" and Set_BusB_To(2 downto 1) = "10" then RegAddrB_r <= XY_State(1) & "11"; end if; -- Address from register RegAddrC <= Alternate & Set_Addr_To(1 downto 0); -- Jump (HL), LD SP,HL if (JumpXY = '1' or LDSPHL = '1') then RegAddrC <= Alternate & "10"; end if; if ((JumpXY = '1' or LDSPHL = '1') and XY_State /= "00") or (MCycle = "110") then RegAddrC <= XY_State(1) & "11"; end if; if I_DJNZ = '1' and Save_ALU_r = '1' and Mode < 2 then IncDecZ <= F_Out(Flag_Z); end if; if (TState = 2 or (TState = 3 and MCycle = "001")) and IncDec_16(2 downto 0) = "100" then if ID16 = 0 then IncDecZ <= '0'; else IncDecZ <= '1'; end if; end if; RegBusA_r <= RegBusA; end if; end if; end process; RegAddrA <= -- 16 bit increment/decrement Alternate & IncDec_16(1 downto 0) when (TState = 2 or (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and XY_State = "00" else XY_State(1) & "11" when (TState = 2 or (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and IncDec_16(1 downto 0) = "10" else -- EX HL,DL Alternate & "10" when ExchangeDH = '1' and TState = 3 else Alternate & "01" when ExchangeDH = '1' and TState = 4 else -- Bus A / Write RegAddrA_r; RegAddrB <= -- EX HL,DL Alternate & "01" when ExchangeDH = '1' and TState = 3 else -- Bus B RegAddrB_r; ID16 <= signed(RegBusA) - 1 when IncDec_16(3) = '1' else signed(RegBusA) + 1; process (Save_ALU_r, Auto_Wait_t1, ALU_OP_r, Read_To_Reg_r, ExchangeDH, IncDec_16, MCycle, TState, Wait_n) begin RegWEH <= '0'; RegWEL <= '0'; if (TState = 1 and Save_ALU_r = '0') or (Save_ALU_r = '1' and ALU_OP_r /= "0111") then case Read_To_Reg_r is when "10000" | "10001" | "10010" | "10011" | "10100" | "10101" => RegWEH <= not Read_To_Reg_r(0); RegWEL <= Read_To_Reg_r(0); when others => end case; end if; if ExchangeDH = '1' and (TState = 3 or TState = 4) then RegWEH <= '1'; RegWEL <= '1'; end if; if IncDec_16(2) = '1' and ((TState = 2 and Wait_n = '1' and MCycle /= "001") or (TState = 3 and MCycle = "001")) then case IncDec_16(1 downto 0) is when "00" | "01" | "10" => RegWEH <= '1'; RegWEL <= '1'; when others => end case; end if; end process; process (Save_Mux, RegBusB, RegBusA_r, ID16, ExchangeDH, IncDec_16, MCycle, TState, Wait_n) begin RegDIH <= Save_Mux; RegDIL <= Save_Mux; if ExchangeDH = '1' and TState = 3 then RegDIH <= RegBusB(15 downto 8); RegDIL <= RegBusB(7 downto 0); end if; if ExchangeDH = '1' and TState = 4 then RegDIH <= RegBusA_r(15 downto 8); RegDIL <= RegBusA_r(7 downto 0); end if; if IncDec_16(2) = '1' and ((TState = 2 and MCycle /= "001") or (TState = 3 and MCycle = "001")) then RegDIH <= std_logic_vector(ID16(15 downto 8)); RegDIL <= std_logic_vector(ID16(7 downto 0)); end if; end process; Regs : T80_Reg port map( Clk => CLK_n, CEN => ClkEn, WEH => RegWEH, WEL => RegWEL, AddrA => RegAddrA, AddrB => RegAddrB, AddrC => RegAddrC, DIH => RegDIH, DIL => RegDIL, DOAH => RegBusA(15 downto 8), DOAL => RegBusA(7 downto 0), DOBH => RegBusB(15 downto 8), DOBL => RegBusB(7 downto 0), DOCH => RegBusC(15 downto 8), DOCL => RegBusC(7 downto 0)); --------------------------------------------------------------------------- -- -- Buses -- --------------------------------------------------------------------------- process (CLK_n) begin if CLK_n'event and CLK_n = '1' then if ClkEn = '1' then case Set_BusB_To is when "0111" => BusB <= ACC; when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" => if Set_BusB_To(0) = '1' then BusB <= RegBusB(7 downto 0); else BusB <= RegBusB(15 downto 8); end if; when "0110" => BusB <= DI_Reg; when "1000" => BusB <= std_logic_vector(SP(7 downto 0)); when "1001" => BusB <= std_logic_vector(SP(15 downto 8)); when "1010" => BusB <= "00000001"; when "1011" => BusB <= F; when "1100" => BusB <= std_logic_vector(PC(7 downto 0)); when "1101" => BusB <= std_logic_vector(PC(15 downto 8)); when "1110" => BusB <= "00000000"; when others => BusB <= "--------"; end case; case Set_BusA_To is when "0111" => BusA <= ACC; when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" => if Set_BusA_To(0) = '1' then BusA <= RegBusA(7 downto 0); else BusA <= RegBusA(15 downto 8); end if; when "0110" => BusA <= DI_Reg; when "1000" => BusA <= std_logic_vector(SP(7 downto 0)); when "1001" => BusA <= std_logic_vector(SP(15 downto 8)); when "1010" => BusA <= "00000000"; when others => BusB <= "--------"; end case; end if; end if; end process; --------------------------------------------------------------------------- -- -- Generate external control signals -- --------------------------------------------------------------------------- process (RESET_n,CLK_n) begin if RESET_n = '0' then RFSH_n <= '1'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then if MCycle = "001" and ((TState = 2 and Wait_n = '1') or TState = 3) then RFSH_n <= '0'; else RFSH_n <= '1'; end if; end if; end if; end process; MC <= std_logic_vector(MCycle); TS <= std_logic_vector(TState); DI_Reg <= DI; HALT_n <= not Halt_FF; BUSAK_n <= not BusAck; IntCycle_n <= not IntCycle; IntE <= IntE_FF1; IORQ <= IORQ_i; Stop <= I_DJNZ; ------------------------------------------------------------------------- -- -- Syncronise inputs -- ------------------------------------------------------------------------- process (RESET_n, CLK_n) variable OldNMI_n : std_logic; begin if RESET_n = '0' then BusReq_s <= '0'; INT_s <= '0'; NMI_s <= '0'; OldNMI_n := '0'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then BusReq_s <= not BUSRQ_n; INT_s <= not INT_n; if NMICycle = '1' then NMI_s <= '0'; elsif NMI_n = '0' and OldNMI_n = '1' then NMI_s <= '1'; end if; OldNMI_n := NMI_n; end if; end if; end process; ------------------------------------------------------------------------- -- -- Main state machine -- ------------------------------------------------------------------------- process (RESET_n, CLK_n) begin if RESET_n = '0' then MCycle <= "001"; TState <= "000"; Pre_XY_F_M <= "000"; Halt_FF <= '0'; BusAck <= '0'; NMICycle <= '0'; IntCycle <= '0'; IntE_FF1 <= '0'; IntE_FF2 <= '0'; No_BTR <= '0'; Auto_Wait_t1 <= '0'; Auto_Wait_t2 <= '0'; M1_n <= '1'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then Auto_Wait_t1 <= Auto_Wait; Auto_Wait_t2 <= Auto_Wait_t1; No_BTR <= (I_BT and (not IR(4) or not F(Flag_P))) or (I_BC and (not IR(4) or F(Flag_Z) or not F(Flag_P))) or (I_BTR and (not IR(4) or F(Flag_Z))); if TState = 2 then if SetEI = '1' then IntE_FF1 <= '1'; IntE_FF2 <= '1'; end if; if I_RETN = '1' then IntE_FF1 <= IntE_FF2; end if; end if; if TState = 3 then if SetDI = '1' then IntE_FF1 <= '0'; IntE_FF2 <= '0'; end if; end if; if IntCycle = '1' or NMICycle = '1' then Halt_FF <= '0'; end if; if MCycle = "001" and TState = 2 and Wait_n = '1' then M1_n <= '1'; end if; if BusReq_s = '1' and BusAck = '1' then else BusAck <= '0'; if TState = 2 and Wait_n = '0' then elsif T_Res = '1' then if Halt = '1' then Halt_FF <= '1'; end if; if BusReq_s = '1' then BusAck <= '1'; else TState <= "001"; if NextIs_XY_Fetch = '1' then MCycle <= "110"; Pre_XY_F_M <= MCycle; if IR = "00110110" and Mode = 0 then Pre_XY_F_M <= "010"; end if; elsif (MCycle = "111") or (MCycle = "110" and Mode = 1 and ISet /= "01") then MCycle <= std_logic_vector(unsigned(Pre_XY_F_M) + 1); elsif (MCycle = MCycles) or No_BTR = '1' or (MCycle = "010" and I_DJNZ = '1' and IncDecZ = '1') then M1_n <= '0'; MCycle <= "001"; IntCycle <= '0'; NMICycle <= '0'; if NMI_s = '1' and Prefix = "00" then NMICycle <= '1'; IntE_FF1 <= '0'; elsif (IntE_FF1 = '1' and INT_s = '1') and Prefix = "00" and SetEI = '0' then IntCycle <= '1'; IntE_FF1 <= '0'; IntE_FF2 <= '0'; end if; else MCycle <= std_logic_vector(unsigned(MCycle) + 1); end if; end if; else if Auto_Wait = '1' nand Auto_Wait_t2 = '0' then TState <= TState + 1; end if; end if; end if; if TState = 0 then M1_n <= '0'; end if; end if; end if; end process; process (IntCycle, NMICycle, MCycle) begin Auto_Wait <= '0'; if IntCycle = '1' or NMICycle = '1' then if MCycle = "001" then Auto_Wait <= '1'; end if; end if; end process; end;
-- **** -- T80(b) core. In an effort to merge and maintain bug fixes .... -- -- -- Ver 300 started tidyup. Rmoved some auto_wait bits from 0247 which caused problems -- -- MikeJ March 2005 -- Latest version from www.fpgaarcade.com (original www.opencores.org) -- -- **** -- -- Z80 compatible microprocessor core -- -- Version : 0247 -- -- Copyright (c) 2001-2002 Daniel Wallner ([email protected]) -- -- All rights reserved -- -- Redistribution and use in source and synthezised forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- -- Redistributions in synthesized form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- Neither the name of the author nor the names of other contributors may -- be used to endorse or promote products derived from this software without -- specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. -- -- Please report bugs to the author, but before you do so, please -- make sure that this is not a derivative work and that -- you have the latest version of this file. -- -- The latest version of this file can be found at: -- http://www.opencores.org/cvsweb.shtml/t80/ -- -- Limitations : -- -- File history : -- -- 0208 : First complete release -- -- 0210 : Fixed wait and halt -- -- 0211 : Fixed Refresh addition and IM 1 -- -- 0214 : Fixed mostly flags, only the block instructions now fail the zex regression test -- -- 0232 : Removed refresh address output for Mode > 1 and added DJNZ M1_n fix by Mike Johnson -- -- 0235 : Added clock enable and IM 2 fix by Mike Johnson -- -- 0237 : Changed 8080 I/O address output, added IntE output -- -- 0238 : Fixed (IX/IY+d) timing and 16 bit ADC and SBC zero flag -- -- 0240 : Added interrupt ack fix by Mike Johnson, changed (IX/IY+d) timing and changed flags in GB mode -- -- 0242 : Added I/O wait, fixed refresh address, moved some registers to RAM -- -- 0247 : Fixed bus req/ack cycle -- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; use work.T80_Pack.all; entity T80 is generic( Mode : integer := 0; -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB IOWait : integer := 0; -- 1 => Single cycle I/O, 1 => Std I/O cycle Flag_C : integer := 0; Flag_N : integer := 1; Flag_P : integer := 2; Flag_X : integer := 3; Flag_H : integer := 4; Flag_Y : integer := 5; Flag_Z : integer := 6; Flag_S : integer := 7 ); port( RESET_n : in std_logic; CLK_n : in std_logic; CEN : in std_logic; WAIT_n : in std_logic; INT_n : in std_logic; NMI_n : in std_logic; BUSRQ_n : in std_logic; M1_n : out std_logic; IORQ : out std_logic; NoRead : out std_logic; Write : out std_logic; RFSH_n : out std_logic; HALT_n : out std_logic; BUSAK_n : out std_logic; A : out std_logic_vector(15 downto 0); DInst : in std_logic_vector(7 downto 0); DI : in std_logic_vector(7 downto 0); DO : out std_logic_vector(7 downto 0); MC : out std_logic_vector(2 downto 0); TS : out std_logic_vector(2 downto 0); IntCycle_n : out std_logic; IntE : out std_logic; Stop : out std_logic ); end T80; architecture rtl of T80 is constant aNone : std_logic_vector(2 downto 0) := "111"; constant aBC : std_logic_vector(2 downto 0) := "000"; constant aDE : std_logic_vector(2 downto 0) := "001"; constant aXY : std_logic_vector(2 downto 0) := "010"; constant aIOA : std_logic_vector(2 downto 0) := "100"; constant aSP : std_logic_vector(2 downto 0) := "101"; constant aZI : std_logic_vector(2 downto 0) := "110"; -- Registers signal ACC, F : std_logic_vector(7 downto 0); signal Ap, Fp : std_logic_vector(7 downto 0); signal I : std_logic_vector(7 downto 0); signal R : unsigned(7 downto 0); signal SP, PC : unsigned(15 downto 0); signal RegDIH : std_logic_vector(7 downto 0); signal RegDIL : std_logic_vector(7 downto 0); signal RegBusA : std_logic_vector(15 downto 0); signal RegBusB : std_logic_vector(15 downto 0); signal RegBusC : std_logic_vector(15 downto 0); signal RegAddrA_r : std_logic_vector(2 downto 0); signal RegAddrA : std_logic_vector(2 downto 0); signal RegAddrB_r : std_logic_vector(2 downto 0); signal RegAddrB : std_logic_vector(2 downto 0); signal RegAddrC : std_logic_vector(2 downto 0); signal RegWEH : std_logic; signal RegWEL : std_logic; signal Alternate : std_logic; -- Help Registers signal TmpAddr : std_logic_vector(15 downto 0); -- Temporary address register signal IR : std_logic_vector(7 downto 0); -- Instruction register signal ISet : std_logic_vector(1 downto 0); -- Instruction set selector signal RegBusA_r : std_logic_vector(15 downto 0); signal ID16 : signed(15 downto 0); signal Save_Mux : std_logic_vector(7 downto 0); signal TState : unsigned(2 downto 0); signal MCycle : std_logic_vector(2 downto 0); signal IntE_FF1 : std_logic; signal IntE_FF2 : std_logic; signal Halt_FF : std_logic; signal BusReq_s : std_logic; signal BusAck : std_logic; signal ClkEn : std_logic; signal NMI_s : std_logic; signal INT_s : std_logic; signal IStatus : std_logic_vector(1 downto 0); signal DI_Reg : std_logic_vector(7 downto 0); signal T_Res : std_logic; signal XY_State : std_logic_vector(1 downto 0); signal Pre_XY_F_M : std_logic_vector(2 downto 0); signal NextIs_XY_Fetch : std_logic; signal XY_Ind : std_logic; signal No_BTR : std_logic; signal BTR_r : std_logic; signal Auto_Wait : std_logic; signal Auto_Wait_t1 : std_logic; signal Auto_Wait_t2 : std_logic; signal IncDecZ : std_logic; -- ALU signals signal BusB : std_logic_vector(7 downto 0); signal BusA : std_logic_vector(7 downto 0); signal ALU_Q : std_logic_vector(7 downto 0); signal F_Out : std_logic_vector(7 downto 0); -- Registered micro code outputs signal Read_To_Reg_r : std_logic_vector(4 downto 0); signal Arith16_r : std_logic; signal Z16_r : std_logic; signal ALU_Op_r : std_logic_vector(3 downto 0); signal Save_ALU_r : std_logic; signal PreserveC_r : std_logic; signal MCycles : std_logic_vector(2 downto 0); -- Micro code outputs signal MCycles_d : std_logic_vector(2 downto 0); signal TStates : std_logic_vector(2 downto 0); signal IntCycle : std_logic; signal NMICycle : std_logic; signal Inc_PC : std_logic; signal Inc_WZ : std_logic; signal IncDec_16 : std_logic_vector(3 downto 0); signal Prefix : std_logic_vector(1 downto 0); signal Read_To_Acc : std_logic; signal Read_To_Reg : std_logic; signal Set_BusB_To : std_logic_vector(3 downto 0); signal Set_BusA_To : std_logic_vector(3 downto 0); signal ALU_Op : std_logic_vector(3 downto 0); signal Save_ALU : std_logic; signal PreserveC : std_logic; signal Arith16 : std_logic; signal Set_Addr_To : std_logic_vector(2 downto 0); signal Jump : std_logic; signal JumpE : std_logic; signal JumpXY : std_logic; signal Call : std_logic; signal RstP : std_logic; signal LDZ : std_logic; signal LDW : std_logic; signal LDSPHL : std_logic; signal IORQ_i : std_logic; signal Special_LD : std_logic_vector(2 downto 0); signal ExchangeDH : std_logic; signal ExchangeRp : std_logic; signal ExchangeAF : std_logic; signal ExchangeRS : std_logic; signal I_DJNZ : std_logic; signal I_CPL : std_logic; signal I_CCF : std_logic; signal I_SCF : std_logic; signal I_RETN : std_logic; signal I_BT : std_logic; signal I_BC : std_logic; signal I_BTR : std_logic; signal I_RLD : std_logic; signal I_RRD : std_logic; signal I_INRC : std_logic; signal SetDI : std_logic; signal SetEI : std_logic; signal IMode : std_logic_vector(1 downto 0); signal Halt : std_logic; begin mcode : T80_MCode generic map( Mode => Mode, Flag_C => Flag_C, Flag_N => Flag_N, Flag_P => Flag_P, Flag_X => Flag_X, Flag_H => Flag_H, Flag_Y => Flag_Y, Flag_Z => Flag_Z, Flag_S => Flag_S) port map( IR => IR, ISet => ISet, MCycle => MCycle, F => F, NMICycle => NMICycle, IntCycle => IntCycle, MCycles => MCycles_d, TStates => TStates, Prefix => Prefix, Inc_PC => Inc_PC, Inc_WZ => Inc_WZ, IncDec_16 => IncDec_16, Read_To_Acc => Read_To_Acc, Read_To_Reg => Read_To_Reg, Set_BusB_To => Set_BusB_To, Set_BusA_To => Set_BusA_To, ALU_Op => ALU_Op, Save_ALU => Save_ALU, PreserveC => PreserveC, Arith16 => Arith16, Set_Addr_To => Set_Addr_To, IORQ => IORQ_i, Jump => Jump, JumpE => JumpE, JumpXY => JumpXY, Call => Call, RstP => RstP, LDZ => LDZ, LDW => LDW, LDSPHL => LDSPHL, Special_LD => Special_LD, ExchangeDH => ExchangeDH, ExchangeRp => ExchangeRp, ExchangeAF => ExchangeAF, ExchangeRS => ExchangeRS, I_DJNZ => I_DJNZ, I_CPL => I_CPL, I_CCF => I_CCF, I_SCF => I_SCF, I_RETN => I_RETN, I_BT => I_BT, I_BC => I_BC, I_BTR => I_BTR, I_RLD => I_RLD, I_RRD => I_RRD, I_INRC => I_INRC, SetDI => SetDI, SetEI => SetEI, IMode => IMode, Halt => Halt, NoRead => NoRead, Write => Write); alu : T80_ALU generic map( Mode => Mode, Flag_C => Flag_C, Flag_N => Flag_N, Flag_P => Flag_P, Flag_X => Flag_X, Flag_H => Flag_H, Flag_Y => Flag_Y, Flag_Z => Flag_Z, Flag_S => Flag_S) port map( Arith16 => Arith16_r, Z16 => Z16_r, ALU_Op => ALU_Op_r, IR => IR(5 downto 0), ISet => ISet, BusA => BusA, BusB => BusB, F_In => F, Q => ALU_Q, F_Out => F_Out); ClkEn <= CEN and not BusAck; T_Res <= '1' when TState = unsigned(TStates) else '0'; NextIs_XY_Fetch <= '1' when XY_State /= "00" and XY_Ind = '0' and ((Set_Addr_To = aXY) or (MCycle = "001" and IR = "11001011") or (MCycle = "001" and IR = "00110110")) else '0'; Save_Mux <= BusB when ExchangeRp = '1' else DI_Reg when Save_ALU_r = '0' else ALU_Q; process (RESET_n, CLK_n) begin if RESET_n = '0' then PC <= (others => '0'); -- Program Counter A <= (others => '0'); TmpAddr <= (others => '0'); IR <= "00000000"; ISet <= "00"; XY_State <= "00"; IStatus <= "00"; MCycles <= "000"; DO <= "00000000"; ACC <= (others => '1'); F <= (others => '1'); Ap <= (others => '1'); Fp <= (others => '1'); I <= (others => '0'); R <= (others => '0'); SP <= (others => '1'); Alternate <= '0'; Read_To_Reg_r <= "00000"; F <= (others => '1'); Arith16_r <= '0'; BTR_r <= '0'; Z16_r <= '0'; ALU_Op_r <= "0000"; Save_ALU_r <= '0'; PreserveC_r <= '0'; XY_Ind <= '0'; elsif CLK_n'event and CLK_n = '1' then if ClkEn = '1' then ALU_Op_r <= "0000"; Save_ALU_r <= '0'; Read_To_Reg_r <= "00000"; MCycles <= MCycles_d; if IMode /= "11" then IStatus <= IMode; end if; Arith16_r <= Arith16; PreserveC_r <= PreserveC; if ISet = "10" and ALU_OP(2) = '0' and ALU_OP(0) = '1' and MCycle = "011" then Z16_r <= '1'; else Z16_r <= '0'; end if; if MCycle = "001" and TState(2) = '0' then -- MCycle = 1 and TState = 1, 2, or 3 if TState = 2 and Wait_n = '1' then if Mode < 2 then A(7 downto 0) <= std_logic_vector(R); A(15 downto 8) <= I; R(6 downto 0) <= R(6 downto 0) + 1; end if; if Jump = '0' and Call = '0' and NMICycle = '0' and IntCycle = '0' and not (Halt_FF = '1' or Halt = '1') then PC <= PC + 1; end if; if IntCycle = '1' and IStatus = "01" then IR <= "11111111"; elsif Halt_FF = '1' or (IntCycle = '1' and IStatus = "10") or NMICycle = '1' then IR <= "00000000"; else IR <= DInst; end if; ISet <= "00"; if Prefix /= "00" then if Prefix = "11" then if IR(5) = '1' then XY_State <= "10"; else XY_State <= "01"; end if; else if Prefix = "10" then XY_State <= "00"; XY_Ind <= '0'; end if; ISet <= Prefix; end if; else XY_State <= "00"; XY_Ind <= '0'; end if; end if; else -- either (MCycle > 1) OR (MCycle = 1 AND TState > 3) if MCycle = "110" then XY_Ind <= '1'; if Prefix = "01" then ISet <= "01"; end if; end if; if T_Res = '1' then BTR_r <= (I_BT or I_BC or I_BTR) and not No_BTR; if Jump = '1' then A(15 downto 8) <= DI_Reg; A(7 downto 0) <= TmpAddr(7 downto 0); PC(15 downto 8) <= unsigned(DI_Reg); PC(7 downto 0) <= unsigned(TmpAddr(7 downto 0)); elsif JumpXY = '1' then A <= RegBusC; PC <= unsigned(RegBusC); elsif Call = '1' or RstP = '1' then A <= TmpAddr; PC <= unsigned(TmpAddr); elsif MCycle = MCycles and NMICycle = '1' then A <= "0000000001100110"; PC <= "0000000001100110"; elsif MCycle = "011" and IntCycle = '1' and IStatus = "10" then A(15 downto 8) <= I; A(7 downto 0) <= TmpAddr(7 downto 0); PC(15 downto 8) <= unsigned(I); PC(7 downto 0) <= unsigned(TmpAddr(7 downto 0)); else case Set_Addr_To is when aXY => if XY_State = "00" then A <= RegBusC; else if NextIs_XY_Fetch = '1' then A <= std_logic_vector(PC); else A <= TmpAddr; end if; end if; when aIOA => if Mode = 3 then -- Memory map I/O on GBZ80 A(15 downto 8) <= (others => '1'); elsif Mode = 2 then -- Duplicate I/O address on 8080 A(15 downto 8) <= DI_Reg; else A(15 downto 8) <= ACC; end if; A(7 downto 0) <= DI_Reg; when aSP => A <= std_logic_vector(SP); when aBC => if Mode = 3 and IORQ_i = '1' then -- Memory map I/O on GBZ80 A(15 downto 8) <= (others => '1'); A(7 downto 0) <= RegBusC(7 downto 0); else A <= RegBusC; end if; when aDE => A <= RegBusC; when aZI => if Inc_WZ = '1' then A <= std_logic_vector(unsigned(TmpAddr) + 1); else A(15 downto 8) <= DI_Reg; A(7 downto 0) <= TmpAddr(7 downto 0); end if; when others => A <= std_logic_vector(PC); end case; end if; Save_ALU_r <= Save_ALU; ALU_Op_r <= ALU_Op; if I_CPL = '1' then -- CPL ACC <= not ACC; F(Flag_Y) <= not ACC(5); F(Flag_H) <= '1'; F(Flag_X) <= not ACC(3); F(Flag_N) <= '1'; end if; if I_CCF = '1' then -- CCF F(Flag_C) <= not F(Flag_C); F(Flag_Y) <= ACC(5); F(Flag_H) <= F(Flag_C); F(Flag_X) <= ACC(3); F(Flag_N) <= '0'; end if; if I_SCF = '1' then -- SCF F(Flag_C) <= '1'; F(Flag_Y) <= ACC(5); F(Flag_H) <= '0'; F(Flag_X) <= ACC(3); F(Flag_N) <= '0'; end if; end if; if TState = 2 and Wait_n = '1' then if ISet = "01" and MCycle = "111" then IR <= DInst; end if; if JumpE = '1' then PC <= unsigned(signed(PC) + signed(DI_Reg)); elsif Inc_PC = '1' then PC <= PC + 1; end if; if BTR_r = '1' then PC <= PC - 2; end if; if RstP = '1' then TmpAddr <= (others =>'0'); TmpAddr(5 downto 3) <= IR(5 downto 3); end if; end if; if TState = 3 and MCycle = "110" then TmpAddr <= std_logic_vector(signed(RegBusC) + signed(DI_Reg)); end if; if (TState = 2 and Wait_n = '1') or (TState = 4 and MCycle = "001") then if IncDec_16(2 downto 0) = "111" then if IncDec_16(3) = '1' then SP <= SP - 1; else SP <= SP + 1; end if; end if; end if; if LDSPHL = '1' then SP <= unsigned(RegBusC); end if; if ExchangeAF = '1' then Ap <= ACC; ACC <= Ap; Fp <= F; F <= Fp; end if; if ExchangeRS = '1' then Alternate <= not Alternate; end if; end if; if TState = 3 then if LDZ = '1' then TmpAddr(7 downto 0) <= DI_Reg; end if; if LDW = '1' then TmpAddr(15 downto 8) <= DI_Reg; end if; if Special_LD(2) = '1' then case Special_LD(1 downto 0) is when "00" => ACC <= I; F(Flag_P) <= IntE_FF2; when "01" => ACC <= std_logic_vector(R); F(Flag_P) <= IntE_FF2; when "10" => I <= ACC; when others => R <= unsigned(ACC); end case; end if; end if; if (I_DJNZ = '0' and Save_ALU_r = '1') or ALU_Op_r = "1001" then if Mode = 3 then F(6) <= F_Out(6); F(5) <= F_Out(5); F(7) <= F_Out(7); if PreserveC_r = '0' then F(4) <= F_Out(4); end if; else F(7 downto 1) <= F_Out(7 downto 1); if PreserveC_r = '0' then F(Flag_C) <= F_Out(0); end if; end if; end if; if T_Res = '1' and I_INRC = '1' then F(Flag_H) <= '0'; F(Flag_N) <= '0'; if DI_Reg(7 downto 0) = "00000000" then F(Flag_Z) <= '1'; else F(Flag_Z) <= '0'; end if; F(Flag_S) <= DI_Reg(7); F(Flag_P) <= not (DI_Reg(0) xor DI_Reg(1) xor DI_Reg(2) xor DI_Reg(3) xor DI_Reg(4) xor DI_Reg(5) xor DI_Reg(6) xor DI_Reg(7)); end if; if TState = 1 then DO <= BusB; if I_RLD = '1' then DO(3 downto 0) <= BusA(3 downto 0); DO(7 downto 4) <= BusB(3 downto 0); end if; if I_RRD = '1' then DO(3 downto 0) <= BusB(7 downto 4); DO(7 downto 4) <= BusA(3 downto 0); end if; end if; if T_Res = '1' then Read_To_Reg_r(3 downto 0) <= Set_BusA_To; Read_To_Reg_r(4) <= Read_To_Reg; if Read_To_Acc = '1' then Read_To_Reg_r(3 downto 0) <= "0111"; Read_To_Reg_r(4) <= '1'; end if; end if; if TState = 1 and I_BT = '1' then F(Flag_X) <= ALU_Q(3); F(Flag_Y) <= ALU_Q(1); F(Flag_H) <= '0'; F(Flag_N) <= '0'; end if; if I_BC = '1' or I_BT = '1' then F(Flag_P) <= IncDecZ; end if; if (TState = 1 and Save_ALU_r = '0') or (Save_ALU_r = '1' and ALU_OP_r /= "0111") then case Read_To_Reg_r is when "10111" => ACC <= Save_Mux; when "10110" => DO <= Save_Mux; when "11000" => SP(7 downto 0) <= unsigned(Save_Mux); when "11001" => SP(15 downto 8) <= unsigned(Save_Mux); when "11011" => F <= Save_Mux; when others => end case; end if; end if; end if; end process; --------------------------------------------------------------------------- -- -- BC('), DE('), HL('), IX and IY -- --------------------------------------------------------------------------- process (CLK_n) begin if CLK_n'event and CLK_n = '1' then if ClkEn = '1' then -- Bus A / Write RegAddrA_r <= Alternate & Set_BusA_To(2 downto 1); if XY_Ind = '0' and XY_State /= "00" and Set_BusA_To(2 downto 1) = "10" then RegAddrA_r <= XY_State(1) & "11"; end if; -- Bus B RegAddrB_r <= Alternate & Set_BusB_To(2 downto 1); if XY_Ind = '0' and XY_State /= "00" and Set_BusB_To(2 downto 1) = "10" then RegAddrB_r <= XY_State(1) & "11"; end if; -- Address from register RegAddrC <= Alternate & Set_Addr_To(1 downto 0); -- Jump (HL), LD SP,HL if (JumpXY = '1' or LDSPHL = '1') then RegAddrC <= Alternate & "10"; end if; if ((JumpXY = '1' or LDSPHL = '1') and XY_State /= "00") or (MCycle = "110") then RegAddrC <= XY_State(1) & "11"; end if; if I_DJNZ = '1' and Save_ALU_r = '1' and Mode < 2 then IncDecZ <= F_Out(Flag_Z); end if; if (TState = 2 or (TState = 3 and MCycle = "001")) and IncDec_16(2 downto 0) = "100" then if ID16 = 0 then IncDecZ <= '0'; else IncDecZ <= '1'; end if; end if; RegBusA_r <= RegBusA; end if; end if; end process; RegAddrA <= -- 16 bit increment/decrement Alternate & IncDec_16(1 downto 0) when (TState = 2 or (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and XY_State = "00" else XY_State(1) & "11" when (TState = 2 or (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and IncDec_16(1 downto 0) = "10" else -- EX HL,DL Alternate & "10" when ExchangeDH = '1' and TState = 3 else Alternate & "01" when ExchangeDH = '1' and TState = 4 else -- Bus A / Write RegAddrA_r; RegAddrB <= -- EX HL,DL Alternate & "01" when ExchangeDH = '1' and TState = 3 else -- Bus B RegAddrB_r; ID16 <= signed(RegBusA) - 1 when IncDec_16(3) = '1' else signed(RegBusA) + 1; process (Save_ALU_r, Auto_Wait_t1, ALU_OP_r, Read_To_Reg_r, ExchangeDH, IncDec_16, MCycle, TState, Wait_n) begin RegWEH <= '0'; RegWEL <= '0'; if (TState = 1 and Save_ALU_r = '0') or (Save_ALU_r = '1' and ALU_OP_r /= "0111") then case Read_To_Reg_r is when "10000" | "10001" | "10010" | "10011" | "10100" | "10101" => RegWEH <= not Read_To_Reg_r(0); RegWEL <= Read_To_Reg_r(0); when others => end case; end if; if ExchangeDH = '1' and (TState = 3 or TState = 4) then RegWEH <= '1'; RegWEL <= '1'; end if; if IncDec_16(2) = '1' and ((TState = 2 and Wait_n = '1' and MCycle /= "001") or (TState = 3 and MCycle = "001")) then case IncDec_16(1 downto 0) is when "00" | "01" | "10" => RegWEH <= '1'; RegWEL <= '1'; when others => end case; end if; end process; process (Save_Mux, RegBusB, RegBusA_r, ID16, ExchangeDH, IncDec_16, MCycle, TState, Wait_n) begin RegDIH <= Save_Mux; RegDIL <= Save_Mux; if ExchangeDH = '1' and TState = 3 then RegDIH <= RegBusB(15 downto 8); RegDIL <= RegBusB(7 downto 0); end if; if ExchangeDH = '1' and TState = 4 then RegDIH <= RegBusA_r(15 downto 8); RegDIL <= RegBusA_r(7 downto 0); end if; if IncDec_16(2) = '1' and ((TState = 2 and MCycle /= "001") or (TState = 3 and MCycle = "001")) then RegDIH <= std_logic_vector(ID16(15 downto 8)); RegDIL <= std_logic_vector(ID16(7 downto 0)); end if; end process; Regs : T80_Reg port map( Clk => CLK_n, CEN => ClkEn, WEH => RegWEH, WEL => RegWEL, AddrA => RegAddrA, AddrB => RegAddrB, AddrC => RegAddrC, DIH => RegDIH, DIL => RegDIL, DOAH => RegBusA(15 downto 8), DOAL => RegBusA(7 downto 0), DOBH => RegBusB(15 downto 8), DOBL => RegBusB(7 downto 0), DOCH => RegBusC(15 downto 8), DOCL => RegBusC(7 downto 0)); --------------------------------------------------------------------------- -- -- Buses -- --------------------------------------------------------------------------- process (CLK_n) begin if CLK_n'event and CLK_n = '1' then if ClkEn = '1' then case Set_BusB_To is when "0111" => BusB <= ACC; when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" => if Set_BusB_To(0) = '1' then BusB <= RegBusB(7 downto 0); else BusB <= RegBusB(15 downto 8); end if; when "0110" => BusB <= DI_Reg; when "1000" => BusB <= std_logic_vector(SP(7 downto 0)); when "1001" => BusB <= std_logic_vector(SP(15 downto 8)); when "1010" => BusB <= "00000001"; when "1011" => BusB <= F; when "1100" => BusB <= std_logic_vector(PC(7 downto 0)); when "1101" => BusB <= std_logic_vector(PC(15 downto 8)); when "1110" => BusB <= "00000000"; when others => BusB <= "--------"; end case; case Set_BusA_To is when "0111" => BusA <= ACC; when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" => if Set_BusA_To(0) = '1' then BusA <= RegBusA(7 downto 0); else BusA <= RegBusA(15 downto 8); end if; when "0110" => BusA <= DI_Reg; when "1000" => BusA <= std_logic_vector(SP(7 downto 0)); when "1001" => BusA <= std_logic_vector(SP(15 downto 8)); when "1010" => BusA <= "00000000"; when others => BusB <= "--------"; end case; end if; end if; end process; --------------------------------------------------------------------------- -- -- Generate external control signals -- --------------------------------------------------------------------------- process (RESET_n,CLK_n) begin if RESET_n = '0' then RFSH_n <= '1'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then if MCycle = "001" and ((TState = 2 and Wait_n = '1') or TState = 3) then RFSH_n <= '0'; else RFSH_n <= '1'; end if; end if; end if; end process; MC <= std_logic_vector(MCycle); TS <= std_logic_vector(TState); DI_Reg <= DI; HALT_n <= not Halt_FF; BUSAK_n <= not BusAck; IntCycle_n <= not IntCycle; IntE <= IntE_FF1; IORQ <= IORQ_i; Stop <= I_DJNZ; ------------------------------------------------------------------------- -- -- Syncronise inputs -- ------------------------------------------------------------------------- process (RESET_n, CLK_n) variable OldNMI_n : std_logic; begin if RESET_n = '0' then BusReq_s <= '0'; INT_s <= '0'; NMI_s <= '0'; OldNMI_n := '0'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then BusReq_s <= not BUSRQ_n; INT_s <= not INT_n; if NMICycle = '1' then NMI_s <= '0'; elsif NMI_n = '0' and OldNMI_n = '1' then NMI_s <= '1'; end if; OldNMI_n := NMI_n; end if; end if; end process; ------------------------------------------------------------------------- -- -- Main state machine -- ------------------------------------------------------------------------- process (RESET_n, CLK_n) begin if RESET_n = '0' then MCycle <= "001"; TState <= "000"; Pre_XY_F_M <= "000"; Halt_FF <= '0'; BusAck <= '0'; NMICycle <= '0'; IntCycle <= '0'; IntE_FF1 <= '0'; IntE_FF2 <= '0'; No_BTR <= '0'; Auto_Wait_t1 <= '0'; Auto_Wait_t2 <= '0'; M1_n <= '1'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then Auto_Wait_t1 <= Auto_Wait; Auto_Wait_t2 <= Auto_Wait_t1; No_BTR <= (I_BT and (not IR(4) or not F(Flag_P))) or (I_BC and (not IR(4) or F(Flag_Z) or not F(Flag_P))) or (I_BTR and (not IR(4) or F(Flag_Z))); if TState = 2 then if SetEI = '1' then IntE_FF1 <= '1'; IntE_FF2 <= '1'; end if; if I_RETN = '1' then IntE_FF1 <= IntE_FF2; end if; end if; if TState = 3 then if SetDI = '1' then IntE_FF1 <= '0'; IntE_FF2 <= '0'; end if; end if; if IntCycle = '1' or NMICycle = '1' then Halt_FF <= '0'; end if; if MCycle = "001" and TState = 2 and Wait_n = '1' then M1_n <= '1'; end if; if BusReq_s = '1' and BusAck = '1' then else BusAck <= '0'; if TState = 2 and Wait_n = '0' then elsif T_Res = '1' then if Halt = '1' then Halt_FF <= '1'; end if; if BusReq_s = '1' then BusAck <= '1'; else TState <= "001"; if NextIs_XY_Fetch = '1' then MCycle <= "110"; Pre_XY_F_M <= MCycle; if IR = "00110110" and Mode = 0 then Pre_XY_F_M <= "010"; end if; elsif (MCycle = "111") or (MCycle = "110" and Mode = 1 and ISet /= "01") then MCycle <= std_logic_vector(unsigned(Pre_XY_F_M) + 1); elsif (MCycle = MCycles) or No_BTR = '1' or (MCycle = "010" and I_DJNZ = '1' and IncDecZ = '1') then M1_n <= '0'; MCycle <= "001"; IntCycle <= '0'; NMICycle <= '0'; if NMI_s = '1' and Prefix = "00" then NMICycle <= '1'; IntE_FF1 <= '0'; elsif (IntE_FF1 = '1' and INT_s = '1') and Prefix = "00" and SetEI = '0' then IntCycle <= '1'; IntE_FF1 <= '0'; IntE_FF2 <= '0'; end if; else MCycle <= std_logic_vector(unsigned(MCycle) + 1); end if; end if; else if Auto_Wait = '1' nand Auto_Wait_t2 = '0' then TState <= TState + 1; end if; end if; end if; if TState = 0 then M1_n <= '0'; end if; end if; end if; end process; process (IntCycle, NMICycle, MCycle) begin Auto_Wait <= '0'; if IntCycle = '1' or NMICycle = '1' then if MCycle = "001" then Auto_Wait <= '1'; end if; end if; end process; end;
-- **** -- T80(b) core. In an effort to merge and maintain bug fixes .... -- -- -- Ver 300 started tidyup. Rmoved some auto_wait bits from 0247 which caused problems -- -- MikeJ March 2005 -- Latest version from www.fpgaarcade.com (original www.opencores.org) -- -- **** -- -- Z80 compatible microprocessor core -- -- Version : 0247 -- -- Copyright (c) 2001-2002 Daniel Wallner ([email protected]) -- -- All rights reserved -- -- Redistribution and use in source and synthezised forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- -- Redistributions in synthesized form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- Neither the name of the author nor the names of other contributors may -- be used to endorse or promote products derived from this software without -- specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. -- -- Please report bugs to the author, but before you do so, please -- make sure that this is not a derivative work and that -- you have the latest version of this file. -- -- The latest version of this file can be found at: -- http://www.opencores.org/cvsweb.shtml/t80/ -- -- Limitations : -- -- File history : -- -- 0208 : First complete release -- -- 0210 : Fixed wait and halt -- -- 0211 : Fixed Refresh addition and IM 1 -- -- 0214 : Fixed mostly flags, only the block instructions now fail the zex regression test -- -- 0232 : Removed refresh address output for Mode > 1 and added DJNZ M1_n fix by Mike Johnson -- -- 0235 : Added clock enable and IM 2 fix by Mike Johnson -- -- 0237 : Changed 8080 I/O address output, added IntE output -- -- 0238 : Fixed (IX/IY+d) timing and 16 bit ADC and SBC zero flag -- -- 0240 : Added interrupt ack fix by Mike Johnson, changed (IX/IY+d) timing and changed flags in GB mode -- -- 0242 : Added I/O wait, fixed refresh address, moved some registers to RAM -- -- 0247 : Fixed bus req/ack cycle -- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; use work.T80_Pack.all; entity T80 is generic( Mode : integer := 0; -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB IOWait : integer := 0; -- 1 => Single cycle I/O, 1 => Std I/O cycle Flag_C : integer := 0; Flag_N : integer := 1; Flag_P : integer := 2; Flag_X : integer := 3; Flag_H : integer := 4; Flag_Y : integer := 5; Flag_Z : integer := 6; Flag_S : integer := 7 ); port( RESET_n : in std_logic; CLK_n : in std_logic; CEN : in std_logic; WAIT_n : in std_logic; INT_n : in std_logic; NMI_n : in std_logic; BUSRQ_n : in std_logic; M1_n : out std_logic; IORQ : out std_logic; NoRead : out std_logic; Write : out std_logic; RFSH_n : out std_logic; HALT_n : out std_logic; BUSAK_n : out std_logic; A : out std_logic_vector(15 downto 0); DInst : in std_logic_vector(7 downto 0); DI : in std_logic_vector(7 downto 0); DO : out std_logic_vector(7 downto 0); MC : out std_logic_vector(2 downto 0); TS : out std_logic_vector(2 downto 0); IntCycle_n : out std_logic; IntE : out std_logic; Stop : out std_logic ); end T80; architecture rtl of T80 is constant aNone : std_logic_vector(2 downto 0) := "111"; constant aBC : std_logic_vector(2 downto 0) := "000"; constant aDE : std_logic_vector(2 downto 0) := "001"; constant aXY : std_logic_vector(2 downto 0) := "010"; constant aIOA : std_logic_vector(2 downto 0) := "100"; constant aSP : std_logic_vector(2 downto 0) := "101"; constant aZI : std_logic_vector(2 downto 0) := "110"; -- Registers signal ACC, F : std_logic_vector(7 downto 0); signal Ap, Fp : std_logic_vector(7 downto 0); signal I : std_logic_vector(7 downto 0); signal R : unsigned(7 downto 0); signal SP, PC : unsigned(15 downto 0); signal RegDIH : std_logic_vector(7 downto 0); signal RegDIL : std_logic_vector(7 downto 0); signal RegBusA : std_logic_vector(15 downto 0); signal RegBusB : std_logic_vector(15 downto 0); signal RegBusC : std_logic_vector(15 downto 0); signal RegAddrA_r : std_logic_vector(2 downto 0); signal RegAddrA : std_logic_vector(2 downto 0); signal RegAddrB_r : std_logic_vector(2 downto 0); signal RegAddrB : std_logic_vector(2 downto 0); signal RegAddrC : std_logic_vector(2 downto 0); signal RegWEH : std_logic; signal RegWEL : std_logic; signal Alternate : std_logic; -- Help Registers signal TmpAddr : std_logic_vector(15 downto 0); -- Temporary address register signal IR : std_logic_vector(7 downto 0); -- Instruction register signal ISet : std_logic_vector(1 downto 0); -- Instruction set selector signal RegBusA_r : std_logic_vector(15 downto 0); signal ID16 : signed(15 downto 0); signal Save_Mux : std_logic_vector(7 downto 0); signal TState : unsigned(2 downto 0); signal MCycle : std_logic_vector(2 downto 0); signal IntE_FF1 : std_logic; signal IntE_FF2 : std_logic; signal Halt_FF : std_logic; signal BusReq_s : std_logic; signal BusAck : std_logic; signal ClkEn : std_logic; signal NMI_s : std_logic; signal INT_s : std_logic; signal IStatus : std_logic_vector(1 downto 0); signal DI_Reg : std_logic_vector(7 downto 0); signal T_Res : std_logic; signal XY_State : std_logic_vector(1 downto 0); signal Pre_XY_F_M : std_logic_vector(2 downto 0); signal NextIs_XY_Fetch : std_logic; signal XY_Ind : std_logic; signal No_BTR : std_logic; signal BTR_r : std_logic; signal Auto_Wait : std_logic; signal Auto_Wait_t1 : std_logic; signal Auto_Wait_t2 : std_logic; signal IncDecZ : std_logic; -- ALU signals signal BusB : std_logic_vector(7 downto 0); signal BusA : std_logic_vector(7 downto 0); signal ALU_Q : std_logic_vector(7 downto 0); signal F_Out : std_logic_vector(7 downto 0); -- Registered micro code outputs signal Read_To_Reg_r : std_logic_vector(4 downto 0); signal Arith16_r : std_logic; signal Z16_r : std_logic; signal ALU_Op_r : std_logic_vector(3 downto 0); signal Save_ALU_r : std_logic; signal PreserveC_r : std_logic; signal MCycles : std_logic_vector(2 downto 0); -- Micro code outputs signal MCycles_d : std_logic_vector(2 downto 0); signal TStates : std_logic_vector(2 downto 0); signal IntCycle : std_logic; signal NMICycle : std_logic; signal Inc_PC : std_logic; signal Inc_WZ : std_logic; signal IncDec_16 : std_logic_vector(3 downto 0); signal Prefix : std_logic_vector(1 downto 0); signal Read_To_Acc : std_logic; signal Read_To_Reg : std_logic; signal Set_BusB_To : std_logic_vector(3 downto 0); signal Set_BusA_To : std_logic_vector(3 downto 0); signal ALU_Op : std_logic_vector(3 downto 0); signal Save_ALU : std_logic; signal PreserveC : std_logic; signal Arith16 : std_logic; signal Set_Addr_To : std_logic_vector(2 downto 0); signal Jump : std_logic; signal JumpE : std_logic; signal JumpXY : std_logic; signal Call : std_logic; signal RstP : std_logic; signal LDZ : std_logic; signal LDW : std_logic; signal LDSPHL : std_logic; signal IORQ_i : std_logic; signal Special_LD : std_logic_vector(2 downto 0); signal ExchangeDH : std_logic; signal ExchangeRp : std_logic; signal ExchangeAF : std_logic; signal ExchangeRS : std_logic; signal I_DJNZ : std_logic; signal I_CPL : std_logic; signal I_CCF : std_logic; signal I_SCF : std_logic; signal I_RETN : std_logic; signal I_BT : std_logic; signal I_BC : std_logic; signal I_BTR : std_logic; signal I_RLD : std_logic; signal I_RRD : std_logic; signal I_INRC : std_logic; signal SetDI : std_logic; signal SetEI : std_logic; signal IMode : std_logic_vector(1 downto 0); signal Halt : std_logic; begin mcode : T80_MCode generic map( Mode => Mode, Flag_C => Flag_C, Flag_N => Flag_N, Flag_P => Flag_P, Flag_X => Flag_X, Flag_H => Flag_H, Flag_Y => Flag_Y, Flag_Z => Flag_Z, Flag_S => Flag_S) port map( IR => IR, ISet => ISet, MCycle => MCycle, F => F, NMICycle => NMICycle, IntCycle => IntCycle, MCycles => MCycles_d, TStates => TStates, Prefix => Prefix, Inc_PC => Inc_PC, Inc_WZ => Inc_WZ, IncDec_16 => IncDec_16, Read_To_Acc => Read_To_Acc, Read_To_Reg => Read_To_Reg, Set_BusB_To => Set_BusB_To, Set_BusA_To => Set_BusA_To, ALU_Op => ALU_Op, Save_ALU => Save_ALU, PreserveC => PreserveC, Arith16 => Arith16, Set_Addr_To => Set_Addr_To, IORQ => IORQ_i, Jump => Jump, JumpE => JumpE, JumpXY => JumpXY, Call => Call, RstP => RstP, LDZ => LDZ, LDW => LDW, LDSPHL => LDSPHL, Special_LD => Special_LD, ExchangeDH => ExchangeDH, ExchangeRp => ExchangeRp, ExchangeAF => ExchangeAF, ExchangeRS => ExchangeRS, I_DJNZ => I_DJNZ, I_CPL => I_CPL, I_CCF => I_CCF, I_SCF => I_SCF, I_RETN => I_RETN, I_BT => I_BT, I_BC => I_BC, I_BTR => I_BTR, I_RLD => I_RLD, I_RRD => I_RRD, I_INRC => I_INRC, SetDI => SetDI, SetEI => SetEI, IMode => IMode, Halt => Halt, NoRead => NoRead, Write => Write); alu : T80_ALU generic map( Mode => Mode, Flag_C => Flag_C, Flag_N => Flag_N, Flag_P => Flag_P, Flag_X => Flag_X, Flag_H => Flag_H, Flag_Y => Flag_Y, Flag_Z => Flag_Z, Flag_S => Flag_S) port map( Arith16 => Arith16_r, Z16 => Z16_r, ALU_Op => ALU_Op_r, IR => IR(5 downto 0), ISet => ISet, BusA => BusA, BusB => BusB, F_In => F, Q => ALU_Q, F_Out => F_Out); ClkEn <= CEN and not BusAck; T_Res <= '1' when TState = unsigned(TStates) else '0'; NextIs_XY_Fetch <= '1' when XY_State /= "00" and XY_Ind = '0' and ((Set_Addr_To = aXY) or (MCycle = "001" and IR = "11001011") or (MCycle = "001" and IR = "00110110")) else '0'; Save_Mux <= BusB when ExchangeRp = '1' else DI_Reg when Save_ALU_r = '0' else ALU_Q; process (RESET_n, CLK_n) begin if RESET_n = '0' then PC <= (others => '0'); -- Program Counter A <= (others => '0'); TmpAddr <= (others => '0'); IR <= "00000000"; ISet <= "00"; XY_State <= "00"; IStatus <= "00"; MCycles <= "000"; DO <= "00000000"; ACC <= (others => '1'); F <= (others => '1'); Ap <= (others => '1'); Fp <= (others => '1'); I <= (others => '0'); R <= (others => '0'); SP <= (others => '1'); Alternate <= '0'; Read_To_Reg_r <= "00000"; F <= (others => '1'); Arith16_r <= '0'; BTR_r <= '0'; Z16_r <= '0'; ALU_Op_r <= "0000"; Save_ALU_r <= '0'; PreserveC_r <= '0'; XY_Ind <= '0'; elsif CLK_n'event and CLK_n = '1' then if ClkEn = '1' then ALU_Op_r <= "0000"; Save_ALU_r <= '0'; Read_To_Reg_r <= "00000"; MCycles <= MCycles_d; if IMode /= "11" then IStatus <= IMode; end if; Arith16_r <= Arith16; PreserveC_r <= PreserveC; if ISet = "10" and ALU_OP(2) = '0' and ALU_OP(0) = '1' and MCycle = "011" then Z16_r <= '1'; else Z16_r <= '0'; end if; if MCycle = "001" and TState(2) = '0' then -- MCycle = 1 and TState = 1, 2, or 3 if TState = 2 and Wait_n = '1' then if Mode < 2 then A(7 downto 0) <= std_logic_vector(R); A(15 downto 8) <= I; R(6 downto 0) <= R(6 downto 0) + 1; end if; if Jump = '0' and Call = '0' and NMICycle = '0' and IntCycle = '0' and not (Halt_FF = '1' or Halt = '1') then PC <= PC + 1; end if; if IntCycle = '1' and IStatus = "01" then IR <= "11111111"; elsif Halt_FF = '1' or (IntCycle = '1' and IStatus = "10") or NMICycle = '1' then IR <= "00000000"; else IR <= DInst; end if; ISet <= "00"; if Prefix /= "00" then if Prefix = "11" then if IR(5) = '1' then XY_State <= "10"; else XY_State <= "01"; end if; else if Prefix = "10" then XY_State <= "00"; XY_Ind <= '0'; end if; ISet <= Prefix; end if; else XY_State <= "00"; XY_Ind <= '0'; end if; end if; else -- either (MCycle > 1) OR (MCycle = 1 AND TState > 3) if MCycle = "110" then XY_Ind <= '1'; if Prefix = "01" then ISet <= "01"; end if; end if; if T_Res = '1' then BTR_r <= (I_BT or I_BC or I_BTR) and not No_BTR; if Jump = '1' then A(15 downto 8) <= DI_Reg; A(7 downto 0) <= TmpAddr(7 downto 0); PC(15 downto 8) <= unsigned(DI_Reg); PC(7 downto 0) <= unsigned(TmpAddr(7 downto 0)); elsif JumpXY = '1' then A <= RegBusC; PC <= unsigned(RegBusC); elsif Call = '1' or RstP = '1' then A <= TmpAddr; PC <= unsigned(TmpAddr); elsif MCycle = MCycles and NMICycle = '1' then A <= "0000000001100110"; PC <= "0000000001100110"; elsif MCycle = "011" and IntCycle = '1' and IStatus = "10" then A(15 downto 8) <= I; A(7 downto 0) <= TmpAddr(7 downto 0); PC(15 downto 8) <= unsigned(I); PC(7 downto 0) <= unsigned(TmpAddr(7 downto 0)); else case Set_Addr_To is when aXY => if XY_State = "00" then A <= RegBusC; else if NextIs_XY_Fetch = '1' then A <= std_logic_vector(PC); else A <= TmpAddr; end if; end if; when aIOA => if Mode = 3 then -- Memory map I/O on GBZ80 A(15 downto 8) <= (others => '1'); elsif Mode = 2 then -- Duplicate I/O address on 8080 A(15 downto 8) <= DI_Reg; else A(15 downto 8) <= ACC; end if; A(7 downto 0) <= DI_Reg; when aSP => A <= std_logic_vector(SP); when aBC => if Mode = 3 and IORQ_i = '1' then -- Memory map I/O on GBZ80 A(15 downto 8) <= (others => '1'); A(7 downto 0) <= RegBusC(7 downto 0); else A <= RegBusC; end if; when aDE => A <= RegBusC; when aZI => if Inc_WZ = '1' then A <= std_logic_vector(unsigned(TmpAddr) + 1); else A(15 downto 8) <= DI_Reg; A(7 downto 0) <= TmpAddr(7 downto 0); end if; when others => A <= std_logic_vector(PC); end case; end if; Save_ALU_r <= Save_ALU; ALU_Op_r <= ALU_Op; if I_CPL = '1' then -- CPL ACC <= not ACC; F(Flag_Y) <= not ACC(5); F(Flag_H) <= '1'; F(Flag_X) <= not ACC(3); F(Flag_N) <= '1'; end if; if I_CCF = '1' then -- CCF F(Flag_C) <= not F(Flag_C); F(Flag_Y) <= ACC(5); F(Flag_H) <= F(Flag_C); F(Flag_X) <= ACC(3); F(Flag_N) <= '0'; end if; if I_SCF = '1' then -- SCF F(Flag_C) <= '1'; F(Flag_Y) <= ACC(5); F(Flag_H) <= '0'; F(Flag_X) <= ACC(3); F(Flag_N) <= '0'; end if; end if; if TState = 2 and Wait_n = '1' then if ISet = "01" and MCycle = "111" then IR <= DInst; end if; if JumpE = '1' then PC <= unsigned(signed(PC) + signed(DI_Reg)); elsif Inc_PC = '1' then PC <= PC + 1; end if; if BTR_r = '1' then PC <= PC - 2; end if; if RstP = '1' then TmpAddr <= (others =>'0'); TmpAddr(5 downto 3) <= IR(5 downto 3); end if; end if; if TState = 3 and MCycle = "110" then TmpAddr <= std_logic_vector(signed(RegBusC) + signed(DI_Reg)); end if; if (TState = 2 and Wait_n = '1') or (TState = 4 and MCycle = "001") then if IncDec_16(2 downto 0) = "111" then if IncDec_16(3) = '1' then SP <= SP - 1; else SP <= SP + 1; end if; end if; end if; if LDSPHL = '1' then SP <= unsigned(RegBusC); end if; if ExchangeAF = '1' then Ap <= ACC; ACC <= Ap; Fp <= F; F <= Fp; end if; if ExchangeRS = '1' then Alternate <= not Alternate; end if; end if; if TState = 3 then if LDZ = '1' then TmpAddr(7 downto 0) <= DI_Reg; end if; if LDW = '1' then TmpAddr(15 downto 8) <= DI_Reg; end if; if Special_LD(2) = '1' then case Special_LD(1 downto 0) is when "00" => ACC <= I; F(Flag_P) <= IntE_FF2; when "01" => ACC <= std_logic_vector(R); F(Flag_P) <= IntE_FF2; when "10" => I <= ACC; when others => R <= unsigned(ACC); end case; end if; end if; if (I_DJNZ = '0' and Save_ALU_r = '1') or ALU_Op_r = "1001" then if Mode = 3 then F(6) <= F_Out(6); F(5) <= F_Out(5); F(7) <= F_Out(7); if PreserveC_r = '0' then F(4) <= F_Out(4); end if; else F(7 downto 1) <= F_Out(7 downto 1); if PreserveC_r = '0' then F(Flag_C) <= F_Out(0); end if; end if; end if; if T_Res = '1' and I_INRC = '1' then F(Flag_H) <= '0'; F(Flag_N) <= '0'; if DI_Reg(7 downto 0) = "00000000" then F(Flag_Z) <= '1'; else F(Flag_Z) <= '0'; end if; F(Flag_S) <= DI_Reg(7); F(Flag_P) <= not (DI_Reg(0) xor DI_Reg(1) xor DI_Reg(2) xor DI_Reg(3) xor DI_Reg(4) xor DI_Reg(5) xor DI_Reg(6) xor DI_Reg(7)); end if; if TState = 1 then DO <= BusB; if I_RLD = '1' then DO(3 downto 0) <= BusA(3 downto 0); DO(7 downto 4) <= BusB(3 downto 0); end if; if I_RRD = '1' then DO(3 downto 0) <= BusB(7 downto 4); DO(7 downto 4) <= BusA(3 downto 0); end if; end if; if T_Res = '1' then Read_To_Reg_r(3 downto 0) <= Set_BusA_To; Read_To_Reg_r(4) <= Read_To_Reg; if Read_To_Acc = '1' then Read_To_Reg_r(3 downto 0) <= "0111"; Read_To_Reg_r(4) <= '1'; end if; end if; if TState = 1 and I_BT = '1' then F(Flag_X) <= ALU_Q(3); F(Flag_Y) <= ALU_Q(1); F(Flag_H) <= '0'; F(Flag_N) <= '0'; end if; if I_BC = '1' or I_BT = '1' then F(Flag_P) <= IncDecZ; end if; if (TState = 1 and Save_ALU_r = '0') or (Save_ALU_r = '1' and ALU_OP_r /= "0111") then case Read_To_Reg_r is when "10111" => ACC <= Save_Mux; when "10110" => DO <= Save_Mux; when "11000" => SP(7 downto 0) <= unsigned(Save_Mux); when "11001" => SP(15 downto 8) <= unsigned(Save_Mux); when "11011" => F <= Save_Mux; when others => end case; end if; end if; end if; end process; --------------------------------------------------------------------------- -- -- BC('), DE('), HL('), IX and IY -- --------------------------------------------------------------------------- process (CLK_n) begin if CLK_n'event and CLK_n = '1' then if ClkEn = '1' then -- Bus A / Write RegAddrA_r <= Alternate & Set_BusA_To(2 downto 1); if XY_Ind = '0' and XY_State /= "00" and Set_BusA_To(2 downto 1) = "10" then RegAddrA_r <= XY_State(1) & "11"; end if; -- Bus B RegAddrB_r <= Alternate & Set_BusB_To(2 downto 1); if XY_Ind = '0' and XY_State /= "00" and Set_BusB_To(2 downto 1) = "10" then RegAddrB_r <= XY_State(1) & "11"; end if; -- Address from register RegAddrC <= Alternate & Set_Addr_To(1 downto 0); -- Jump (HL), LD SP,HL if (JumpXY = '1' or LDSPHL = '1') then RegAddrC <= Alternate & "10"; end if; if ((JumpXY = '1' or LDSPHL = '1') and XY_State /= "00") or (MCycle = "110") then RegAddrC <= XY_State(1) & "11"; end if; if I_DJNZ = '1' and Save_ALU_r = '1' and Mode < 2 then IncDecZ <= F_Out(Flag_Z); end if; if (TState = 2 or (TState = 3 and MCycle = "001")) and IncDec_16(2 downto 0) = "100" then if ID16 = 0 then IncDecZ <= '0'; else IncDecZ <= '1'; end if; end if; RegBusA_r <= RegBusA; end if; end if; end process; RegAddrA <= -- 16 bit increment/decrement Alternate & IncDec_16(1 downto 0) when (TState = 2 or (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and XY_State = "00" else XY_State(1) & "11" when (TState = 2 or (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and IncDec_16(1 downto 0) = "10" else -- EX HL,DL Alternate & "10" when ExchangeDH = '1' and TState = 3 else Alternate & "01" when ExchangeDH = '1' and TState = 4 else -- Bus A / Write RegAddrA_r; RegAddrB <= -- EX HL,DL Alternate & "01" when ExchangeDH = '1' and TState = 3 else -- Bus B RegAddrB_r; ID16 <= signed(RegBusA) - 1 when IncDec_16(3) = '1' else signed(RegBusA) + 1; process (Save_ALU_r, Auto_Wait_t1, ALU_OP_r, Read_To_Reg_r, ExchangeDH, IncDec_16, MCycle, TState, Wait_n) begin RegWEH <= '0'; RegWEL <= '0'; if (TState = 1 and Save_ALU_r = '0') or (Save_ALU_r = '1' and ALU_OP_r /= "0111") then case Read_To_Reg_r is when "10000" | "10001" | "10010" | "10011" | "10100" | "10101" => RegWEH <= not Read_To_Reg_r(0); RegWEL <= Read_To_Reg_r(0); when others => end case; end if; if ExchangeDH = '1' and (TState = 3 or TState = 4) then RegWEH <= '1'; RegWEL <= '1'; end if; if IncDec_16(2) = '1' and ((TState = 2 and Wait_n = '1' and MCycle /= "001") or (TState = 3 and MCycle = "001")) then case IncDec_16(1 downto 0) is when "00" | "01" | "10" => RegWEH <= '1'; RegWEL <= '1'; when others => end case; end if; end process; process (Save_Mux, RegBusB, RegBusA_r, ID16, ExchangeDH, IncDec_16, MCycle, TState, Wait_n) begin RegDIH <= Save_Mux; RegDIL <= Save_Mux; if ExchangeDH = '1' and TState = 3 then RegDIH <= RegBusB(15 downto 8); RegDIL <= RegBusB(7 downto 0); end if; if ExchangeDH = '1' and TState = 4 then RegDIH <= RegBusA_r(15 downto 8); RegDIL <= RegBusA_r(7 downto 0); end if; if IncDec_16(2) = '1' and ((TState = 2 and MCycle /= "001") or (TState = 3 and MCycle = "001")) then RegDIH <= std_logic_vector(ID16(15 downto 8)); RegDIL <= std_logic_vector(ID16(7 downto 0)); end if; end process; Regs : T80_Reg port map( Clk => CLK_n, CEN => ClkEn, WEH => RegWEH, WEL => RegWEL, AddrA => RegAddrA, AddrB => RegAddrB, AddrC => RegAddrC, DIH => RegDIH, DIL => RegDIL, DOAH => RegBusA(15 downto 8), DOAL => RegBusA(7 downto 0), DOBH => RegBusB(15 downto 8), DOBL => RegBusB(7 downto 0), DOCH => RegBusC(15 downto 8), DOCL => RegBusC(7 downto 0)); --------------------------------------------------------------------------- -- -- Buses -- --------------------------------------------------------------------------- process (CLK_n) begin if CLK_n'event and CLK_n = '1' then if ClkEn = '1' then case Set_BusB_To is when "0111" => BusB <= ACC; when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" => if Set_BusB_To(0) = '1' then BusB <= RegBusB(7 downto 0); else BusB <= RegBusB(15 downto 8); end if; when "0110" => BusB <= DI_Reg; when "1000" => BusB <= std_logic_vector(SP(7 downto 0)); when "1001" => BusB <= std_logic_vector(SP(15 downto 8)); when "1010" => BusB <= "00000001"; when "1011" => BusB <= F; when "1100" => BusB <= std_logic_vector(PC(7 downto 0)); when "1101" => BusB <= std_logic_vector(PC(15 downto 8)); when "1110" => BusB <= "00000000"; when others => BusB <= "--------"; end case; case Set_BusA_To is when "0111" => BusA <= ACC; when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" => if Set_BusA_To(0) = '1' then BusA <= RegBusA(7 downto 0); else BusA <= RegBusA(15 downto 8); end if; when "0110" => BusA <= DI_Reg; when "1000" => BusA <= std_logic_vector(SP(7 downto 0)); when "1001" => BusA <= std_logic_vector(SP(15 downto 8)); when "1010" => BusA <= "00000000"; when others => BusB <= "--------"; end case; end if; end if; end process; --------------------------------------------------------------------------- -- -- Generate external control signals -- --------------------------------------------------------------------------- process (RESET_n,CLK_n) begin if RESET_n = '0' then RFSH_n <= '1'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then if MCycle = "001" and ((TState = 2 and Wait_n = '1') or TState = 3) then RFSH_n <= '0'; else RFSH_n <= '1'; end if; end if; end if; end process; MC <= std_logic_vector(MCycle); TS <= std_logic_vector(TState); DI_Reg <= DI; HALT_n <= not Halt_FF; BUSAK_n <= not BusAck; IntCycle_n <= not IntCycle; IntE <= IntE_FF1; IORQ <= IORQ_i; Stop <= I_DJNZ; ------------------------------------------------------------------------- -- -- Syncronise inputs -- ------------------------------------------------------------------------- process (RESET_n, CLK_n) variable OldNMI_n : std_logic; begin if RESET_n = '0' then BusReq_s <= '0'; INT_s <= '0'; NMI_s <= '0'; OldNMI_n := '0'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then BusReq_s <= not BUSRQ_n; INT_s <= not INT_n; if NMICycle = '1' then NMI_s <= '0'; elsif NMI_n = '0' and OldNMI_n = '1' then NMI_s <= '1'; end if; OldNMI_n := NMI_n; end if; end if; end process; ------------------------------------------------------------------------- -- -- Main state machine -- ------------------------------------------------------------------------- process (RESET_n, CLK_n) begin if RESET_n = '0' then MCycle <= "001"; TState <= "000"; Pre_XY_F_M <= "000"; Halt_FF <= '0'; BusAck <= '0'; NMICycle <= '0'; IntCycle <= '0'; IntE_FF1 <= '0'; IntE_FF2 <= '0'; No_BTR <= '0'; Auto_Wait_t1 <= '0'; Auto_Wait_t2 <= '0'; M1_n <= '1'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then Auto_Wait_t1 <= Auto_Wait; Auto_Wait_t2 <= Auto_Wait_t1; No_BTR <= (I_BT and (not IR(4) or not F(Flag_P))) or (I_BC and (not IR(4) or F(Flag_Z) or not F(Flag_P))) or (I_BTR and (not IR(4) or F(Flag_Z))); if TState = 2 then if SetEI = '1' then IntE_FF1 <= '1'; IntE_FF2 <= '1'; end if; if I_RETN = '1' then IntE_FF1 <= IntE_FF2; end if; end if; if TState = 3 then if SetDI = '1' then IntE_FF1 <= '0'; IntE_FF2 <= '0'; end if; end if; if IntCycle = '1' or NMICycle = '1' then Halt_FF <= '0'; end if; if MCycle = "001" and TState = 2 and Wait_n = '1' then M1_n <= '1'; end if; if BusReq_s = '1' and BusAck = '1' then else BusAck <= '0'; if TState = 2 and Wait_n = '0' then elsif T_Res = '1' then if Halt = '1' then Halt_FF <= '1'; end if; if BusReq_s = '1' then BusAck <= '1'; else TState <= "001"; if NextIs_XY_Fetch = '1' then MCycle <= "110"; Pre_XY_F_M <= MCycle; if IR = "00110110" and Mode = 0 then Pre_XY_F_M <= "010"; end if; elsif (MCycle = "111") or (MCycle = "110" and Mode = 1 and ISet /= "01") then MCycle <= std_logic_vector(unsigned(Pre_XY_F_M) + 1); elsif (MCycle = MCycles) or No_BTR = '1' or (MCycle = "010" and I_DJNZ = '1' and IncDecZ = '1') then M1_n <= '0'; MCycle <= "001"; IntCycle <= '0'; NMICycle <= '0'; if NMI_s = '1' and Prefix = "00" then NMICycle <= '1'; IntE_FF1 <= '0'; elsif (IntE_FF1 = '1' and INT_s = '1') and Prefix = "00" and SetEI = '0' then IntCycle <= '1'; IntE_FF1 <= '0'; IntE_FF2 <= '0'; end if; else MCycle <= std_logic_vector(unsigned(MCycle) + 1); end if; end if; else if Auto_Wait = '1' nand Auto_Wait_t2 = '0' then TState <= TState + 1; end if; end if; end if; if TState = 0 then M1_n <= '0'; end if; end if; end if; end process; process (IntCycle, NMICycle, MCycle) begin Auto_Wait <= '0'; if IntCycle = '1' or NMICycle = '1' then if MCycle = "001" then Auto_Wait <= '1'; end if; end if; end process; end;
-- **** -- T80(b) core. In an effort to merge and maintain bug fixes .... -- -- -- Ver 300 started tidyup. Rmoved some auto_wait bits from 0247 which caused problems -- -- MikeJ March 2005 -- Latest version from www.fpgaarcade.com (original www.opencores.org) -- -- **** -- -- Z80 compatible microprocessor core -- -- Version : 0247 -- -- Copyright (c) 2001-2002 Daniel Wallner ([email protected]) -- -- All rights reserved -- -- Redistribution and use in source and synthezised forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- -- Redistributions in synthesized form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- Neither the name of the author nor the names of other contributors may -- be used to endorse or promote products derived from this software without -- specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. -- -- Please report bugs to the author, but before you do so, please -- make sure that this is not a derivative work and that -- you have the latest version of this file. -- -- The latest version of this file can be found at: -- http://www.opencores.org/cvsweb.shtml/t80/ -- -- Limitations : -- -- File history : -- -- 0208 : First complete release -- -- 0210 : Fixed wait and halt -- -- 0211 : Fixed Refresh addition and IM 1 -- -- 0214 : Fixed mostly flags, only the block instructions now fail the zex regression test -- -- 0232 : Removed refresh address output for Mode > 1 and added DJNZ M1_n fix by Mike Johnson -- -- 0235 : Added clock enable and IM 2 fix by Mike Johnson -- -- 0237 : Changed 8080 I/O address output, added IntE output -- -- 0238 : Fixed (IX/IY+d) timing and 16 bit ADC and SBC zero flag -- -- 0240 : Added interrupt ack fix by Mike Johnson, changed (IX/IY+d) timing and changed flags in GB mode -- -- 0242 : Added I/O wait, fixed refresh address, moved some registers to RAM -- -- 0247 : Fixed bus req/ack cycle -- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; use work.T80_Pack.all; entity T80 is generic( Mode : integer := 0; -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB IOWait : integer := 0; -- 1 => Single cycle I/O, 1 => Std I/O cycle Flag_C : integer := 0; Flag_N : integer := 1; Flag_P : integer := 2; Flag_X : integer := 3; Flag_H : integer := 4; Flag_Y : integer := 5; Flag_Z : integer := 6; Flag_S : integer := 7 ); port( RESET_n : in std_logic; CLK_n : in std_logic; CEN : in std_logic; WAIT_n : in std_logic; INT_n : in std_logic; NMI_n : in std_logic; BUSRQ_n : in std_logic; M1_n : out std_logic; IORQ : out std_logic; NoRead : out std_logic; Write : out std_logic; RFSH_n : out std_logic; HALT_n : out std_logic; BUSAK_n : out std_logic; A : out std_logic_vector(15 downto 0); DInst : in std_logic_vector(7 downto 0); DI : in std_logic_vector(7 downto 0); DO : out std_logic_vector(7 downto 0); MC : out std_logic_vector(2 downto 0); TS : out std_logic_vector(2 downto 0); IntCycle_n : out std_logic; IntE : out std_logic; Stop : out std_logic ); end T80; architecture rtl of T80 is constant aNone : std_logic_vector(2 downto 0) := "111"; constant aBC : std_logic_vector(2 downto 0) := "000"; constant aDE : std_logic_vector(2 downto 0) := "001"; constant aXY : std_logic_vector(2 downto 0) := "010"; constant aIOA : std_logic_vector(2 downto 0) := "100"; constant aSP : std_logic_vector(2 downto 0) := "101"; constant aZI : std_logic_vector(2 downto 0) := "110"; -- Registers signal ACC, F : std_logic_vector(7 downto 0); signal Ap, Fp : std_logic_vector(7 downto 0); signal I : std_logic_vector(7 downto 0); signal R : unsigned(7 downto 0); signal SP, PC : unsigned(15 downto 0); signal RegDIH : std_logic_vector(7 downto 0); signal RegDIL : std_logic_vector(7 downto 0); signal RegBusA : std_logic_vector(15 downto 0); signal RegBusB : std_logic_vector(15 downto 0); signal RegBusC : std_logic_vector(15 downto 0); signal RegAddrA_r : std_logic_vector(2 downto 0); signal RegAddrA : std_logic_vector(2 downto 0); signal RegAddrB_r : std_logic_vector(2 downto 0); signal RegAddrB : std_logic_vector(2 downto 0); signal RegAddrC : std_logic_vector(2 downto 0); signal RegWEH : std_logic; signal RegWEL : std_logic; signal Alternate : std_logic; -- Help Registers signal TmpAddr : std_logic_vector(15 downto 0); -- Temporary address register signal IR : std_logic_vector(7 downto 0); -- Instruction register signal ISet : std_logic_vector(1 downto 0); -- Instruction set selector signal RegBusA_r : std_logic_vector(15 downto 0); signal ID16 : signed(15 downto 0); signal Save_Mux : std_logic_vector(7 downto 0); signal TState : unsigned(2 downto 0); signal MCycle : std_logic_vector(2 downto 0); signal IntE_FF1 : std_logic; signal IntE_FF2 : std_logic; signal Halt_FF : std_logic; signal BusReq_s : std_logic; signal BusAck : std_logic; signal ClkEn : std_logic; signal NMI_s : std_logic; signal INT_s : std_logic; signal IStatus : std_logic_vector(1 downto 0); signal DI_Reg : std_logic_vector(7 downto 0); signal T_Res : std_logic; signal XY_State : std_logic_vector(1 downto 0); signal Pre_XY_F_M : std_logic_vector(2 downto 0); signal NextIs_XY_Fetch : std_logic; signal XY_Ind : std_logic; signal No_BTR : std_logic; signal BTR_r : std_logic; signal Auto_Wait : std_logic; signal Auto_Wait_t1 : std_logic; signal Auto_Wait_t2 : std_logic; signal IncDecZ : std_logic; -- ALU signals signal BusB : std_logic_vector(7 downto 0); signal BusA : std_logic_vector(7 downto 0); signal ALU_Q : std_logic_vector(7 downto 0); signal F_Out : std_logic_vector(7 downto 0); -- Registered micro code outputs signal Read_To_Reg_r : std_logic_vector(4 downto 0); signal Arith16_r : std_logic; signal Z16_r : std_logic; signal ALU_Op_r : std_logic_vector(3 downto 0); signal Save_ALU_r : std_logic; signal PreserveC_r : std_logic; signal MCycles : std_logic_vector(2 downto 0); -- Micro code outputs signal MCycles_d : std_logic_vector(2 downto 0); signal TStates : std_logic_vector(2 downto 0); signal IntCycle : std_logic; signal NMICycle : std_logic; signal Inc_PC : std_logic; signal Inc_WZ : std_logic; signal IncDec_16 : std_logic_vector(3 downto 0); signal Prefix : std_logic_vector(1 downto 0); signal Read_To_Acc : std_logic; signal Read_To_Reg : std_logic; signal Set_BusB_To : std_logic_vector(3 downto 0); signal Set_BusA_To : std_logic_vector(3 downto 0); signal ALU_Op : std_logic_vector(3 downto 0); signal Save_ALU : std_logic; signal PreserveC : std_logic; signal Arith16 : std_logic; signal Set_Addr_To : std_logic_vector(2 downto 0); signal Jump : std_logic; signal JumpE : std_logic; signal JumpXY : std_logic; signal Call : std_logic; signal RstP : std_logic; signal LDZ : std_logic; signal LDW : std_logic; signal LDSPHL : std_logic; signal IORQ_i : std_logic; signal Special_LD : std_logic_vector(2 downto 0); signal ExchangeDH : std_logic; signal ExchangeRp : std_logic; signal ExchangeAF : std_logic; signal ExchangeRS : std_logic; signal I_DJNZ : std_logic; signal I_CPL : std_logic; signal I_CCF : std_logic; signal I_SCF : std_logic; signal I_RETN : std_logic; signal I_BT : std_logic; signal I_BC : std_logic; signal I_BTR : std_logic; signal I_RLD : std_logic; signal I_RRD : std_logic; signal I_INRC : std_logic; signal SetDI : std_logic; signal SetEI : std_logic; signal IMode : std_logic_vector(1 downto 0); signal Halt : std_logic; begin mcode : T80_MCode generic map( Mode => Mode, Flag_C => Flag_C, Flag_N => Flag_N, Flag_P => Flag_P, Flag_X => Flag_X, Flag_H => Flag_H, Flag_Y => Flag_Y, Flag_Z => Flag_Z, Flag_S => Flag_S) port map( IR => IR, ISet => ISet, MCycle => MCycle, F => F, NMICycle => NMICycle, IntCycle => IntCycle, MCycles => MCycles_d, TStates => TStates, Prefix => Prefix, Inc_PC => Inc_PC, Inc_WZ => Inc_WZ, IncDec_16 => IncDec_16, Read_To_Acc => Read_To_Acc, Read_To_Reg => Read_To_Reg, Set_BusB_To => Set_BusB_To, Set_BusA_To => Set_BusA_To, ALU_Op => ALU_Op, Save_ALU => Save_ALU, PreserveC => PreserveC, Arith16 => Arith16, Set_Addr_To => Set_Addr_To, IORQ => IORQ_i, Jump => Jump, JumpE => JumpE, JumpXY => JumpXY, Call => Call, RstP => RstP, LDZ => LDZ, LDW => LDW, LDSPHL => LDSPHL, Special_LD => Special_LD, ExchangeDH => ExchangeDH, ExchangeRp => ExchangeRp, ExchangeAF => ExchangeAF, ExchangeRS => ExchangeRS, I_DJNZ => I_DJNZ, I_CPL => I_CPL, I_CCF => I_CCF, I_SCF => I_SCF, I_RETN => I_RETN, I_BT => I_BT, I_BC => I_BC, I_BTR => I_BTR, I_RLD => I_RLD, I_RRD => I_RRD, I_INRC => I_INRC, SetDI => SetDI, SetEI => SetEI, IMode => IMode, Halt => Halt, NoRead => NoRead, Write => Write); alu : T80_ALU generic map( Mode => Mode, Flag_C => Flag_C, Flag_N => Flag_N, Flag_P => Flag_P, Flag_X => Flag_X, Flag_H => Flag_H, Flag_Y => Flag_Y, Flag_Z => Flag_Z, Flag_S => Flag_S) port map( Arith16 => Arith16_r, Z16 => Z16_r, ALU_Op => ALU_Op_r, IR => IR(5 downto 0), ISet => ISet, BusA => BusA, BusB => BusB, F_In => F, Q => ALU_Q, F_Out => F_Out); ClkEn <= CEN and not BusAck; T_Res <= '1' when TState = unsigned(TStates) else '0'; NextIs_XY_Fetch <= '1' when XY_State /= "00" and XY_Ind = '0' and ((Set_Addr_To = aXY) or (MCycle = "001" and IR = "11001011") or (MCycle = "001" and IR = "00110110")) else '0'; Save_Mux <= BusB when ExchangeRp = '1' else DI_Reg when Save_ALU_r = '0' else ALU_Q; process (RESET_n, CLK_n) begin if RESET_n = '0' then PC <= (others => '0'); -- Program Counter A <= (others => '0'); TmpAddr <= (others => '0'); IR <= "00000000"; ISet <= "00"; XY_State <= "00"; IStatus <= "00"; MCycles <= "000"; DO <= "00000000"; ACC <= (others => '1'); F <= (others => '1'); Ap <= (others => '1'); Fp <= (others => '1'); I <= (others => '0'); R <= (others => '0'); SP <= (others => '1'); Alternate <= '0'; Read_To_Reg_r <= "00000"; F <= (others => '1'); Arith16_r <= '0'; BTR_r <= '0'; Z16_r <= '0'; ALU_Op_r <= "0000"; Save_ALU_r <= '0'; PreserveC_r <= '0'; XY_Ind <= '0'; elsif CLK_n'event and CLK_n = '1' then if ClkEn = '1' then ALU_Op_r <= "0000"; Save_ALU_r <= '0'; Read_To_Reg_r <= "00000"; MCycles <= MCycles_d; if IMode /= "11" then IStatus <= IMode; end if; Arith16_r <= Arith16; PreserveC_r <= PreserveC; if ISet = "10" and ALU_OP(2) = '0' and ALU_OP(0) = '1' and MCycle = "011" then Z16_r <= '1'; else Z16_r <= '0'; end if; if MCycle = "001" and TState(2) = '0' then -- MCycle = 1 and TState = 1, 2, or 3 if TState = 2 and Wait_n = '1' then if Mode < 2 then A(7 downto 0) <= std_logic_vector(R); A(15 downto 8) <= I; R(6 downto 0) <= R(6 downto 0) + 1; end if; if Jump = '0' and Call = '0' and NMICycle = '0' and IntCycle = '0' and not (Halt_FF = '1' or Halt = '1') then PC <= PC + 1; end if; if IntCycle = '1' and IStatus = "01" then IR <= "11111111"; elsif Halt_FF = '1' or (IntCycle = '1' and IStatus = "10") or NMICycle = '1' then IR <= "00000000"; else IR <= DInst; end if; ISet <= "00"; if Prefix /= "00" then if Prefix = "11" then if IR(5) = '1' then XY_State <= "10"; else XY_State <= "01"; end if; else if Prefix = "10" then XY_State <= "00"; XY_Ind <= '0'; end if; ISet <= Prefix; end if; else XY_State <= "00"; XY_Ind <= '0'; end if; end if; else -- either (MCycle > 1) OR (MCycle = 1 AND TState > 3) if MCycle = "110" then XY_Ind <= '1'; if Prefix = "01" then ISet <= "01"; end if; end if; if T_Res = '1' then BTR_r <= (I_BT or I_BC or I_BTR) and not No_BTR; if Jump = '1' then A(15 downto 8) <= DI_Reg; A(7 downto 0) <= TmpAddr(7 downto 0); PC(15 downto 8) <= unsigned(DI_Reg); PC(7 downto 0) <= unsigned(TmpAddr(7 downto 0)); elsif JumpXY = '1' then A <= RegBusC; PC <= unsigned(RegBusC); elsif Call = '1' or RstP = '1' then A <= TmpAddr; PC <= unsigned(TmpAddr); elsif MCycle = MCycles and NMICycle = '1' then A <= "0000000001100110"; PC <= "0000000001100110"; elsif MCycle = "011" and IntCycle = '1' and IStatus = "10" then A(15 downto 8) <= I; A(7 downto 0) <= TmpAddr(7 downto 0); PC(15 downto 8) <= unsigned(I); PC(7 downto 0) <= unsigned(TmpAddr(7 downto 0)); else case Set_Addr_To is when aXY => if XY_State = "00" then A <= RegBusC; else if NextIs_XY_Fetch = '1' then A <= std_logic_vector(PC); else A <= TmpAddr; end if; end if; when aIOA => if Mode = 3 then -- Memory map I/O on GBZ80 A(15 downto 8) <= (others => '1'); elsif Mode = 2 then -- Duplicate I/O address on 8080 A(15 downto 8) <= DI_Reg; else A(15 downto 8) <= ACC; end if; A(7 downto 0) <= DI_Reg; when aSP => A <= std_logic_vector(SP); when aBC => if Mode = 3 and IORQ_i = '1' then -- Memory map I/O on GBZ80 A(15 downto 8) <= (others => '1'); A(7 downto 0) <= RegBusC(7 downto 0); else A <= RegBusC; end if; when aDE => A <= RegBusC; when aZI => if Inc_WZ = '1' then A <= std_logic_vector(unsigned(TmpAddr) + 1); else A(15 downto 8) <= DI_Reg; A(7 downto 0) <= TmpAddr(7 downto 0); end if; when others => A <= std_logic_vector(PC); end case; end if; Save_ALU_r <= Save_ALU; ALU_Op_r <= ALU_Op; if I_CPL = '1' then -- CPL ACC <= not ACC; F(Flag_Y) <= not ACC(5); F(Flag_H) <= '1'; F(Flag_X) <= not ACC(3); F(Flag_N) <= '1'; end if; if I_CCF = '1' then -- CCF F(Flag_C) <= not F(Flag_C); F(Flag_Y) <= ACC(5); F(Flag_H) <= F(Flag_C); F(Flag_X) <= ACC(3); F(Flag_N) <= '0'; end if; if I_SCF = '1' then -- SCF F(Flag_C) <= '1'; F(Flag_Y) <= ACC(5); F(Flag_H) <= '0'; F(Flag_X) <= ACC(3); F(Flag_N) <= '0'; end if; end if; if TState = 2 and Wait_n = '1' then if ISet = "01" and MCycle = "111" then IR <= DInst; end if; if JumpE = '1' then PC <= unsigned(signed(PC) + signed(DI_Reg)); elsif Inc_PC = '1' then PC <= PC + 1; end if; if BTR_r = '1' then PC <= PC - 2; end if; if RstP = '1' then TmpAddr <= (others =>'0'); TmpAddr(5 downto 3) <= IR(5 downto 3); end if; end if; if TState = 3 and MCycle = "110" then TmpAddr <= std_logic_vector(signed(RegBusC) + signed(DI_Reg)); end if; if (TState = 2 and Wait_n = '1') or (TState = 4 and MCycle = "001") then if IncDec_16(2 downto 0) = "111" then if IncDec_16(3) = '1' then SP <= SP - 1; else SP <= SP + 1; end if; end if; end if; if LDSPHL = '1' then SP <= unsigned(RegBusC); end if; if ExchangeAF = '1' then Ap <= ACC; ACC <= Ap; Fp <= F; F <= Fp; end if; if ExchangeRS = '1' then Alternate <= not Alternate; end if; end if; if TState = 3 then if LDZ = '1' then TmpAddr(7 downto 0) <= DI_Reg; end if; if LDW = '1' then TmpAddr(15 downto 8) <= DI_Reg; end if; if Special_LD(2) = '1' then case Special_LD(1 downto 0) is when "00" => ACC <= I; F(Flag_P) <= IntE_FF2; when "01" => ACC <= std_logic_vector(R); F(Flag_P) <= IntE_FF2; when "10" => I <= ACC; when others => R <= unsigned(ACC); end case; end if; end if; if (I_DJNZ = '0' and Save_ALU_r = '1') or ALU_Op_r = "1001" then if Mode = 3 then F(6) <= F_Out(6); F(5) <= F_Out(5); F(7) <= F_Out(7); if PreserveC_r = '0' then F(4) <= F_Out(4); end if; else F(7 downto 1) <= F_Out(7 downto 1); if PreserveC_r = '0' then F(Flag_C) <= F_Out(0); end if; end if; end if; if T_Res = '1' and I_INRC = '1' then F(Flag_H) <= '0'; F(Flag_N) <= '0'; if DI_Reg(7 downto 0) = "00000000" then F(Flag_Z) <= '1'; else F(Flag_Z) <= '0'; end if; F(Flag_S) <= DI_Reg(7); F(Flag_P) <= not (DI_Reg(0) xor DI_Reg(1) xor DI_Reg(2) xor DI_Reg(3) xor DI_Reg(4) xor DI_Reg(5) xor DI_Reg(6) xor DI_Reg(7)); end if; if TState = 1 then DO <= BusB; if I_RLD = '1' then DO(3 downto 0) <= BusA(3 downto 0); DO(7 downto 4) <= BusB(3 downto 0); end if; if I_RRD = '1' then DO(3 downto 0) <= BusB(7 downto 4); DO(7 downto 4) <= BusA(3 downto 0); end if; end if; if T_Res = '1' then Read_To_Reg_r(3 downto 0) <= Set_BusA_To; Read_To_Reg_r(4) <= Read_To_Reg; if Read_To_Acc = '1' then Read_To_Reg_r(3 downto 0) <= "0111"; Read_To_Reg_r(4) <= '1'; end if; end if; if TState = 1 and I_BT = '1' then F(Flag_X) <= ALU_Q(3); F(Flag_Y) <= ALU_Q(1); F(Flag_H) <= '0'; F(Flag_N) <= '0'; end if; if I_BC = '1' or I_BT = '1' then F(Flag_P) <= IncDecZ; end if; if (TState = 1 and Save_ALU_r = '0') or (Save_ALU_r = '1' and ALU_OP_r /= "0111") then case Read_To_Reg_r is when "10111" => ACC <= Save_Mux; when "10110" => DO <= Save_Mux; when "11000" => SP(7 downto 0) <= unsigned(Save_Mux); when "11001" => SP(15 downto 8) <= unsigned(Save_Mux); when "11011" => F <= Save_Mux; when others => end case; end if; end if; end if; end process; --------------------------------------------------------------------------- -- -- BC('), DE('), HL('), IX and IY -- --------------------------------------------------------------------------- process (CLK_n) begin if CLK_n'event and CLK_n = '1' then if ClkEn = '1' then -- Bus A / Write RegAddrA_r <= Alternate & Set_BusA_To(2 downto 1); if XY_Ind = '0' and XY_State /= "00" and Set_BusA_To(2 downto 1) = "10" then RegAddrA_r <= XY_State(1) & "11"; end if; -- Bus B RegAddrB_r <= Alternate & Set_BusB_To(2 downto 1); if XY_Ind = '0' and XY_State /= "00" and Set_BusB_To(2 downto 1) = "10" then RegAddrB_r <= XY_State(1) & "11"; end if; -- Address from register RegAddrC <= Alternate & Set_Addr_To(1 downto 0); -- Jump (HL), LD SP,HL if (JumpXY = '1' or LDSPHL = '1') then RegAddrC <= Alternate & "10"; end if; if ((JumpXY = '1' or LDSPHL = '1') and XY_State /= "00") or (MCycle = "110") then RegAddrC <= XY_State(1) & "11"; end if; if I_DJNZ = '1' and Save_ALU_r = '1' and Mode < 2 then IncDecZ <= F_Out(Flag_Z); end if; if (TState = 2 or (TState = 3 and MCycle = "001")) and IncDec_16(2 downto 0) = "100" then if ID16 = 0 then IncDecZ <= '0'; else IncDecZ <= '1'; end if; end if; RegBusA_r <= RegBusA; end if; end if; end process; RegAddrA <= -- 16 bit increment/decrement Alternate & IncDec_16(1 downto 0) when (TState = 2 or (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and XY_State = "00" else XY_State(1) & "11" when (TState = 2 or (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and IncDec_16(1 downto 0) = "10" else -- EX HL,DL Alternate & "10" when ExchangeDH = '1' and TState = 3 else Alternate & "01" when ExchangeDH = '1' and TState = 4 else -- Bus A / Write RegAddrA_r; RegAddrB <= -- EX HL,DL Alternate & "01" when ExchangeDH = '1' and TState = 3 else -- Bus B RegAddrB_r; ID16 <= signed(RegBusA) - 1 when IncDec_16(3) = '1' else signed(RegBusA) + 1; process (Save_ALU_r, Auto_Wait_t1, ALU_OP_r, Read_To_Reg_r, ExchangeDH, IncDec_16, MCycle, TState, Wait_n) begin RegWEH <= '0'; RegWEL <= '0'; if (TState = 1 and Save_ALU_r = '0') or (Save_ALU_r = '1' and ALU_OP_r /= "0111") then case Read_To_Reg_r is when "10000" | "10001" | "10010" | "10011" | "10100" | "10101" => RegWEH <= not Read_To_Reg_r(0); RegWEL <= Read_To_Reg_r(0); when others => end case; end if; if ExchangeDH = '1' and (TState = 3 or TState = 4) then RegWEH <= '1'; RegWEL <= '1'; end if; if IncDec_16(2) = '1' and ((TState = 2 and Wait_n = '1' and MCycle /= "001") or (TState = 3 and MCycle = "001")) then case IncDec_16(1 downto 0) is when "00" | "01" | "10" => RegWEH <= '1'; RegWEL <= '1'; when others => end case; end if; end process; process (Save_Mux, RegBusB, RegBusA_r, ID16, ExchangeDH, IncDec_16, MCycle, TState, Wait_n) begin RegDIH <= Save_Mux; RegDIL <= Save_Mux; if ExchangeDH = '1' and TState = 3 then RegDIH <= RegBusB(15 downto 8); RegDIL <= RegBusB(7 downto 0); end if; if ExchangeDH = '1' and TState = 4 then RegDIH <= RegBusA_r(15 downto 8); RegDIL <= RegBusA_r(7 downto 0); end if; if IncDec_16(2) = '1' and ((TState = 2 and MCycle /= "001") or (TState = 3 and MCycle = "001")) then RegDIH <= std_logic_vector(ID16(15 downto 8)); RegDIL <= std_logic_vector(ID16(7 downto 0)); end if; end process; Regs : T80_Reg port map( Clk => CLK_n, CEN => ClkEn, WEH => RegWEH, WEL => RegWEL, AddrA => RegAddrA, AddrB => RegAddrB, AddrC => RegAddrC, DIH => RegDIH, DIL => RegDIL, DOAH => RegBusA(15 downto 8), DOAL => RegBusA(7 downto 0), DOBH => RegBusB(15 downto 8), DOBL => RegBusB(7 downto 0), DOCH => RegBusC(15 downto 8), DOCL => RegBusC(7 downto 0)); --------------------------------------------------------------------------- -- -- Buses -- --------------------------------------------------------------------------- process (CLK_n) begin if CLK_n'event and CLK_n = '1' then if ClkEn = '1' then case Set_BusB_To is when "0111" => BusB <= ACC; when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" => if Set_BusB_To(0) = '1' then BusB <= RegBusB(7 downto 0); else BusB <= RegBusB(15 downto 8); end if; when "0110" => BusB <= DI_Reg; when "1000" => BusB <= std_logic_vector(SP(7 downto 0)); when "1001" => BusB <= std_logic_vector(SP(15 downto 8)); when "1010" => BusB <= "00000001"; when "1011" => BusB <= F; when "1100" => BusB <= std_logic_vector(PC(7 downto 0)); when "1101" => BusB <= std_logic_vector(PC(15 downto 8)); when "1110" => BusB <= "00000000"; when others => BusB <= "--------"; end case; case Set_BusA_To is when "0111" => BusA <= ACC; when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" => if Set_BusA_To(0) = '1' then BusA <= RegBusA(7 downto 0); else BusA <= RegBusA(15 downto 8); end if; when "0110" => BusA <= DI_Reg; when "1000" => BusA <= std_logic_vector(SP(7 downto 0)); when "1001" => BusA <= std_logic_vector(SP(15 downto 8)); when "1010" => BusA <= "00000000"; when others => BusB <= "--------"; end case; end if; end if; end process; --------------------------------------------------------------------------- -- -- Generate external control signals -- --------------------------------------------------------------------------- process (RESET_n,CLK_n) begin if RESET_n = '0' then RFSH_n <= '1'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then if MCycle = "001" and ((TState = 2 and Wait_n = '1') or TState = 3) then RFSH_n <= '0'; else RFSH_n <= '1'; end if; end if; end if; end process; MC <= std_logic_vector(MCycle); TS <= std_logic_vector(TState); DI_Reg <= DI; HALT_n <= not Halt_FF; BUSAK_n <= not BusAck; IntCycle_n <= not IntCycle; IntE <= IntE_FF1; IORQ <= IORQ_i; Stop <= I_DJNZ; ------------------------------------------------------------------------- -- -- Syncronise inputs -- ------------------------------------------------------------------------- process (RESET_n, CLK_n) variable OldNMI_n : std_logic; begin if RESET_n = '0' then BusReq_s <= '0'; INT_s <= '0'; NMI_s <= '0'; OldNMI_n := '0'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then BusReq_s <= not BUSRQ_n; INT_s <= not INT_n; if NMICycle = '1' then NMI_s <= '0'; elsif NMI_n = '0' and OldNMI_n = '1' then NMI_s <= '1'; end if; OldNMI_n := NMI_n; end if; end if; end process; ------------------------------------------------------------------------- -- -- Main state machine -- ------------------------------------------------------------------------- process (RESET_n, CLK_n) begin if RESET_n = '0' then MCycle <= "001"; TState <= "000"; Pre_XY_F_M <= "000"; Halt_FF <= '0'; BusAck <= '0'; NMICycle <= '0'; IntCycle <= '0'; IntE_FF1 <= '0'; IntE_FF2 <= '0'; No_BTR <= '0'; Auto_Wait_t1 <= '0'; Auto_Wait_t2 <= '0'; M1_n <= '1'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then Auto_Wait_t1 <= Auto_Wait; Auto_Wait_t2 <= Auto_Wait_t1; No_BTR <= (I_BT and (not IR(4) or not F(Flag_P))) or (I_BC and (not IR(4) or F(Flag_Z) or not F(Flag_P))) or (I_BTR and (not IR(4) or F(Flag_Z))); if TState = 2 then if SetEI = '1' then IntE_FF1 <= '1'; IntE_FF2 <= '1'; end if; if I_RETN = '1' then IntE_FF1 <= IntE_FF2; end if; end if; if TState = 3 then if SetDI = '1' then IntE_FF1 <= '0'; IntE_FF2 <= '0'; end if; end if; if IntCycle = '1' or NMICycle = '1' then Halt_FF <= '0'; end if; if MCycle = "001" and TState = 2 and Wait_n = '1' then M1_n <= '1'; end if; if BusReq_s = '1' and BusAck = '1' then else BusAck <= '0'; if TState = 2 and Wait_n = '0' then elsif T_Res = '1' then if Halt = '1' then Halt_FF <= '1'; end if; if BusReq_s = '1' then BusAck <= '1'; else TState <= "001"; if NextIs_XY_Fetch = '1' then MCycle <= "110"; Pre_XY_F_M <= MCycle; if IR = "00110110" and Mode = 0 then Pre_XY_F_M <= "010"; end if; elsif (MCycle = "111") or (MCycle = "110" and Mode = 1 and ISet /= "01") then MCycle <= std_logic_vector(unsigned(Pre_XY_F_M) + 1); elsif (MCycle = MCycles) or No_BTR = '1' or (MCycle = "010" and I_DJNZ = '1' and IncDecZ = '1') then M1_n <= '0'; MCycle <= "001"; IntCycle <= '0'; NMICycle <= '0'; if NMI_s = '1' and Prefix = "00" then NMICycle <= '1'; IntE_FF1 <= '0'; elsif (IntE_FF1 = '1' and INT_s = '1') and Prefix = "00" and SetEI = '0' then IntCycle <= '1'; IntE_FF1 <= '0'; IntE_FF2 <= '0'; end if; else MCycle <= std_logic_vector(unsigned(MCycle) + 1); end if; end if; else if Auto_Wait = '1' nand Auto_Wait_t2 = '0' then TState <= TState + 1; end if; end if; end if; if TState = 0 then M1_n <= '0'; end if; end if; end if; end process; process (IntCycle, NMICycle, MCycle) begin Auto_Wait <= '0'; if IntCycle = '1' or NMICycle = '1' then if MCycle = "001" then Auto_Wait <= '1'; end if; end if; end process; end;
-- **** -- T80(b) core. In an effort to merge and maintain bug fixes .... -- -- -- Ver 300 started tidyup. Rmoved some auto_wait bits from 0247 which caused problems -- -- MikeJ March 2005 -- Latest version from www.fpgaarcade.com (original www.opencores.org) -- -- **** -- -- Z80 compatible microprocessor core -- -- Version : 0247 -- -- Copyright (c) 2001-2002 Daniel Wallner ([email protected]) -- -- All rights reserved -- -- Redistribution and use in source and synthezised forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- -- Redistributions in synthesized form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- Neither the name of the author nor the names of other contributors may -- be used to endorse or promote products derived from this software without -- specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. -- -- Please report bugs to the author, but before you do so, please -- make sure that this is not a derivative work and that -- you have the latest version of this file. -- -- The latest version of this file can be found at: -- http://www.opencores.org/cvsweb.shtml/t80/ -- -- Limitations : -- -- File history : -- -- 0208 : First complete release -- -- 0210 : Fixed wait and halt -- -- 0211 : Fixed Refresh addition and IM 1 -- -- 0214 : Fixed mostly flags, only the block instructions now fail the zex regression test -- -- 0232 : Removed refresh address output for Mode > 1 and added DJNZ M1_n fix by Mike Johnson -- -- 0235 : Added clock enable and IM 2 fix by Mike Johnson -- -- 0237 : Changed 8080 I/O address output, added IntE output -- -- 0238 : Fixed (IX/IY+d) timing and 16 bit ADC and SBC zero flag -- -- 0240 : Added interrupt ack fix by Mike Johnson, changed (IX/IY+d) timing and changed flags in GB mode -- -- 0242 : Added I/O wait, fixed refresh address, moved some registers to RAM -- -- 0247 : Fixed bus req/ack cycle -- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; use work.T80_Pack.all; entity T80 is generic( Mode : integer := 0; -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB IOWait : integer := 0; -- 1 => Single cycle I/O, 1 => Std I/O cycle Flag_C : integer := 0; Flag_N : integer := 1; Flag_P : integer := 2; Flag_X : integer := 3; Flag_H : integer := 4; Flag_Y : integer := 5; Flag_Z : integer := 6; Flag_S : integer := 7 ); port( RESET_n : in std_logic; CLK_n : in std_logic; CEN : in std_logic; WAIT_n : in std_logic; INT_n : in std_logic; NMI_n : in std_logic; BUSRQ_n : in std_logic; M1_n : out std_logic; IORQ : out std_logic; NoRead : out std_logic; Write : out std_logic; RFSH_n : out std_logic; HALT_n : out std_logic; BUSAK_n : out std_logic; A : out std_logic_vector(15 downto 0); DInst : in std_logic_vector(7 downto 0); DI : in std_logic_vector(7 downto 0); DO : out std_logic_vector(7 downto 0); MC : out std_logic_vector(2 downto 0); TS : out std_logic_vector(2 downto 0); IntCycle_n : out std_logic; IntE : out std_logic; Stop : out std_logic ); end T80; architecture rtl of T80 is constant aNone : std_logic_vector(2 downto 0) := "111"; constant aBC : std_logic_vector(2 downto 0) := "000"; constant aDE : std_logic_vector(2 downto 0) := "001"; constant aXY : std_logic_vector(2 downto 0) := "010"; constant aIOA : std_logic_vector(2 downto 0) := "100"; constant aSP : std_logic_vector(2 downto 0) := "101"; constant aZI : std_logic_vector(2 downto 0) := "110"; -- Registers signal ACC, F : std_logic_vector(7 downto 0); signal Ap, Fp : std_logic_vector(7 downto 0); signal I : std_logic_vector(7 downto 0); signal R : unsigned(7 downto 0); signal SP, PC : unsigned(15 downto 0); signal RegDIH : std_logic_vector(7 downto 0); signal RegDIL : std_logic_vector(7 downto 0); signal RegBusA : std_logic_vector(15 downto 0); signal RegBusB : std_logic_vector(15 downto 0); signal RegBusC : std_logic_vector(15 downto 0); signal RegAddrA_r : std_logic_vector(2 downto 0); signal RegAddrA : std_logic_vector(2 downto 0); signal RegAddrB_r : std_logic_vector(2 downto 0); signal RegAddrB : std_logic_vector(2 downto 0); signal RegAddrC : std_logic_vector(2 downto 0); signal RegWEH : std_logic; signal RegWEL : std_logic; signal Alternate : std_logic; -- Help Registers signal TmpAddr : std_logic_vector(15 downto 0); -- Temporary address register signal IR : std_logic_vector(7 downto 0); -- Instruction register signal ISet : std_logic_vector(1 downto 0); -- Instruction set selector signal RegBusA_r : std_logic_vector(15 downto 0); signal ID16 : signed(15 downto 0); signal Save_Mux : std_logic_vector(7 downto 0); signal TState : unsigned(2 downto 0); signal MCycle : std_logic_vector(2 downto 0); signal IntE_FF1 : std_logic; signal IntE_FF2 : std_logic; signal Halt_FF : std_logic; signal BusReq_s : std_logic; signal BusAck : std_logic; signal ClkEn : std_logic; signal NMI_s : std_logic; signal INT_s : std_logic; signal IStatus : std_logic_vector(1 downto 0); signal DI_Reg : std_logic_vector(7 downto 0); signal T_Res : std_logic; signal XY_State : std_logic_vector(1 downto 0); signal Pre_XY_F_M : std_logic_vector(2 downto 0); signal NextIs_XY_Fetch : std_logic; signal XY_Ind : std_logic; signal No_BTR : std_logic; signal BTR_r : std_logic; signal Auto_Wait : std_logic; signal Auto_Wait_t1 : std_logic; signal Auto_Wait_t2 : std_logic; signal IncDecZ : std_logic; -- ALU signals signal BusB : std_logic_vector(7 downto 0); signal BusA : std_logic_vector(7 downto 0); signal ALU_Q : std_logic_vector(7 downto 0); signal F_Out : std_logic_vector(7 downto 0); -- Registered micro code outputs signal Read_To_Reg_r : std_logic_vector(4 downto 0); signal Arith16_r : std_logic; signal Z16_r : std_logic; signal ALU_Op_r : std_logic_vector(3 downto 0); signal Save_ALU_r : std_logic; signal PreserveC_r : std_logic; signal MCycles : std_logic_vector(2 downto 0); -- Micro code outputs signal MCycles_d : std_logic_vector(2 downto 0); signal TStates : std_logic_vector(2 downto 0); signal IntCycle : std_logic; signal NMICycle : std_logic; signal Inc_PC : std_logic; signal Inc_WZ : std_logic; signal IncDec_16 : std_logic_vector(3 downto 0); signal Prefix : std_logic_vector(1 downto 0); signal Read_To_Acc : std_logic; signal Read_To_Reg : std_logic; signal Set_BusB_To : std_logic_vector(3 downto 0); signal Set_BusA_To : std_logic_vector(3 downto 0); signal ALU_Op : std_logic_vector(3 downto 0); signal Save_ALU : std_logic; signal PreserveC : std_logic; signal Arith16 : std_logic; signal Set_Addr_To : std_logic_vector(2 downto 0); signal Jump : std_logic; signal JumpE : std_logic; signal JumpXY : std_logic; signal Call : std_logic; signal RstP : std_logic; signal LDZ : std_logic; signal LDW : std_logic; signal LDSPHL : std_logic; signal IORQ_i : std_logic; signal Special_LD : std_logic_vector(2 downto 0); signal ExchangeDH : std_logic; signal ExchangeRp : std_logic; signal ExchangeAF : std_logic; signal ExchangeRS : std_logic; signal I_DJNZ : std_logic; signal I_CPL : std_logic; signal I_CCF : std_logic; signal I_SCF : std_logic; signal I_RETN : std_logic; signal I_BT : std_logic; signal I_BC : std_logic; signal I_BTR : std_logic; signal I_RLD : std_logic; signal I_RRD : std_logic; signal I_INRC : std_logic; signal SetDI : std_logic; signal SetEI : std_logic; signal IMode : std_logic_vector(1 downto 0); signal Halt : std_logic; begin mcode : T80_MCode generic map( Mode => Mode, Flag_C => Flag_C, Flag_N => Flag_N, Flag_P => Flag_P, Flag_X => Flag_X, Flag_H => Flag_H, Flag_Y => Flag_Y, Flag_Z => Flag_Z, Flag_S => Flag_S) port map( IR => IR, ISet => ISet, MCycle => MCycle, F => F, NMICycle => NMICycle, IntCycle => IntCycle, MCycles => MCycles_d, TStates => TStates, Prefix => Prefix, Inc_PC => Inc_PC, Inc_WZ => Inc_WZ, IncDec_16 => IncDec_16, Read_To_Acc => Read_To_Acc, Read_To_Reg => Read_To_Reg, Set_BusB_To => Set_BusB_To, Set_BusA_To => Set_BusA_To, ALU_Op => ALU_Op, Save_ALU => Save_ALU, PreserveC => PreserveC, Arith16 => Arith16, Set_Addr_To => Set_Addr_To, IORQ => IORQ_i, Jump => Jump, JumpE => JumpE, JumpXY => JumpXY, Call => Call, RstP => RstP, LDZ => LDZ, LDW => LDW, LDSPHL => LDSPHL, Special_LD => Special_LD, ExchangeDH => ExchangeDH, ExchangeRp => ExchangeRp, ExchangeAF => ExchangeAF, ExchangeRS => ExchangeRS, I_DJNZ => I_DJNZ, I_CPL => I_CPL, I_CCF => I_CCF, I_SCF => I_SCF, I_RETN => I_RETN, I_BT => I_BT, I_BC => I_BC, I_BTR => I_BTR, I_RLD => I_RLD, I_RRD => I_RRD, I_INRC => I_INRC, SetDI => SetDI, SetEI => SetEI, IMode => IMode, Halt => Halt, NoRead => NoRead, Write => Write); alu : T80_ALU generic map( Mode => Mode, Flag_C => Flag_C, Flag_N => Flag_N, Flag_P => Flag_P, Flag_X => Flag_X, Flag_H => Flag_H, Flag_Y => Flag_Y, Flag_Z => Flag_Z, Flag_S => Flag_S) port map( Arith16 => Arith16_r, Z16 => Z16_r, ALU_Op => ALU_Op_r, IR => IR(5 downto 0), ISet => ISet, BusA => BusA, BusB => BusB, F_In => F, Q => ALU_Q, F_Out => F_Out); ClkEn <= CEN and not BusAck; T_Res <= '1' when TState = unsigned(TStates) else '0'; NextIs_XY_Fetch <= '1' when XY_State /= "00" and XY_Ind = '0' and ((Set_Addr_To = aXY) or (MCycle = "001" and IR = "11001011") or (MCycle = "001" and IR = "00110110")) else '0'; Save_Mux <= BusB when ExchangeRp = '1' else DI_Reg when Save_ALU_r = '0' else ALU_Q; process (RESET_n, CLK_n) begin if RESET_n = '0' then PC <= (others => '0'); -- Program Counter A <= (others => '0'); TmpAddr <= (others => '0'); IR <= "00000000"; ISet <= "00"; XY_State <= "00"; IStatus <= "00"; MCycles <= "000"; DO <= "00000000"; ACC <= (others => '1'); F <= (others => '1'); Ap <= (others => '1'); Fp <= (others => '1'); I <= (others => '0'); R <= (others => '0'); SP <= (others => '1'); Alternate <= '0'; Read_To_Reg_r <= "00000"; F <= (others => '1'); Arith16_r <= '0'; BTR_r <= '0'; Z16_r <= '0'; ALU_Op_r <= "0000"; Save_ALU_r <= '0'; PreserveC_r <= '0'; XY_Ind <= '0'; elsif CLK_n'event and CLK_n = '1' then if ClkEn = '1' then ALU_Op_r <= "0000"; Save_ALU_r <= '0'; Read_To_Reg_r <= "00000"; MCycles <= MCycles_d; if IMode /= "11" then IStatus <= IMode; end if; Arith16_r <= Arith16; PreserveC_r <= PreserveC; if ISet = "10" and ALU_OP(2) = '0' and ALU_OP(0) = '1' and MCycle = "011" then Z16_r <= '1'; else Z16_r <= '0'; end if; if MCycle = "001" and TState(2) = '0' then -- MCycle = 1 and TState = 1, 2, or 3 if TState = 2 and Wait_n = '1' then if Mode < 2 then A(7 downto 0) <= std_logic_vector(R); A(15 downto 8) <= I; R(6 downto 0) <= R(6 downto 0) + 1; end if; if Jump = '0' and Call = '0' and NMICycle = '0' and IntCycle = '0' and not (Halt_FF = '1' or Halt = '1') then PC <= PC + 1; end if; if IntCycle = '1' and IStatus = "01" then IR <= "11111111"; elsif Halt_FF = '1' or (IntCycle = '1' and IStatus = "10") or NMICycle = '1' then IR <= "00000000"; else IR <= DInst; end if; ISet <= "00"; if Prefix /= "00" then if Prefix = "11" then if IR(5) = '1' then XY_State <= "10"; else XY_State <= "01"; end if; else if Prefix = "10" then XY_State <= "00"; XY_Ind <= '0'; end if; ISet <= Prefix; end if; else XY_State <= "00"; XY_Ind <= '0'; end if; end if; else -- either (MCycle > 1) OR (MCycle = 1 AND TState > 3) if MCycle = "110" then XY_Ind <= '1'; if Prefix = "01" then ISet <= "01"; end if; end if; if T_Res = '1' then BTR_r <= (I_BT or I_BC or I_BTR) and not No_BTR; if Jump = '1' then A(15 downto 8) <= DI_Reg; A(7 downto 0) <= TmpAddr(7 downto 0); PC(15 downto 8) <= unsigned(DI_Reg); PC(7 downto 0) <= unsigned(TmpAddr(7 downto 0)); elsif JumpXY = '1' then A <= RegBusC; PC <= unsigned(RegBusC); elsif Call = '1' or RstP = '1' then A <= TmpAddr; PC <= unsigned(TmpAddr); elsif MCycle = MCycles and NMICycle = '1' then A <= "0000000001100110"; PC <= "0000000001100110"; elsif MCycle = "011" and IntCycle = '1' and IStatus = "10" then A(15 downto 8) <= I; A(7 downto 0) <= TmpAddr(7 downto 0); PC(15 downto 8) <= unsigned(I); PC(7 downto 0) <= unsigned(TmpAddr(7 downto 0)); else case Set_Addr_To is when aXY => if XY_State = "00" then A <= RegBusC; else if NextIs_XY_Fetch = '1' then A <= std_logic_vector(PC); else A <= TmpAddr; end if; end if; when aIOA => if Mode = 3 then -- Memory map I/O on GBZ80 A(15 downto 8) <= (others => '1'); elsif Mode = 2 then -- Duplicate I/O address on 8080 A(15 downto 8) <= DI_Reg; else A(15 downto 8) <= ACC; end if; A(7 downto 0) <= DI_Reg; when aSP => A <= std_logic_vector(SP); when aBC => if Mode = 3 and IORQ_i = '1' then -- Memory map I/O on GBZ80 A(15 downto 8) <= (others => '1'); A(7 downto 0) <= RegBusC(7 downto 0); else A <= RegBusC; end if; when aDE => A <= RegBusC; when aZI => if Inc_WZ = '1' then A <= std_logic_vector(unsigned(TmpAddr) + 1); else A(15 downto 8) <= DI_Reg; A(7 downto 0) <= TmpAddr(7 downto 0); end if; when others => A <= std_logic_vector(PC); end case; end if; Save_ALU_r <= Save_ALU; ALU_Op_r <= ALU_Op; if I_CPL = '1' then -- CPL ACC <= not ACC; F(Flag_Y) <= not ACC(5); F(Flag_H) <= '1'; F(Flag_X) <= not ACC(3); F(Flag_N) <= '1'; end if; if I_CCF = '1' then -- CCF F(Flag_C) <= not F(Flag_C); F(Flag_Y) <= ACC(5); F(Flag_H) <= F(Flag_C); F(Flag_X) <= ACC(3); F(Flag_N) <= '0'; end if; if I_SCF = '1' then -- SCF F(Flag_C) <= '1'; F(Flag_Y) <= ACC(5); F(Flag_H) <= '0'; F(Flag_X) <= ACC(3); F(Flag_N) <= '0'; end if; end if; if TState = 2 and Wait_n = '1' then if ISet = "01" and MCycle = "111" then IR <= DInst; end if; if JumpE = '1' then PC <= unsigned(signed(PC) + signed(DI_Reg)); elsif Inc_PC = '1' then PC <= PC + 1; end if; if BTR_r = '1' then PC <= PC - 2; end if; if RstP = '1' then TmpAddr <= (others =>'0'); TmpAddr(5 downto 3) <= IR(5 downto 3); end if; end if; if TState = 3 and MCycle = "110" then TmpAddr <= std_logic_vector(signed(RegBusC) + signed(DI_Reg)); end if; if (TState = 2 and Wait_n = '1') or (TState = 4 and MCycle = "001") then if IncDec_16(2 downto 0) = "111" then if IncDec_16(3) = '1' then SP <= SP - 1; else SP <= SP + 1; end if; end if; end if; if LDSPHL = '1' then SP <= unsigned(RegBusC); end if; if ExchangeAF = '1' then Ap <= ACC; ACC <= Ap; Fp <= F; F <= Fp; end if; if ExchangeRS = '1' then Alternate <= not Alternate; end if; end if; if TState = 3 then if LDZ = '1' then TmpAddr(7 downto 0) <= DI_Reg; end if; if LDW = '1' then TmpAddr(15 downto 8) <= DI_Reg; end if; if Special_LD(2) = '1' then case Special_LD(1 downto 0) is when "00" => ACC <= I; F(Flag_P) <= IntE_FF2; when "01" => ACC <= std_logic_vector(R); F(Flag_P) <= IntE_FF2; when "10" => I <= ACC; when others => R <= unsigned(ACC); end case; end if; end if; if (I_DJNZ = '0' and Save_ALU_r = '1') or ALU_Op_r = "1001" then if Mode = 3 then F(6) <= F_Out(6); F(5) <= F_Out(5); F(7) <= F_Out(7); if PreserveC_r = '0' then F(4) <= F_Out(4); end if; else F(7 downto 1) <= F_Out(7 downto 1); if PreserveC_r = '0' then F(Flag_C) <= F_Out(0); end if; end if; end if; if T_Res = '1' and I_INRC = '1' then F(Flag_H) <= '0'; F(Flag_N) <= '0'; if DI_Reg(7 downto 0) = "00000000" then F(Flag_Z) <= '1'; else F(Flag_Z) <= '0'; end if; F(Flag_S) <= DI_Reg(7); F(Flag_P) <= not (DI_Reg(0) xor DI_Reg(1) xor DI_Reg(2) xor DI_Reg(3) xor DI_Reg(4) xor DI_Reg(5) xor DI_Reg(6) xor DI_Reg(7)); end if; if TState = 1 then DO <= BusB; if I_RLD = '1' then DO(3 downto 0) <= BusA(3 downto 0); DO(7 downto 4) <= BusB(3 downto 0); end if; if I_RRD = '1' then DO(3 downto 0) <= BusB(7 downto 4); DO(7 downto 4) <= BusA(3 downto 0); end if; end if; if T_Res = '1' then Read_To_Reg_r(3 downto 0) <= Set_BusA_To; Read_To_Reg_r(4) <= Read_To_Reg; if Read_To_Acc = '1' then Read_To_Reg_r(3 downto 0) <= "0111"; Read_To_Reg_r(4) <= '1'; end if; end if; if TState = 1 and I_BT = '1' then F(Flag_X) <= ALU_Q(3); F(Flag_Y) <= ALU_Q(1); F(Flag_H) <= '0'; F(Flag_N) <= '0'; end if; if I_BC = '1' or I_BT = '1' then F(Flag_P) <= IncDecZ; end if; if (TState = 1 and Save_ALU_r = '0') or (Save_ALU_r = '1' and ALU_OP_r /= "0111") then case Read_To_Reg_r is when "10111" => ACC <= Save_Mux; when "10110" => DO <= Save_Mux; when "11000" => SP(7 downto 0) <= unsigned(Save_Mux); when "11001" => SP(15 downto 8) <= unsigned(Save_Mux); when "11011" => F <= Save_Mux; when others => end case; end if; end if; end if; end process; --------------------------------------------------------------------------- -- -- BC('), DE('), HL('), IX and IY -- --------------------------------------------------------------------------- process (CLK_n) begin if CLK_n'event and CLK_n = '1' then if ClkEn = '1' then -- Bus A / Write RegAddrA_r <= Alternate & Set_BusA_To(2 downto 1); if XY_Ind = '0' and XY_State /= "00" and Set_BusA_To(2 downto 1) = "10" then RegAddrA_r <= XY_State(1) & "11"; end if; -- Bus B RegAddrB_r <= Alternate & Set_BusB_To(2 downto 1); if XY_Ind = '0' and XY_State /= "00" and Set_BusB_To(2 downto 1) = "10" then RegAddrB_r <= XY_State(1) & "11"; end if; -- Address from register RegAddrC <= Alternate & Set_Addr_To(1 downto 0); -- Jump (HL), LD SP,HL if (JumpXY = '1' or LDSPHL = '1') then RegAddrC <= Alternate & "10"; end if; if ((JumpXY = '1' or LDSPHL = '1') and XY_State /= "00") or (MCycle = "110") then RegAddrC <= XY_State(1) & "11"; end if; if I_DJNZ = '1' and Save_ALU_r = '1' and Mode < 2 then IncDecZ <= F_Out(Flag_Z); end if; if (TState = 2 or (TState = 3 and MCycle = "001")) and IncDec_16(2 downto 0) = "100" then if ID16 = 0 then IncDecZ <= '0'; else IncDecZ <= '1'; end if; end if; RegBusA_r <= RegBusA; end if; end if; end process; RegAddrA <= -- 16 bit increment/decrement Alternate & IncDec_16(1 downto 0) when (TState = 2 or (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and XY_State = "00" else XY_State(1) & "11" when (TState = 2 or (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and IncDec_16(1 downto 0) = "10" else -- EX HL,DL Alternate & "10" when ExchangeDH = '1' and TState = 3 else Alternate & "01" when ExchangeDH = '1' and TState = 4 else -- Bus A / Write RegAddrA_r; RegAddrB <= -- EX HL,DL Alternate & "01" when ExchangeDH = '1' and TState = 3 else -- Bus B RegAddrB_r; ID16 <= signed(RegBusA) - 1 when IncDec_16(3) = '1' else signed(RegBusA) + 1; process (Save_ALU_r, Auto_Wait_t1, ALU_OP_r, Read_To_Reg_r, ExchangeDH, IncDec_16, MCycle, TState, Wait_n) begin RegWEH <= '0'; RegWEL <= '0'; if (TState = 1 and Save_ALU_r = '0') or (Save_ALU_r = '1' and ALU_OP_r /= "0111") then case Read_To_Reg_r is when "10000" | "10001" | "10010" | "10011" | "10100" | "10101" => RegWEH <= not Read_To_Reg_r(0); RegWEL <= Read_To_Reg_r(0); when others => end case; end if; if ExchangeDH = '1' and (TState = 3 or TState = 4) then RegWEH <= '1'; RegWEL <= '1'; end if; if IncDec_16(2) = '1' and ((TState = 2 and Wait_n = '1' and MCycle /= "001") or (TState = 3 and MCycle = "001")) then case IncDec_16(1 downto 0) is when "00" | "01" | "10" => RegWEH <= '1'; RegWEL <= '1'; when others => end case; end if; end process; process (Save_Mux, RegBusB, RegBusA_r, ID16, ExchangeDH, IncDec_16, MCycle, TState, Wait_n) begin RegDIH <= Save_Mux; RegDIL <= Save_Mux; if ExchangeDH = '1' and TState = 3 then RegDIH <= RegBusB(15 downto 8); RegDIL <= RegBusB(7 downto 0); end if; if ExchangeDH = '1' and TState = 4 then RegDIH <= RegBusA_r(15 downto 8); RegDIL <= RegBusA_r(7 downto 0); end if; if IncDec_16(2) = '1' and ((TState = 2 and MCycle /= "001") or (TState = 3 and MCycle = "001")) then RegDIH <= std_logic_vector(ID16(15 downto 8)); RegDIL <= std_logic_vector(ID16(7 downto 0)); end if; end process; Regs : T80_Reg port map( Clk => CLK_n, CEN => ClkEn, WEH => RegWEH, WEL => RegWEL, AddrA => RegAddrA, AddrB => RegAddrB, AddrC => RegAddrC, DIH => RegDIH, DIL => RegDIL, DOAH => RegBusA(15 downto 8), DOAL => RegBusA(7 downto 0), DOBH => RegBusB(15 downto 8), DOBL => RegBusB(7 downto 0), DOCH => RegBusC(15 downto 8), DOCL => RegBusC(7 downto 0)); --------------------------------------------------------------------------- -- -- Buses -- --------------------------------------------------------------------------- process (CLK_n) begin if CLK_n'event and CLK_n = '1' then if ClkEn = '1' then case Set_BusB_To is when "0111" => BusB <= ACC; when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" => if Set_BusB_To(0) = '1' then BusB <= RegBusB(7 downto 0); else BusB <= RegBusB(15 downto 8); end if; when "0110" => BusB <= DI_Reg; when "1000" => BusB <= std_logic_vector(SP(7 downto 0)); when "1001" => BusB <= std_logic_vector(SP(15 downto 8)); when "1010" => BusB <= "00000001"; when "1011" => BusB <= F; when "1100" => BusB <= std_logic_vector(PC(7 downto 0)); when "1101" => BusB <= std_logic_vector(PC(15 downto 8)); when "1110" => BusB <= "00000000"; when others => BusB <= "--------"; end case; case Set_BusA_To is when "0111" => BusA <= ACC; when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" => if Set_BusA_To(0) = '1' then BusA <= RegBusA(7 downto 0); else BusA <= RegBusA(15 downto 8); end if; when "0110" => BusA <= DI_Reg; when "1000" => BusA <= std_logic_vector(SP(7 downto 0)); when "1001" => BusA <= std_logic_vector(SP(15 downto 8)); when "1010" => BusA <= "00000000"; when others => BusB <= "--------"; end case; end if; end if; end process; --------------------------------------------------------------------------- -- -- Generate external control signals -- --------------------------------------------------------------------------- process (RESET_n,CLK_n) begin if RESET_n = '0' then RFSH_n <= '1'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then if MCycle = "001" and ((TState = 2 and Wait_n = '1') or TState = 3) then RFSH_n <= '0'; else RFSH_n <= '1'; end if; end if; end if; end process; MC <= std_logic_vector(MCycle); TS <= std_logic_vector(TState); DI_Reg <= DI; HALT_n <= not Halt_FF; BUSAK_n <= not BusAck; IntCycle_n <= not IntCycle; IntE <= IntE_FF1; IORQ <= IORQ_i; Stop <= I_DJNZ; ------------------------------------------------------------------------- -- -- Syncronise inputs -- ------------------------------------------------------------------------- process (RESET_n, CLK_n) variable OldNMI_n : std_logic; begin if RESET_n = '0' then BusReq_s <= '0'; INT_s <= '0'; NMI_s <= '0'; OldNMI_n := '0'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then BusReq_s <= not BUSRQ_n; INT_s <= not INT_n; if NMICycle = '1' then NMI_s <= '0'; elsif NMI_n = '0' and OldNMI_n = '1' then NMI_s <= '1'; end if; OldNMI_n := NMI_n; end if; end if; end process; ------------------------------------------------------------------------- -- -- Main state machine -- ------------------------------------------------------------------------- process (RESET_n, CLK_n) begin if RESET_n = '0' then MCycle <= "001"; TState <= "000"; Pre_XY_F_M <= "000"; Halt_FF <= '0'; BusAck <= '0'; NMICycle <= '0'; IntCycle <= '0'; IntE_FF1 <= '0'; IntE_FF2 <= '0'; No_BTR <= '0'; Auto_Wait_t1 <= '0'; Auto_Wait_t2 <= '0'; M1_n <= '1'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then Auto_Wait_t1 <= Auto_Wait; Auto_Wait_t2 <= Auto_Wait_t1; No_BTR <= (I_BT and (not IR(4) or not F(Flag_P))) or (I_BC and (not IR(4) or F(Flag_Z) or not F(Flag_P))) or (I_BTR and (not IR(4) or F(Flag_Z))); if TState = 2 then if SetEI = '1' then IntE_FF1 <= '1'; IntE_FF2 <= '1'; end if; if I_RETN = '1' then IntE_FF1 <= IntE_FF2; end if; end if; if TState = 3 then if SetDI = '1' then IntE_FF1 <= '0'; IntE_FF2 <= '0'; end if; end if; if IntCycle = '1' or NMICycle = '1' then Halt_FF <= '0'; end if; if MCycle = "001" and TState = 2 and Wait_n = '1' then M1_n <= '1'; end if; if BusReq_s = '1' and BusAck = '1' then else BusAck <= '0'; if TState = 2 and Wait_n = '0' then elsif T_Res = '1' then if Halt = '1' then Halt_FF <= '1'; end if; if BusReq_s = '1' then BusAck <= '1'; else TState <= "001"; if NextIs_XY_Fetch = '1' then MCycle <= "110"; Pre_XY_F_M <= MCycle; if IR = "00110110" and Mode = 0 then Pre_XY_F_M <= "010"; end if; elsif (MCycle = "111") or (MCycle = "110" and Mode = 1 and ISet /= "01") then MCycle <= std_logic_vector(unsigned(Pre_XY_F_M) + 1); elsif (MCycle = MCycles) or No_BTR = '1' or (MCycle = "010" and I_DJNZ = '1' and IncDecZ = '1') then M1_n <= '0'; MCycle <= "001"; IntCycle <= '0'; NMICycle <= '0'; if NMI_s = '1' and Prefix = "00" then NMICycle <= '1'; IntE_FF1 <= '0'; elsif (IntE_FF1 = '1' and INT_s = '1') and Prefix = "00" and SetEI = '0' then IntCycle <= '1'; IntE_FF1 <= '0'; IntE_FF2 <= '0'; end if; else MCycle <= std_logic_vector(unsigned(MCycle) + 1); end if; end if; else if Auto_Wait = '1' nand Auto_Wait_t2 = '0' then TState <= TState + 1; end if; end if; end if; if TState = 0 then M1_n <= '0'; end if; end if; end if; end process; process (IntCycle, NMICycle, MCycle) begin Auto_Wait <= '0'; if IntCycle = '1' or NMICycle = '1' then if MCycle = "001" then Auto_Wait <= '1'; end if; end if; end process; end;
-- **** -- T80(b) core. In an effort to merge and maintain bug fixes .... -- -- -- Ver 300 started tidyup. Rmoved some auto_wait bits from 0247 which caused problems -- -- MikeJ March 2005 -- Latest version from www.fpgaarcade.com (original www.opencores.org) -- -- **** -- -- Z80 compatible microprocessor core -- -- Version : 0247 -- -- Copyright (c) 2001-2002 Daniel Wallner ([email protected]) -- -- All rights reserved -- -- Redistribution and use in source and synthezised forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- -- Redistributions in synthesized form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- Neither the name of the author nor the names of other contributors may -- be used to endorse or promote products derived from this software without -- specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. -- -- Please report bugs to the author, but before you do so, please -- make sure that this is not a derivative work and that -- you have the latest version of this file. -- -- The latest version of this file can be found at: -- http://www.opencores.org/cvsweb.shtml/t80/ -- -- Limitations : -- -- File history : -- -- 0208 : First complete release -- -- 0210 : Fixed wait and halt -- -- 0211 : Fixed Refresh addition and IM 1 -- -- 0214 : Fixed mostly flags, only the block instructions now fail the zex regression test -- -- 0232 : Removed refresh address output for Mode > 1 and added DJNZ M1_n fix by Mike Johnson -- -- 0235 : Added clock enable and IM 2 fix by Mike Johnson -- -- 0237 : Changed 8080 I/O address output, added IntE output -- -- 0238 : Fixed (IX/IY+d) timing and 16 bit ADC and SBC zero flag -- -- 0240 : Added interrupt ack fix by Mike Johnson, changed (IX/IY+d) timing and changed flags in GB mode -- -- 0242 : Added I/O wait, fixed refresh address, moved some registers to RAM -- -- 0247 : Fixed bus req/ack cycle -- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; use work.T80_Pack.all; entity T80 is generic( Mode : integer := 0; -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB IOWait : integer := 0; -- 1 => Single cycle I/O, 1 => Std I/O cycle Flag_C : integer := 0; Flag_N : integer := 1; Flag_P : integer := 2; Flag_X : integer := 3; Flag_H : integer := 4; Flag_Y : integer := 5; Flag_Z : integer := 6; Flag_S : integer := 7 ); port( RESET_n : in std_logic; CLK_n : in std_logic; CEN : in std_logic; WAIT_n : in std_logic; INT_n : in std_logic; NMI_n : in std_logic; BUSRQ_n : in std_logic; M1_n : out std_logic; IORQ : out std_logic; NoRead : out std_logic; Write : out std_logic; RFSH_n : out std_logic; HALT_n : out std_logic; BUSAK_n : out std_logic; A : out std_logic_vector(15 downto 0); DInst : in std_logic_vector(7 downto 0); DI : in std_logic_vector(7 downto 0); DO : out std_logic_vector(7 downto 0); MC : out std_logic_vector(2 downto 0); TS : out std_logic_vector(2 downto 0); IntCycle_n : out std_logic; IntE : out std_logic; Stop : out std_logic ); end T80; architecture rtl of T80 is constant aNone : std_logic_vector(2 downto 0) := "111"; constant aBC : std_logic_vector(2 downto 0) := "000"; constant aDE : std_logic_vector(2 downto 0) := "001"; constant aXY : std_logic_vector(2 downto 0) := "010"; constant aIOA : std_logic_vector(2 downto 0) := "100"; constant aSP : std_logic_vector(2 downto 0) := "101"; constant aZI : std_logic_vector(2 downto 0) := "110"; -- Registers signal ACC, F : std_logic_vector(7 downto 0); signal Ap, Fp : std_logic_vector(7 downto 0); signal I : std_logic_vector(7 downto 0); signal R : unsigned(7 downto 0); signal SP, PC : unsigned(15 downto 0); signal RegDIH : std_logic_vector(7 downto 0); signal RegDIL : std_logic_vector(7 downto 0); signal RegBusA : std_logic_vector(15 downto 0); signal RegBusB : std_logic_vector(15 downto 0); signal RegBusC : std_logic_vector(15 downto 0); signal RegAddrA_r : std_logic_vector(2 downto 0); signal RegAddrA : std_logic_vector(2 downto 0); signal RegAddrB_r : std_logic_vector(2 downto 0); signal RegAddrB : std_logic_vector(2 downto 0); signal RegAddrC : std_logic_vector(2 downto 0); signal RegWEH : std_logic; signal RegWEL : std_logic; signal Alternate : std_logic; -- Help Registers signal TmpAddr : std_logic_vector(15 downto 0); -- Temporary address register signal IR : std_logic_vector(7 downto 0); -- Instruction register signal ISet : std_logic_vector(1 downto 0); -- Instruction set selector signal RegBusA_r : std_logic_vector(15 downto 0); signal ID16 : signed(15 downto 0); signal Save_Mux : std_logic_vector(7 downto 0); signal TState : unsigned(2 downto 0); signal MCycle : std_logic_vector(2 downto 0); signal IntE_FF1 : std_logic; signal IntE_FF2 : std_logic; signal Halt_FF : std_logic; signal BusReq_s : std_logic; signal BusAck : std_logic; signal ClkEn : std_logic; signal NMI_s : std_logic; signal INT_s : std_logic; signal IStatus : std_logic_vector(1 downto 0); signal DI_Reg : std_logic_vector(7 downto 0); signal T_Res : std_logic; signal XY_State : std_logic_vector(1 downto 0); signal Pre_XY_F_M : std_logic_vector(2 downto 0); signal NextIs_XY_Fetch : std_logic; signal XY_Ind : std_logic; signal No_BTR : std_logic; signal BTR_r : std_logic; signal Auto_Wait : std_logic; signal Auto_Wait_t1 : std_logic; signal Auto_Wait_t2 : std_logic; signal IncDecZ : std_logic; -- ALU signals signal BusB : std_logic_vector(7 downto 0); signal BusA : std_logic_vector(7 downto 0); signal ALU_Q : std_logic_vector(7 downto 0); signal F_Out : std_logic_vector(7 downto 0); -- Registered micro code outputs signal Read_To_Reg_r : std_logic_vector(4 downto 0); signal Arith16_r : std_logic; signal Z16_r : std_logic; signal ALU_Op_r : std_logic_vector(3 downto 0); signal Save_ALU_r : std_logic; signal PreserveC_r : std_logic; signal MCycles : std_logic_vector(2 downto 0); -- Micro code outputs signal MCycles_d : std_logic_vector(2 downto 0); signal TStates : std_logic_vector(2 downto 0); signal IntCycle : std_logic; signal NMICycle : std_logic; signal Inc_PC : std_logic; signal Inc_WZ : std_logic; signal IncDec_16 : std_logic_vector(3 downto 0); signal Prefix : std_logic_vector(1 downto 0); signal Read_To_Acc : std_logic; signal Read_To_Reg : std_logic; signal Set_BusB_To : std_logic_vector(3 downto 0); signal Set_BusA_To : std_logic_vector(3 downto 0); signal ALU_Op : std_logic_vector(3 downto 0); signal Save_ALU : std_logic; signal PreserveC : std_logic; signal Arith16 : std_logic; signal Set_Addr_To : std_logic_vector(2 downto 0); signal Jump : std_logic; signal JumpE : std_logic; signal JumpXY : std_logic; signal Call : std_logic; signal RstP : std_logic; signal LDZ : std_logic; signal LDW : std_logic; signal LDSPHL : std_logic; signal IORQ_i : std_logic; signal Special_LD : std_logic_vector(2 downto 0); signal ExchangeDH : std_logic; signal ExchangeRp : std_logic; signal ExchangeAF : std_logic; signal ExchangeRS : std_logic; signal I_DJNZ : std_logic; signal I_CPL : std_logic; signal I_CCF : std_logic; signal I_SCF : std_logic; signal I_RETN : std_logic; signal I_BT : std_logic; signal I_BC : std_logic; signal I_BTR : std_logic; signal I_RLD : std_logic; signal I_RRD : std_logic; signal I_INRC : std_logic; signal SetDI : std_logic; signal SetEI : std_logic; signal IMode : std_logic_vector(1 downto 0); signal Halt : std_logic; begin mcode : T80_MCode generic map( Mode => Mode, Flag_C => Flag_C, Flag_N => Flag_N, Flag_P => Flag_P, Flag_X => Flag_X, Flag_H => Flag_H, Flag_Y => Flag_Y, Flag_Z => Flag_Z, Flag_S => Flag_S) port map( IR => IR, ISet => ISet, MCycle => MCycle, F => F, NMICycle => NMICycle, IntCycle => IntCycle, MCycles => MCycles_d, TStates => TStates, Prefix => Prefix, Inc_PC => Inc_PC, Inc_WZ => Inc_WZ, IncDec_16 => IncDec_16, Read_To_Acc => Read_To_Acc, Read_To_Reg => Read_To_Reg, Set_BusB_To => Set_BusB_To, Set_BusA_To => Set_BusA_To, ALU_Op => ALU_Op, Save_ALU => Save_ALU, PreserveC => PreserveC, Arith16 => Arith16, Set_Addr_To => Set_Addr_To, IORQ => IORQ_i, Jump => Jump, JumpE => JumpE, JumpXY => JumpXY, Call => Call, RstP => RstP, LDZ => LDZ, LDW => LDW, LDSPHL => LDSPHL, Special_LD => Special_LD, ExchangeDH => ExchangeDH, ExchangeRp => ExchangeRp, ExchangeAF => ExchangeAF, ExchangeRS => ExchangeRS, I_DJNZ => I_DJNZ, I_CPL => I_CPL, I_CCF => I_CCF, I_SCF => I_SCF, I_RETN => I_RETN, I_BT => I_BT, I_BC => I_BC, I_BTR => I_BTR, I_RLD => I_RLD, I_RRD => I_RRD, I_INRC => I_INRC, SetDI => SetDI, SetEI => SetEI, IMode => IMode, Halt => Halt, NoRead => NoRead, Write => Write); alu : T80_ALU generic map( Mode => Mode, Flag_C => Flag_C, Flag_N => Flag_N, Flag_P => Flag_P, Flag_X => Flag_X, Flag_H => Flag_H, Flag_Y => Flag_Y, Flag_Z => Flag_Z, Flag_S => Flag_S) port map( Arith16 => Arith16_r, Z16 => Z16_r, ALU_Op => ALU_Op_r, IR => IR(5 downto 0), ISet => ISet, BusA => BusA, BusB => BusB, F_In => F, Q => ALU_Q, F_Out => F_Out); ClkEn <= CEN and not BusAck; T_Res <= '1' when TState = unsigned(TStates) else '0'; NextIs_XY_Fetch <= '1' when XY_State /= "00" and XY_Ind = '0' and ((Set_Addr_To = aXY) or (MCycle = "001" and IR = "11001011") or (MCycle = "001" and IR = "00110110")) else '0'; Save_Mux <= BusB when ExchangeRp = '1' else DI_Reg when Save_ALU_r = '0' else ALU_Q; process (RESET_n, CLK_n) begin if RESET_n = '0' then PC <= (others => '0'); -- Program Counter A <= (others => '0'); TmpAddr <= (others => '0'); IR <= "00000000"; ISet <= "00"; XY_State <= "00"; IStatus <= "00"; MCycles <= "000"; DO <= "00000000"; ACC <= (others => '1'); F <= (others => '1'); Ap <= (others => '1'); Fp <= (others => '1'); I <= (others => '0'); R <= (others => '0'); SP <= (others => '1'); Alternate <= '0'; Read_To_Reg_r <= "00000"; F <= (others => '1'); Arith16_r <= '0'; BTR_r <= '0'; Z16_r <= '0'; ALU_Op_r <= "0000"; Save_ALU_r <= '0'; PreserveC_r <= '0'; XY_Ind <= '0'; elsif CLK_n'event and CLK_n = '1' then if ClkEn = '1' then ALU_Op_r <= "0000"; Save_ALU_r <= '0'; Read_To_Reg_r <= "00000"; MCycles <= MCycles_d; if IMode /= "11" then IStatus <= IMode; end if; Arith16_r <= Arith16; PreserveC_r <= PreserveC; if ISet = "10" and ALU_OP(2) = '0' and ALU_OP(0) = '1' and MCycle = "011" then Z16_r <= '1'; else Z16_r <= '0'; end if; if MCycle = "001" and TState(2) = '0' then -- MCycle = 1 and TState = 1, 2, or 3 if TState = 2 and Wait_n = '1' then if Mode < 2 then A(7 downto 0) <= std_logic_vector(R); A(15 downto 8) <= I; R(6 downto 0) <= R(6 downto 0) + 1; end if; if Jump = '0' and Call = '0' and NMICycle = '0' and IntCycle = '0' and not (Halt_FF = '1' or Halt = '1') then PC <= PC + 1; end if; if IntCycle = '1' and IStatus = "01" then IR <= "11111111"; elsif Halt_FF = '1' or (IntCycle = '1' and IStatus = "10") or NMICycle = '1' then IR <= "00000000"; else IR <= DInst; end if; ISet <= "00"; if Prefix /= "00" then if Prefix = "11" then if IR(5) = '1' then XY_State <= "10"; else XY_State <= "01"; end if; else if Prefix = "10" then XY_State <= "00"; XY_Ind <= '0'; end if; ISet <= Prefix; end if; else XY_State <= "00"; XY_Ind <= '0'; end if; end if; else -- either (MCycle > 1) OR (MCycle = 1 AND TState > 3) if MCycle = "110" then XY_Ind <= '1'; if Prefix = "01" then ISet <= "01"; end if; end if; if T_Res = '1' then BTR_r <= (I_BT or I_BC or I_BTR) and not No_BTR; if Jump = '1' then A(15 downto 8) <= DI_Reg; A(7 downto 0) <= TmpAddr(7 downto 0); PC(15 downto 8) <= unsigned(DI_Reg); PC(7 downto 0) <= unsigned(TmpAddr(7 downto 0)); elsif JumpXY = '1' then A <= RegBusC; PC <= unsigned(RegBusC); elsif Call = '1' or RstP = '1' then A <= TmpAddr; PC <= unsigned(TmpAddr); elsif MCycle = MCycles and NMICycle = '1' then A <= "0000000001100110"; PC <= "0000000001100110"; elsif MCycle = "011" and IntCycle = '1' and IStatus = "10" then A(15 downto 8) <= I; A(7 downto 0) <= TmpAddr(7 downto 0); PC(15 downto 8) <= unsigned(I); PC(7 downto 0) <= unsigned(TmpAddr(7 downto 0)); else case Set_Addr_To is when aXY => if XY_State = "00" then A <= RegBusC; else if NextIs_XY_Fetch = '1' then A <= std_logic_vector(PC); else A <= TmpAddr; end if; end if; when aIOA => if Mode = 3 then -- Memory map I/O on GBZ80 A(15 downto 8) <= (others => '1'); elsif Mode = 2 then -- Duplicate I/O address on 8080 A(15 downto 8) <= DI_Reg; else A(15 downto 8) <= ACC; end if; A(7 downto 0) <= DI_Reg; when aSP => A <= std_logic_vector(SP); when aBC => if Mode = 3 and IORQ_i = '1' then -- Memory map I/O on GBZ80 A(15 downto 8) <= (others => '1'); A(7 downto 0) <= RegBusC(7 downto 0); else A <= RegBusC; end if; when aDE => A <= RegBusC; when aZI => if Inc_WZ = '1' then A <= std_logic_vector(unsigned(TmpAddr) + 1); else A(15 downto 8) <= DI_Reg; A(7 downto 0) <= TmpAddr(7 downto 0); end if; when others => A <= std_logic_vector(PC); end case; end if; Save_ALU_r <= Save_ALU; ALU_Op_r <= ALU_Op; if I_CPL = '1' then -- CPL ACC <= not ACC; F(Flag_Y) <= not ACC(5); F(Flag_H) <= '1'; F(Flag_X) <= not ACC(3); F(Flag_N) <= '1'; end if; if I_CCF = '1' then -- CCF F(Flag_C) <= not F(Flag_C); F(Flag_Y) <= ACC(5); F(Flag_H) <= F(Flag_C); F(Flag_X) <= ACC(3); F(Flag_N) <= '0'; end if; if I_SCF = '1' then -- SCF F(Flag_C) <= '1'; F(Flag_Y) <= ACC(5); F(Flag_H) <= '0'; F(Flag_X) <= ACC(3); F(Flag_N) <= '0'; end if; end if; if TState = 2 and Wait_n = '1' then if ISet = "01" and MCycle = "111" then IR <= DInst; end if; if JumpE = '1' then PC <= unsigned(signed(PC) + signed(DI_Reg)); elsif Inc_PC = '1' then PC <= PC + 1; end if; if BTR_r = '1' then PC <= PC - 2; end if; if RstP = '1' then TmpAddr <= (others =>'0'); TmpAddr(5 downto 3) <= IR(5 downto 3); end if; end if; if TState = 3 and MCycle = "110" then TmpAddr <= std_logic_vector(signed(RegBusC) + signed(DI_Reg)); end if; if (TState = 2 and Wait_n = '1') or (TState = 4 and MCycle = "001") then if IncDec_16(2 downto 0) = "111" then if IncDec_16(3) = '1' then SP <= SP - 1; else SP <= SP + 1; end if; end if; end if; if LDSPHL = '1' then SP <= unsigned(RegBusC); end if; if ExchangeAF = '1' then Ap <= ACC; ACC <= Ap; Fp <= F; F <= Fp; end if; if ExchangeRS = '1' then Alternate <= not Alternate; end if; end if; if TState = 3 then if LDZ = '1' then TmpAddr(7 downto 0) <= DI_Reg; end if; if LDW = '1' then TmpAddr(15 downto 8) <= DI_Reg; end if; if Special_LD(2) = '1' then case Special_LD(1 downto 0) is when "00" => ACC <= I; F(Flag_P) <= IntE_FF2; when "01" => ACC <= std_logic_vector(R); F(Flag_P) <= IntE_FF2; when "10" => I <= ACC; when others => R <= unsigned(ACC); end case; end if; end if; if (I_DJNZ = '0' and Save_ALU_r = '1') or ALU_Op_r = "1001" then if Mode = 3 then F(6) <= F_Out(6); F(5) <= F_Out(5); F(7) <= F_Out(7); if PreserveC_r = '0' then F(4) <= F_Out(4); end if; else F(7 downto 1) <= F_Out(7 downto 1); if PreserveC_r = '0' then F(Flag_C) <= F_Out(0); end if; end if; end if; if T_Res = '1' and I_INRC = '1' then F(Flag_H) <= '0'; F(Flag_N) <= '0'; if DI_Reg(7 downto 0) = "00000000" then F(Flag_Z) <= '1'; else F(Flag_Z) <= '0'; end if; F(Flag_S) <= DI_Reg(7); F(Flag_P) <= not (DI_Reg(0) xor DI_Reg(1) xor DI_Reg(2) xor DI_Reg(3) xor DI_Reg(4) xor DI_Reg(5) xor DI_Reg(6) xor DI_Reg(7)); end if; if TState = 1 then DO <= BusB; if I_RLD = '1' then DO(3 downto 0) <= BusA(3 downto 0); DO(7 downto 4) <= BusB(3 downto 0); end if; if I_RRD = '1' then DO(3 downto 0) <= BusB(7 downto 4); DO(7 downto 4) <= BusA(3 downto 0); end if; end if; if T_Res = '1' then Read_To_Reg_r(3 downto 0) <= Set_BusA_To; Read_To_Reg_r(4) <= Read_To_Reg; if Read_To_Acc = '1' then Read_To_Reg_r(3 downto 0) <= "0111"; Read_To_Reg_r(4) <= '1'; end if; end if; if TState = 1 and I_BT = '1' then F(Flag_X) <= ALU_Q(3); F(Flag_Y) <= ALU_Q(1); F(Flag_H) <= '0'; F(Flag_N) <= '0'; end if; if I_BC = '1' or I_BT = '1' then F(Flag_P) <= IncDecZ; end if; if (TState = 1 and Save_ALU_r = '0') or (Save_ALU_r = '1' and ALU_OP_r /= "0111") then case Read_To_Reg_r is when "10111" => ACC <= Save_Mux; when "10110" => DO <= Save_Mux; when "11000" => SP(7 downto 0) <= unsigned(Save_Mux); when "11001" => SP(15 downto 8) <= unsigned(Save_Mux); when "11011" => F <= Save_Mux; when others => end case; end if; end if; end if; end process; --------------------------------------------------------------------------- -- -- BC('), DE('), HL('), IX and IY -- --------------------------------------------------------------------------- process (CLK_n) begin if CLK_n'event and CLK_n = '1' then if ClkEn = '1' then -- Bus A / Write RegAddrA_r <= Alternate & Set_BusA_To(2 downto 1); if XY_Ind = '0' and XY_State /= "00" and Set_BusA_To(2 downto 1) = "10" then RegAddrA_r <= XY_State(1) & "11"; end if; -- Bus B RegAddrB_r <= Alternate & Set_BusB_To(2 downto 1); if XY_Ind = '0' and XY_State /= "00" and Set_BusB_To(2 downto 1) = "10" then RegAddrB_r <= XY_State(1) & "11"; end if; -- Address from register RegAddrC <= Alternate & Set_Addr_To(1 downto 0); -- Jump (HL), LD SP,HL if (JumpXY = '1' or LDSPHL = '1') then RegAddrC <= Alternate & "10"; end if; if ((JumpXY = '1' or LDSPHL = '1') and XY_State /= "00") or (MCycle = "110") then RegAddrC <= XY_State(1) & "11"; end if; if I_DJNZ = '1' and Save_ALU_r = '1' and Mode < 2 then IncDecZ <= F_Out(Flag_Z); end if; if (TState = 2 or (TState = 3 and MCycle = "001")) and IncDec_16(2 downto 0) = "100" then if ID16 = 0 then IncDecZ <= '0'; else IncDecZ <= '1'; end if; end if; RegBusA_r <= RegBusA; end if; end if; end process; RegAddrA <= -- 16 bit increment/decrement Alternate & IncDec_16(1 downto 0) when (TState = 2 or (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and XY_State = "00" else XY_State(1) & "11" when (TState = 2 or (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and IncDec_16(1 downto 0) = "10" else -- EX HL,DL Alternate & "10" when ExchangeDH = '1' and TState = 3 else Alternate & "01" when ExchangeDH = '1' and TState = 4 else -- Bus A / Write RegAddrA_r; RegAddrB <= -- EX HL,DL Alternate & "01" when ExchangeDH = '1' and TState = 3 else -- Bus B RegAddrB_r; ID16 <= signed(RegBusA) - 1 when IncDec_16(3) = '1' else signed(RegBusA) + 1; process (Save_ALU_r, Auto_Wait_t1, ALU_OP_r, Read_To_Reg_r, ExchangeDH, IncDec_16, MCycle, TState, Wait_n) begin RegWEH <= '0'; RegWEL <= '0'; if (TState = 1 and Save_ALU_r = '0') or (Save_ALU_r = '1' and ALU_OP_r /= "0111") then case Read_To_Reg_r is when "10000" | "10001" | "10010" | "10011" | "10100" | "10101" => RegWEH <= not Read_To_Reg_r(0); RegWEL <= Read_To_Reg_r(0); when others => end case; end if; if ExchangeDH = '1' and (TState = 3 or TState = 4) then RegWEH <= '1'; RegWEL <= '1'; end if; if IncDec_16(2) = '1' and ((TState = 2 and Wait_n = '1' and MCycle /= "001") or (TState = 3 and MCycle = "001")) then case IncDec_16(1 downto 0) is when "00" | "01" | "10" => RegWEH <= '1'; RegWEL <= '1'; when others => end case; end if; end process; process (Save_Mux, RegBusB, RegBusA_r, ID16, ExchangeDH, IncDec_16, MCycle, TState, Wait_n) begin RegDIH <= Save_Mux; RegDIL <= Save_Mux; if ExchangeDH = '1' and TState = 3 then RegDIH <= RegBusB(15 downto 8); RegDIL <= RegBusB(7 downto 0); end if; if ExchangeDH = '1' and TState = 4 then RegDIH <= RegBusA_r(15 downto 8); RegDIL <= RegBusA_r(7 downto 0); end if; if IncDec_16(2) = '1' and ((TState = 2 and MCycle /= "001") or (TState = 3 and MCycle = "001")) then RegDIH <= std_logic_vector(ID16(15 downto 8)); RegDIL <= std_logic_vector(ID16(7 downto 0)); end if; end process; Regs : T80_Reg port map( Clk => CLK_n, CEN => ClkEn, WEH => RegWEH, WEL => RegWEL, AddrA => RegAddrA, AddrB => RegAddrB, AddrC => RegAddrC, DIH => RegDIH, DIL => RegDIL, DOAH => RegBusA(15 downto 8), DOAL => RegBusA(7 downto 0), DOBH => RegBusB(15 downto 8), DOBL => RegBusB(7 downto 0), DOCH => RegBusC(15 downto 8), DOCL => RegBusC(7 downto 0)); --------------------------------------------------------------------------- -- -- Buses -- --------------------------------------------------------------------------- process (CLK_n) begin if CLK_n'event and CLK_n = '1' then if ClkEn = '1' then case Set_BusB_To is when "0111" => BusB <= ACC; when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" => if Set_BusB_To(0) = '1' then BusB <= RegBusB(7 downto 0); else BusB <= RegBusB(15 downto 8); end if; when "0110" => BusB <= DI_Reg; when "1000" => BusB <= std_logic_vector(SP(7 downto 0)); when "1001" => BusB <= std_logic_vector(SP(15 downto 8)); when "1010" => BusB <= "00000001"; when "1011" => BusB <= F; when "1100" => BusB <= std_logic_vector(PC(7 downto 0)); when "1101" => BusB <= std_logic_vector(PC(15 downto 8)); when "1110" => BusB <= "00000000"; when others => BusB <= "--------"; end case; case Set_BusA_To is when "0111" => BusA <= ACC; when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" => if Set_BusA_To(0) = '1' then BusA <= RegBusA(7 downto 0); else BusA <= RegBusA(15 downto 8); end if; when "0110" => BusA <= DI_Reg; when "1000" => BusA <= std_logic_vector(SP(7 downto 0)); when "1001" => BusA <= std_logic_vector(SP(15 downto 8)); when "1010" => BusA <= "00000000"; when others => BusB <= "--------"; end case; end if; end if; end process; --------------------------------------------------------------------------- -- -- Generate external control signals -- --------------------------------------------------------------------------- process (RESET_n,CLK_n) begin if RESET_n = '0' then RFSH_n <= '1'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then if MCycle = "001" and ((TState = 2 and Wait_n = '1') or TState = 3) then RFSH_n <= '0'; else RFSH_n <= '1'; end if; end if; end if; end process; MC <= std_logic_vector(MCycle); TS <= std_logic_vector(TState); DI_Reg <= DI; HALT_n <= not Halt_FF; BUSAK_n <= not BusAck; IntCycle_n <= not IntCycle; IntE <= IntE_FF1; IORQ <= IORQ_i; Stop <= I_DJNZ; ------------------------------------------------------------------------- -- -- Syncronise inputs -- ------------------------------------------------------------------------- process (RESET_n, CLK_n) variable OldNMI_n : std_logic; begin if RESET_n = '0' then BusReq_s <= '0'; INT_s <= '0'; NMI_s <= '0'; OldNMI_n := '0'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then BusReq_s <= not BUSRQ_n; INT_s <= not INT_n; if NMICycle = '1' then NMI_s <= '0'; elsif NMI_n = '0' and OldNMI_n = '1' then NMI_s <= '1'; end if; OldNMI_n := NMI_n; end if; end if; end process; ------------------------------------------------------------------------- -- -- Main state machine -- ------------------------------------------------------------------------- process (RESET_n, CLK_n) begin if RESET_n = '0' then MCycle <= "001"; TState <= "000"; Pre_XY_F_M <= "000"; Halt_FF <= '0'; BusAck <= '0'; NMICycle <= '0'; IntCycle <= '0'; IntE_FF1 <= '0'; IntE_FF2 <= '0'; No_BTR <= '0'; Auto_Wait_t1 <= '0'; Auto_Wait_t2 <= '0'; M1_n <= '1'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then Auto_Wait_t1 <= Auto_Wait; Auto_Wait_t2 <= Auto_Wait_t1; No_BTR <= (I_BT and (not IR(4) or not F(Flag_P))) or (I_BC and (not IR(4) or F(Flag_Z) or not F(Flag_P))) or (I_BTR and (not IR(4) or F(Flag_Z))); if TState = 2 then if SetEI = '1' then IntE_FF1 <= '1'; IntE_FF2 <= '1'; end if; if I_RETN = '1' then IntE_FF1 <= IntE_FF2; end if; end if; if TState = 3 then if SetDI = '1' then IntE_FF1 <= '0'; IntE_FF2 <= '0'; end if; end if; if IntCycle = '1' or NMICycle = '1' then Halt_FF <= '0'; end if; if MCycle = "001" and TState = 2 and Wait_n = '1' then M1_n <= '1'; end if; if BusReq_s = '1' and BusAck = '1' then else BusAck <= '0'; if TState = 2 and Wait_n = '0' then elsif T_Res = '1' then if Halt = '1' then Halt_FF <= '1'; end if; if BusReq_s = '1' then BusAck <= '1'; else TState <= "001"; if NextIs_XY_Fetch = '1' then MCycle <= "110"; Pre_XY_F_M <= MCycle; if IR = "00110110" and Mode = 0 then Pre_XY_F_M <= "010"; end if; elsif (MCycle = "111") or (MCycle = "110" and Mode = 1 and ISet /= "01") then MCycle <= std_logic_vector(unsigned(Pre_XY_F_M) + 1); elsif (MCycle = MCycles) or No_BTR = '1' or (MCycle = "010" and I_DJNZ = '1' and IncDecZ = '1') then M1_n <= '0'; MCycle <= "001"; IntCycle <= '0'; NMICycle <= '0'; if NMI_s = '1' and Prefix = "00" then NMICycle <= '1'; IntE_FF1 <= '0'; elsif (IntE_FF1 = '1' and INT_s = '1') and Prefix = "00" and SetEI = '0' then IntCycle <= '1'; IntE_FF1 <= '0'; IntE_FF2 <= '0'; end if; else MCycle <= std_logic_vector(unsigned(MCycle) + 1); end if; end if; else if Auto_Wait = '1' nand Auto_Wait_t2 = '0' then TState <= TState + 1; end if; end if; end if; if TState = 0 then M1_n <= '0'; end if; end if; end if; end process; process (IntCycle, NMICycle, MCycle) begin Auto_Wait <= '0'; if IntCycle = '1' or NMICycle = '1' then if MCycle = "001" then Auto_Wait <= '1'; end if; end if; end process; end;
-- **** -- T80(b) core. In an effort to merge and maintain bug fixes .... -- -- -- Ver 300 started tidyup. Rmoved some auto_wait bits from 0247 which caused problems -- -- MikeJ March 2005 -- Latest version from www.fpgaarcade.com (original www.opencores.org) -- -- **** -- -- Z80 compatible microprocessor core -- -- Version : 0247 -- -- Copyright (c) 2001-2002 Daniel Wallner ([email protected]) -- -- All rights reserved -- -- Redistribution and use in source and synthezised forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- -- Redistributions in synthesized form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- Neither the name of the author nor the names of other contributors may -- be used to endorse or promote products derived from this software without -- specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. -- -- Please report bugs to the author, but before you do so, please -- make sure that this is not a derivative work and that -- you have the latest version of this file. -- -- The latest version of this file can be found at: -- http://www.opencores.org/cvsweb.shtml/t80/ -- -- Limitations : -- -- File history : -- -- 0208 : First complete release -- -- 0210 : Fixed wait and halt -- -- 0211 : Fixed Refresh addition and IM 1 -- -- 0214 : Fixed mostly flags, only the block instructions now fail the zex regression test -- -- 0232 : Removed refresh address output for Mode > 1 and added DJNZ M1_n fix by Mike Johnson -- -- 0235 : Added clock enable and IM 2 fix by Mike Johnson -- -- 0237 : Changed 8080 I/O address output, added IntE output -- -- 0238 : Fixed (IX/IY+d) timing and 16 bit ADC and SBC zero flag -- -- 0240 : Added interrupt ack fix by Mike Johnson, changed (IX/IY+d) timing and changed flags in GB mode -- -- 0242 : Added I/O wait, fixed refresh address, moved some registers to RAM -- -- 0247 : Fixed bus req/ack cycle -- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; use work.T80_Pack.all; entity T80 is generic( Mode : integer := 0; -- 0 => Z80, 1 => Fast Z80, 2 => 8080, 3 => GB IOWait : integer := 0; -- 1 => Single cycle I/O, 1 => Std I/O cycle Flag_C : integer := 0; Flag_N : integer := 1; Flag_P : integer := 2; Flag_X : integer := 3; Flag_H : integer := 4; Flag_Y : integer := 5; Flag_Z : integer := 6; Flag_S : integer := 7 ); port( RESET_n : in std_logic; CLK_n : in std_logic; CEN : in std_logic; WAIT_n : in std_logic; INT_n : in std_logic; NMI_n : in std_logic; BUSRQ_n : in std_logic; M1_n : out std_logic; IORQ : out std_logic; NoRead : out std_logic; Write : out std_logic; RFSH_n : out std_logic; HALT_n : out std_logic; BUSAK_n : out std_logic; A : out std_logic_vector(15 downto 0); DInst : in std_logic_vector(7 downto 0); DI : in std_logic_vector(7 downto 0); DO : out std_logic_vector(7 downto 0); MC : out std_logic_vector(2 downto 0); TS : out std_logic_vector(2 downto 0); IntCycle_n : out std_logic; IntE : out std_logic; Stop : out std_logic ); end T80; architecture rtl of T80 is constant aNone : std_logic_vector(2 downto 0) := "111"; constant aBC : std_logic_vector(2 downto 0) := "000"; constant aDE : std_logic_vector(2 downto 0) := "001"; constant aXY : std_logic_vector(2 downto 0) := "010"; constant aIOA : std_logic_vector(2 downto 0) := "100"; constant aSP : std_logic_vector(2 downto 0) := "101"; constant aZI : std_logic_vector(2 downto 0) := "110"; -- Registers signal ACC, F : std_logic_vector(7 downto 0); signal Ap, Fp : std_logic_vector(7 downto 0); signal I : std_logic_vector(7 downto 0); signal R : unsigned(7 downto 0); signal SP, PC : unsigned(15 downto 0); signal RegDIH : std_logic_vector(7 downto 0); signal RegDIL : std_logic_vector(7 downto 0); signal RegBusA : std_logic_vector(15 downto 0); signal RegBusB : std_logic_vector(15 downto 0); signal RegBusC : std_logic_vector(15 downto 0); signal RegAddrA_r : std_logic_vector(2 downto 0); signal RegAddrA : std_logic_vector(2 downto 0); signal RegAddrB_r : std_logic_vector(2 downto 0); signal RegAddrB : std_logic_vector(2 downto 0); signal RegAddrC : std_logic_vector(2 downto 0); signal RegWEH : std_logic; signal RegWEL : std_logic; signal Alternate : std_logic; -- Help Registers signal TmpAddr : std_logic_vector(15 downto 0); -- Temporary address register signal IR : std_logic_vector(7 downto 0); -- Instruction register signal ISet : std_logic_vector(1 downto 0); -- Instruction set selector signal RegBusA_r : std_logic_vector(15 downto 0); signal ID16 : signed(15 downto 0); signal Save_Mux : std_logic_vector(7 downto 0); signal TState : unsigned(2 downto 0); signal MCycle : std_logic_vector(2 downto 0); signal IntE_FF1 : std_logic; signal IntE_FF2 : std_logic; signal Halt_FF : std_logic; signal BusReq_s : std_logic; signal BusAck : std_logic; signal ClkEn : std_logic; signal NMI_s : std_logic; signal INT_s : std_logic; signal IStatus : std_logic_vector(1 downto 0); signal DI_Reg : std_logic_vector(7 downto 0); signal T_Res : std_logic; signal XY_State : std_logic_vector(1 downto 0); signal Pre_XY_F_M : std_logic_vector(2 downto 0); signal NextIs_XY_Fetch : std_logic; signal XY_Ind : std_logic; signal No_BTR : std_logic; signal BTR_r : std_logic; signal Auto_Wait : std_logic; signal Auto_Wait_t1 : std_logic; signal Auto_Wait_t2 : std_logic; signal IncDecZ : std_logic; -- ALU signals signal BusB : std_logic_vector(7 downto 0); signal BusA : std_logic_vector(7 downto 0); signal ALU_Q : std_logic_vector(7 downto 0); signal F_Out : std_logic_vector(7 downto 0); -- Registered micro code outputs signal Read_To_Reg_r : std_logic_vector(4 downto 0); signal Arith16_r : std_logic; signal Z16_r : std_logic; signal ALU_Op_r : std_logic_vector(3 downto 0); signal Save_ALU_r : std_logic; signal PreserveC_r : std_logic; signal MCycles : std_logic_vector(2 downto 0); -- Micro code outputs signal MCycles_d : std_logic_vector(2 downto 0); signal TStates : std_logic_vector(2 downto 0); signal IntCycle : std_logic; signal NMICycle : std_logic; signal Inc_PC : std_logic; signal Inc_WZ : std_logic; signal IncDec_16 : std_logic_vector(3 downto 0); signal Prefix : std_logic_vector(1 downto 0); signal Read_To_Acc : std_logic; signal Read_To_Reg : std_logic; signal Set_BusB_To : std_logic_vector(3 downto 0); signal Set_BusA_To : std_logic_vector(3 downto 0); signal ALU_Op : std_logic_vector(3 downto 0); signal Save_ALU : std_logic; signal PreserveC : std_logic; signal Arith16 : std_logic; signal Set_Addr_To : std_logic_vector(2 downto 0); signal Jump : std_logic; signal JumpE : std_logic; signal JumpXY : std_logic; signal Call : std_logic; signal RstP : std_logic; signal LDZ : std_logic; signal LDW : std_logic; signal LDSPHL : std_logic; signal IORQ_i : std_logic; signal Special_LD : std_logic_vector(2 downto 0); signal ExchangeDH : std_logic; signal ExchangeRp : std_logic; signal ExchangeAF : std_logic; signal ExchangeRS : std_logic; signal I_DJNZ : std_logic; signal I_CPL : std_logic; signal I_CCF : std_logic; signal I_SCF : std_logic; signal I_RETN : std_logic; signal I_BT : std_logic; signal I_BC : std_logic; signal I_BTR : std_logic; signal I_RLD : std_logic; signal I_RRD : std_logic; signal I_INRC : std_logic; signal SetDI : std_logic; signal SetEI : std_logic; signal IMode : std_logic_vector(1 downto 0); signal Halt : std_logic; begin mcode : T80_MCode generic map( Mode => Mode, Flag_C => Flag_C, Flag_N => Flag_N, Flag_P => Flag_P, Flag_X => Flag_X, Flag_H => Flag_H, Flag_Y => Flag_Y, Flag_Z => Flag_Z, Flag_S => Flag_S) port map( IR => IR, ISet => ISet, MCycle => MCycle, F => F, NMICycle => NMICycle, IntCycle => IntCycle, MCycles => MCycles_d, TStates => TStates, Prefix => Prefix, Inc_PC => Inc_PC, Inc_WZ => Inc_WZ, IncDec_16 => IncDec_16, Read_To_Acc => Read_To_Acc, Read_To_Reg => Read_To_Reg, Set_BusB_To => Set_BusB_To, Set_BusA_To => Set_BusA_To, ALU_Op => ALU_Op, Save_ALU => Save_ALU, PreserveC => PreserveC, Arith16 => Arith16, Set_Addr_To => Set_Addr_To, IORQ => IORQ_i, Jump => Jump, JumpE => JumpE, JumpXY => JumpXY, Call => Call, RstP => RstP, LDZ => LDZ, LDW => LDW, LDSPHL => LDSPHL, Special_LD => Special_LD, ExchangeDH => ExchangeDH, ExchangeRp => ExchangeRp, ExchangeAF => ExchangeAF, ExchangeRS => ExchangeRS, I_DJNZ => I_DJNZ, I_CPL => I_CPL, I_CCF => I_CCF, I_SCF => I_SCF, I_RETN => I_RETN, I_BT => I_BT, I_BC => I_BC, I_BTR => I_BTR, I_RLD => I_RLD, I_RRD => I_RRD, I_INRC => I_INRC, SetDI => SetDI, SetEI => SetEI, IMode => IMode, Halt => Halt, NoRead => NoRead, Write => Write); alu : T80_ALU generic map( Mode => Mode, Flag_C => Flag_C, Flag_N => Flag_N, Flag_P => Flag_P, Flag_X => Flag_X, Flag_H => Flag_H, Flag_Y => Flag_Y, Flag_Z => Flag_Z, Flag_S => Flag_S) port map( Arith16 => Arith16_r, Z16 => Z16_r, ALU_Op => ALU_Op_r, IR => IR(5 downto 0), ISet => ISet, BusA => BusA, BusB => BusB, F_In => F, Q => ALU_Q, F_Out => F_Out); ClkEn <= CEN and not BusAck; T_Res <= '1' when TState = unsigned(TStates) else '0'; NextIs_XY_Fetch <= '1' when XY_State /= "00" and XY_Ind = '0' and ((Set_Addr_To = aXY) or (MCycle = "001" and IR = "11001011") or (MCycle = "001" and IR = "00110110")) else '0'; Save_Mux <= BusB when ExchangeRp = '1' else DI_Reg when Save_ALU_r = '0' else ALU_Q; process (RESET_n, CLK_n) begin if RESET_n = '0' then PC <= (others => '0'); -- Program Counter A <= (others => '0'); TmpAddr <= (others => '0'); IR <= "00000000"; ISet <= "00"; XY_State <= "00"; IStatus <= "00"; MCycles <= "000"; DO <= "00000000"; ACC <= (others => '1'); F <= (others => '1'); Ap <= (others => '1'); Fp <= (others => '1'); I <= (others => '0'); R <= (others => '0'); SP <= (others => '1'); Alternate <= '0'; Read_To_Reg_r <= "00000"; F <= (others => '1'); Arith16_r <= '0'; BTR_r <= '0'; Z16_r <= '0'; ALU_Op_r <= "0000"; Save_ALU_r <= '0'; PreserveC_r <= '0'; XY_Ind <= '0'; elsif CLK_n'event and CLK_n = '1' then if ClkEn = '1' then ALU_Op_r <= "0000"; Save_ALU_r <= '0'; Read_To_Reg_r <= "00000"; MCycles <= MCycles_d; if IMode /= "11" then IStatus <= IMode; end if; Arith16_r <= Arith16; PreserveC_r <= PreserveC; if ISet = "10" and ALU_OP(2) = '0' and ALU_OP(0) = '1' and MCycle = "011" then Z16_r <= '1'; else Z16_r <= '0'; end if; if MCycle = "001" and TState(2) = '0' then -- MCycle = 1 and TState = 1, 2, or 3 if TState = 2 and Wait_n = '1' then if Mode < 2 then A(7 downto 0) <= std_logic_vector(R); A(15 downto 8) <= I; R(6 downto 0) <= R(6 downto 0) + 1; end if; if Jump = '0' and Call = '0' and NMICycle = '0' and IntCycle = '0' and not (Halt_FF = '1' or Halt = '1') then PC <= PC + 1; end if; if IntCycle = '1' and IStatus = "01" then IR <= "11111111"; elsif Halt_FF = '1' or (IntCycle = '1' and IStatus = "10") or NMICycle = '1' then IR <= "00000000"; else IR <= DInst; end if; ISet <= "00"; if Prefix /= "00" then if Prefix = "11" then if IR(5) = '1' then XY_State <= "10"; else XY_State <= "01"; end if; else if Prefix = "10" then XY_State <= "00"; XY_Ind <= '0'; end if; ISet <= Prefix; end if; else XY_State <= "00"; XY_Ind <= '0'; end if; end if; else -- either (MCycle > 1) OR (MCycle = 1 AND TState > 3) if MCycle = "110" then XY_Ind <= '1'; if Prefix = "01" then ISet <= "01"; end if; end if; if T_Res = '1' then BTR_r <= (I_BT or I_BC or I_BTR) and not No_BTR; if Jump = '1' then A(15 downto 8) <= DI_Reg; A(7 downto 0) <= TmpAddr(7 downto 0); PC(15 downto 8) <= unsigned(DI_Reg); PC(7 downto 0) <= unsigned(TmpAddr(7 downto 0)); elsif JumpXY = '1' then A <= RegBusC; PC <= unsigned(RegBusC); elsif Call = '1' or RstP = '1' then A <= TmpAddr; PC <= unsigned(TmpAddr); elsif MCycle = MCycles and NMICycle = '1' then A <= "0000000001100110"; PC <= "0000000001100110"; elsif MCycle = "011" and IntCycle = '1' and IStatus = "10" then A(15 downto 8) <= I; A(7 downto 0) <= TmpAddr(7 downto 0); PC(15 downto 8) <= unsigned(I); PC(7 downto 0) <= unsigned(TmpAddr(7 downto 0)); else case Set_Addr_To is when aXY => if XY_State = "00" then A <= RegBusC; else if NextIs_XY_Fetch = '1' then A <= std_logic_vector(PC); else A <= TmpAddr; end if; end if; when aIOA => if Mode = 3 then -- Memory map I/O on GBZ80 A(15 downto 8) <= (others => '1'); elsif Mode = 2 then -- Duplicate I/O address on 8080 A(15 downto 8) <= DI_Reg; else A(15 downto 8) <= ACC; end if; A(7 downto 0) <= DI_Reg; when aSP => A <= std_logic_vector(SP); when aBC => if Mode = 3 and IORQ_i = '1' then -- Memory map I/O on GBZ80 A(15 downto 8) <= (others => '1'); A(7 downto 0) <= RegBusC(7 downto 0); else A <= RegBusC; end if; when aDE => A <= RegBusC; when aZI => if Inc_WZ = '1' then A <= std_logic_vector(unsigned(TmpAddr) + 1); else A(15 downto 8) <= DI_Reg; A(7 downto 0) <= TmpAddr(7 downto 0); end if; when others => A <= std_logic_vector(PC); end case; end if; Save_ALU_r <= Save_ALU; ALU_Op_r <= ALU_Op; if I_CPL = '1' then -- CPL ACC <= not ACC; F(Flag_Y) <= not ACC(5); F(Flag_H) <= '1'; F(Flag_X) <= not ACC(3); F(Flag_N) <= '1'; end if; if I_CCF = '1' then -- CCF F(Flag_C) <= not F(Flag_C); F(Flag_Y) <= ACC(5); F(Flag_H) <= F(Flag_C); F(Flag_X) <= ACC(3); F(Flag_N) <= '0'; end if; if I_SCF = '1' then -- SCF F(Flag_C) <= '1'; F(Flag_Y) <= ACC(5); F(Flag_H) <= '0'; F(Flag_X) <= ACC(3); F(Flag_N) <= '0'; end if; end if; if TState = 2 and Wait_n = '1' then if ISet = "01" and MCycle = "111" then IR <= DInst; end if; if JumpE = '1' then PC <= unsigned(signed(PC) + signed(DI_Reg)); elsif Inc_PC = '1' then PC <= PC + 1; end if; if BTR_r = '1' then PC <= PC - 2; end if; if RstP = '1' then TmpAddr <= (others =>'0'); TmpAddr(5 downto 3) <= IR(5 downto 3); end if; end if; if TState = 3 and MCycle = "110" then TmpAddr <= std_logic_vector(signed(RegBusC) + signed(DI_Reg)); end if; if (TState = 2 and Wait_n = '1') or (TState = 4 and MCycle = "001") then if IncDec_16(2 downto 0) = "111" then if IncDec_16(3) = '1' then SP <= SP - 1; else SP <= SP + 1; end if; end if; end if; if LDSPHL = '1' then SP <= unsigned(RegBusC); end if; if ExchangeAF = '1' then Ap <= ACC; ACC <= Ap; Fp <= F; F <= Fp; end if; if ExchangeRS = '1' then Alternate <= not Alternate; end if; end if; if TState = 3 then if LDZ = '1' then TmpAddr(7 downto 0) <= DI_Reg; end if; if LDW = '1' then TmpAddr(15 downto 8) <= DI_Reg; end if; if Special_LD(2) = '1' then case Special_LD(1 downto 0) is when "00" => ACC <= I; F(Flag_P) <= IntE_FF2; when "01" => ACC <= std_logic_vector(R); F(Flag_P) <= IntE_FF2; when "10" => I <= ACC; when others => R <= unsigned(ACC); end case; end if; end if; if (I_DJNZ = '0' and Save_ALU_r = '1') or ALU_Op_r = "1001" then if Mode = 3 then F(6) <= F_Out(6); F(5) <= F_Out(5); F(7) <= F_Out(7); if PreserveC_r = '0' then F(4) <= F_Out(4); end if; else F(7 downto 1) <= F_Out(7 downto 1); if PreserveC_r = '0' then F(Flag_C) <= F_Out(0); end if; end if; end if; if T_Res = '1' and I_INRC = '1' then F(Flag_H) <= '0'; F(Flag_N) <= '0'; if DI_Reg(7 downto 0) = "00000000" then F(Flag_Z) <= '1'; else F(Flag_Z) <= '0'; end if; F(Flag_S) <= DI_Reg(7); F(Flag_P) <= not (DI_Reg(0) xor DI_Reg(1) xor DI_Reg(2) xor DI_Reg(3) xor DI_Reg(4) xor DI_Reg(5) xor DI_Reg(6) xor DI_Reg(7)); end if; if TState = 1 then DO <= BusB; if I_RLD = '1' then DO(3 downto 0) <= BusA(3 downto 0); DO(7 downto 4) <= BusB(3 downto 0); end if; if I_RRD = '1' then DO(3 downto 0) <= BusB(7 downto 4); DO(7 downto 4) <= BusA(3 downto 0); end if; end if; if T_Res = '1' then Read_To_Reg_r(3 downto 0) <= Set_BusA_To; Read_To_Reg_r(4) <= Read_To_Reg; if Read_To_Acc = '1' then Read_To_Reg_r(3 downto 0) <= "0111"; Read_To_Reg_r(4) <= '1'; end if; end if; if TState = 1 and I_BT = '1' then F(Flag_X) <= ALU_Q(3); F(Flag_Y) <= ALU_Q(1); F(Flag_H) <= '0'; F(Flag_N) <= '0'; end if; if I_BC = '1' or I_BT = '1' then F(Flag_P) <= IncDecZ; end if; if (TState = 1 and Save_ALU_r = '0') or (Save_ALU_r = '1' and ALU_OP_r /= "0111") then case Read_To_Reg_r is when "10111" => ACC <= Save_Mux; when "10110" => DO <= Save_Mux; when "11000" => SP(7 downto 0) <= unsigned(Save_Mux); when "11001" => SP(15 downto 8) <= unsigned(Save_Mux); when "11011" => F <= Save_Mux; when others => end case; end if; end if; end if; end process; --------------------------------------------------------------------------- -- -- BC('), DE('), HL('), IX and IY -- --------------------------------------------------------------------------- process (CLK_n) begin if CLK_n'event and CLK_n = '1' then if ClkEn = '1' then -- Bus A / Write RegAddrA_r <= Alternate & Set_BusA_To(2 downto 1); if XY_Ind = '0' and XY_State /= "00" and Set_BusA_To(2 downto 1) = "10" then RegAddrA_r <= XY_State(1) & "11"; end if; -- Bus B RegAddrB_r <= Alternate & Set_BusB_To(2 downto 1); if XY_Ind = '0' and XY_State /= "00" and Set_BusB_To(2 downto 1) = "10" then RegAddrB_r <= XY_State(1) & "11"; end if; -- Address from register RegAddrC <= Alternate & Set_Addr_To(1 downto 0); -- Jump (HL), LD SP,HL if (JumpXY = '1' or LDSPHL = '1') then RegAddrC <= Alternate & "10"; end if; if ((JumpXY = '1' or LDSPHL = '1') and XY_State /= "00") or (MCycle = "110") then RegAddrC <= XY_State(1) & "11"; end if; if I_DJNZ = '1' and Save_ALU_r = '1' and Mode < 2 then IncDecZ <= F_Out(Flag_Z); end if; if (TState = 2 or (TState = 3 and MCycle = "001")) and IncDec_16(2 downto 0) = "100" then if ID16 = 0 then IncDecZ <= '0'; else IncDecZ <= '1'; end if; end if; RegBusA_r <= RegBusA; end if; end if; end process; RegAddrA <= -- 16 bit increment/decrement Alternate & IncDec_16(1 downto 0) when (TState = 2 or (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and XY_State = "00" else XY_State(1) & "11" when (TState = 2 or (TState = 3 and MCycle = "001" and IncDec_16(2) = '1')) and IncDec_16(1 downto 0) = "10" else -- EX HL,DL Alternate & "10" when ExchangeDH = '1' and TState = 3 else Alternate & "01" when ExchangeDH = '1' and TState = 4 else -- Bus A / Write RegAddrA_r; RegAddrB <= -- EX HL,DL Alternate & "01" when ExchangeDH = '1' and TState = 3 else -- Bus B RegAddrB_r; ID16 <= signed(RegBusA) - 1 when IncDec_16(3) = '1' else signed(RegBusA) + 1; process (Save_ALU_r, Auto_Wait_t1, ALU_OP_r, Read_To_Reg_r, ExchangeDH, IncDec_16, MCycle, TState, Wait_n) begin RegWEH <= '0'; RegWEL <= '0'; if (TState = 1 and Save_ALU_r = '0') or (Save_ALU_r = '1' and ALU_OP_r /= "0111") then case Read_To_Reg_r is when "10000" | "10001" | "10010" | "10011" | "10100" | "10101" => RegWEH <= not Read_To_Reg_r(0); RegWEL <= Read_To_Reg_r(0); when others => end case; end if; if ExchangeDH = '1' and (TState = 3 or TState = 4) then RegWEH <= '1'; RegWEL <= '1'; end if; if IncDec_16(2) = '1' and ((TState = 2 and Wait_n = '1' and MCycle /= "001") or (TState = 3 and MCycle = "001")) then case IncDec_16(1 downto 0) is when "00" | "01" | "10" => RegWEH <= '1'; RegWEL <= '1'; when others => end case; end if; end process; process (Save_Mux, RegBusB, RegBusA_r, ID16, ExchangeDH, IncDec_16, MCycle, TState, Wait_n) begin RegDIH <= Save_Mux; RegDIL <= Save_Mux; if ExchangeDH = '1' and TState = 3 then RegDIH <= RegBusB(15 downto 8); RegDIL <= RegBusB(7 downto 0); end if; if ExchangeDH = '1' and TState = 4 then RegDIH <= RegBusA_r(15 downto 8); RegDIL <= RegBusA_r(7 downto 0); end if; if IncDec_16(2) = '1' and ((TState = 2 and MCycle /= "001") or (TState = 3 and MCycle = "001")) then RegDIH <= std_logic_vector(ID16(15 downto 8)); RegDIL <= std_logic_vector(ID16(7 downto 0)); end if; end process; Regs : T80_Reg port map( Clk => CLK_n, CEN => ClkEn, WEH => RegWEH, WEL => RegWEL, AddrA => RegAddrA, AddrB => RegAddrB, AddrC => RegAddrC, DIH => RegDIH, DIL => RegDIL, DOAH => RegBusA(15 downto 8), DOAL => RegBusA(7 downto 0), DOBH => RegBusB(15 downto 8), DOBL => RegBusB(7 downto 0), DOCH => RegBusC(15 downto 8), DOCL => RegBusC(7 downto 0)); --------------------------------------------------------------------------- -- -- Buses -- --------------------------------------------------------------------------- process (CLK_n) begin if CLK_n'event and CLK_n = '1' then if ClkEn = '1' then case Set_BusB_To is when "0111" => BusB <= ACC; when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" => if Set_BusB_To(0) = '1' then BusB <= RegBusB(7 downto 0); else BusB <= RegBusB(15 downto 8); end if; when "0110" => BusB <= DI_Reg; when "1000" => BusB <= std_logic_vector(SP(7 downto 0)); when "1001" => BusB <= std_logic_vector(SP(15 downto 8)); when "1010" => BusB <= "00000001"; when "1011" => BusB <= F; when "1100" => BusB <= std_logic_vector(PC(7 downto 0)); when "1101" => BusB <= std_logic_vector(PC(15 downto 8)); when "1110" => BusB <= "00000000"; when others => BusB <= "--------"; end case; case Set_BusA_To is when "0111" => BusA <= ACC; when "0000" | "0001" | "0010" | "0011" | "0100" | "0101" => if Set_BusA_To(0) = '1' then BusA <= RegBusA(7 downto 0); else BusA <= RegBusA(15 downto 8); end if; when "0110" => BusA <= DI_Reg; when "1000" => BusA <= std_logic_vector(SP(7 downto 0)); when "1001" => BusA <= std_logic_vector(SP(15 downto 8)); when "1010" => BusA <= "00000000"; when others => BusB <= "--------"; end case; end if; end if; end process; --------------------------------------------------------------------------- -- -- Generate external control signals -- --------------------------------------------------------------------------- process (RESET_n,CLK_n) begin if RESET_n = '0' then RFSH_n <= '1'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then if MCycle = "001" and ((TState = 2 and Wait_n = '1') or TState = 3) then RFSH_n <= '0'; else RFSH_n <= '1'; end if; end if; end if; end process; MC <= std_logic_vector(MCycle); TS <= std_logic_vector(TState); DI_Reg <= DI; HALT_n <= not Halt_FF; BUSAK_n <= not BusAck; IntCycle_n <= not IntCycle; IntE <= IntE_FF1; IORQ <= IORQ_i; Stop <= I_DJNZ; ------------------------------------------------------------------------- -- -- Syncronise inputs -- ------------------------------------------------------------------------- process (RESET_n, CLK_n) variable OldNMI_n : std_logic; begin if RESET_n = '0' then BusReq_s <= '0'; INT_s <= '0'; NMI_s <= '0'; OldNMI_n := '0'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then BusReq_s <= not BUSRQ_n; INT_s <= not INT_n; if NMICycle = '1' then NMI_s <= '0'; elsif NMI_n = '0' and OldNMI_n = '1' then NMI_s <= '1'; end if; OldNMI_n := NMI_n; end if; end if; end process; ------------------------------------------------------------------------- -- -- Main state machine -- ------------------------------------------------------------------------- process (RESET_n, CLK_n) begin if RESET_n = '0' then MCycle <= "001"; TState <= "000"; Pre_XY_F_M <= "000"; Halt_FF <= '0'; BusAck <= '0'; NMICycle <= '0'; IntCycle <= '0'; IntE_FF1 <= '0'; IntE_FF2 <= '0'; No_BTR <= '0'; Auto_Wait_t1 <= '0'; Auto_Wait_t2 <= '0'; M1_n <= '1'; elsif CLK_n'event and CLK_n = '1' then if CEN = '1' then Auto_Wait_t1 <= Auto_Wait; Auto_Wait_t2 <= Auto_Wait_t1; No_BTR <= (I_BT and (not IR(4) or not F(Flag_P))) or (I_BC and (not IR(4) or F(Flag_Z) or not F(Flag_P))) or (I_BTR and (not IR(4) or F(Flag_Z))); if TState = 2 then if SetEI = '1' then IntE_FF1 <= '1'; IntE_FF2 <= '1'; end if; if I_RETN = '1' then IntE_FF1 <= IntE_FF2; end if; end if; if TState = 3 then if SetDI = '1' then IntE_FF1 <= '0'; IntE_FF2 <= '0'; end if; end if; if IntCycle = '1' or NMICycle = '1' then Halt_FF <= '0'; end if; if MCycle = "001" and TState = 2 and Wait_n = '1' then M1_n <= '1'; end if; if BusReq_s = '1' and BusAck = '1' then else BusAck <= '0'; if TState = 2 and Wait_n = '0' then elsif T_Res = '1' then if Halt = '1' then Halt_FF <= '1'; end if; if BusReq_s = '1' then BusAck <= '1'; else TState <= "001"; if NextIs_XY_Fetch = '1' then MCycle <= "110"; Pre_XY_F_M <= MCycle; if IR = "00110110" and Mode = 0 then Pre_XY_F_M <= "010"; end if; elsif (MCycle = "111") or (MCycle = "110" and Mode = 1 and ISet /= "01") then MCycle <= std_logic_vector(unsigned(Pre_XY_F_M) + 1); elsif (MCycle = MCycles) or No_BTR = '1' or (MCycle = "010" and I_DJNZ = '1' and IncDecZ = '1') then M1_n <= '0'; MCycle <= "001"; IntCycle <= '0'; NMICycle <= '0'; if NMI_s = '1' and Prefix = "00" then NMICycle <= '1'; IntE_FF1 <= '0'; elsif (IntE_FF1 = '1' and INT_s = '1') and Prefix = "00" and SetEI = '0' then IntCycle <= '1'; IntE_FF1 <= '0'; IntE_FF2 <= '0'; end if; else MCycle <= std_logic_vector(unsigned(MCycle) + 1); end if; end if; else if Auto_Wait = '1' nand Auto_Wait_t2 = '0' then TState <= TState + 1; end if; end if; end if; if TState = 0 then M1_n <= '0'; end if; end if; end if; end process; process (IntCycle, NMICycle, MCycle) begin Auto_Wait <= '0'; if IntCycle = '1' or NMICycle = '1' then if MCycle = "001" then Auto_Wait <= '1'; end if; end if; end process; end;
--This should pass context c1 is end context c1; --This should fail context c1 is end context c1; context c1 is end context c1; context c1 is end context c1; -- Split declaration across lines context c1 is end context c1 ;
-- PSHDL is a library and (trans-)compiler for PSHDL input. It generates -- output suitable for implementation or simulation of it. -- -- Copyright (C) 2013 Karsten Becker (feedback (at) pshdl (dot) org) -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- -- This License does not grant permission to use the trade names, trademarks, -- service marks, or product names of the Licensor, except as required for -- reasonable and customary use in describing the origin of the Work. -- --Contributors: -- Karsten Becker - initial API and implementation --Updated for version 0.1.80 on 2014-05-19 --Added log2ceil and log2floor --Updated for version 0.1.75 on 2014-04-23 --Added ternary overload for boolean --Added not overload for integer library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; package ShiftOps is function srlUint(arg: unsigned; s:natural) return unsigned; function srlInt(arg: signed; s:natural) return signed; function srlNatural(arg: natural; s:natural) return natural; function srlInteger(arg: integer; s:natural) return integer; function srlBit(arg: std_logic; s:natural) return std_logic; function srlBitvector(arg: std_logic_vector; s:natural) return std_logic_vector; function sraUint(arg: unsigned; s:natural) return unsigned; function sraInt(arg: signed; s:natural) return signed; function sraNatural(arg: natural; s:natural) return natural; function sraInteger(arg: integer; s:natural) return integer; function sraBit(arg: std_logic; s:natural) return std_logic; function sraBitvector(arg: std_logic_vector; s:natural) return std_logic_vector; function sllUint(arg: unsigned; s:natural) return unsigned; function sllInt(arg: signed; s:natural) return signed; function sllNatural(arg: natural; s:natural) return natural; function sllInteger(arg: integer; s:natural) return integer; function sllBit(arg: std_logic; s:natural) return std_logic; function sllBitvector(arg: std_logic_vector; s:natural) return std_logic_vector; end; package body ShiftOps is function sraBitvector(arg: std_logic_vector; s:natural) return std_logic_vector is begin return std_logic_vector(sraUint(unsigned(arg),s)); end sraBitvector; function srlBitvector(arg: std_logic_vector; s:natural) return std_logic_vector is begin return std_logic_vector(srlUint(unsigned(arg),s)); end srlBitvector; function sllBitvector(arg: std_logic_vector; s:natural) return std_logic_vector is begin return std_logic_vector(sllUint(unsigned(arg),s)); end sllBitvector; function sraBit(arg: std_logic; s:natural) return std_logic is begin --The MSB is the bit itself, so it is returned return arg; end sraBit; function srlBit(arg: std_logic; s:natural) return std_logic is begin if (s=0) then return arg; end if; return '0'; end srlBit; function sllBit(arg: std_logic; s:natural) return std_logic is begin if (s=0) then return arg; end if; return '0'; end sllBit; function srlUint(arg: unsigned; s:natural) return unsigned is begin return SHIFT_RIGHT(arg,s); end srlUint; function sraUint(arg: unsigned; s:natural) return unsigned is begin return SHIFT_RIGHT(arg,s); end sraUint; function sllUint(arg: unsigned; s:natural) return unsigned is begin return SHIFT_LEFT(arg,s); end sllUint; function srlInt(arg: signed; s:natural) return signed is begin return SIGNED(SHIFT_RIGHT(UNSIGNED(ARG), s)); end srlInt; function sraInt(arg: signed; s:natural) return signed is begin return SHIFT_RIGHT(arg,s); end sraInt; function sllInt(arg: signed; s:natural) return signed is begin return SHIFT_LEFT(arg,s); end sllInt; function srlInteger(arg: integer; s:natural) return integer is begin return to_integer(SHIFT_RIGHT(to_UNSIGNED(ARG,32), s)); end srlInteger; function sraInteger(arg: integer; s:natural) return integer is begin return to_integer(SHIFT_RIGHT(to_SIGNED(arg,32),s)); end sraInteger; function sllInteger(arg: integer; s:natural) return integer is begin return to_integer(SHIFT_LEFT(to_SIGNED(arg,32),s)); end sllInteger; function srlNatural(arg: natural; s:natural) return natural is begin return to_integer(SHIFT_RIGHT(to_UNSIGNED(ARG,32), s)); end srlNatural; function sraNatural(arg: natural; s:natural) return natural is begin return to_integer(SHIFT_RIGHT(to_UNSIGNED(arg,32),s)); end sraNatural; function sllNatural(arg: natural; s:natural) return natural is begin return to_integer(SHIFT_LEFT(to_UNSIGNED(arg,32),s)); end sllNatural; end; library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; package Casts is function max (LEFT, RIGHT: INTEGER) return INTEGER ; function min (LEFT, RIGHT: INTEGER) return INTEGER ; function boolToBit(ARG: boolean) return std_logic; function boolToBitvector(ARG: boolean) return std_logic_vector; function boolToInt(ARG: boolean) return signed; function boolToUint(ARG: boolean) return unsigned; function boolToInteger(ARG: boolean) return integer; function boolToNatural(ARG: boolean) return natural; function intToUint (ARG : signed) return unsigned; function intToBit (ARG : signed) return std_logic; function intToBitvector (ARG : signed) return std_logic_vector; function intToInteger (ARG : signed) return integer; function intToNatural (ARG : signed) return natural; function uintToInt (ARG : unsigned) return signed; function uintToBit (ARG : unsigned) return std_logic; function uintToBitvector (ARG : unsigned) return std_logic_vector; function uintToInteger (ARG : unsigned) return integer; function uintToNatural (ARG : unsigned) return natural; function bitToInt (ARG : std_logic) return signed; function bitToUint (ARG : std_logic) return unsigned; function bitToBitvector (ARG : std_logic) return std_logic_vector; function bitToInteger (ARG : std_logic) return integer; function bitToNatural (ARG : std_logic) return natural; function bitvectorToInt (ARG : std_logic_vector) return signed; function bitvectorToUint (ARG : std_logic_vector) return unsigned; function bitvectorToBit (ARG : std_logic_vector) return std_logic; function bitvectorToInteger (ARG : std_logic_vector) return integer; function bitvectorToNatural (ARG : std_logic_vector) return natural; function integerToInt (ARG : integer) return signed; function integerToUint (ARG : integer) return unsigned; function integerToBit (ARG : integer) return std_logic; function integerToBitvector (ARG : integer) return std_logic_vector; function integerToNatural (ARG : integer) return natural; function naturalToInt (ARG : natural) return signed; function naturalToUint (ARG : natural) return unsigned; function naturalToBit (ARG : natural) return std_logic; function naturalToBitvector (ARG : natural) return std_logic_vector; function naturalToInteger (ARG : natural) return integer; function resizeSLV(S:std_logic_vector; NEWSIZE:natural) return std_logic_vector; function resizeBit(S:std_logic; NEWSIZE:natural) return std_logic_vector; function resizeInt(S:signed; NEWSIZE:natural) return signed; function resizeUint(S:unsigned; NEWSIZE:natural) return unsigned; function resizeInteger(S:integer; NEWSIZE:natural) return signed; function resizeNatural(S:natural; NEWSIZE:natural) return unsigned; end; package body Casts is function MAX (LEFT, RIGHT: INTEGER) return INTEGER is begin if LEFT > RIGHT then return LEFT; else return RIGHT; end if; end MAX; function MIN (LEFT, RIGHT: INTEGER) return INTEGER is begin if LEFT < RIGHT then return LEFT; else return RIGHT; end if; end MIN; function boolToBit(ARG: boolean) return std_logic is begin if (ARG) then return '1'; end if; return '0'; end; function boolToBitvector(ARG: boolean) return std_logic_vector is begin if (ARG) then return "01"; end if; return "00"; end; function boolToInt(ARG: boolean) return signed is begin if (ARG) then return "01"; end if; return "00"; end; function boolToUint(ARG: boolean) return unsigned is begin if (ARG) then return "01"; end if; return "00"; end; function boolToInteger(ARG: boolean) return integer is begin if (ARG) then return 1; end if; return 0; end; function boolToNatural(ARG: boolean) return natural is begin if (ARG) then return 1; end if; return 0; end; function intToUint (ARG : signed) return unsigned is begin return unsigned(ARG); end; function intToBit (ARG : signed) return std_logic is begin if (ARG/=0) then return '1'; else return '0'; end if; end; function intToBitvector (ARG : signed) return std_logic_vector is begin return std_logic_vector(ARG); end; function intToInteger (ARG : signed) return integer is begin return to_integer(ARG); end; function uintToInt (ARG : unsigned) return signed is begin return signed(ARG); end; function uintToBit (ARG : unsigned) return std_logic is begin if (ARG/=0) then return '1'; else return '0'; end if; end; function uintToBitvector (ARG : unsigned) return std_logic_vector is begin return std_logic_vector(ARG); end; function uintToInteger (ARG : unsigned) return integer is begin return to_integer(signed(ARG)); end; function bitToInt (ARG : std_logic) return signed is begin if (ARG/='0') then return to_signed(1,2); else return to_signed(0,2); end if; end; function bitToUint (ARG : std_logic) return unsigned is begin if (ARG/='0') then return to_unsigned(1,2); else return to_unsigned(0,2); end if; end; function bitToBitvector (ARG : std_logic) return std_logic_vector is variable res: std_logic_vector(0 downto 0); begin res(0):=ARG; return res; end; function bitToInteger (ARG : std_logic) return integer is begin if (ARG/='0') then return 1; else return 0; end if; end; function bitvectorToInt (ARG : std_logic_vector) return signed is begin return signed(ARG); end; function bitvectorToUint (ARG : std_logic_vector) return unsigned is begin return unsigned(ARG); end; function bitvectorToBit (ARG : std_logic_vector) return std_logic is begin if (ARG/=(ARG'range=>'0')) then return '1'; else return '0'; end if; end; function bitvectorToInteger (ARG : std_logic_vector) return integer is begin return to_integer(signed(ARG)); end; function bitvectorToInt (ARG : signed) return signed is begin return ARG; end; function bitvectorToUint (ARG : signed) return unsigned is begin return unsigned(ARG); end; function bitvectorToBit (ARG : signed) return std_logic is begin if (ARG/=(ARG'range=>'0')) then return '1'; else return '0'; end if; end; function bitvectorToInteger (ARG : signed) return integer is begin return to_integer(signed(ARG)); end; function bitvectorToInt (ARG : unsigned) return signed is begin return signed(ARG); end; function bitvectorToUint (ARG : unsigned) return unsigned is begin return ARG; end; function bitvectorToBit (ARG : unsigned) return std_logic is begin if (ARG/=(ARG'range=>'0')) then return '1'; else return '0'; end if; end; function bitvectorToInteger (ARG : unsigned) return integer is begin return to_integer(signed(ARG)); end; function integerToInt (ARG : integer) return signed is begin return to_signed(ARG,32); end; function integerToUint (ARG : integer) return unsigned is begin return to_unsigned(ARG,32); end; function integerToBit (ARG : integer) return std_logic is begin if (ARG/=0) then return '1'; else return '0'; end if; end; function integerToBitvector (ARG : integer) return std_logic_vector is begin return std_logic_vector(to_signed(ARG,32)); end; function intToNatural (ARG : signed) return natural is begin return to_integer(unsigned(ARG)); end; function uintToNatural (ARG : unsigned) return natural is begin return to_integer('0'&ARG); end; function bitToNatural (ARG : std_logic) return natural is begin if (ARG/='0') then return 1; else return 0; end if; end; function bitvectorToNatural (ARG : std_logic_vector) return natural is begin return to_integer(unsigned(ARG)); end; function bitvectorToNatural (ARG : unsigned) return natural is begin return to_integer(ARG); end; function bitvectorToNatural (ARG : signed) return natural is begin return to_integer(unsigned(ARG)); end; function integerToNatural (ARG : integer) return natural is begin return ARG; end; function naturalToInt (ARG : natural) return signed is begin return to_signed(ARG,32); end; function naturalToUint (ARG : natural) return unsigned is begin return to_unsigned(ARG,32); end; function naturalToBit (ARG : natural) return std_logic is begin if (ARG/=0) then return '1'; else return '0'; end if; end; function naturalToBitvector (ARG : natural) return std_logic_vector is begin return std_logic_vector(to_unsigned(ARG,32)); end; function naturalToInteger (ARG : natural) return integer is begin return ARG; end; function resizeSLV(S:std_logic_vector; NEWSIZE:natural) return std_logic_vector is begin return std_logic_vector(resize(unsigned(S),NEWSIZE)); end; function resizeBit(S:std_logic; NEWSIZE:natural) return std_logic_vector is begin return std_logic_vector(resize(bitToUint(S),NEWSIZE)); end; function resizeNatural(S:natural; NEWSIZE:natural) return unsigned is begin return resize(integerToUint(S),NEWSIZE); end; function resizeInteger(S:integer; NEWSIZE:natural) return signed is begin return resize(integerToInt(S),NEWSIZE); end; function resizeUint(S:unsigned; NEWSIZE:natural) return unsigned is begin if (S'length=NEWSIZE) then return S; elsif (S'LENGTH>NEWSIZE) then return S(NEWSIZE-1 downto 0); else return ((NEWSIZE-S'LENGTH)-1 downto 0 =>'0') & S; end if; end; function resizeInt(S:signed; NEWSIZE:natural) return signed is begin if (S'length=NEWSIZE) then return S; elsif (S'LENGTH>NEWSIZE) then return S(NEWSIZE-1 downto 0); else return ((NEWSIZE-S'LENGTH)-1 downto 0 =>S(S'LEFT)) & S; end if; end; end; library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use work.Casts.all; use work.ShiftOps.all; package Types is function ternaryOp(condition: boolean; thenValue: integer; elseValue:integer) return integer; function ternaryOp(condition: boolean; thenValue: boolean; elseValue:boolean) return boolean; function ternaryOp(condition: boolean; thenValue: unsigned; elseValue:unsigned) return unsigned; function ternaryOp(condition: boolean; thenValue: signed; elseValue:signed) return signed; function ternaryOp(condition: boolean; thenValue: std_logic_vector; elseValue:std_logic_vector) return std_logic_vector; function ternaryOp(condition: boolean; thenValue: std_logic; elseValue:std_logic) return std_logic; function "not" (L: INTEGER) return INTEGER; function log2ceil (L: POSITIVE) return NATURAL; function log2floor (L: POSITIVE) return NATURAL; function "or" (L: INTEGER; R: INTEGER) return INTEGER; function "xor" (L: INTEGER; R: INTEGER) return INTEGER; function "and" (L: INTEGER; R: INTEGER) return INTEGER; function widthOf(a: std_logic_vector) return INTEGER; function widthOf(a: unsigned) return INTEGER; function widthOf(a: signed) return INTEGER; function msbOf(a: std_logic_vector) return INTEGER; function msbOf(a: unsigned) return INTEGER; function msbOf(a: signed) return INTEGER; end; package body Types is function ternaryOp(condition: boolean; thenValue: boolean; elseValue:boolean) return boolean is begin if (condition) then return thenValue; else return elseValue; end if; end ternaryOp; function ternaryOp(condition: boolean; thenValue: integer; elseValue:integer) return integer is begin if (condition) then return thenValue; else return elseValue; end if; end ternaryOp; function ternaryOp(condition: boolean; thenValue: unsigned; elseValue:unsigned) return unsigned is begin if (condition) then return thenValue; else return elseValue; end if; end ternaryOp; function ternaryOp(condition: boolean; thenValue: signed; elseValue:signed) return signed is begin if (condition) then return thenValue; else return elseValue; end if; end ternaryOp; function ternaryOp(condition: boolean; thenValue: std_logic_vector; elseValue:std_logic_vector) return std_logic_vector is begin if (condition) then return thenValue; else return elseValue; end if; end ternaryOp; function ternaryOp(condition: boolean; thenValue: std_logic; elseValue:std_logic) return std_logic is begin if (condition) then return thenValue; else return elseValue; end if; end ternaryOp; function "not" (L: INTEGER) return INTEGER is begin return intToInteger(not resizeInteger(L,32)); end "not"; function log2ceil (L: POSITIVE) return NATURAL is variable bitCount : natural; variable i: unsigned(31 downto 0); begin i := to_UNSIGNED(L-1, 32); bitCount:=0; while (i > 0) loop bitCount := bitCount + 1; i:=SHIFT_RIGHT(i,1); end loop; return bitCount; end log2ceil; function log2floor (L: POSITIVE) return NATURAL is variable bitCount : natural; variable i: unsigned(31 downto 0); begin i := to_UNSIGNED(L,32); bitCount:=0; while (i > 1) loop bitCount := bitCount + 1; i:=SHIFT_RIGHT(i,1); end loop; return bitCount; end log2floor; function "or" (L: INTEGER; R: INTEGER) return INTEGER is begin return intToInteger(resizeInteger(L,32) or resizeInteger(R,32)); end "or"; function "xor" (L: INTEGER; R: INTEGER) return INTEGER is begin return intToInteger(resizeInteger(L,32) xor resizeInteger(R,32)); end "xor"; function "and" (L: INTEGER; R: INTEGER) return INTEGER is begin return intToInteger(resizeInteger(L,32) and resizeInteger(R,32)); end "and"; function widthOf(a: std_logic_vector) return INTEGER is begin return a'LENGTH; end widthOf; function widthOf(a: unsigned) return INTEGER is begin return a'LENGTH; end widthOf; function widthOf(a: signed) return INTEGER is begin return a'LENGTH; end widthOf; function msbOf(a: std_logic_vector) return INTEGER is begin return a'HIGH; end msbOf; function msbOf(a: unsigned) return INTEGER is begin return a'HIGH; end msbOf; function msbOf(a: signed) return INTEGER is begin return a'HIGH; end msbOf; end;
-- Generic size register made with D Flip Flops LIBRARY ieee; USE ieee.std_logic_1164.all; LIBRARY work; ENTITY Generic_register IS GENERIC (N : integer := 8); PORT ( CLK : IN std_logic; RST : IN std_logic; EN : IN std_logic; DIN : IN std_logic_vector(N-1 downto 0); DOUT : OUT std_logic_vector(N-1 downto 0)); END Generic_register; ARCHITECTURE structural OF Generic_register IS COMPONENT ffd IS PORT ( CLK : IN std_logic; RST : IN std_logic; EN : IN std_logic; D : IN std_logic; Q : OUT std_logic ); END COMPONENT; BEGIN REG_GENERATOR : for i in 0 to N-1 generate FFD_I : ffd PORT MAP ( CLK => CLK, RST => RST, EN => EN, D => DIN(i), Q => DOUT(i)); END GENERATE; END structural;
library verilog; use verilog.vl_types.all; entity F2AB is generic( WIDTH : integer := 32; DAC_RESOLUTION : vl_logic_vector(5 downto 0) := (Hi0, Hi0, Hi0, Hi0, Hi0, Hi0); WARNING_MSGS_ON : integer := 1; FAST_ADC_CONV_SIM: integer := 0; ANALOG_QUAD_NUM : integer := 6; ADC_NUM : integer := 3; NUM_ADC_IN : integer := 5; VAREF_INT : real := 2.560000 ); port( AV1 : in vl_logic_vector(5 downto 0); AV2 : in vl_logic_vector(5 downto 0); AC : in vl_logic_vector(5 downto 0); AT : in vl_logic_vector(5 downto 0); ATGND_01 : in vl_logic; ATGND_23 : in vl_logic; ATGND_45 : in vl_logic; VAREF : in vl_logic_vector(2 downto 0); ADCGNDREF : in vl_logic; ADC_VAREFSEL : in vl_logic; ADC0 : in vl_logic_vector(3 downto 0); ADC1 : in vl_logic_vector(3 downto 0); ADC2 : in vl_logic_vector(3 downto 0); DEN_ADC : in vl_logic_vector(11 downto 0); ADC0_PWRDWN : in vl_logic; ADC0_ADCRESET : in vl_logic; ADC0_SYSCLK : in vl_logic; ADC0_CHNUMBER : in vl_logic_vector(4 downto 0); ADC0_MODE : in vl_logic_vector(3 downto 0); ADC0_TVC : in vl_logic_vector(7 downto 0); ADC0_STC : in vl_logic_vector(7 downto 0); ADC0_ADCSTART : in vl_logic; ADC1_PWRDWN : in vl_logic; ADC1_ADCRESET : in vl_logic; ADC1_SYSCLK : in vl_logic; ADC1_CHNUMBER : in vl_logic_vector(4 downto 0); ADC1_MODE : in vl_logic_vector(3 downto 0); ADC1_TVC : in vl_logic_vector(7 downto 0); ADC1_STC : in vl_logic_vector(7 downto 0); ADC1_ADCSTART : in vl_logic; ADC2_PWRDWN : in vl_logic; ADC2_ADCRESET : in vl_logic; ADC2_SYSCLK : in vl_logic; ADC2_CHNUMBER : in vl_logic_vector(4 downto 0); ADC2_MODE : in vl_logic_vector(3 downto 0); ADC2_TVC : in vl_logic_vector(7 downto 0); ADC2_STC : in vl_logic_vector(7 downto 0); ADC2_ADCSTART : in vl_logic; ACB_RST : in vl_logic; ACB_WEN : in vl_logic; ACB_ADDR : in vl_logic_vector(7 downto 0); ACB_WDATA : in vl_logic_vector(7 downto 0); ADC_VAREFOUT : out vl_logic; ACB_RDATA : out vl_logic_vector(7 downto 0); ADC0_BUSY : out vl_logic; ADC0_CALIBRATE : out vl_logic; ADC0_DATAVALID : out vl_logic; ADC0_SAMPLE : out vl_logic; ADC0_RESULT : out vl_logic_vector(11 downto 0); ADC1_BUSY : out vl_logic; ADC1_CALIBRATE : out vl_logic; ADC1_DATAVALID : out vl_logic; ADC1_SAMPLE : out vl_logic; ADC1_RESULT : out vl_logic_vector(11 downto 0); ADC2_BUSY : out vl_logic; ADC2_CALIBRATE : out vl_logic; ADC2_DATAVALID : out vl_logic; ADC2_SAMPLE : out vl_logic; ADC2_RESULT : out vl_logic_vector(11 downto 0); DACOUT0 : out vl_logic; DACOUT1 : out vl_logic; DACOUT2 : out vl_logic; DIG_ADC : out vl_logic_vector(11 downto 0); OBD_DIN : in vl_logic_vector(2 downto 0); OBD_CLKIN : in vl_logic_vector(2 downto 0); OBD_ENABLE : in vl_logic_vector(2 downto 0); COMPARATOR : out vl_logic_vector(11 downto 0) ); attribute DAC_RESOLUTION_mti_vect_attrib : integer; attribute DAC_RESOLUTION_mti_vect_attrib of DAC_RESOLUTION : constant is 0; end F2AB;
library verilog; use verilog.vl_types.all; entity F2AB is generic( WIDTH : integer := 32; DAC_RESOLUTION : vl_logic_vector(5 downto 0) := (Hi0, Hi0, Hi0, Hi0, Hi0, Hi0); WARNING_MSGS_ON : integer := 1; FAST_ADC_CONV_SIM: integer := 0; ANALOG_QUAD_NUM : integer := 6; ADC_NUM : integer := 3; NUM_ADC_IN : integer := 5; VAREF_INT : real := 2.560000 ); port( AV1 : in vl_logic_vector(5 downto 0); AV2 : in vl_logic_vector(5 downto 0); AC : in vl_logic_vector(5 downto 0); AT : in vl_logic_vector(5 downto 0); ATGND_01 : in vl_logic; ATGND_23 : in vl_logic; ATGND_45 : in vl_logic; VAREF : in vl_logic_vector(2 downto 0); ADCGNDREF : in vl_logic; ADC_VAREFSEL : in vl_logic; ADC0 : in vl_logic_vector(3 downto 0); ADC1 : in vl_logic_vector(3 downto 0); ADC2 : in vl_logic_vector(3 downto 0); DEN_ADC : in vl_logic_vector(11 downto 0); ADC0_PWRDWN : in vl_logic; ADC0_ADCRESET : in vl_logic; ADC0_SYSCLK : in vl_logic; ADC0_CHNUMBER : in vl_logic_vector(4 downto 0); ADC0_MODE : in vl_logic_vector(3 downto 0); ADC0_TVC : in vl_logic_vector(7 downto 0); ADC0_STC : in vl_logic_vector(7 downto 0); ADC0_ADCSTART : in vl_logic; ADC1_PWRDWN : in vl_logic; ADC1_ADCRESET : in vl_logic; ADC1_SYSCLK : in vl_logic; ADC1_CHNUMBER : in vl_logic_vector(4 downto 0); ADC1_MODE : in vl_logic_vector(3 downto 0); ADC1_TVC : in vl_logic_vector(7 downto 0); ADC1_STC : in vl_logic_vector(7 downto 0); ADC1_ADCSTART : in vl_logic; ADC2_PWRDWN : in vl_logic; ADC2_ADCRESET : in vl_logic; ADC2_SYSCLK : in vl_logic; ADC2_CHNUMBER : in vl_logic_vector(4 downto 0); ADC2_MODE : in vl_logic_vector(3 downto 0); ADC2_TVC : in vl_logic_vector(7 downto 0); ADC2_STC : in vl_logic_vector(7 downto 0); ADC2_ADCSTART : in vl_logic; ACB_RST : in vl_logic; ACB_WEN : in vl_logic; ACB_ADDR : in vl_logic_vector(7 downto 0); ACB_WDATA : in vl_logic_vector(7 downto 0); ADC_VAREFOUT : out vl_logic; ACB_RDATA : out vl_logic_vector(7 downto 0); ADC0_BUSY : out vl_logic; ADC0_CALIBRATE : out vl_logic; ADC0_DATAVALID : out vl_logic; ADC0_SAMPLE : out vl_logic; ADC0_RESULT : out vl_logic_vector(11 downto 0); ADC1_BUSY : out vl_logic; ADC1_CALIBRATE : out vl_logic; ADC1_DATAVALID : out vl_logic; ADC1_SAMPLE : out vl_logic; ADC1_RESULT : out vl_logic_vector(11 downto 0); ADC2_BUSY : out vl_logic; ADC2_CALIBRATE : out vl_logic; ADC2_DATAVALID : out vl_logic; ADC2_SAMPLE : out vl_logic; ADC2_RESULT : out vl_logic_vector(11 downto 0); DACOUT0 : out vl_logic; DACOUT1 : out vl_logic; DACOUT2 : out vl_logic; DIG_ADC : out vl_logic_vector(11 downto 0); OBD_DIN : in vl_logic_vector(2 downto 0); OBD_CLKIN : in vl_logic_vector(2 downto 0); OBD_ENABLE : in vl_logic_vector(2 downto 0); COMPARATOR : out vl_logic_vector(11 downto 0) ); attribute DAC_RESOLUTION_mti_vect_attrib : integer; attribute DAC_RESOLUTION_mti_vect_attrib of DAC_RESOLUTION : constant is 0; end F2AB;
library verilog; use verilog.vl_types.all; entity F2AB is generic( WIDTH : integer := 32; DAC_RESOLUTION : vl_logic_vector(5 downto 0) := (Hi0, Hi0, Hi0, Hi0, Hi0, Hi0); WARNING_MSGS_ON : integer := 1; FAST_ADC_CONV_SIM: integer := 0; ANALOG_QUAD_NUM : integer := 6; ADC_NUM : integer := 3; NUM_ADC_IN : integer := 5; VAREF_INT : real := 2.560000 ); port( AV1 : in vl_logic_vector(5 downto 0); AV2 : in vl_logic_vector(5 downto 0); AC : in vl_logic_vector(5 downto 0); AT : in vl_logic_vector(5 downto 0); ATGND_01 : in vl_logic; ATGND_23 : in vl_logic; ATGND_45 : in vl_logic; VAREF : in vl_logic_vector(2 downto 0); ADCGNDREF : in vl_logic; ADC_VAREFSEL : in vl_logic; ADC0 : in vl_logic_vector(3 downto 0); ADC1 : in vl_logic_vector(3 downto 0); ADC2 : in vl_logic_vector(3 downto 0); DEN_ADC : in vl_logic_vector(11 downto 0); ADC0_PWRDWN : in vl_logic; ADC0_ADCRESET : in vl_logic; ADC0_SYSCLK : in vl_logic; ADC0_CHNUMBER : in vl_logic_vector(4 downto 0); ADC0_MODE : in vl_logic_vector(3 downto 0); ADC0_TVC : in vl_logic_vector(7 downto 0); ADC0_STC : in vl_logic_vector(7 downto 0); ADC0_ADCSTART : in vl_logic; ADC1_PWRDWN : in vl_logic; ADC1_ADCRESET : in vl_logic; ADC1_SYSCLK : in vl_logic; ADC1_CHNUMBER : in vl_logic_vector(4 downto 0); ADC1_MODE : in vl_logic_vector(3 downto 0); ADC1_TVC : in vl_logic_vector(7 downto 0); ADC1_STC : in vl_logic_vector(7 downto 0); ADC1_ADCSTART : in vl_logic; ADC2_PWRDWN : in vl_logic; ADC2_ADCRESET : in vl_logic; ADC2_SYSCLK : in vl_logic; ADC2_CHNUMBER : in vl_logic_vector(4 downto 0); ADC2_MODE : in vl_logic_vector(3 downto 0); ADC2_TVC : in vl_logic_vector(7 downto 0); ADC2_STC : in vl_logic_vector(7 downto 0); ADC2_ADCSTART : in vl_logic; ACB_RST : in vl_logic; ACB_WEN : in vl_logic; ACB_ADDR : in vl_logic_vector(7 downto 0); ACB_WDATA : in vl_logic_vector(7 downto 0); ADC_VAREFOUT : out vl_logic; ACB_RDATA : out vl_logic_vector(7 downto 0); ADC0_BUSY : out vl_logic; ADC0_CALIBRATE : out vl_logic; ADC0_DATAVALID : out vl_logic; ADC0_SAMPLE : out vl_logic; ADC0_RESULT : out vl_logic_vector(11 downto 0); ADC1_BUSY : out vl_logic; ADC1_CALIBRATE : out vl_logic; ADC1_DATAVALID : out vl_logic; ADC1_SAMPLE : out vl_logic; ADC1_RESULT : out vl_logic_vector(11 downto 0); ADC2_BUSY : out vl_logic; ADC2_CALIBRATE : out vl_logic; ADC2_DATAVALID : out vl_logic; ADC2_SAMPLE : out vl_logic; ADC2_RESULT : out vl_logic_vector(11 downto 0); DACOUT0 : out vl_logic; DACOUT1 : out vl_logic; DACOUT2 : out vl_logic; DIG_ADC : out vl_logic_vector(11 downto 0); OBD_DIN : in vl_logic_vector(2 downto 0); OBD_CLKIN : in vl_logic_vector(2 downto 0); OBD_ENABLE : in vl_logic_vector(2 downto 0); COMPARATOR : out vl_logic_vector(11 downto 0) ); attribute DAC_RESOLUTION_mti_vect_attrib : integer; attribute DAC_RESOLUTION_mti_vect_attrib of DAC_RESOLUTION : constant is 0; end F2AB;
package STRSYN is attribute SigDir : string; attribute SigType : string; attribute SigBias : string; end STRSYN; entity op is port ( terminal in1: electrical; terminal in2: electrical; terminal out1: electrical; terminal vbias4: electrical; terminal gnd: electrical; terminal vdd: electrical; terminal vbias3: electrical; terminal vbias2: electrical; terminal vbias1: electrical); end op; architecture simple of op is -- Attributes for Ports attribute SigDir of in1:terminal is "input"; attribute SigType of in1:terminal is "voltage"; attribute SigDir of in2:terminal is "input"; attribute SigType of in2:terminal is "voltage"; attribute SigDir of out1:terminal is "output"; attribute SigType of out1:terminal is "voltage"; attribute SigDir of vbias4:terminal is "reference"; attribute SigType of vbias4:terminal is "voltage"; attribute SigDir of gnd:terminal is "reference"; attribute SigType of gnd:terminal is "current"; attribute SigBias of gnd:terminal is "negative"; attribute SigDir of vdd:terminal is "reference"; attribute SigType of vdd:terminal is "current"; attribute SigBias of vdd:terminal is "positive"; attribute SigDir of vbias3:terminal is "reference"; attribute SigType of vbias3:terminal is "voltage"; attribute SigDir of vbias2:terminal is "reference"; attribute SigType of vbias2:terminal is "voltage"; attribute SigDir of vbias1:terminal is "reference"; attribute SigType of vbias1:terminal is "voltage"; terminal net1: electrical; terminal net2: electrical; terminal net3: electrical; terminal net4: electrical; terminal net5: electrical; terminal net6: electrical; terminal net7: electrical; terminal net8: electrical; terminal net9: electrical; terminal net10: electrical; terminal net11: electrical; terminal net12: electrical; terminal net13: electrical; terminal net14: electrical; begin subnet0_subnet0_m1 : entity nmos(behave) generic map( L => Ldiff_0, W => Wdiff_0, scope => private ) port map( D => net1, G => in1, S => net6 ); subnet0_subnet0_m2 : entity nmos(behave) generic map( L => Ldiff_0, W => Wdiff_0, scope => private ) port map( D => net2, G => in2, S => net6 ); subnet0_subnet0_m3 : entity nmos(behave) generic map( L => LBias, W => W_0 ) port map( D => net6, G => vbias4, S => gnd ); subnet0_subnet0_m4 : entity nmos(behave) generic map( L => Ldiff_0, W => Wdiff_0, scope => private ) port map( D => net7, G => in1, S => net6 ); subnet0_subnet0_m5 : entity nmos(behave) generic map( L => Ldiff_0, W => Wdiff_0, scope => private ) port map( D => net7, G => in2, S => net6 ); subnet0_subnet0_m6 : entity pmos(behave) generic map( L => Lcmdiffp_0, W => Wcmdiffp_0, scope => private ) port map( D => net7, G => net7, S => vdd ); subnet0_subnet0_m7 : entity pmos(behave) generic map( L => Lcmdiffp_0, W => Wcmdiffp_0, scope => private ) port map( D => net7, G => net7, S => vdd ); subnet0_subnet0_m8 : entity pmos(behave) generic map( L => Lcmdiffp_0, W => Wcmdiffp_0, scope => private ) port map( D => net1, G => net7, S => vdd ); subnet0_subnet0_m9 : entity pmos(behave) generic map( L => Lcmdiffp_0, W => Wcmdiffp_0, scope => private ) port map( D => net2, G => net7, S => vdd ); subnet0_subnet1_m1 : entity pmos(behave) generic map( L => Lsrc, W => Wsrc_2, scope => Wprivate, symmetry_scope => sym_7 ) port map( D => net3, G => net1, S => vdd ); subnet0_subnet2_m1 : entity pmos(behave) generic map( L => Lsrc, W => Wsrc_2, scope => Wprivate, symmetry_scope => sym_7 ) port map( D => net4, G => net2, S => vdd ); subnet0_subnet3_m1 : entity nmos(behave) generic map( L => LBias, W => Wcmcasc_3, scope => Wprivate, symmetry_scope => sym_8 ) port map( D => net3, G => vbias3, S => net8 ); subnet0_subnet3_m2 : entity nmos(behave) generic map( L => Lcm_3, W => Wcm_3, scope => private, symmetry_scope => sym_8 ) port map( D => net8, G => net3, S => gnd ); subnet0_subnet3_m3 : entity nmos(behave) generic map( L => Lcm_3, W => Wcmout_3, scope => private, symmetry_scope => sym_8 ) port map( D => net9, G => net3, S => gnd ); subnet0_subnet3_m4 : entity nmos(behave) generic map( L => LBias, W => Wcmcasc_3, scope => Wprivate, symmetry_scope => sym_8 ) port map( D => net5, G => vbias3, S => net9 ); subnet0_subnet4_m1 : entity nmos(behave) generic map( L => LBias, W => Wcmcasc_3, scope => Wprivate, symmetry_scope => sym_8 ) port map( D => net4, G => vbias3, S => net10 ); subnet0_subnet4_m2 : entity nmos(behave) generic map( L => Lcm_3, W => Wcm_3, scope => private, symmetry_scope => sym_8 ) port map( D => net10, G => net4, S => gnd ); subnet0_subnet4_m3 : entity nmos(behave) generic map( L => Lcm_3, W => Wcmout_3, scope => private, symmetry_scope => sym_8 ) port map( D => net11, G => net4, S => gnd ); subnet0_subnet4_m4 : entity nmos(behave) generic map( L => LBias, W => Wcmcasc_3, scope => Wprivate, symmetry_scope => sym_8 ) port map( D => out1, G => vbias3, S => net11 ); subnet0_subnet5_m1 : entity pmos(behave) generic map( L => LBias, W => Wcmcasc_1, scope => Wprivate ) port map( D => net5, G => vbias2, S => net12 ); subnet0_subnet5_m2 : entity pmos(behave) generic map( L => Lcm_1, W => Wcm_1, scope => private ) port map( D => net12, G => net5, S => vdd ); subnet0_subnet5_m3 : entity pmos(behave) generic map( L => Lcm_1, W => Wcmout_1, scope => private ) port map( D => net13, G => net5, S => vdd ); subnet0_subnet5_m4 : entity pmos(behave) generic map( L => LBias, W => Wcmcasc_1, scope => Wprivate ) port map( D => out1, G => vbias2, S => net13 ); subnet1_subnet0_m1 : entity pmos(behave) generic map( L => LBias, W => (pfak)*(WBias) ) port map( D => vbias1, G => vbias1, S => vdd ); subnet1_subnet0_m2 : entity pmos(behave) generic map( L => (pfak)*(LBias), W => (pfak)*(WBias) ) port map( D => vbias2, G => vbias2, S => vbias1 ); subnet1_subnet0_i1 : entity idc(behave) generic map( dc => 1.145e-05 ) port map( P => vdd, N => vbias3 ); subnet1_subnet0_m3 : entity nmos(behave) generic map( L => (pfak)*(LBias), W => WBias ) port map( D => vbias3, G => vbias3, S => vbias4 ); subnet1_subnet0_m4 : entity nmos(behave) generic map( L => LBias, W => WBias ) port map( D => vbias2, G => vbias3, S => net14 ); subnet1_subnet0_m5 : entity nmos(behave) generic map( L => LBias, W => WBias ) port map( D => vbias4, G => vbias4, S => gnd ); subnet1_subnet0_m6 : entity nmos(behave) generic map( L => LBias, W => WBias ) port map( D => net14, G => vbias4, S => gnd ); end simple;
library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; library std; use std.env.all; entity psl_endpoint_eval_in_vhdl is end entity psl_endpoint_eval_in_vhdl; architecture test of psl_endpoint_eval_in_vhdl is signal s_rst_n : std_logic := '0'; signal s_clk : std_logic := '0'; signal s_write : std_logic; signal s_read : std_logic; begin s_rst_n <= '1' after 100 ns; s_clk <= not s_clk after 10 ns; TestP : process is begin report "RUNNING psl_endpoint_eval_in_vhdl test case"; report "=========================================="; s_write <= '0'; -- named assertion should hit s_read <= '0'; wait until s_rst_n = '1' and rising_edge(s_clk); s_write <= '1'; wait until rising_edge(s_clk); s_read <= '1'; -- assertion should hit wait until rising_edge(s_clk); s_write <= '0'; s_read <= '0'; wait until rising_edge(s_clk); stop(0); wait; end process TestP; -- psl default clock is rising_edge(s_clk); -- psl endpoint E_TEST0 is {not(s_write); s_write}; process is begin wait for E_TEST0; report "HIT"; wait; end process; end architecture test;
library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; library std; use std.env.all; entity psl_endpoint_eval_in_vhdl is end entity psl_endpoint_eval_in_vhdl; architecture test of psl_endpoint_eval_in_vhdl is signal s_rst_n : std_logic := '0'; signal s_clk : std_logic := '0'; signal s_write : std_logic; signal s_read : std_logic; begin s_rst_n <= '1' after 100 ns; s_clk <= not s_clk after 10 ns; TestP : process is begin report "RUNNING psl_endpoint_eval_in_vhdl test case"; report "=========================================="; s_write <= '0'; -- named assertion should hit s_read <= '0'; wait until s_rst_n = '1' and rising_edge(s_clk); s_write <= '1'; wait until rising_edge(s_clk); s_read <= '1'; -- assertion should hit wait until rising_edge(s_clk); s_write <= '0'; s_read <= '0'; wait until rising_edge(s_clk); stop(0); wait; end process TestP; -- psl default clock is rising_edge(s_clk); -- psl endpoint E_TEST0 is {not(s_write); s_write}; process is begin wait for E_TEST0; report "HIT"; wait; end process; end architecture test;
------------------------------------------------------------------------------- -- -- T400 Microcontroller Core -- -- $Id: t400_core-c.vhd,v 1.3 2006-05-22 00:03:29 arniml Exp $ -- -- Copyright (c) 2006, Arnim Laeuger ([email protected]) -- -- All rights reserved -- ------------------------------------------------------------------------------- configuration t400_core_struct_c0 of t400_core is for struct for clkgen_b: t400_clkgen use configuration work.t400_clkgen_rtl_c0; end for; for reset_b: t400_reset use configuration work.t400_reset_rtl_c0; end for; for pmem_ctrl_b: t400_pmem_ctrl use configuration work.t400_pmem_ctrl_rtl_c0; end for; for dmem_ctrl_b: t400_dmem_ctrl use configuration work.t400_dmem_ctrl_rtl_c0; end for; for decoder_b: t400_decoder use configuration work.t400_decoder_rtl_c0; end for; for skip_b: t400_skip use configuration work.t400_skip_rtl_c0; end for; for alu_b: t400_alu use configuration work.t400_alu_rtl_c0; end for; for stack_b: t400_stack use configuration work.t400_stack_rtl_c0; end for; for io_l_b: t400_io_l use configuration work.t400_io_l_rtl_c0; end for; for io_d_b: t400_io_d use configuration work.t400_io_d_rtl_c0; end for; for io_g_b: t400_io_g use configuration work.t400_io_g_rtl_c0; end for; for use_in for io_in_b: t400_io_in use configuration work.t400_io_in_rtl_c0; end for; end for; for sio_b: t400_sio use configuration work.t400_sio_rtl_c0; end for; for use_tim for timer_b: t400_timer use configuration work.t400_timer_rtl_c0; end for; end for; end for; end t400_core_struct_c0; ------------------------------------------------------------------------------- -- File History: -- -- $Log: not supported by cvs2svn $ -- Revision 1.2 2006/05/20 02:48:17 arniml -- timer module included -- -- Revision 1.1.1.1 2006/05/06 01:56:44 arniml -- import from local CVS repository, LOC_CVS_0_1 -- -------------------------------------------------------------------------------
------------------------------------------------------------------------------- -- -- Title : sfh -- Design : ALU -- Author : riczhang -- Company : Stony Brook University -- ------------------------------------------------------------------------------- -- -- File : c:\My_Designs\ESE345_PROJECT\ALU\src\sfh.vhd -- Generated : Tue Dec 6 14:06:04 2016 -- From : interface description file -- By : Itf2Vhdl ver. 1.22 -- ------------------------------------------------------------------------------- -- -- Description : -- ------------------------------------------------------------------------------- --{{ Section below this comment is automatically maintained -- and may be overwritten --{entity {sfh} architecture {behavioral}} library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.NUMERIC_STD.ALL; entity sfh is port( rs1: in std_logic_vector(63 downto 0); rs2: in std_logic_vector(63 downto 0); rd: out std_logic_vector (63 downto 0) ); end sfh; --}} End of automatically maintained section architecture behavioral of sfh is begin process(rs1,rs2) begin rd(63 downto 48)<= std_logic_vector(unsigned(rs1(63 downto 48)) - unsigned(rs2(63 downto 48))); rd(47 downto 32)<=std_logic_vector(unsigned(rs1(47 downto 32)) - unsigned(rs2(47 downto 32))); rd(31 downto 16)<= std_logic_vector(unsigned(rs1(31 downto 16)) - unsigned(rs2(31 downto 16))); rd(15 downto 0)<=std_logic_vector(unsigned(rs1(15 downto 0)) - unsigned(rs2(15 downto 0))); end process; end behavioral;
---------------------------------------------------------------------------------- -- Company: -- Engineer: -- -- Create Date: 22:22:33 11/30/2015 -- Design Name: -- Module Name: Top - Behavioral -- Project Name: -- Target Devices: -- Tool versions: -- Description: -- -- Dependencies: -- -- Revision: -- Revision 0.01 - File Created -- Additional Comments: -- ---------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity Top is Port ( in_Clk100MHz : in STD_LOGIC; in_Rst : in STD_LOGIC; in_Rx : in STD_LOGIC; out_Tx : out STD_LOGIC; led : out STD_LOGIC ); end Top; architecture Behavioral of Top is --Comp: U4 Line Detector Component Ultrasonic Port ( Clk : in STD_LOGIC; Rst : in STD_LOGIC; Rx : in STD_LOGIC; Tx : out STD_LOGIC; out_ultrasonic : out STD_LOGIC); end component; signal out_ultrasonic_1 : STD_LOGIC; begin U4: Ultrasonic Port map (in_Clk100MHz,in_Rst, in_Rx,out_Tx, out_ultrasonic_1); process(out_ultrasonic_1) begin if(out_ultrasonic_1 ='1') then led <= '1'; else led <= '0'; end if; end process; end Behavioral;
-- $Id: sys_w11a_n4.vhd 1247 2022-07-06 07:04:33Z mueller $ -- SPDX-License-Identifier: GPL-3.0-or-later -- Copyright 2013-2022 by Walter F.J. Mueller <[email protected]> -- ------------------------------------------------------------------------------ -- Module Name: sys_w11a_n4 - syn -- Description: w11a test design for nexys4 -- -- Dependencies: bplib/bpgen/s7_cmt_1ce1ce -- bplib/bpgen/bp_rs232_4line_iob -- vlib/rlink/rlink_sp2c -- w11a/pdp11_sys70 -- ibus/ibdr_maxisys -- bplib/nxcramlib/nx_cram_memctl_as -- bplib/fx2rlink/ioleds_sp1c -- w11a/pdp11_hio70 -- bplib/bpgen/sn_humanio_rbus -- bplib/sysmon/sysmonx_rbus_base -- vlib/rbus/rbd_usracc -- vlib/rbus/rb_sres_or_4 -- -- Test bench: tb/tb_sys_w11a_n4 -- -- Target Devices: generic -- Tool versions: viv 2014.4-2022.1; ghdl 0.29-2.0.0 (ise 14.5-14.7 retired) -- -- Synthesized: -- Date Rev viv Target flop lutl lutm bram slic MHz -- 2022-07-05 1247 2022.1 xc7a100t-1 3455 6137 279 17.5 2100 80 -- 2019-05-19 1150 2017.2 xc7a100t-1 3418 7272 285 17.5 2234 80 +dz11 -- 2019-05-01 1143 2017.2 xc7a100t-1 3295 6597 260 17.5 2107 80 +m9312 -- 2019-04-27 1140 2017.2 xc7a100t-1 3288 6574 260 17.0 2132 80 +dlbuf -- 2019-04-24 1137 2017.2 xc7a100t-1 3251 6465 228 17.0 2043 80 +pcbuf -- 2019-03-17 1123 2017.2 xc7a100t-1 3231 6403 212 17.0 2053 80 +lpbuf -- 2019-03-02 1116 2017.2 xc7a100t-1 3200 6317 198 17.0 2032 80 +ibtst -- 2019-02-02 1108 2018.3 xc7a100t-1 3165 6497 182 17.0 2054 80 -- 2019-02-02 1108 2017.2 xc7a100t-1 3146 6227 182 17.0 1982 80 -- 2018-10-13 1056 2017.2 xc7a100t-1 3146 6228 182 17.0 1979 80 +dmpcnt -- 2018-09-15 1045 2017.2 xc7a100t-1 2926 5904 150 17.0 1884 80 +KW11P -- 2017-04-22 885 2016.4 xc7a100t-1 2862 5859 150 12.0 1900 80 +dmcmon -- 2017-04-16 881 2016.4 xc7a100t-1 2645 5621 138 12.0 1804 80 +DEUNA -- 2017-01-29 846 2016.4 xc7a100t-1 2574 5496 138 12.0 1750 80 +int24 -- 2016-05-26 768 2016.1 xc7a100t-1 2777 5672 150 10.0 1763 90 dms=0 -- 2016-05-22 767 2016.1 xc7a100t-1 2790 5774 150 11.0 1812 75 fsm -- 2016-03-29 756 2015.4 xc7a100t-1 2651 4955 150 11.0 1608 75 2clock -- 2016-03-27 753 2015.4 xc7a100t-1 2545 4850 150 11.0 1576 80 meminf -- 2016-03-27 752 2015.4 xc7a100t-1 2544 4875 178 13.0 1569 80 +TW=8 -- 2016-03-13 742 2015.4 xc7a100t-1 2536 4868 178 10.5 1542 80 +XADC -- 2015-06-04 686 2014.4 xc7a100t-1 2111 4541 162 7.5 1469 80 +TM11 -- 2015-05-14 680 2014.4 xc7a100t-1 2030 4459 162 7.5 1427 80 -- 2015-02-22 650 2014.4 xc7a100t-1 1606 3652 146 3.5 1158 80 -- 2015-02-22 650 i 14.7 xc7a100t-1 1670 3564 124 1508 80 -- -- Revision History: -- Date Rev Version Comment -- 2018-12-16 1086 2.5 use s7_cmt_1ce1ce -- 2018-10-13 1055 2.4 use DM_STAT_EXP; IDEC to maxisys; setup PERFEXT -- 2016-04-02 758 2.3.1 add rbd_usracc (bitfile+jtag timestamp access) -- 2016-03-28 755 2.3 use serport_2clock2 -- 2016-03-19 748 2.2.1 define rlink SYSID -- 2016-03-13 742 2.2 add sysmon_rbus -- 2015-05-09 677 2.1 start/stop/suspend overhaul; reset overhaul -- 2015-05-01 672 2.0 use pdp11_sys70 and pdp11_hio70 -- 2015-04-11 666 1.4.2 rearrange XON handling -- 2015-02-21 649 1.4.1 use ioleds_sp1c,pdp11_(statleds,ledmux,dspmux) -- 2015-02-07 643 1.4 new DSP+LED layout, use pdp11_dr; drop bram and -- minisys options; -- 2015-02-01 641 1.3.1 separate I_BTNRST_N; autobaud on msb of display -- 2015-01-31 640 1.3 drop fusp iface; use new sn_hio -- 2014-12-24 620 1.2.1 relocate ibus window and hio rbus address -- 2014-08-28 588 1.2 use new rlink v4 iface and 4 bit STAT -- 2014-08-15 583 1.1 rb_mreq addr now 16 bit -- 2013-09-28 535 1.0.1 use proper clock manager -- 2013-09-22 543 1.0 Initial version (derived from sys_w11a_n3) ------------------------------------------------------------------------------ -- -- w11a test design for nexys4 -- w11a + rlink + serport -- -- Usage of Nexys 4 Switches, Buttons, LEDs -- -- SWI(15:5): no function (only connected to sn_humanio_rbus) -- (5): select DSP(7:4) display -- 0 abclkdiv & abclkdiv_f -- 1 PC -- (4): select DSP(3:0) display -- 0 DISPREG -- 1 DR emulation -- (3): select LED display -- 0 overall status -- 1 DR emulation -- (2): unused-reserved (USB port select) -- (1): 1 enable XON -- (0): unused-reserved (serial port select) -- -- LEDs if SWI(3) = 1 -- (15:0) DR emulation; shows R0 during wait like 11/45+70 -- -- LEDs if SWI(3) = 0 -- (7) MEM_ACT_W -- (6) MEM_ACT_R -- (5) cmdbusy (all rlink access, mostly rdma) -- (4:0) if cpugo=1 show cpu mode activity -- (4) kernel mode, pri>0 -- (3) kernel mode, pri=0 -- (2) kernel mode, wait -- (1) supervisor mode -- (0) user mode -- if cpugo=0 shows cpurust -- (4) '1' -- (3:0) cpurust code -- -- DSP(7:4) shows abclkdiv & abclkdiv_f or PS, depending on SWI(5) -- DSP(3:0) shows DISPREG or DR emulation, depending on SWI(4) -- DP(3:0) shows IO activity -- (3) not SER_MONI.txok (shows tx back pressure) -- (2) SER_MONI.txact (shows tx activity) -- (1) not SER_MONI.rxok (shows rx back pressure) -- (0) SER_MONI.rxact (shows rx activity) -- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use work.slvtypes.all; use work.serportlib.all; use work.rblib.all; use work.rbdlib.all; use work.rlinklib.all; use work.bpgenlib.all; use work.bpgenrbuslib.all; use work.sysmonrbuslib.all; use work.nxcramlib.all; use work.iblib.all; use work.ibdlib.all; use work.pdp11.all; use work.sys_conf.all; -- ---------------------------------------------------------------------------- entity sys_w11a_n4 is -- top level -- implements nexys4_cram_aif port ( I_CLK100 : in slbit; -- 100 MHz clock I_RXD : in slbit; -- receive data (board view) O_TXD : out slbit; -- transmit data (board view) O_RTS_N : out slbit; -- rx rts (board view; act.low) I_CTS_N : in slbit; -- tx cts (board view; act.low) I_SWI : in slv16; -- n4 switches I_BTN : in slv5; -- n4 buttons I_BTNRST_N : in slbit; -- n4 reset button O_LED : out slv16; -- n4 leds O_RGBLED0 : out slv3; -- n4 rgb-led 0 O_RGBLED1 : out slv3; -- n4 rgb-led 1 O_ANO_N : out slv8; -- 7 segment disp: anodes (act.low) O_SEG_N : out slv8; -- 7 segment disp: segments (act.low) O_MEM_CE_N : out slbit; -- cram: chip enable (act.low) O_MEM_BE_N : out slv2; -- cram: byte enables (act.low) O_MEM_WE_N : out slbit; -- cram: write enable (act.low) O_MEM_OE_N : out slbit; -- cram: output enable (act.low) O_MEM_ADV_N : out slbit; -- cram: address valid (act.low) O_MEM_CLK : out slbit; -- cram: clock O_MEM_CRE : out slbit; -- cram: command register enable I_MEM_WAIT : in slbit; -- cram: mem wait O_MEM_ADDR : out slv23; -- cram: address lines IO_MEM_DATA : inout slv16 -- cram: data lines ); end sys_w11a_n4; architecture syn of sys_w11a_n4 is signal CLK : slbit := '0'; signal RESET : slbit := '0'; signal CE_USEC : slbit := '0'; signal CE_MSEC : slbit := '0'; signal CLKS : slbit := '0'; signal CES_MSEC : slbit := '0'; signal RXD : slbit := '1'; signal TXD : slbit := '0'; signal RTS_N : slbit := '0'; signal CTS_N : slbit := '0'; signal RB_MREQ : rb_mreq_type := rb_mreq_init; signal RB_SRES : rb_sres_type := rb_sres_init; signal RB_SRES_CPU : rb_sres_type := rb_sres_init; signal RB_SRES_HIO : rb_sres_type := rb_sres_init; signal RB_SRES_SYSMON : rb_sres_type := rb_sres_init; signal RB_SRES_USRACC : rb_sres_type := rb_sres_init; signal RB_LAM : slv16 := (others=>'0'); signal RB_STAT : slv4 := (others=>'0'); signal SER_MONI : serport_moni_type := serport_moni_init; signal GRESET : slbit := '0'; -- general reset (from rbus) signal CRESET : slbit := '0'; -- cpu reset (from cp) signal BRESET : slbit := '0'; -- bus reset (from cp or cpu) signal PERFEXT : slv8 := (others=>'0'); signal EI_PRI : slv3 := (others=>'0'); signal EI_VECT : slv9_2 := (others=>'0'); signal EI_ACKM : slbit := '0'; signal CP_STAT : cp_stat_type := cp_stat_init; signal DM_STAT_EXP : dm_stat_exp_type := dm_stat_exp_init; signal MEM_REQ : slbit := '0'; signal MEM_WE : slbit := '0'; signal MEM_BUSY : slbit := '0'; signal MEM_ACK_R : slbit := '0'; signal MEM_ACT_R : slbit := '0'; signal MEM_ACT_W : slbit := '0'; signal MEM_ADDR : slv20 := (others=>'0'); signal MEM_BE : slv4 := (others=>'0'); signal MEM_DI : slv32 := (others=>'0'); signal MEM_DO : slv32 := (others=>'0'); signal MEM_ADDR_EXT : slv22 := (others=>'0'); signal IB_MREQ : ib_mreq_type := ib_mreq_init; signal IB_SRES_IBDR : ib_sres_type := ib_sres_init; signal DISPREG : slv16 := (others=>'0'); signal ABCLKDIV : slv16 := (others=>'0'); signal SWI : slv16 := (others=>'0'); signal BTN : slv5 := (others=>'0'); signal LED : slv16 := (others=>'0'); signal DSP_DAT : slv32 := (others=>'0'); signal DSP_DP : slv8 := (others=>'0'); constant rbaddr_rbmon : slv16 := x"ffe8"; -- ffe8/0008: 1111 1111 1110 1xxx constant rbaddr_hio : slv16 := x"fef0"; -- fef0/0008: 1111 1110 1111 0xxx constant rbaddr_sysmon: slv16 := x"fb00"; -- fb00/0080: 1111 1011 0xxx xxxx constant sysid_proj : slv16 := x"0201"; -- w11a constant sysid_board : slv8 := x"05"; -- nexys4 constant sysid_vers : slv8 := x"00"; begin assert (sys_conf_clksys mod 1000000) = 0 report "assert sys_conf_clksys on MHz grid" severity failure; GEN_CLKALL : s7_cmt_1ce1ce -- clock generator system ------------ generic map ( CLKIN_PERIOD => 10.0, CLKIN_JITTER => 0.01, STARTUP_WAIT => false, CLK0_VCODIV => sys_conf_clksys_vcodivide, CLK0_VCOMUL => sys_conf_clksys_vcomultiply, CLK0_OUTDIV => sys_conf_clksys_outdivide, CLK0_GENTYPE => sys_conf_clksys_gentype, CLK0_CDUWIDTH => 7, CLK0_USECDIV => sys_conf_clksys_mhz, CLK0_MSECDIV => 1000, CLK1_VCODIV => sys_conf_clkser_vcodivide, CLK1_VCOMUL => sys_conf_clkser_vcomultiply, CLK1_OUTDIV => sys_conf_clkser_outdivide, CLK1_GENTYPE => sys_conf_clkser_gentype, CLK1_CDUWIDTH => 7, CLK1_USECDIV => sys_conf_clkser_mhz, CLK1_MSECDIV => 1000) port map ( CLKIN => I_CLK100, CLK0 => CLK, CE0_USEC => CE_USEC, CE0_MSEC => CE_MSEC, CLK1 => CLKS, CE1_USEC => open, CE1_MSEC => CES_MSEC, LOCKED => open ); IOB_RS232 : bp_rs232_4line_iob -- serport iob ---------------------- port map ( CLK => CLKS, RXD => RXD, TXD => TXD, CTS_N => CTS_N, RTS_N => RTS_N, I_RXD => I_RXD, O_TXD => O_TXD, I_CTS_N => I_CTS_N, O_RTS_N => O_RTS_N ); RLINK : rlink_sp2c -- rlink for serport ----------------- generic map ( BTOWIDTH => 7, -- 128 cycles access timeout RTAWIDTH => 12, SYSID => sysid_proj & sysid_board & sysid_vers, IFAWIDTH => 5, -- 32 word input fifo OFAWIDTH => 5, -- 32 word output fifo ENAPIN_RLMON => sbcntl_sbf_rlmon, ENAPIN_RBMON => sbcntl_sbf_rbmon, CDWIDTH => 12, CDINIT => sys_conf_ser2rri_cdinit, RBMON_AWIDTH => sys_conf_rbmon_awidth, RBMON_RBADDR => rbaddr_rbmon) port map ( CLK => CLK, CE_USEC => CE_USEC, CE_MSEC => CE_MSEC, CE_INT => CE_MSEC, RESET => RESET, CLKS => CLKS, CES_MSEC => CES_MSEC, ENAXON => SWI(1), ESCFILL => '0', RXSD => RXD, TXSD => TXD, CTS_N => CTS_N, RTS_N => RTS_N, RB_MREQ => RB_MREQ, RB_SRES => RB_SRES, RB_LAM => RB_LAM, RB_STAT => RB_STAT, RL_MONI => open, SER_MONI => SER_MONI ); PERFEXT(0) <= '0'; -- unused (ext_rdrhit) PERFEXT(1) <= '0'; -- unused (ext_wrrhit) PERFEXT(2) <= '0'; -- unused (ext_wrflush) PERFEXT(3) <= SER_MONI.rxact; -- ext_rlrxact PERFEXT(4) <= not SER_MONI.rxok; -- ext_rlrxback PERFEXT(5) <= SER_MONI.txact; -- ext_rltxact PERFEXT(6) <= not SER_MONI.txok; -- ext_rltxback PERFEXT(7) <= CE_USEC; -- ext_usec SYS70 : pdp11_sys70 -- 1 cpu system ---------------------- port map ( CLK => CLK, RESET => RESET, RB_MREQ => RB_MREQ, RB_SRES => RB_SRES_CPU, RB_STAT => RB_STAT, RB_LAM_CPU => RB_LAM(0), GRESET => GRESET, CRESET => CRESET, BRESET => BRESET, CP_STAT => CP_STAT, EI_PRI => EI_PRI, EI_VECT => EI_VECT, EI_ACKM => EI_ACKM, PERFEXT => PERFEXT, IB_MREQ => IB_MREQ, IB_SRES => IB_SRES_IBDR, MEM_REQ => MEM_REQ, MEM_WE => MEM_WE, MEM_BUSY => MEM_BUSY, MEM_ACK_R => MEM_ACK_R, MEM_ADDR => MEM_ADDR, MEM_BE => MEM_BE, MEM_DI => MEM_DI, MEM_DO => MEM_DO, DM_STAT_EXP => DM_STAT_EXP ); IBDR_SYS : ibdr_maxisys -- IO system ------------------------- port map ( CLK => CLK, CE_USEC => CE_USEC, CE_MSEC => CE_MSEC, RESET => GRESET, BRESET => BRESET, ITIMER => DM_STAT_EXP.se_itimer, IDEC => DM_STAT_EXP.se_idec, CPUSUSP => CP_STAT.cpususp, RB_LAM => RB_LAM(15 downto 1), IB_MREQ => IB_MREQ, IB_SRES => IB_SRES_IBDR, EI_ACKM => EI_ACKM, EI_PRI => EI_PRI, EI_VECT => EI_VECT, DISPREG => DISPREG ); MEM_ADDR_EXT <= "00" & MEM_ADDR; -- just use lower 4 MB (of 16 MB) CRAMCTL: nx_cram_memctl_as -- memory controller ----------------- generic map ( READ0DELAY => sys_conf_memctl_read0delay, READ1DELAY => sys_conf_memctl_read1delay, WRITEDELAY => sys_conf_memctl_writedelay) port map ( CLK => CLK, RESET => GRESET, REQ => MEM_REQ, WE => MEM_WE, BUSY => MEM_BUSY, ACK_R => MEM_ACK_R, ACK_W => open, ACT_R => MEM_ACT_R, ACT_W => MEM_ACT_W, ADDR => MEM_ADDR_EXT, BE => MEM_BE, DI => MEM_DI, DO => MEM_DO, O_MEM_CE_N => O_MEM_CE_N, O_MEM_BE_N => O_MEM_BE_N, O_MEM_WE_N => O_MEM_WE_N, O_MEM_OE_N => O_MEM_OE_N, O_MEM_ADV_N => O_MEM_ADV_N, O_MEM_CLK => O_MEM_CLK, O_MEM_CRE => O_MEM_CRE, I_MEM_WAIT => I_MEM_WAIT, O_MEM_ADDR => O_MEM_ADDR, IO_MEM_DATA => IO_MEM_DATA ); LED_IO : ioleds_sp1c -- hio leds from serport ------------- port map ( SER_MONI => SER_MONI, IOLEDS => DSP_DP(3 downto 0) ); DSP_DP(7 downto 4) <= "0010"; ABCLKDIV <= SER_MONI.abclkdiv(11 downto 0) & '0' & SER_MONI.abclkdiv_f; HIO70 : pdp11_hio70 -- hio from sys70 -------------------- generic map ( LWIDTH => LED'length, DCWIDTH => 3) port map ( SEL_LED => SWI(3), SEL_DSP => SWI(5 downto 4), MEM_ACT_R => MEM_ACT_R, MEM_ACT_W => MEM_ACT_W, CP_STAT => CP_STAT, DM_STAT_EXP => DM_STAT_EXP, ABCLKDIV => ABCLKDIV, DISPREG => DISPREG, LED => LED, DSP_DAT => DSP_DAT ); HIO : sn_humanio_rbus -- hio manager ----------------------- generic map ( SWIDTH => 16, BWIDTH => 5, LWIDTH => 16, DCWIDTH => 3, DEBOUNCE => sys_conf_hio_debounce, RB_ADDR => rbaddr_hio) port map ( CLK => CLK, RESET => RESET, CE_MSEC => CE_MSEC, RB_MREQ => RB_MREQ, RB_SRES => RB_SRES_HIO, SWI => SWI, BTN => BTN, LED => LED, DSP_DAT => DSP_DAT, DSP_DP => DSP_DP, I_SWI => I_SWI, I_BTN => I_BTN, O_LED => O_LED, O_ANO_N => O_ANO_N, O_SEG_N => O_SEG_N ); SMRB : if sys_conf_rbd_sysmon generate I0: sysmonx_rbus_base generic map ( -- use default INIT_ (Vccint=1.00) CLK_MHZ => sys_conf_clksys_mhz, RB_ADDR => rbaddr_sysmon) port map ( CLK => CLK, RESET => RESET, RB_MREQ => RB_MREQ, RB_SRES => RB_SRES_SYSMON, ALM => open, OT => open, TEMP => open ); end generate SMRB; UARB : rbd_usracc port map ( CLK => CLK, RB_MREQ => RB_MREQ, RB_SRES => RB_SRES_USRACC ); RB_SRES_OR : rb_sres_or_4 -- rbus or --------------------------- port map ( RB_SRES_1 => RB_SRES_CPU, RB_SRES_2 => RB_SRES_HIO, RB_SRES_3 => RB_SRES_SYSMON, RB_SRES_4 => RB_SRES_USRACC, RB_SRES_OR => RB_SRES ); -- setup unused outputs in nexys4 O_RGBLED0 <= (others=>'0'); O_RGBLED1 <= (others=>not I_BTNRST_N); end syn;
------------------------------------------------------------------------------ -- This file is a part of the GRLIB VHDL IP LIBRARY -- Copyright (C) 2003 - 2008, Gaisler Research -- Copyright (C) 2008 - 2014, Aeroflex Gaisler -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ----------------------------------------------------------------------------- -- Entity: greth_mb -- File: greth_mb.vhd -- Author: Marko Isomaki -- Description: Ethernet Media Access Controller with Ethernet Debug -- Communication Link and dual AHB master interfaces ------------------------------------------------------------------------------ library ieee; library grlib; library gaisler; use ieee.std_logic_1164.all; use grlib.stdlib.all; use grlib.amba.all; use grlib.devices.all; library techmap; use techmap.gencomp.all; use gaisler.net.all; use gaisler.ethernet_mac.all; library eth; use eth.ethcomp.all; entity greth_mb is generic( hindex : integer := 0; ehindex : integer := 0; pindex : integer := 0; paddr : integer := 0; pmask : integer := 16#FFF#; pirq : integer := 0; memtech : integer := 0; ifg_gap : integer := 24; attempt_limit : integer := 16; backoff_limit : integer := 10; slot_time : integer := 128; mdcscaler : integer range 0 to 255 := 25; enable_mdio : integer range 0 to 1 := 0; fifosize : integer range 4 to 512 := 8; nsync : integer range 1 to 2 := 2; edcl : integer range 0 to 3 := 0; edclbufsz : integer range 1 to 64 := 1; macaddrh : integer := 16#00005E#; macaddrl : integer := 16#000000#; ipaddrh : integer := 16#c0a8#; ipaddrl : integer := 16#0035#; phyrstadr : integer range 0 to 32 := 0; rmii : integer range 0 to 1 := 0; oepol : integer range 0 to 1 := 0; scanen : integer range 0 to 1 := 0; ft : integer range 0 to 2 := 0; edclft : integer range 0 to 2 := 0; mdint_pol : integer range 0 to 1 := 0; enable_mdint : integer range 0 to 1 := 0; multicast : integer range 0 to 1 := 0; edclsepahb : integer range 0 to 1 := 0; ramdebug : integer range 0 to 2 := 0; mdiohold : integer := 1; maxsize : integer; gmiimode : integer range 0 to 1 := 0 ); port( rst : in std_ulogic; clk : in std_ulogic; ahbmi : in ahb_mst_in_type; ahbmo : out ahb_mst_out_type; ahbmi2 : in ahb_mst_in_type; ahbmo2 : out ahb_mst_out_type; apbi : in apb_slv_in_type; apbo : out apb_slv_out_type; ethi : in eth_in_type; etho : out eth_out_type ); end entity; architecture rtl of greth_mb is function getfifosize(edcl, fifosize, ebufsize : in integer) return integer is begin if (edcl /= 0) and (ebufsize > fifosize) then return ebufsize; else return fifosize; end if; end function; constant fabits : integer := log2(fifosize); type szvct is array (0 to 6) of integer; constant ebuf : szvct := (64, 128, 128, 256, 256, 256, 256); constant eabits : integer := log2(edclbufsz) + 8; constant bufsize : std_logic_vector(2 downto 0) := conv_std_logic_vector(log2(edclbufsz), 3); constant ebufsize : integer := ebuf(log2(edclbufsz)); constant txfifosize : integer := getfifosize(edcl, fifosize, ebufsize); constant txfabits : integer := log2(txfifosize); constant REVISION : amba_version_type := 0; constant pconfig : apb_config_type := ( 0 => ahb_device_reg ( VENDOR_GAISLER, GAISLER_ETHMAC, 0, REVISION, pirq), 1 => apb_iobar(paddr, pmask)); constant hconfig : ahb_config_type := ( 0 => ahb_device_reg ( VENDOR_GAISLER, GAISLER_ETHMAC, 0, revision, 0), others => zero32); constant ehconfig : ahb_config_type := ( 0 => ahb_device_reg ( VENDOR_GAISLER, GAISLER_EDCLMST, 0, REVISION, 0), others => zero32); signal irq : std_ulogic; --rx ahb fifo signal rxrenable : std_ulogic; signal rxraddress : std_logic_vector(10 downto 0); signal rxwrite : std_ulogic; signal rxwdata : std_logic_vector(31 downto 0); signal rxwaddress : std_logic_vector(10 downto 0); signal rxrdata : std_logic_vector(31 downto 0); --tx ahb fifo signal txrenable : std_ulogic; signal txraddress : std_logic_vector(10 downto 0); signal txwrite : std_ulogic; signal txwdata : std_logic_vector(31 downto 0); signal txwaddress : std_logic_vector(10 downto 0); signal txrdata : std_logic_vector(31 downto 0); --edcl buf signal erenable : std_ulogic; signal eraddress : std_logic_vector(15 downto 0); signal ewritem : std_ulogic; signal ewritel : std_ulogic; signal ewaddressm : std_logic_vector(15 downto 0); signal ewaddressl : std_logic_vector(15 downto 0); signal ewdata : std_logic_vector(31 downto 0); signal erdata : std_logic_vector(31 downto 0); signal lmdio_oe : std_ulogic; -- Fix for wider bus signal hwdata : std_logic_vector(31 downto 0); signal hrdata : std_logic_vector(31 downto 0); signal ehwdata : std_logic_vector(31 downto 0); signal ehrdata : std_logic_vector(31 downto 0); begin ethc0: grethc generic map( ifg_gap => ifg_gap, attempt_limit => attempt_limit, backoff_limit => backoff_limit, mdcscaler => mdcscaler, enable_mdio => enable_mdio, fifosize => fifosize, nsync => nsync, edcl => edcl, edclbufsz => edclbufsz, macaddrh => macaddrh, macaddrl => macaddrl, ipaddrh => ipaddrh, ipaddrl => ipaddrl, phyrstadr => phyrstadr, rmii => rmii, oepol => oepol, scanen => scanen, mdint_pol => mdint_pol, enable_mdint => enable_mdint, multicast => multicast, edclsepahbg => edclsepahb, ramdebug => ramdebug, mdiohold => mdiohold, maxsize => maxsize, gmiimode => gmiimode ) port map( rst => rst, clk => clk, --ahb mst in hgrant => ahbmi.hgrant(hindex), hready => ahbmi.hready, hresp => ahbmi.hresp, hrdata => hrdata, --ahb mst out hbusreq => ahbmo.hbusreq, hlock => ahbmo.hlock, htrans => ahbmo.htrans, haddr => ahbmo.haddr, hwrite => ahbmo.hwrite, hsize => ahbmo.hsize, hburst => ahbmo.hburst, hprot => ahbmo.hprot, hwdata => hwdata, --edcl ahb mst in ehgrant => ahbmi2.hgrant(ehindex), ehready => ahbmi2.hready, ehresp => ahbmi2.hresp, ehrdata => ehrdata, --edcl ahb mst out ehbusreq => ahbmo2.hbusreq, ehlock => ahbmo2.hlock, ehtrans => ahbmo2.htrans, ehaddr => ahbmo2.haddr, ehwrite => ahbmo2.hwrite, ehsize => ahbmo2.hsize, ehburst => ahbmo2.hburst, ehprot => ahbmo2.hprot, ehwdata => ehwdata, --apb slv in psel => apbi.psel(pindex), penable => apbi.penable, paddr => apbi.paddr, pwrite => apbi.pwrite, pwdata => apbi.pwdata, --apb slv out prdata => apbo.prdata, --irq irq => irq, --rx ahb fifo rxrenable => rxrenable, rxraddress => rxraddress, rxwrite => rxwrite, rxwdata => rxwdata, rxwaddress => rxwaddress, rxrdata => rxrdata, --tx ahb fifo txrenable => txrenable, txraddress => txraddress, txwrite => txwrite, txwdata => txwdata, txwaddress => txwaddress, txrdata => txrdata, --edcl buf erenable => erenable, eraddress => eraddress, ewritem => ewritem, ewritel => ewritel, ewaddressm => ewaddressm, ewaddressl => ewaddressl, ewdata => ewdata, erdata => erdata, --ethernet input signals rmii_clk => ethi.rmii_clk, tx_clk => ethi.tx_clk, tx_dv => ethi.tx_dv, rx_clk => ethi.rx_clk, rxd => ethi.rxd(3 downto 0), rx_dv => ethi.rx_dv, rx_er => ethi.rx_er, rx_col => ethi.rx_col, rx_crs => ethi.rx_crs, rx_en => ethi.rx_en, mdio_i => ethi.mdio_i, phyrstaddr => ethi.phyrstaddr, mdint => ethi.mdint, --ethernet output signals reset => etho.reset, txd => etho.txd(3 downto 0), tx_en => etho.tx_en, tx_er => etho.tx_er, mdc => etho.mdc, mdio_o => etho.mdio_o, mdio_oe => lmdio_oe, --scantest testrst => ahbmi.testrst, testen => ahbmi.testen, testoen => ahbmi.testoen, edcladdr => ethi.edcladdr, edclsepahb => ethi.edclsepahb, edcldisable => ethi.edcldisable); etho.mdio_oe <= ahbmi.testoen when (scanen = 1) and (ahbmi.testen = '1') else lmdio_oe; irqdrv : process(irq) begin apbo.pirq <= (others => '0'); apbo.pirq(pirq) <= irq; end process; hrdata <= ahbreadword(ahbmi.hrdata); ahbmo.hwdata <= ahbdrivedata(hwdata); ahbmo.hconfig <= hconfig; ahbmo.hindex <= hindex; ahbmo.hirq <= (others => '0'); ehrdata <= ahbreadword(ahbmi2.hrdata); ahbmo2.hwdata <= ahbdrivedata(ehwdata); ahbmo2.hconfig <= ehconfig; ahbmo2.hindex <= ehindex; ahbmo2.hirq <= (others => '0'); apbo.pconfig <= pconfig; apbo.pindex <= pindex; ------------------------------------------------------------------------------- -- FIFOS ---------------------------------------------------------------------- ------------------------------------------------------------------------------- nft : if ft = 0 generate tx_fifo0 : syncram_2p generic map(tech => memtech, abits => txfabits, dbits => 32, sepclk => 0) port map(clk, txrenable, txraddress(txfabits-1 downto 0), txrdata, clk, txwrite, txwaddress(txfabits-1 downto 0), txwdata); rx_fifo0 : syncram_2p generic map(tech => memtech, abits => fabits, dbits => 32, sepclk => 0) port map(clk, rxrenable, rxraddress(fabits-1 downto 0), rxrdata, clk, rxwrite, rxwaddress(fabits-1 downto 0), rxwdata); end generate; ft1 : if ft /= 0 generate tx_fifo0 : syncram_2pft generic map(tech => memtech, abits => txfabits, dbits => 32, sepclk => 0, ft => ft) port map(clk, txrenable, txraddress(txfabits-1 downto 0), txrdata, clk, txwrite, txwaddress(txfabits-1 downto 0), txwdata); rx_fifo0 : syncram_2pft generic map(tech => memtech, abits => fabits, dbits => 32, sepclk => 0, ft => ft) port map(clk, rxrenable, rxraddress(fabits-1 downto 0), rxrdata, clk, rxwrite, rxwaddress(fabits-1 downto 0), rxwdata); end generate; ------------------------------------------------------------------------------- -- EDCL buffer ram ------------------------------------------------------------ ------------------------------------------------------------------------------- edclramnft : if (edcl /= 0) and (edclft = 0) generate r0 : syncram_2p generic map (memtech, eabits, 16) port map( clk, erenable, eraddress(eabits-1 downto 0), erdata(31 downto 16), clk, ewritem, ewaddressm(eabits-1 downto 0), ewdata(31 downto 16)); r1 : syncram_2p generic map (memtech, eabits, 16) port map( clk, erenable, eraddress(eabits-1 downto 0), erdata(15 downto 0), clk, ewritel, ewaddressl(eabits-1 downto 0), ewdata(15 downto 0)); end generate; edclramft1 : if (edcl /= 0) and (edclft /= 0) generate r0 : syncram_2p generic map (memtech, eabits, 16, 0, 0, ft) port map( clk, erenable, eraddress(eabits-1 downto 0), erdata(31 downto 16), clk, ewritem, ewaddressm(eabits-1 downto 0), ewdata(31 downto 16)); r1 : syncram_2p generic map (memtech, eabits, 16, 0, 0, ft) port map( clk, erenable, eraddress(eabits-1 downto 0), erdata(15 downto 0), clk, ewritel, ewaddressl(eabits-1 downto 0), ewdata(15 downto 0)); end generate; -- pragma translate_off bootmsg : report_version generic map ( "greth" & tost(hindex) & ": 10/100 Mbit Ethernet MAC rev " & tost(REVISION) & tost(hindex) & ", EDCL " & tost(edcl) & ", buffer " & tost(edclbufsz) & " kbyte " & tost(txfifosize) & " txfifo," & " irq " & tost(pirq) ); -- pragma translate_on end architecture;
------------------------------------------------------------------------------- -- system_v_tc_vid_out_0_wrapper.vhd ------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; library UNISIM; use UNISIM.VCOMPONENTS.ALL; library v_tc_v5_01_a; use v_tc_v5_01_a.all; entity system_v_tc_vid_out_0_wrapper is port ( s_axi_aclk : in std_logic; s_axi_aresetn : in std_logic; s_axi_aclken : in std_logic; s_axi_awaddr : in std_logic_vector(8 downto 0); s_axi_awvalid : in std_logic; s_axi_awready : out std_logic; s_axi_wdata : in std_logic_vector(31 downto 0); s_axi_wstrb : in std_logic_vector(3 downto 0); s_axi_wvalid : in std_logic; s_axi_wready : out std_logic; s_axi_bresp : out std_logic_vector(1 downto 0); s_axi_bvalid : out std_logic; s_axi_bready : in std_logic; s_axi_araddr : in std_logic_vector(8 downto 0); s_axi_arvalid : in std_logic; s_axi_arready : out std_logic; s_axi_rdata : out std_logic_vector(31 downto 0); s_axi_rresp : out std_logic_vector(1 downto 0); s_axi_rvalid : out std_logic; s_axi_rready : in std_logic; irq : out std_logic; intc_if : out std_logic_vector(31 downto 0); clk : in std_logic; resetn : in std_logic; clken : in std_logic; det_clken : in std_logic; gen_clken : in std_logic; fsync_in : in std_logic; vblank_in : in std_logic; vsync_in : in std_logic; hblank_in : in std_logic; hsync_in : in std_logic; active_video_in : in std_logic; active_chroma_in : in std_logic; vblank_out : out std_logic; vsync_out : out std_logic; hblank_out : out std_logic; hsync_out : out std_logic; active_video_out : out std_logic; active_chroma_out : out std_logic; fsync_out : out std_logic_vector(0 to 0) ); attribute x_core_info : STRING; attribute x_core_info of system_v_tc_vid_out_0_wrapper : entity is "v_tc_v5_01_a"; end system_v_tc_vid_out_0_wrapper; architecture STRUCTURE of system_v_tc_vid_out_0_wrapper is component v_tc is generic ( C_HAS_AXI4_LITE : INTEGER; C_HAS_INTC_IF : INTEGER; C_GEN_AUTO_SWITCH : integer; C_MAX_PIXELS : integer; C_MAX_LINES : integer; C_NUM_FSYNCS : integer; C_DETECT_EN : integer; C_GENERATE_EN : integer; C_DET_HSYNC_EN : integer; C_DET_VSYNC_EN : integer; C_DET_HBLANK_EN : integer; C_DET_VBLANK_EN : integer; C_DET_AVIDEO_EN : integer; C_DET_ACHROMA_EN : integer; C_GEN_HSYNC_EN : integer; C_GEN_VSYNC_EN : integer; C_GEN_HBLANK_EN : integer; C_GEN_VBLANK_EN : integer; C_GEN_AVIDEO_EN : integer; C_GEN_ACHROMA_EN : integer; C_GEN_VIDEO_FORMAT : INTEGER; C_GEN_CPARITY : integer; C_SYNC_EN : integer; C_GEN_VBLANK_POLARITY : integer; C_GEN_HBLANK_POLARITY : integer; C_GEN_VSYNC_POLARITY : integer; C_GEN_HSYNC_POLARITY : integer; C_GEN_AVIDEO_POLARITY : integer; C_GEN_ACHROMA_POLARITY : integer; C_GEN_VACTIVE_SIZE : integer; C_GEN_HACTIVE_SIZE : integer; C_GEN_HFRAME_SIZE : integer; C_GEN_F0_VFRAME_SIZE : integer; C_GEN_HSYNC_START : integer; C_GEN_HSYNC_END : integer; C_GEN_F0_VBLANK_HSTART : integer; C_GEN_F0_VBLANK_HEND : integer; C_GEN_F0_VSYNC_VSTART : integer; C_GEN_F0_VSYNC_VEND : integer; C_GEN_F0_VSYNC_HSTART : integer; C_GEN_F0_VSYNC_HEND : integer; C_FSYNC_HSTART0 : integer; C_FSYNC_VSTART0 : integer; C_FSYNC_HSTART1 : integer; C_FSYNC_VSTART1 : integer; C_FSYNC_HSTART2 : integer; C_FSYNC_VSTART2 : integer; C_FSYNC_HSTART3 : integer; C_FSYNC_VSTART3 : integer; C_FSYNC_HSTART4 : integer; C_FSYNC_VSTART4 : integer; C_FSYNC_HSTART5 : integer; C_FSYNC_VSTART5 : integer; C_FSYNC_HSTART6 : integer; C_FSYNC_VSTART6 : integer; C_FSYNC_HSTART7 : integer; C_FSYNC_VSTART7 : integer; C_FSYNC_HSTART8 : integer; C_FSYNC_VSTART8 : integer; C_FSYNC_HSTART9 : integer; C_FSYNC_VSTART9 : integer; C_FSYNC_HSTART10 : integer; C_FSYNC_VSTART10 : integer; C_FSYNC_HSTART11 : integer; C_FSYNC_VSTART11 : integer; C_FSYNC_HSTART12 : integer; C_FSYNC_VSTART12 : integer; C_FSYNC_HSTART13 : integer; C_FSYNC_VSTART13 : integer; C_FSYNC_HSTART14 : integer; C_FSYNC_VSTART14 : integer; C_FSYNC_HSTART15 : integer; C_FSYNC_VSTART15 : integer; C_S_AXI_ADDR_WIDTH : INTEGER; C_S_AXI_DATA_WIDTH : INTEGER; C_S_AXI_CLK_FREQ_HZ : INTEGER; C_FAMILY : STRING ); port ( s_axi_aclk : in std_logic; s_axi_aresetn : in std_logic; s_axi_aclken : in std_logic; s_axi_awaddr : in std_logic_vector((C_S_AXI_ADDR_WIDTH-1) downto 0); s_axi_awvalid : in std_logic; s_axi_awready : out std_logic; s_axi_wdata : in std_logic_vector((C_S_AXI_DATA_WIDTH-1) downto 0); s_axi_wstrb : in std_logic_vector(((C_S_AXI_DATA_WIDTH/8)-1) downto 0); s_axi_wvalid : in std_logic; s_axi_wready : out std_logic; s_axi_bresp : out std_logic_vector(1 downto 0); s_axi_bvalid : out std_logic; s_axi_bready : in std_logic; s_axi_araddr : in std_logic_vector((C_S_AXI_ADDR_WIDTH-1) downto 0); s_axi_arvalid : in std_logic; s_axi_arready : out std_logic; s_axi_rdata : out std_logic_vector((C_S_AXI_DATA_WIDTH-1) downto 0); s_axi_rresp : out std_logic_vector(1 downto 0); s_axi_rvalid : out std_logic; s_axi_rready : in std_logic; irq : out std_logic; intc_if : out std_logic_vector(31 downto 0); clk : in std_logic; resetn : in std_logic; clken : in std_logic; det_clken : in std_logic; gen_clken : in std_logic; fsync_in : in std_logic; vblank_in : in std_logic; vsync_in : in std_logic; hblank_in : in std_logic; hsync_in : in std_logic; active_video_in : in std_logic; active_chroma_in : in std_logic; vblank_out : out std_logic; vsync_out : out std_logic; hblank_out : out std_logic; hsync_out : out std_logic; active_video_out : out std_logic; active_chroma_out : out std_logic; fsync_out : out std_logic_vector(C_NUM_FSYNCS-1 to 0) ); end component; begin v_tc_vid_out_0 : v_tc generic map ( C_HAS_AXI4_LITE => 1, C_HAS_INTC_IF => 0, C_GEN_AUTO_SWITCH => 1, C_MAX_PIXELS => 4096, C_MAX_LINES => 4096, C_NUM_FSYNCS => 1, C_DETECT_EN => 0, C_GENERATE_EN => 1, C_DET_HSYNC_EN => 1, C_DET_VSYNC_EN => 1, C_DET_HBLANK_EN => 1, C_DET_VBLANK_EN => 1, C_DET_AVIDEO_EN => 1, C_DET_ACHROMA_EN => 0, C_GEN_HSYNC_EN => 1, C_GEN_VSYNC_EN => 1, C_GEN_HBLANK_EN => 1, C_GEN_VBLANK_EN => 1, C_GEN_AVIDEO_EN => 1, C_GEN_ACHROMA_EN => 0, C_GEN_VIDEO_FORMAT => 0, C_GEN_CPARITY => 0, C_SYNC_EN => 1, C_GEN_VBLANK_POLARITY => 1, C_GEN_HBLANK_POLARITY => 1, C_GEN_VSYNC_POLARITY => 1, C_GEN_HSYNC_POLARITY => 1, C_GEN_AVIDEO_POLARITY => 1, C_GEN_ACHROMA_POLARITY => 1, C_GEN_VACTIVE_SIZE => 720, C_GEN_HACTIVE_SIZE => 1280, C_GEN_HFRAME_SIZE => 1650, C_GEN_F0_VFRAME_SIZE => 750, C_GEN_HSYNC_START => 1390, C_GEN_HSYNC_END => 1430, C_GEN_F0_VBLANK_HSTART => 1280, C_GEN_F0_VBLANK_HEND => 1280, C_GEN_F0_VSYNC_VSTART => 724, C_GEN_F0_VSYNC_VEND => 729, C_GEN_F0_VSYNC_HSTART => 1280, C_GEN_F0_VSYNC_HEND => 1280, C_FSYNC_HSTART0 => 0, C_FSYNC_VSTART0 => 0, C_FSYNC_HSTART1 => 0, C_FSYNC_VSTART1 => 0, C_FSYNC_HSTART2 => 0, C_FSYNC_VSTART2 => 0, C_FSYNC_HSTART3 => 0, C_FSYNC_VSTART3 => 0, C_FSYNC_HSTART4 => 0, C_FSYNC_VSTART4 => 0, C_FSYNC_HSTART5 => 0, C_FSYNC_VSTART5 => 0, C_FSYNC_HSTART6 => 0, C_FSYNC_VSTART6 => 0, C_FSYNC_HSTART7 => 0, C_FSYNC_VSTART7 => 0, C_FSYNC_HSTART8 => 0, C_FSYNC_VSTART8 => 0, C_FSYNC_HSTART9 => 0, C_FSYNC_VSTART9 => 0, C_FSYNC_HSTART10 => 0, C_FSYNC_VSTART10 => 0, C_FSYNC_HSTART11 => 0, C_FSYNC_VSTART11 => 0, C_FSYNC_HSTART12 => 0, C_FSYNC_VSTART12 => 0, C_FSYNC_HSTART13 => 0, C_FSYNC_VSTART13 => 0, C_FSYNC_HSTART14 => 0, C_FSYNC_VSTART14 => 0, C_FSYNC_HSTART15 => 0, C_FSYNC_VSTART15 => 0, C_S_AXI_ADDR_WIDTH => 9, C_S_AXI_DATA_WIDTH => 32, C_S_AXI_CLK_FREQ_HZ => 100000000, C_FAMILY => "zynq" ) port map ( s_axi_aclk => s_axi_aclk, s_axi_aresetn => s_axi_aresetn, s_axi_aclken => s_axi_aclken, s_axi_awaddr => s_axi_awaddr, s_axi_awvalid => s_axi_awvalid, s_axi_awready => s_axi_awready, s_axi_wdata => s_axi_wdata, s_axi_wstrb => s_axi_wstrb, s_axi_wvalid => s_axi_wvalid, s_axi_wready => s_axi_wready, s_axi_bresp => s_axi_bresp, s_axi_bvalid => s_axi_bvalid, s_axi_bready => s_axi_bready, s_axi_araddr => s_axi_araddr, s_axi_arvalid => s_axi_arvalid, s_axi_arready => s_axi_arready, s_axi_rdata => s_axi_rdata, s_axi_rresp => s_axi_rresp, s_axi_rvalid => s_axi_rvalid, s_axi_rready => s_axi_rready, irq => irq, intc_if => intc_if, clk => clk, resetn => resetn, clken => clken, det_clken => det_clken, gen_clken => gen_clken, fsync_in => fsync_in, vblank_in => vblank_in, vsync_in => vsync_in, hblank_in => hblank_in, hsync_in => hsync_in, active_video_in => active_video_in, active_chroma_in => active_chroma_in, vblank_out => vblank_out, vsync_out => vsync_out, hblank_out => hblank_out, hsync_out => hsync_out, active_video_out => active_video_out, active_chroma_out => active_chroma_out, fsync_out => fsync_out ); end architecture STRUCTURE;
------------------------------------------------------------------------------- -- -- Copyright (c) 1989 by Intermetrics, Inc. -- All rights reserved. -- ------------------------------------------------------------------------------- -- -- TEST NAME: -- -- CT00520 -- -- AUTHOR: -- -- A. Wilmot -- -- TEST OBJECTIVES: -- -- 7.3.2.2 (12) -- 7.3.2.2 (15) -- 7.3.2.2 (16) -- -- DESIGN UNIT ORDERING: -- -- PKG00520 -- ENT00520(ARCH00520) -- ENT00520_Test_Bench(ARCH00520_Test_Bench) -- -- REVISION HISTORY: -- -- 12-AUG-1987 - initial revision -- 11-APR-1988 - JW: Test was really bogus. -- -- NOTES: -- -- self-checking -- package PKG00520 is type rec_1 is record f1 : integer ; f2 : boolean ; end record ; subtype brange is integer range 4 downto 0 ; subtype crange is integer range 1 downto 1 ; subtype drange is integer range 0 to 2 ; type arr_1 is array ( boolean range <> , crange range <> ) of rec_1 ; type time_matrix is array ( drange range <> , brange range <> ) of time ; type bit_matrix is array ( brange range <> , drange range <> ) of bit ; type bit_arr_vec is array ( brange range <> ) of bit_vector ( 0 to 2 ) ; end PKG00520 ; use WORK.STANDARD_TYPES.all ; use WORK.PKG00520.all ; entity ENT00520 is generic ( g_arr_1 : arr_1 ; g_time_matrix : time_matrix ; g_bit_matrix : bit_matrix ; g_bitarr_vec : bit_arr_vec ; g_string : string ; g_bit_vector : bit_vector ) ; -- JW: Added defaults to ports. port ( p_arr_1 : arr_1 := ( (1 => (1, true)), (1 => (0, false)) ) ; p_time_matrix : time_matrix := ( (15 ns, 15ms, 15 ps, 15 fs, 9 ns), (10 ns, 10ms, 10 ps, 10 fs, 6 ns), (5 ns, 5ms, 5 ps, 5 fs, 3 ns) ) ; p_bit_matrix : bit_matrix := ( B"000", B"001", B"010", B"011", B"111" ) ; p_bitarr_vec : bit_arr_vec := ( B"000", B"001", B"010", B"011", B"111" ) ; p_string : string := ( "abcDEF" ) ; p_bit_vector : bit_vector := ( ('1', '0', '0') ) ) ; procedure p1 ( p_arr_1 : arr_1 ; p_time_matrix : time_matrix ; p_bit_matrix : bit_matrix ; p_bitarr_vec : bit_arr_vec ; p_string : string ; p_bit_vector : bit_vector ) is variable correct : boolean := true ; subtype rg_arr_11 is boolean range g_arr_1'range(1) ; subtype rg_arr_12 is integer range g_arr_1'range(2) ; subtype rg_time_matrix1 is integer range g_time_matrix'range(1) ; subtype rg_time_matrix2 is integer range g_time_matrix'range(2) ; subtype rg_bit_matrix1 is integer range g_bit_matrix'range(1) ; subtype rg_bit_matrix2 is integer range g_bit_matrix'range(2) ; subtype rg_bitarr_vec1 is integer range g_bitarr_vec'range(1) ; subtype rg_string is integer range g_string'range ; subtype rg_bit_vector is integer range g_bit_vector'range ; subtype rp_arr_11 is boolean range p_arr_1'range(1) ; subtype rp_arr_12 is integer range p_arr_1'range(2) ; subtype rp_time_matrix1 is integer range p_time_matrix'range(1) ; subtype rp_time_matrix2 is integer range p_time_matrix'range(2) ; subtype rp_bit_matrix1 is integer range p_bit_matrix'range(1) ; subtype rp_bit_matrix2 is integer range p_bit_matrix'range(2) ; subtype rp_bitarr_vec1 is integer range p_bitarr_vec'range(1) ; subtype rp_string is integer range p_string'range ; subtype rp_bit_vector is integer range p_bit_vector'range ; begin correct := correct and rg_arr_11'left <= rg_arr_11'right ; correct := correct and rg_arr_11'left = false and rg_arr_11'right = true ; correct := correct and rg_arr_12'right <= rg_arr_12'left ; correct := correct and rg_arr_12'left = 1 and rg_arr_12'right = 1 ; correct := correct and rg_time_matrix1'left <= rg_time_matrix1'right ; correct := correct and rg_time_matrix1'left = 0 and rg_time_matrix1'right = 2 ; correct := correct and rg_time_matrix2'right <= rg_time_matrix2'left ; correct := correct and rg_time_matrix2'left = 4 and rg_time_matrix2'right = 0 ; correct := correct and rg_bit_matrix1'right <= rg_bit_matrix1'left ; correct := correct and rg_bit_matrix1'left = 4 and rg_bit_matrix1'right = 0 ; correct := correct and rg_bit_matrix2'left <= rg_bit_matrix2'right ; correct := correct and rg_bit_matrix2'left = 0 and rg_bit_matrix2'right = 2 ; correct := correct and rg_bitarr_vec1'right <= rg_bitarr_vec1'left ; correct := correct and rg_bitarr_vec1'left = 4 and rg_bitarr_vec1'right = 0 ; correct := correct and rg_string'left <= rg_string'right ; correct := correct and rg_string'left = 1 and rg_string'right = 6 ; correct := correct and rg_bit_vector'left <= rg_bit_vector'right ; correct := correct and rg_bit_vector'left = 0 and rg_bit_vector'right = 2 ; correct := correct and rp_arr_11'left <= rp_arr_11'right ; correct := correct and rp_arr_11'left = false and rp_arr_11'right = true ; correct := correct and rp_arr_12'right <= rp_arr_12'left ; correct := correct and rp_arr_12'left = 1 and rp_arr_12'right = 1 ; correct := correct and rp_time_matrix1'left <= rp_time_matrix1'right ; correct := correct and rp_time_matrix1'left = 0 and rp_time_matrix1'right = 2 ; correct := correct and rp_time_matrix2'right <= rp_time_matrix2'left ; correct := correct and rp_time_matrix2'left = 4 and rp_time_matrix2'right = 0 ; correct := correct and rp_bit_matrix1'right <= rp_bit_matrix1'left ; correct := correct and rp_bit_matrix1'left = 4 and rp_bit_matrix1'right = 0 ; correct := correct and rp_bit_matrix2'left <= rp_bit_matrix2'right ; correct := correct and rp_bit_matrix2'left = 0 and rp_bit_matrix2'right = 2 ; correct := correct and rp_bitarr_vec1'right <= rp_bitarr_vec1'left ; correct := correct and rp_bitarr_vec1'left = 4 and rp_bitarr_vec1'right = 0 ; correct := correct and rp_string'left <= rp_string'right ; correct := correct and rp_string'left = 1 and rp_string'right = 6 ; correct := correct and rp_bit_vector'left <= rp_bit_vector'right ; correct := correct and rp_bit_vector'left = 0 and rp_bit_vector'right = 2 ; test_report ( "ARCH00520" , "Positional aggregates associated with unconstrained" & " generics and parameters" , correct ) ; end p1 ; end ENT00520 ; architecture ARCH00520 of ENT00520 is begin process variable correct : boolean := true ; subtype rp_arr_11 is boolean range p_arr_1'range(1) ; subtype rp_arr_12 is integer range p_arr_1'range(2) ; subtype rp_time_matrix1 is integer range p_time_matrix'range(1) ; subtype rp_time_matrix2 is integer range p_time_matrix'range(2) ; subtype rp_bit_matrix1 is integer range p_bit_matrix'range(1) ; subtype rp_bit_matrix2 is integer range p_bit_matrix'range(2) ; subtype rp_bitarr_vec1 is integer range p_bitarr_vec'range(1) ; subtype rp_string is integer range p_string'range ; subtype rp_bit_vector is integer range p_bit_vector'range ; begin p1 ( ( (1 => (1, true)), (1 => (0, false)) ) , ( (15 ns, 15ms, 15 ps, 15 fs, 9 ns), (10 ns, 10ms, 10 ps, 10 fs, 6 ns), (5 ns, 5ms, 5 ps, 5 fs, 3 ns) ) , ( B"000", B"001", B"010", B"011", B"111" ) , ( B"000", B"001", B"010", B"011", B"111" ) , ( "abcDEF" ) , ( ('1', '0', '0') ) ) ; correct := correct and rp_arr_11'left <= rp_arr_11'right ; correct := correct and rp_arr_11'left = false and rp_arr_11'right = true ; correct := correct and rp_arr_12'right <= rp_arr_12'left ; correct := correct and rp_arr_12'left = 1 and rp_arr_12'right = 1 ; correct := correct and rp_time_matrix1'left <= rp_time_matrix1'right ; correct := correct and rp_time_matrix1'left = 0 and rp_time_matrix1'right = 2 ; correct := correct and rp_time_matrix2'right <= rp_time_matrix2'left ; correct := correct and rp_time_matrix2'left = 4 and rp_time_matrix2'right = 0 ; correct := correct and rp_bit_matrix1'right <= rp_bit_matrix1'left ; correct := correct and rp_bit_matrix1'left = 4 and rp_bit_matrix1'right = 0 ; correct := correct and rp_bit_matrix2'left <= rp_bit_matrix2'right ; correct := correct and rp_bit_matrix2'left = 0 and rp_bit_matrix2'right = 2 ; correct := correct and rp_bitarr_vec1'right <= rp_bitarr_vec1'left ; correct := correct and rp_bitarr_vec1'left = 4 and rp_bitarr_vec1'right = 0 ; correct := correct and rp_string'left <= rp_string'right ; correct := correct and rp_string'left = 1 and rp_string'right = 6 ; correct := correct and rp_bit_vector'left <= rp_bit_vector'right ; correct := correct and rp_bit_vector'left = 0 and rp_bit_vector'right = 2 ; test_report ( "ARCH00520" , "Positional aggregates associated with unconstrained" & " signals" , correct ) ; wait ; end process ; end ARCH00520 ; use WORK.PKG00520.all ; entity ENT00520_Test_Bench is end ENT00520_Test_Bench ; architecture ARCH00520_Test_Bench of ENT00520_Test_Bench is begin L1: block component UUT -- JW: Generic ports were missing here generic ( g_arr_1 : arr_1 ; g_time_matrix : time_matrix ; g_bit_matrix : bit_matrix ; g_bitarr_vec : bit_arr_vec ; g_string : string ; g_bit_vector : bit_vector ) ; end component ; for CIS1 : UUT use entity WORK.ENT00520 ( ARCH00520 ) ; begin CIS1 : UUT generic map ( ( (1 => (1, true)), (1 => (0, false)) ), ( (15 ns, 15ms, 15 ps, 15 fs, 9 ns), (10 ns, 10ms, 10 ps, 10 fs, 6 ns), (5 ns, 5ms, 5 ps, 5 fs, 3 ns) ) , ( B"000", B"001", B"010", B"011", B"111" ) , ( B"000", B"001", B"010", B"011", B"111" ) , ( "abcDEF" ) , ( ('1', '0', '0') ) ); -- JW: Removed port map which was attempting to associate literals with ports. end block L1 ; end ARCH00520_Test_Bench ;
--HIDE_STR entity LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE WORK.MYTYPE.ALL; ENTITY HIDE_STR IS PORT(CLK: IN STD_LOGIC; RESET: IN STD_LOGIC; ENABLE: IN STD_LOGIC; R_IN: IN COLOR; G_IN: IN COLOR; B_IN: IN COLOR; XX: IN COLOR; YY: IN COLOR; ZZ: IN INTEGER RANGE 0 TO 2; --VHDL中string的下标从1开始 STR: IN STRING(1 TO 20); HR_OUT: OUT COLOR; HG_OUT: OUT COLOR; HB_OUT: OUT COLOR); END ENTITY HIDE_STR; ARCHITECTURE ART1 OF HIDE_STR IS SIGNAL INDEX: INTEGER RANGE 0 TO 65535; SIGNAL LEN: INTEGER RANGE 0 TO 65535; BEGIN COMPUTE: PROCESS(XX,YY,STR) BEGIN INDEX<=YY+1+256*XX; LEN<= 8 * STR'LENGTH; END PROCESS; CLOCK: PROCESS(CLK,RESET,ENABLE) VARIABLE FIXED_REM: COLOR; VARIABLE COLOR_REM: STD_LOGIC_VECTOR(7 DOWNTO 0); --COUNT的范围是256*256 VARIABLE COUNT: INTEGER RANGE 0 TO 65536; VARIABLE CHAR_I: INTEGER RANGE 0 TO 8; --STR_I的范围65535/8 VARIABLE STR_I: INTEGER RANGE 1 TO 8192; VARIABLE CHAR_REM: STD_LOGIC_VECTOR(7 DOWNTO 0); BEGIN IF(RESET='1' OR ENABLE='0') THEN HR_OUT<=0; HG_OUT<=0; HB_OUT<=0; COUNT:=0; CHAR_I:=0; --VHDL中string的下标从1开始 STR_I:=1; ELSIF(COUNT=65536) THEN HR_OUT<=0; HG_OUT<=0; HB_OUT<=0; ELSIF(CLK'EVENT AND CLK='1') THEN COUNT:=COUNT+1; IF(ZZ=0) THEN IF( (COUNT>=INDEX) AND (COUNT<INDEX+LEN)) THEN -- 取出8 bit 数据 COLOR_REM := CONV_STD_LOGIC_VECTOR(R_IN, 8); IF(CHAR_I=0) THEN CHAR_REM:=CONV_TO_VECTOR(STR(STR_I)); END IF; -- 更改 LSB位 COLOR_REM(0):= CHAR_REM(CHAR_I); -- 将更改输出 HR_OUT<= CONV_INTEGER(UNSIGNED(COLOR_REM)); IF(CHAR_I<=7) THEN CHAR_I:=CHAR_I+1; END IF; IF(CHAR_I=8) THEN CHAR_I:=0; STR_I:=STR_I+1; END IF; ELSE HR_OUT<=R_IN; END IF; HB_OUT<=B_IN; HG_OUT<=G_IN; ELSIF(ZZ=1) THEN IF( (COUNT>=INDEX) AND (COUNT<INDEX+LEN)) THEN -- 取出8 bit 数据 COLOR_REM := CONV_STD_LOGIC_VECTOR(G_IN, 8); IF(CHAR_I=0) THEN CHAR_REM:=CONV_TO_VECTOR(STR(STR_I)); END IF; -- 更改 LSB位 COLOR_REM(0):= CHAR_REM(CHAR_I); -- 将更改输出 HG_OUT<= CONV_INTEGER(UNSIGNED(COLOR_REM)); IF(CHAR_I<=7) THEN CHAR_I:=CHAR_I+1; END IF; IF(CHAR_I=8) THEN CHAR_I:=0; STR_I:=STR_I+1; END IF; ELSE HG_OUT<=G_IN; END IF; HR_OUT<=R_IN; HB_OUT<=B_IN; ELSIF(ZZ=2) THEN IF( (COUNT>=INDEX) AND (COUNT<INDEX+LEN)) THEN -- 取出8 bit 数据 COLOR_REM := CONV_STD_LOGIC_VECTOR(B_IN, 8); IF(CHAR_I=0) THEN CHAR_REM:=CONV_TO_VECTOR(STR(STR_I)); END IF; -- 更改 LSB位 COLOR_REM(0):= CHAR_REM(CHAR_I); -- 将更改输出 HB_OUT<= CONV_INTEGER(UNSIGNED(COLOR_REM)); IF(CHAR_I<=7) THEN CHAR_I:=CHAR_I+1; END IF; IF(CHAR_I=8) THEN CHAR_I:=0; STR_I:=STR_I+1; END IF; ELSE HB_OUT<=B_IN; END IF; HR_OUT<=R_IN; HG_OUT<=G_IN; END IF; END IF; END PROCESS; END ARCHITECTURE ART1;
Library IEEE; use IEEE.STD_LOGIC_1164.all; entity Mux2_1Demo is port( SW : in STD_LOGIC_VECTOR(3 downto 0); KEY : in STD_LOGIC_VECTOR(3 downto 2); LEDR : out STD_LOGIC_VECTOR(0 downto 0)); end Mux2_1Demo; Architecture Shell of Mux2_1Demo is begin system_core: entity work.Mux2_1(BehavProcess) port map( dataln(0) => SW(0), dataln(1) => SW(1), dataln(2) => SW(2), dataln(3) => SW(3), sel(1) => KEY(3), sel(0) => KEY(2), dataOut => LEDR(0)); end Shell;
Library IEEE; use IEEE.STD_LOGIC_1164.all; entity Mux2_1Demo is port( SW : in STD_LOGIC_VECTOR(3 downto 0); KEY : in STD_LOGIC_VECTOR(3 downto 2); LEDR : out STD_LOGIC_VECTOR(0 downto 0)); end Mux2_1Demo; Architecture Shell of Mux2_1Demo is begin system_core: entity work.Mux2_1(BehavProcess) port map( dataln(0) => SW(0), dataln(1) => SW(1), dataln(2) => SW(2), dataln(3) => SW(3), sel(1) => KEY(3), sel(0) => KEY(2), dataOut => LEDR(0)); end Shell;
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc3070.vhd,v 1.2 2001-10-26 16:29:51 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- package c12s06b02x00p06n01i03070pkg is type integer_cons_vector is array (15 downto 0) of integer; constant C19 : integer_cons_vector := (others => 3); end c12s06b02x00p06n01i03070pkg; use work.c12s06b02x00p06n01i03070pkg.all; ENTITY c12s06b02x00p06n01i03070ent_a IS PORT ( F1: OUT integer ; F3: IN integer_cons_vector; FF: OUT integer := 0 ); END c12s06b02x00p06n01i03070ent_a; ARCHITECTURE c12s06b02x00p06n01i03070arch_a OF c12s06b02x00p06n01i03070ent_a IS BEGIN TESTING: PROCESS begin F1 <= 3; wait for 0 ns; assert F3'active = true report"no activity on F3 when there is activity on actual" severity failure; if (not(F3'active = true)) then F1 <= 11; end if; assert F3(0)'active = true report"no activity on F3 when there is activity on actual" severity failure; if (not(F3(0)'active = true)) then F1 <= 11; end if; assert F3(15)'active = true report"no activity on F3 when there is activity on actual" severity failure; if (not(F3(15)'active = true)) then F1 <= 11; end if; wait; END PROCESS; END c12s06b02x00p06n01i03070arch_a; use work.c12s06b02x00p06n01i03070pkg.all; ENTITY c12s06b02x00p06n01i03070ent IS END c12s06b02x00p06n01i03070ent; ARCHITECTURE c12s06b02x00p06n01i03070arch OF c12s06b02x00p06n01i03070ent IS function scalar_complex(s : integer) return integer_cons_vector is begin return C19; end scalar_complex; component model PORT ( F1: OUT integer; F3: IN integer_cons_vector; FF: OUT integer ); end component; for T1 : model use entity work.c12s06b02x00p06n01i03070ent_a(c12s06b02x00p06n01i03070arch_a); signal S1 : integer_cons_vector; signal S3 : integer; signal SS : integer := 0; BEGIN T1: model port map ( scalar_complex(F1) => S1, F3 => scalar_complex(S3), FF => SS ); TESTING: PROCESS BEGIN S3 <= 3; wait for 0 ns; assert S1'active = true report"no activity on F3 when there is activity on actual" severity failure; assert S1(0)'active = true report"no activity on F3 when there is activity on actual" severity failure; assert S1(15)'active = true report"no activity on F3 when there is activity on actual" severity failure; assert NOT(S1'active = true and S1(0)'active = true and S1(15)'active = true and SS = 0) report "***PASSED TEST: c12s06b02x00p06n01i03070" severity NOTE; assert (S1'active = true and S1(0)'active = true and S1(15)'active = true and SS = 0) report "***FAILED TEST: c12s06b02x00p06n01i03070 - Not every scalar subelement is active if the source itself is active." severity ERROR; wait; END PROCESS TESTING; END c12s06b02x00p06n01i03070arch;
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc3070.vhd,v 1.2 2001-10-26 16:29:51 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- package c12s06b02x00p06n01i03070pkg is type integer_cons_vector is array (15 downto 0) of integer; constant C19 : integer_cons_vector := (others => 3); end c12s06b02x00p06n01i03070pkg; use work.c12s06b02x00p06n01i03070pkg.all; ENTITY c12s06b02x00p06n01i03070ent_a IS PORT ( F1: OUT integer ; F3: IN integer_cons_vector; FF: OUT integer := 0 ); END c12s06b02x00p06n01i03070ent_a; ARCHITECTURE c12s06b02x00p06n01i03070arch_a OF c12s06b02x00p06n01i03070ent_a IS BEGIN TESTING: PROCESS begin F1 <= 3; wait for 0 ns; assert F3'active = true report"no activity on F3 when there is activity on actual" severity failure; if (not(F3'active = true)) then F1 <= 11; end if; assert F3(0)'active = true report"no activity on F3 when there is activity on actual" severity failure; if (not(F3(0)'active = true)) then F1 <= 11; end if; assert F3(15)'active = true report"no activity on F3 when there is activity on actual" severity failure; if (not(F3(15)'active = true)) then F1 <= 11; end if; wait; END PROCESS; END c12s06b02x00p06n01i03070arch_a; use work.c12s06b02x00p06n01i03070pkg.all; ENTITY c12s06b02x00p06n01i03070ent IS END c12s06b02x00p06n01i03070ent; ARCHITECTURE c12s06b02x00p06n01i03070arch OF c12s06b02x00p06n01i03070ent IS function scalar_complex(s : integer) return integer_cons_vector is begin return C19; end scalar_complex; component model PORT ( F1: OUT integer; F3: IN integer_cons_vector; FF: OUT integer ); end component; for T1 : model use entity work.c12s06b02x00p06n01i03070ent_a(c12s06b02x00p06n01i03070arch_a); signal S1 : integer_cons_vector; signal S3 : integer; signal SS : integer := 0; BEGIN T1: model port map ( scalar_complex(F1) => S1, F3 => scalar_complex(S3), FF => SS ); TESTING: PROCESS BEGIN S3 <= 3; wait for 0 ns; assert S1'active = true report"no activity on F3 when there is activity on actual" severity failure; assert S1(0)'active = true report"no activity on F3 when there is activity on actual" severity failure; assert S1(15)'active = true report"no activity on F3 when there is activity on actual" severity failure; assert NOT(S1'active = true and S1(0)'active = true and S1(15)'active = true and SS = 0) report "***PASSED TEST: c12s06b02x00p06n01i03070" severity NOTE; assert (S1'active = true and S1(0)'active = true and S1(15)'active = true and SS = 0) report "***FAILED TEST: c12s06b02x00p06n01i03070 - Not every scalar subelement is active if the source itself is active." severity ERROR; wait; END PROCESS TESTING; END c12s06b02x00p06n01i03070arch;
-- Copyright (C) 2001 Bill Billowitch. -- Some of the work to develop this test suite was done with Air Force -- support. The Air Force and Bill Billowitch assume no -- responsibilities for this software. -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: tc3070.vhd,v 1.2 2001-10-26 16:29:51 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- package c12s06b02x00p06n01i03070pkg is type integer_cons_vector is array (15 downto 0) of integer; constant C19 : integer_cons_vector := (others => 3); end c12s06b02x00p06n01i03070pkg; use work.c12s06b02x00p06n01i03070pkg.all; ENTITY c12s06b02x00p06n01i03070ent_a IS PORT ( F1: OUT integer ; F3: IN integer_cons_vector; FF: OUT integer := 0 ); END c12s06b02x00p06n01i03070ent_a; ARCHITECTURE c12s06b02x00p06n01i03070arch_a OF c12s06b02x00p06n01i03070ent_a IS BEGIN TESTING: PROCESS begin F1 <= 3; wait for 0 ns; assert F3'active = true report"no activity on F3 when there is activity on actual" severity failure; if (not(F3'active = true)) then F1 <= 11; end if; assert F3(0)'active = true report"no activity on F3 when there is activity on actual" severity failure; if (not(F3(0)'active = true)) then F1 <= 11; end if; assert F3(15)'active = true report"no activity on F3 when there is activity on actual" severity failure; if (not(F3(15)'active = true)) then F1 <= 11; end if; wait; END PROCESS; END c12s06b02x00p06n01i03070arch_a; use work.c12s06b02x00p06n01i03070pkg.all; ENTITY c12s06b02x00p06n01i03070ent IS END c12s06b02x00p06n01i03070ent; ARCHITECTURE c12s06b02x00p06n01i03070arch OF c12s06b02x00p06n01i03070ent IS function scalar_complex(s : integer) return integer_cons_vector is begin return C19; end scalar_complex; component model PORT ( F1: OUT integer; F3: IN integer_cons_vector; FF: OUT integer ); end component; for T1 : model use entity work.c12s06b02x00p06n01i03070ent_a(c12s06b02x00p06n01i03070arch_a); signal S1 : integer_cons_vector; signal S3 : integer; signal SS : integer := 0; BEGIN T1: model port map ( scalar_complex(F1) => S1, F3 => scalar_complex(S3), FF => SS ); TESTING: PROCESS BEGIN S3 <= 3; wait for 0 ns; assert S1'active = true report"no activity on F3 when there is activity on actual" severity failure; assert S1(0)'active = true report"no activity on F3 when there is activity on actual" severity failure; assert S1(15)'active = true report"no activity on F3 when there is activity on actual" severity failure; assert NOT(S1'active = true and S1(0)'active = true and S1(15)'active = true and SS = 0) report "***PASSED TEST: c12s06b02x00p06n01i03070" severity NOTE; assert (S1'active = true and S1(0)'active = true and S1(15)'active = true and SS = 0) report "***FAILED TEST: c12s06b02x00p06n01i03070 - Not every scalar subelement is active if the source itself is active." severity ERROR; wait; END PROCESS TESTING; END c12s06b02x00p06n01i03070arch;
------------------------------------------------------------------------------- -- basic_sfifo_fg.vhd ------------------------------------------------------------------------------- -- -- ************************************************************************* -- -- (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- ************************************************************************* -- ------------------------------------------------------------------------------- -- Filename: basic_sfifo_fg.vhd -- -- Description: -- This HDL file implements a basic synchronous (single clock) fifo using the -- FIFO Generator tool. It is intended to offer a simple interface to the user -- with the complexity of the FIFO Generator interface hidden from the user. -- -- Note that in normal op mode (not First Word Fall Through FWFT) the data count -- output goes to zero when the FIFO goes full. This the way FIFO Generator works. -- -- -- VHDL-Standard: VHDL'93 ------------------------------------------------------------------------------- -- Structure: -- basic_sfifo_fg.vhd -- | -- |-- fifo_generator_v8_2 -- ------------------------------------------------------------------------------- -- Revision History: -- -- -- Author: DET -- Revision: $Revision: 1.0 $ -- Date: $3/07/2011$ -- -- History: -- DET 3/07/2011 Initial Version -- ------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library fifo_generator_v11_0; use fifo_generator_v11_0.all; library proc_common_v4_0; use proc_common_v4_0.proc_common_pkg.all; use proc_common_v4_0.proc_common_pkg.log2; --use proc_common_v4_0.coregen_comp_defs.all; -- synopsys translate_off --library XilinxCoreLib; --use XilinxCoreLib.all; -- synopsys translate_on ------------------------------------------------------------------------------- entity basic_sfifo_fg is generic ( C_DWIDTH : Integer := 32 ; -- FIFO data Width (Read and write data ports are symetric) C_DEPTH : Integer := 512 ; -- FIFO Depth (set to power of 2) C_HAS_DATA_COUNT : integer := 1 ; -- 0 = Data Count output not needed -- 1 = Data Count output needed C_DATA_COUNT_WIDTH : integer := 10 ; -- Data Count bit width (Max value is log2(C_DEPTH)) C_IMPLEMENTATION_TYPE : integer range 0 to 1 := 0; -- 0 = Common Clock BRAM / Distributed RAM (Synchronous FIFO) -- 1 = Common Clock Shift Register (Synchronous FIFO) C_MEMORY_TYPE : integer := 1; -- 0 = Any -- 1 = BRAM -- 2 = Distributed Memory -- 3 = Shift Registers C_PRELOAD_REGS : integer := 1; -- 0 = normal -- 1 = FWFT C_PRELOAD_LATENCY : integer := 0; -- 0 = FWFT -- 1 = normal C_USE_FWFT_DATA_COUNT : integer := 0; -- 0 = normal -- 1 for FWFT C_SYNCHRONIZER_STAGE : integer := 2; -- valid values are 0 to 8; C_FAMILY : string := "virtex6" ); port ( CLK : IN std_logic := '0'; DIN : IN std_logic_vector(C_DWIDTH-1 DOWNTO 0) := (OTHERS => '0'); RD_EN : IN std_logic := '0'; SRST : IN std_logic := '0'; WR_EN : IN std_logic := '0'; DATA_COUNT : OUT std_logic_vector(C_DATA_COUNT_WIDTH-1 DOWNTO 0); DOUT : OUT std_logic_vector(C_DWIDTH-1 DOWNTO 0); EMPTY : OUT std_logic; FULL : OUT std_logic ); end entity basic_sfifo_fg; architecture implementation of basic_sfifo_fg is -- Constant Declarations ---------------------------------------------- Constant POINTER_WIDTH : integer := log2(C_DEPTH); -- Constant zeros for programmable threshold inputs signal PROG_RDTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); signal PROG_WRTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- Signals --Signals added to fix MTI and XSIM issues caused by fix for VCS issues not to use "LIBRARY_SCAN = TRUE" signal ALMOST_FULL : std_logic; signal WR_ACK : std_logic; signal OVERFLOW : std_logic; signal VALID : std_logic; signal UNDERFLOW : std_logic; signal ALMOST_EMPTY : std_logic; signal RD_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal WR_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal PROG_FULL : std_logic; signal PROG_EMPTY : std_logic; signal SBITERR : std_logic; signal DBITERR : std_logic; signal S_AXI_AWREADY : std_logic; signal S_AXI_WREADY : std_logic; signal S_AXI_BID : std_logic_vector(3 DOWNTO 0); signal S_AXI_BRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_BUSER : std_logic_vector(0 downto 0); signal S_AXI_BVALID : std_logic; -- AXI Full/Lite Master Write Channel (Read side) signal M_AXI_AWID : std_logic_vector(3 DOWNTO 0); signal M_AXI_AWADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_AWLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_AWSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWUSER : std_logic_vector(0 downto 0); signal M_AXI_AWVALID : std_logic; signal M_AXI_WID : std_logic_vector(3 DOWNTO 0); signal M_AXI_WDATA : std_logic_vector(63 DOWNTO 0); signal M_AXI_WSTRB : std_logic_vector(7 DOWNTO 0); signal M_AXI_WLAST : std_logic; signal M_AXI_WUSER : std_logic_vector(0 downto 0); signal M_AXI_WVALID : std_logic; signal M_AXI_BREADY : std_logic; -- AXI Full/Lite Slave Read Channel (Write side) signal S_AXI_ARREADY : std_logic; signal S_AXI_RID : std_logic_vector(3 DOWNTO 0); signal S_AXI_RDATA : std_logic_vector(63 DOWNTO 0); signal S_AXI_RRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_RLAST : std_logic; signal S_AXI_RUSER : std_logic_vector(0 downto 0); signal S_AXI_RVALID : std_logic; -- AXI Full/Lite Master Read Channel (Read side) signal M_AXI_ARID : std_logic_vector(3 DOWNTO 0); signal M_AXI_ARADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_ARLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_ARSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARUSER : std_logic_vector(0 downto 0); signal M_AXI_ARVALID : std_logic; signal M_AXI_RREADY : std_logic; -- AXI Streaming Slave Signals (Write side) signal S_AXIS_TREADY : std_logic; -- AXI Streaming Master Signals (Read side) signal M_AXIS_TVALID : std_logic; signal M_AXIS_TDATA : std_logic_vector(63 DOWNTO 0); signal M_AXIS_TSTRB : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TKEEP : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TLAST : std_logic; signal M_AXIS_TID : std_logic_vector(7 DOWNTO 0); signal M_AXIS_TDEST : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TUSER : std_logic_vector(3 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals signal AXI_AW_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_SBITERR : std_logic; signal AXI_AW_DBITERR : std_logic; signal AXI_AW_OVERFLOW : std_logic; signal AXI_AW_UNDERFLOW : std_logic; signal AXI_AW_PROG_FULL : STD_LOGIC; signal AXI_AW_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Data Channel Signals signal AXI_W_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_SBITERR : std_logic; signal AXI_W_DBITERR : std_logic; signal AXI_W_OVERFLOW : std_logic; signal AXI_W_UNDERFLOW : std_logic; signal AXI_W_PROG_FULL : STD_LOGIC; signal AXI_W_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Response Channel Signals signal AXI_B_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_SBITERR : std_logic; signal AXI_B_DBITERR : std_logic; signal AXI_B_OVERFLOW : std_logic; signal AXI_B_UNDERFLOW : std_logic; signal AXI_B_PROG_FULL : STD_LOGIC; signal AXI_B_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Address Channel Signals signal AXI_AR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_SBITERR : std_logic; signal AXI_AR_DBITERR : std_logic; signal AXI_AR_OVERFLOW : std_logic; signal AXI_AR_UNDERFLOW : std_logic; signal AXI_AR_PROG_FULL : STD_LOGIC; signal AXI_AR_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Data Channel Signals signal AXI_R_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_SBITERR : std_logic; signal AXI_R_DBITERR : std_logic; signal AXI_R_OVERFLOW : std_logic; signal AXI_R_UNDERFLOW : std_logic; signal AXI_R_PROG_FULL : STD_LOGIC; signal AXI_R_PROG_EMPTY : STD_LOGIC; -- AXI Streaming FIFO Related Signals signal AXIS_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_SBITERR : std_logic; signal AXIS_DBITERR : std_logic; signal AXIS_OVERFLOW : std_logic; signal AXIS_UNDERFLOW : std_logic; signal AXIS_PROG_FULL : STD_LOGIC; signal AXIS_PROG_EMPTY : STD_LOGIC; begin --(architecture implementation) ------------------------------------------------------------------------------- -- Instantiate the generalized FIFO Generator instance -- -- NOTE: -- DO NOT CHANGE TO DIRECT ENTITY INSTANTIATION!!! -- This is a Coregen FIFO Generator Call module for -- BRAM implementations of a basic Sync FIFO -- ------------------------------------------------------------------------------- I_BASIC_SFIFO : entity fifo_generator_v11_0.fifo_generator_v11_0 generic map( C_COMMON_CLOCK => 1, C_COUNT_TYPE => 0, C_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_DEFAULT_VALUE => "BlankString", C_DIN_WIDTH => C_DWIDTH, C_DOUT_RST_VAL => "0", C_DOUT_WIDTH => C_DWIDTH, C_ENABLE_RLOCS => 0, -- n0 C_FAMILY => C_FAMILY, C_HAS_ALMOST_EMPTY => 0, -- n0 C_HAS_ALMOST_FULL => 0, -- n0 C_HAS_BACKUP => 0, -- n0 C_HAS_DATA_COUNT => C_HAS_DATA_COUNT, C_HAS_MEMINIT_FILE => 0, -- n0 C_HAS_OVERFLOW => 0, -- n0 C_HAS_RD_DATA_COUNT => 0, -- n0 C_HAS_RD_RST => 0, -- n0 C_HAS_RST => 0, -- n0 C_HAS_SRST => 1, -- yes C_HAS_UNDERFLOW => 0, -- n0 C_HAS_VALID => 0, -- n0 C_HAS_WR_ACK => 0, -- n0 C_HAS_WR_DATA_COUNT => 0, -- n0 C_HAS_WR_RST => 0, -- n0 C_IMPLEMENTATION_TYPE => 0, -- Common clock BRAM C_INIT_WR_PNTR_VAL => 0, C_MEMORY_TYPE => C_MEMORY_TYPE, C_MIF_FILE_NAME => "BlankString", C_OPTIMIZATION_MODE => 0, C_OVERFLOW_LOW => 0, C_PRELOAD_LATENCY => C_PRELOAD_LATENCY, C_PRELOAD_REGS => C_PRELOAD_REGS, C_PRIM_FIFO_TYPE => "512x36", C_PROG_EMPTY_THRESH_ASSERT_VAL => 0, C_PROG_EMPTY_THRESH_NEGATE_VAL => 0, C_PROG_EMPTY_TYPE => 0, C_PROG_FULL_THRESH_ASSERT_VAL => 0, C_PROG_FULL_THRESH_NEGATE_VAL => 0, C_PROG_FULL_TYPE => 0, C_RD_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_RD_DEPTH => C_DEPTH, C_RD_FREQ => 1, C_RD_PNTR_WIDTH => POINTER_WIDTH, C_UNDERFLOW_LOW => 0, C_USE_DOUT_RST => 1, C_USE_EMBEDDED_REG => 0, C_USE_FIFO16_FLAGS => 0, C_USE_FWFT_DATA_COUNT => C_USE_FWFT_DATA_COUNT, C_VALID_LOW => 0, C_WR_ACK_LOW => 0, C_WR_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_WR_DEPTH => C_DEPTH, C_WR_FREQ => 1, C_WR_PNTR_WIDTH => POINTER_WIDTH, C_WR_RESPONSE_LATENCY => 1, C_USE_ECC => 0, C_FULL_FLAGS_RST_VAL => 0, C_ENABLE_RST_SYNC => 1, C_ERROR_INJECTION_TYPE => 0, C_SYNCHRONIZER_STAGE => C_SYNCHRONIZER_STAGE, C_HAS_INT_CLK => 0, C_MSGON_VAL => 1, -- AXI Interface related parameters start here C_INTERFACE_TYPE => 0, -- : integer := 0; -- 0: Native Interface; 1: AXI Interface C_AXI_TYPE => 0, -- : integer := 0; -- 0: AXI Stream; 1: AXI Full; 2: AXI Lite C_HAS_AXI_WR_CHANNEL => 0, -- : integer := 0; C_HAS_AXI_RD_CHANNEL => 0, -- : integer := 0; C_HAS_SLAVE_CE => 0, -- : integer := 0; C_HAS_MASTER_CE => 0, -- : integer := 0; C_ADD_NGC_CONSTRAINT => 0, -- : integer := 0; C_USE_COMMON_OVERFLOW => 0, -- : integer := 0; C_USE_COMMON_UNDERFLOW => 0, -- : integer := 0; C_USE_DEFAULT_SETTINGS => 0, -- : integer := 0; -- AXI Full/Lite C_AXI_ID_WIDTH => 4 , -- : integer := 0; C_AXI_ADDR_WIDTH => 32, -- : integer := 0; C_AXI_DATA_WIDTH => 64, -- : integer := 0; C_AXI_LEN_WIDTH => 8, -- : integer := 8; C_AXI_LOCK_WIDTH => 2, -- : integer := 2; C_HAS_AXI_ID => 0, -- : integer := 0; C_HAS_AXI_AWUSER => 0 , -- : integer := 0; C_HAS_AXI_WUSER => 0 , -- : integer := 0; C_HAS_AXI_BUSER => 0 , -- : integer := 0; C_HAS_AXI_ARUSER => 0 , -- : integer := 0; C_HAS_AXI_RUSER => 0 , -- : integer := 0; C_AXI_ARUSER_WIDTH => 1 , -- : integer := 0; C_AXI_AWUSER_WIDTH => 1 , -- : integer := 0; C_AXI_WUSER_WIDTH => 1 , -- : integer := 0; C_AXI_BUSER_WIDTH => 1 , -- : integer := 0; C_AXI_RUSER_WIDTH => 1 , -- : integer := 0; -- AXI Streaming C_HAS_AXIS_TDATA => 0 , -- : integer := 0; C_HAS_AXIS_TID => 0 , -- : integer := 0; C_HAS_AXIS_TDEST => 0 , -- : integer := 0; C_HAS_AXIS_TUSER => 0 , -- : integer := 0; C_HAS_AXIS_TREADY => 1 , -- : integer := 0; C_HAS_AXIS_TLAST => 0 , -- : integer := 0; C_HAS_AXIS_TSTRB => 0 , -- : integer := 0; C_HAS_AXIS_TKEEP => 0 , -- : integer := 0; C_AXIS_TDATA_WIDTH => 64, -- : integer := 1; C_AXIS_TID_WIDTH => 8 , -- : integer := 1; C_AXIS_TDEST_WIDTH => 4 , -- : integer := 1; C_AXIS_TUSER_WIDTH => 4 , -- : integer := 1; C_AXIS_TSTRB_WIDTH => 4 , -- : integer := 1; C_AXIS_TKEEP_WIDTH => 4 , -- : integer := 1; -- AXI Channel Type -- WACH --> Write Address Channel -- WDCH --> Write Data Channel -- WRCH --> Write Response Channel -- RACH --> Read Address Channel -- RDCH --> Read Data Channel -- AXIS --> AXI Streaming C_WACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logic C_WDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_WRCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_AXIS_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie -- AXI Implementation Type -- 1 = Common Clock Block RAM FIFO -- 2 = Common Clock Distributed RAM FIFO -- 11 = Independent Clock Block RAM FIFO -- 12 = Independent Clock Distributed RAM FIFO C_IMPLEMENTATION_TYPE_WACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WRCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_AXIS => 1, -- : integer := 0; -- AXI FIFO Type -- 0 = Data FIFO -- 1 = Packet FIFO -- 2 = Low Latency Data FIFO C_APPLICATION_TYPE_WACH => 0, -- : integer := 0; C_APPLICATION_TYPE_WDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_WRCH => 0, -- : integer := 0; C_APPLICATION_TYPE_RACH => 0, -- : integer := 0; C_APPLICATION_TYPE_RDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_AXIS => 0, -- : integer := 0; -- Enable ECC -- 0 = ECC disabled -- 1 = ECC enabled C_USE_ECC_WACH => 0, -- : integer := 0; C_USE_ECC_WDCH => 0, -- : integer := 0; C_USE_ECC_WRCH => 0, -- : integer := 0; C_USE_ECC_RACH => 0, -- : integer := 0; C_USE_ECC_RDCH => 0, -- : integer := 0; C_USE_ECC_AXIS => 0, -- : integer := 0; -- ECC Error Injection Type -- 0 = No Error Injection -- 1 = Single Bit Error Injection -- 2 = Double Bit Error Injection -- 3 = Single Bit and Double Bit Error Injection C_ERROR_INJECTION_TYPE_WACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WRCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_AXIS => 0, -- : integer := 0; -- Input Data Width -- Accumulation of all AXI input signal's width C_DIN_WIDTH_WACH => 32, -- : integer := 1; C_DIN_WIDTH_WDCH => 64, -- : integer := 1; C_DIN_WIDTH_WRCH => 2 , -- : integer := 1; C_DIN_WIDTH_RACH => 32, -- : integer := 1; C_DIN_WIDTH_RDCH => 64, -- : integer := 1; C_DIN_WIDTH_AXIS => 1 , -- : integer := 1; C_WR_DEPTH_WACH => 16 , -- : integer := 16; C_WR_DEPTH_WDCH => 1024, -- : integer := 16; C_WR_DEPTH_WRCH => 16 , -- : integer := 16; C_WR_DEPTH_RACH => 16 , -- : integer := 16; C_WR_DEPTH_RDCH => 1024, -- : integer := 16; C_WR_DEPTH_AXIS => 1024, -- : integer := 16; C_WR_PNTR_WIDTH_WACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_WDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_WRCH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_AXIS => 10, -- : integer := 4; C_HAS_DATA_COUNTS_WACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WRCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_AXIS => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WRCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_AXIS => 0, -- : integer := 0; C_PROG_FULL_TYPE_WACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WRCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_AXIS => 1023, -- : integer := 0; C_PROG_EMPTY_TYPE_WACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS => 1022, -- : integer := 0; C_REG_SLICE_MODE_WACH => 0, -- : integer := 0; C_REG_SLICE_MODE_WDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_WRCH => 0, -- : integer := 0; C_REG_SLICE_MODE_RACH => 0, -- : integer := 0; C_REG_SLICE_MODE_RDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_AXIS => 0 -- : integer := 0 ) port map( backup => '0', backup_marker => '0', clk => CLK, rst => '0', srst => SRST, wr_clk => '0', wr_rst => '0', rd_clk => '0', rd_rst => '0', din => DIN, -- uses this one wr_en => WR_EN, -- uses this one rd_en => RD_EN, -- uses this one prog_empty_thresh => PROG_RDTHRESH_ZEROS, prog_empty_thresh_assert => PROG_RDTHRESH_ZEROS, prog_empty_thresh_negate => PROG_RDTHRESH_ZEROS, prog_full_thresh => PROG_WRTHRESH_ZEROS, prog_full_thresh_assert => PROG_WRTHRESH_ZEROS, prog_full_thresh_negate => PROG_WRTHRESH_ZEROS, int_clk => '0', injectdbiterr => '0', injectsbiterr => '0', dout => DOUT, -- uses this one full => FULL, -- uses this one almost_full => ALMOST_FULL, wr_ack => WR_ACK, overflow => OVERFLOW, empty => EMPTY, -- uses this one almost_empty => ALMOST_EMPTY, valid => VALID, underflow => UNDERFLOW, data_count => DATA_COUNT, -- uses this one rd_data_count => RD_DATA_COUNT, wr_data_count => WR_DATA_COUNT, prog_full => PROG_FULL, prog_empty => PROG_EMPTY, sbiterr => SBITERR, dbiterr => DBITERR, -- AXI Global Signal m_aclk => '0', -- : IN std_logic := '0'; s_aclk => '0', -- : IN std_logic := '0'; s_aresetn => '0', -- : IN std_logic := '0'; m_aclk_en => '0', -- : IN std_logic := '0'; s_aclk_en => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Slave Write Channel (write side) s_axi_awid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awaddr => "00000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlen => "00000000", --(others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awsize => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awburst => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlock => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awcache => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awprot => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awqos => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awregion => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awvalid => '0', -- : IN std_logic := '0'; s_axi_awready => S_AXI_AWREADY, -- : OUT std_logic; s_axi_wid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wstrb => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wlast => '0', -- : IN std_logic := '0'; s_axi_wuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wvalid => '0', -- : IN std_logic := '0'; s_axi_wready => S_AXI_WREADY, -- : OUT std_logic; s_axi_bid => S_AXI_BID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_bresp => S_AXI_BRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_buser => S_AXI_BUSER, -- : OUT std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0); s_axi_bvalid => S_AXI_BVALID, -- : OUT std_logic; s_axi_bready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Write Channel (Read side) m_axi_awid => M_AXI_AWID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_awaddr => M_AXI_AWADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_awlen => M_AXI_AWLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_awsize => M_AXI_AWSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awburst => M_AXI_AWBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awlock => M_AXI_AWLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awcache => M_AXI_AWCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awprot => M_AXI_AWPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awqos => M_AXI_AWQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awregion => M_AXI_AWREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awuser => M_AXI_AWUSER, -- : OUT std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0); m_axi_awvalid => M_AXI_AWVALID, -- : OUT std_logic; m_axi_awready => '0', -- : IN std_logic := '0'; m_axi_wid => M_AXI_WID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_wdata => M_AXI_WDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); m_axi_wstrb => M_AXI_WSTRB, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0); m_axi_wlast => M_AXI_WLAST, -- : OUT std_logic; m_axi_wuser => M_AXI_WUSER, -- : OUT std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0); m_axi_wvalid => M_AXI_WVALID, -- : OUT std_logic; m_axi_wready => '0', -- : IN std_logic := '0'; m_axi_bid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_buser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bvalid => '0', -- : IN std_logic := '0'; m_axi_bready => M_AXI_BREADY, -- : OUT std_logic; -- AXI Full/Lite Slave Read Channel (Write side) s_axi_arid => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_araddr => "00000000000000000000000000000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlen => "00000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arsize => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arburst => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlock => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arcache => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arprot => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arqos => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arregion => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_aruser => "0", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arvalid => '0', -- : IN std_logic := '0'; s_axi_arready => S_AXI_ARREADY, -- : OUT std_logic; s_axi_rid => S_AXI_RID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); s_axi_rdata => S_AXI_RDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); s_axi_rresp => S_AXI_RRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_rlast => S_AXI_RLAST, -- : OUT std_logic; s_axi_ruser => S_AXI_RUSER, -- : OUT std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0); s_axi_rvalid => S_AXI_RVALID, -- : OUT std_logic; s_axi_rready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Read Channel (Read side) m_axi_arid => M_AXI_ARID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_araddr => M_AXI_ARADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_arlen => M_AXI_ARLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_arsize => M_AXI_ARSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arburst => M_AXI_ARBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arlock => M_AXI_ARLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arcache => M_AXI_ARCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arprot => M_AXI_ARPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arqos => M_AXI_ARQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arregion => M_AXI_ARREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_aruser => M_AXI_ARUSER, -- : OUT std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0); m_axi_arvalid => M_AXI_ARVALID, -- : OUT std_logic; m_axi_arready => '0', -- : IN std_logic := '0'; m_axi_rid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rlast => '0', -- : IN std_logic := '0'; m_axi_ruser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rvalid => '0', -- : IN std_logic := '0'; m_axi_rready => M_AXI_RREADY, -- : OUT std_logic; -- AXI Streaming Slave Signals (Write side) s_axis_tvalid => '0', -- : IN std_logic := '0'; s_axis_tready => S_AXIS_TREADY, -- : OUT std_logic; s_axis_tdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tstrb => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tkeep => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tlast => '0', -- : IN std_logic := '0'; s_axis_tid => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tdest => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tuser => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- AXI Streaming Master Signals (Read side) m_axis_tvalid => M_AXIS_TVALID, -- : OUT std_logic; m_axis_tready => '0', -- : IN std_logic := '0'; m_axis_tdata => M_AXIS_TDATA, -- : OUT std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0); m_axis_tstrb => M_AXIS_TSTRB, -- : OUT std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0); m_axis_tkeep => M_AXIS_TKEEP, -- : OUT std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0); m_axis_tlast => M_AXIS_TLAST, -- : OUT std_logic; m_axis_tid => M_AXIS_TID, -- : OUT std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0); m_axis_tdest => M_AXIS_TDEST, -- : OUT std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0); m_axis_tuser => M_AXIS_TUSER, -- : OUT std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals axi_aw_injectsbiterr => '0', -- : IN std_logic := '0'; axi_aw_injectdbiterr => '0', -- : IN std_logic := '0'; axi_aw_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_data_count => AXI_AW_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_wr_data_count => AXI_AW_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_rd_data_count => AXI_AW_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_sbiterr => AXI_AW_SBITERR, -- : OUT std_logic; axi_aw_dbiterr => AXI_AW_DBITERR, -- : OUT std_logic; axi_aw_overflow => AXI_AW_OVERFLOW, -- : OUT std_logic; axi_aw_underflow => AXI_AW_UNDERFLOW, -- : OUT std_logic; axi_aw_prog_full => AXI_AW_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_aw_prog_empty => AXI_AW_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Data Channel Signals axi_w_injectsbiterr => '0', -- : IN std_logic := '0'; axi_w_injectdbiterr => '0', -- : IN std_logic := '0'; axi_w_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_data_count => AXI_W_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_wr_data_count => AXI_W_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_rd_data_count => AXI_W_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_sbiterr => AXI_W_SBITERR, -- : OUT std_logic; axi_w_dbiterr => AXI_W_DBITERR, -- : OUT std_logic; axi_w_overflow => AXI_W_OVERFLOW, -- : OUT std_logic; axi_w_underflow => AXI_W_UNDERFLOW, -- : OUT std_logic; axi_w_prog_full => AXI_W_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_w_prog_empty => AXI_W_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Response Channel Signals axi_b_injectsbiterr => '0', -- : IN std_logic := '0'; axi_b_injectdbiterr => '0', -- : IN std_logic := '0'; axi_b_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_data_count => AXI_B_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_wr_data_count => AXI_B_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_rd_data_count => AXI_B_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_sbiterr => AXI_B_SBITERR, -- : OUT std_logic; axi_b_dbiterr => AXI_B_DBITERR, -- : OUT std_logic; axi_b_overflow => AXI_B_OVERFLOW, -- : OUT std_logic; axi_b_underflow => AXI_B_UNDERFLOW, -- : OUT std_logic; axi_b_prog_full => AXI_B_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_b_prog_empty => AXI_B_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Address Channel Signals axi_ar_injectsbiterr => '0', -- : IN std_logic := '0'; axi_ar_injectdbiterr => '0', -- : IN std_logic := '0'; axi_ar_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_data_count => AXI_AR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_wr_data_count => AXI_AR_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_rd_data_count => AXI_AR_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_sbiterr => AXI_AR_SBITERR, -- : OUT std_logic; axi_ar_dbiterr => AXI_AR_DBITERR, -- : OUT std_logic; axi_ar_overflow => AXI_AR_OVERFLOW, -- : OUT std_logic; axi_ar_underflow => AXI_AR_UNDERFLOW, -- : OUT std_logic; axi_ar_prog_full => AXI_AR_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_ar_prog_empty => AXI_AR_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Data Channel Signals axi_r_injectsbiterr => '0', -- : IN std_logic := '0'; axi_r_injectdbiterr => '0', -- : IN std_logic := '0'; axi_r_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_data_count => AXI_R_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_wr_data_count => AXI_R_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_rd_data_count => AXI_R_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_sbiterr => AXI_R_SBITERR, -- : OUT std_logic; axi_r_dbiterr => AXI_R_DBITERR, -- : OUT std_logic; axi_r_overflow => AXI_R_OVERFLOW, -- : OUT std_logic; axi_r_underflow => AXI_R_UNDERFLOW, -- : OUT std_logic; axi_r_prog_full => AXI_R_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_r_prog_empty => AXI_R_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Streaming FIFO Related Signals axis_injectsbiterr => '0', -- : IN std_logic := '0'; axis_injectdbiterr => '0', -- : IN std_logic := '0'; axis_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_data_count => AXIS_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_wr_data_count => AXIS_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_rd_data_count => AXIS_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_sbiterr => AXIS_SBITERR, -- : OUT std_logic; axis_dbiterr => AXIS_DBITERR, -- : OUT std_logic; axis_overflow => AXIS_OVERFLOW, -- : OUT std_logic; axis_underflow => AXIS_UNDERFLOW, -- : OUT std_logic axis_prog_full => AXIS_PROG_FULL, -- : OUT STD_LOGIC := '0'; axis_prog_empty => AXIS_PROG_EMPTY -- : OUT STD_LOGIC := '1'; ); end implementation;
------------------------------------------------------------------------------- -- basic_sfifo_fg.vhd ------------------------------------------------------------------------------- -- -- ************************************************************************* -- -- (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- ************************************************************************* -- ------------------------------------------------------------------------------- -- Filename: basic_sfifo_fg.vhd -- -- Description: -- This HDL file implements a basic synchronous (single clock) fifo using the -- FIFO Generator tool. It is intended to offer a simple interface to the user -- with the complexity of the FIFO Generator interface hidden from the user. -- -- Note that in normal op mode (not First Word Fall Through FWFT) the data count -- output goes to zero when the FIFO goes full. This the way FIFO Generator works. -- -- -- VHDL-Standard: VHDL'93 ------------------------------------------------------------------------------- -- Structure: -- basic_sfifo_fg.vhd -- | -- |-- fifo_generator_v8_2 -- ------------------------------------------------------------------------------- -- Revision History: -- -- -- Author: DET -- Revision: $Revision: 1.0 $ -- Date: $3/07/2011$ -- -- History: -- DET 3/07/2011 Initial Version -- ------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library fifo_generator_v11_0; use fifo_generator_v11_0.all; library proc_common_v4_0; use proc_common_v4_0.proc_common_pkg.all; use proc_common_v4_0.proc_common_pkg.log2; --use proc_common_v4_0.coregen_comp_defs.all; -- synopsys translate_off --library XilinxCoreLib; --use XilinxCoreLib.all; -- synopsys translate_on ------------------------------------------------------------------------------- entity basic_sfifo_fg is generic ( C_DWIDTH : Integer := 32 ; -- FIFO data Width (Read and write data ports are symetric) C_DEPTH : Integer := 512 ; -- FIFO Depth (set to power of 2) C_HAS_DATA_COUNT : integer := 1 ; -- 0 = Data Count output not needed -- 1 = Data Count output needed C_DATA_COUNT_WIDTH : integer := 10 ; -- Data Count bit width (Max value is log2(C_DEPTH)) C_IMPLEMENTATION_TYPE : integer range 0 to 1 := 0; -- 0 = Common Clock BRAM / Distributed RAM (Synchronous FIFO) -- 1 = Common Clock Shift Register (Synchronous FIFO) C_MEMORY_TYPE : integer := 1; -- 0 = Any -- 1 = BRAM -- 2 = Distributed Memory -- 3 = Shift Registers C_PRELOAD_REGS : integer := 1; -- 0 = normal -- 1 = FWFT C_PRELOAD_LATENCY : integer := 0; -- 0 = FWFT -- 1 = normal C_USE_FWFT_DATA_COUNT : integer := 0; -- 0 = normal -- 1 for FWFT C_SYNCHRONIZER_STAGE : integer := 2; -- valid values are 0 to 8; C_FAMILY : string := "virtex6" ); port ( CLK : IN std_logic := '0'; DIN : IN std_logic_vector(C_DWIDTH-1 DOWNTO 0) := (OTHERS => '0'); RD_EN : IN std_logic := '0'; SRST : IN std_logic := '0'; WR_EN : IN std_logic := '0'; DATA_COUNT : OUT std_logic_vector(C_DATA_COUNT_WIDTH-1 DOWNTO 0); DOUT : OUT std_logic_vector(C_DWIDTH-1 DOWNTO 0); EMPTY : OUT std_logic; FULL : OUT std_logic ); end entity basic_sfifo_fg; architecture implementation of basic_sfifo_fg is -- Constant Declarations ---------------------------------------------- Constant POINTER_WIDTH : integer := log2(C_DEPTH); -- Constant zeros for programmable threshold inputs signal PROG_RDTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); signal PROG_WRTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- Signals --Signals added to fix MTI and XSIM issues caused by fix for VCS issues not to use "LIBRARY_SCAN = TRUE" signal ALMOST_FULL : std_logic; signal WR_ACK : std_logic; signal OVERFLOW : std_logic; signal VALID : std_logic; signal UNDERFLOW : std_logic; signal ALMOST_EMPTY : std_logic; signal RD_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal WR_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal PROG_FULL : std_logic; signal PROG_EMPTY : std_logic; signal SBITERR : std_logic; signal DBITERR : std_logic; signal S_AXI_AWREADY : std_logic; signal S_AXI_WREADY : std_logic; signal S_AXI_BID : std_logic_vector(3 DOWNTO 0); signal S_AXI_BRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_BUSER : std_logic_vector(0 downto 0); signal S_AXI_BVALID : std_logic; -- AXI Full/Lite Master Write Channel (Read side) signal M_AXI_AWID : std_logic_vector(3 DOWNTO 0); signal M_AXI_AWADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_AWLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_AWSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWUSER : std_logic_vector(0 downto 0); signal M_AXI_AWVALID : std_logic; signal M_AXI_WID : std_logic_vector(3 DOWNTO 0); signal M_AXI_WDATA : std_logic_vector(63 DOWNTO 0); signal M_AXI_WSTRB : std_logic_vector(7 DOWNTO 0); signal M_AXI_WLAST : std_logic; signal M_AXI_WUSER : std_logic_vector(0 downto 0); signal M_AXI_WVALID : std_logic; signal M_AXI_BREADY : std_logic; -- AXI Full/Lite Slave Read Channel (Write side) signal S_AXI_ARREADY : std_logic; signal S_AXI_RID : std_logic_vector(3 DOWNTO 0); signal S_AXI_RDATA : std_logic_vector(63 DOWNTO 0); signal S_AXI_RRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_RLAST : std_logic; signal S_AXI_RUSER : std_logic_vector(0 downto 0); signal S_AXI_RVALID : std_logic; -- AXI Full/Lite Master Read Channel (Read side) signal M_AXI_ARID : std_logic_vector(3 DOWNTO 0); signal M_AXI_ARADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_ARLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_ARSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARUSER : std_logic_vector(0 downto 0); signal M_AXI_ARVALID : std_logic; signal M_AXI_RREADY : std_logic; -- AXI Streaming Slave Signals (Write side) signal S_AXIS_TREADY : std_logic; -- AXI Streaming Master Signals (Read side) signal M_AXIS_TVALID : std_logic; signal M_AXIS_TDATA : std_logic_vector(63 DOWNTO 0); signal M_AXIS_TSTRB : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TKEEP : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TLAST : std_logic; signal M_AXIS_TID : std_logic_vector(7 DOWNTO 0); signal M_AXIS_TDEST : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TUSER : std_logic_vector(3 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals signal AXI_AW_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_SBITERR : std_logic; signal AXI_AW_DBITERR : std_logic; signal AXI_AW_OVERFLOW : std_logic; signal AXI_AW_UNDERFLOW : std_logic; signal AXI_AW_PROG_FULL : STD_LOGIC; signal AXI_AW_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Data Channel Signals signal AXI_W_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_SBITERR : std_logic; signal AXI_W_DBITERR : std_logic; signal AXI_W_OVERFLOW : std_logic; signal AXI_W_UNDERFLOW : std_logic; signal AXI_W_PROG_FULL : STD_LOGIC; signal AXI_W_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Response Channel Signals signal AXI_B_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_SBITERR : std_logic; signal AXI_B_DBITERR : std_logic; signal AXI_B_OVERFLOW : std_logic; signal AXI_B_UNDERFLOW : std_logic; signal AXI_B_PROG_FULL : STD_LOGIC; signal AXI_B_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Address Channel Signals signal AXI_AR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_SBITERR : std_logic; signal AXI_AR_DBITERR : std_logic; signal AXI_AR_OVERFLOW : std_logic; signal AXI_AR_UNDERFLOW : std_logic; signal AXI_AR_PROG_FULL : STD_LOGIC; signal AXI_AR_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Data Channel Signals signal AXI_R_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_SBITERR : std_logic; signal AXI_R_DBITERR : std_logic; signal AXI_R_OVERFLOW : std_logic; signal AXI_R_UNDERFLOW : std_logic; signal AXI_R_PROG_FULL : STD_LOGIC; signal AXI_R_PROG_EMPTY : STD_LOGIC; -- AXI Streaming FIFO Related Signals signal AXIS_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_SBITERR : std_logic; signal AXIS_DBITERR : std_logic; signal AXIS_OVERFLOW : std_logic; signal AXIS_UNDERFLOW : std_logic; signal AXIS_PROG_FULL : STD_LOGIC; signal AXIS_PROG_EMPTY : STD_LOGIC; begin --(architecture implementation) ------------------------------------------------------------------------------- -- Instantiate the generalized FIFO Generator instance -- -- NOTE: -- DO NOT CHANGE TO DIRECT ENTITY INSTANTIATION!!! -- This is a Coregen FIFO Generator Call module for -- BRAM implementations of a basic Sync FIFO -- ------------------------------------------------------------------------------- I_BASIC_SFIFO : entity fifo_generator_v11_0.fifo_generator_v11_0 generic map( C_COMMON_CLOCK => 1, C_COUNT_TYPE => 0, C_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_DEFAULT_VALUE => "BlankString", C_DIN_WIDTH => C_DWIDTH, C_DOUT_RST_VAL => "0", C_DOUT_WIDTH => C_DWIDTH, C_ENABLE_RLOCS => 0, -- n0 C_FAMILY => C_FAMILY, C_HAS_ALMOST_EMPTY => 0, -- n0 C_HAS_ALMOST_FULL => 0, -- n0 C_HAS_BACKUP => 0, -- n0 C_HAS_DATA_COUNT => C_HAS_DATA_COUNT, C_HAS_MEMINIT_FILE => 0, -- n0 C_HAS_OVERFLOW => 0, -- n0 C_HAS_RD_DATA_COUNT => 0, -- n0 C_HAS_RD_RST => 0, -- n0 C_HAS_RST => 0, -- n0 C_HAS_SRST => 1, -- yes C_HAS_UNDERFLOW => 0, -- n0 C_HAS_VALID => 0, -- n0 C_HAS_WR_ACK => 0, -- n0 C_HAS_WR_DATA_COUNT => 0, -- n0 C_HAS_WR_RST => 0, -- n0 C_IMPLEMENTATION_TYPE => 0, -- Common clock BRAM C_INIT_WR_PNTR_VAL => 0, C_MEMORY_TYPE => C_MEMORY_TYPE, C_MIF_FILE_NAME => "BlankString", C_OPTIMIZATION_MODE => 0, C_OVERFLOW_LOW => 0, C_PRELOAD_LATENCY => C_PRELOAD_LATENCY, C_PRELOAD_REGS => C_PRELOAD_REGS, C_PRIM_FIFO_TYPE => "512x36", C_PROG_EMPTY_THRESH_ASSERT_VAL => 0, C_PROG_EMPTY_THRESH_NEGATE_VAL => 0, C_PROG_EMPTY_TYPE => 0, C_PROG_FULL_THRESH_ASSERT_VAL => 0, C_PROG_FULL_THRESH_NEGATE_VAL => 0, C_PROG_FULL_TYPE => 0, C_RD_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_RD_DEPTH => C_DEPTH, C_RD_FREQ => 1, C_RD_PNTR_WIDTH => POINTER_WIDTH, C_UNDERFLOW_LOW => 0, C_USE_DOUT_RST => 1, C_USE_EMBEDDED_REG => 0, C_USE_FIFO16_FLAGS => 0, C_USE_FWFT_DATA_COUNT => C_USE_FWFT_DATA_COUNT, C_VALID_LOW => 0, C_WR_ACK_LOW => 0, C_WR_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_WR_DEPTH => C_DEPTH, C_WR_FREQ => 1, C_WR_PNTR_WIDTH => POINTER_WIDTH, C_WR_RESPONSE_LATENCY => 1, C_USE_ECC => 0, C_FULL_FLAGS_RST_VAL => 0, C_ENABLE_RST_SYNC => 1, C_ERROR_INJECTION_TYPE => 0, C_SYNCHRONIZER_STAGE => C_SYNCHRONIZER_STAGE, C_HAS_INT_CLK => 0, C_MSGON_VAL => 1, -- AXI Interface related parameters start here C_INTERFACE_TYPE => 0, -- : integer := 0; -- 0: Native Interface; 1: AXI Interface C_AXI_TYPE => 0, -- : integer := 0; -- 0: AXI Stream; 1: AXI Full; 2: AXI Lite C_HAS_AXI_WR_CHANNEL => 0, -- : integer := 0; C_HAS_AXI_RD_CHANNEL => 0, -- : integer := 0; C_HAS_SLAVE_CE => 0, -- : integer := 0; C_HAS_MASTER_CE => 0, -- : integer := 0; C_ADD_NGC_CONSTRAINT => 0, -- : integer := 0; C_USE_COMMON_OVERFLOW => 0, -- : integer := 0; C_USE_COMMON_UNDERFLOW => 0, -- : integer := 0; C_USE_DEFAULT_SETTINGS => 0, -- : integer := 0; -- AXI Full/Lite C_AXI_ID_WIDTH => 4 , -- : integer := 0; C_AXI_ADDR_WIDTH => 32, -- : integer := 0; C_AXI_DATA_WIDTH => 64, -- : integer := 0; C_AXI_LEN_WIDTH => 8, -- : integer := 8; C_AXI_LOCK_WIDTH => 2, -- : integer := 2; C_HAS_AXI_ID => 0, -- : integer := 0; C_HAS_AXI_AWUSER => 0 , -- : integer := 0; C_HAS_AXI_WUSER => 0 , -- : integer := 0; C_HAS_AXI_BUSER => 0 , -- : integer := 0; C_HAS_AXI_ARUSER => 0 , -- : integer := 0; C_HAS_AXI_RUSER => 0 , -- : integer := 0; C_AXI_ARUSER_WIDTH => 1 , -- : integer := 0; C_AXI_AWUSER_WIDTH => 1 , -- : integer := 0; C_AXI_WUSER_WIDTH => 1 , -- : integer := 0; C_AXI_BUSER_WIDTH => 1 , -- : integer := 0; C_AXI_RUSER_WIDTH => 1 , -- : integer := 0; -- AXI Streaming C_HAS_AXIS_TDATA => 0 , -- : integer := 0; C_HAS_AXIS_TID => 0 , -- : integer := 0; C_HAS_AXIS_TDEST => 0 , -- : integer := 0; C_HAS_AXIS_TUSER => 0 , -- : integer := 0; C_HAS_AXIS_TREADY => 1 , -- : integer := 0; C_HAS_AXIS_TLAST => 0 , -- : integer := 0; C_HAS_AXIS_TSTRB => 0 , -- : integer := 0; C_HAS_AXIS_TKEEP => 0 , -- : integer := 0; C_AXIS_TDATA_WIDTH => 64, -- : integer := 1; C_AXIS_TID_WIDTH => 8 , -- : integer := 1; C_AXIS_TDEST_WIDTH => 4 , -- : integer := 1; C_AXIS_TUSER_WIDTH => 4 , -- : integer := 1; C_AXIS_TSTRB_WIDTH => 4 , -- : integer := 1; C_AXIS_TKEEP_WIDTH => 4 , -- : integer := 1; -- AXI Channel Type -- WACH --> Write Address Channel -- WDCH --> Write Data Channel -- WRCH --> Write Response Channel -- RACH --> Read Address Channel -- RDCH --> Read Data Channel -- AXIS --> AXI Streaming C_WACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logic C_WDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_WRCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_AXIS_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie -- AXI Implementation Type -- 1 = Common Clock Block RAM FIFO -- 2 = Common Clock Distributed RAM FIFO -- 11 = Independent Clock Block RAM FIFO -- 12 = Independent Clock Distributed RAM FIFO C_IMPLEMENTATION_TYPE_WACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WRCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_AXIS => 1, -- : integer := 0; -- AXI FIFO Type -- 0 = Data FIFO -- 1 = Packet FIFO -- 2 = Low Latency Data FIFO C_APPLICATION_TYPE_WACH => 0, -- : integer := 0; C_APPLICATION_TYPE_WDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_WRCH => 0, -- : integer := 0; C_APPLICATION_TYPE_RACH => 0, -- : integer := 0; C_APPLICATION_TYPE_RDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_AXIS => 0, -- : integer := 0; -- Enable ECC -- 0 = ECC disabled -- 1 = ECC enabled C_USE_ECC_WACH => 0, -- : integer := 0; C_USE_ECC_WDCH => 0, -- : integer := 0; C_USE_ECC_WRCH => 0, -- : integer := 0; C_USE_ECC_RACH => 0, -- : integer := 0; C_USE_ECC_RDCH => 0, -- : integer := 0; C_USE_ECC_AXIS => 0, -- : integer := 0; -- ECC Error Injection Type -- 0 = No Error Injection -- 1 = Single Bit Error Injection -- 2 = Double Bit Error Injection -- 3 = Single Bit and Double Bit Error Injection C_ERROR_INJECTION_TYPE_WACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WRCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_AXIS => 0, -- : integer := 0; -- Input Data Width -- Accumulation of all AXI input signal's width C_DIN_WIDTH_WACH => 32, -- : integer := 1; C_DIN_WIDTH_WDCH => 64, -- : integer := 1; C_DIN_WIDTH_WRCH => 2 , -- : integer := 1; C_DIN_WIDTH_RACH => 32, -- : integer := 1; C_DIN_WIDTH_RDCH => 64, -- : integer := 1; C_DIN_WIDTH_AXIS => 1 , -- : integer := 1; C_WR_DEPTH_WACH => 16 , -- : integer := 16; C_WR_DEPTH_WDCH => 1024, -- : integer := 16; C_WR_DEPTH_WRCH => 16 , -- : integer := 16; C_WR_DEPTH_RACH => 16 , -- : integer := 16; C_WR_DEPTH_RDCH => 1024, -- : integer := 16; C_WR_DEPTH_AXIS => 1024, -- : integer := 16; C_WR_PNTR_WIDTH_WACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_WDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_WRCH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_AXIS => 10, -- : integer := 4; C_HAS_DATA_COUNTS_WACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WRCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_AXIS => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WRCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_AXIS => 0, -- : integer := 0; C_PROG_FULL_TYPE_WACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WRCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_AXIS => 1023, -- : integer := 0; C_PROG_EMPTY_TYPE_WACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS => 1022, -- : integer := 0; C_REG_SLICE_MODE_WACH => 0, -- : integer := 0; C_REG_SLICE_MODE_WDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_WRCH => 0, -- : integer := 0; C_REG_SLICE_MODE_RACH => 0, -- : integer := 0; C_REG_SLICE_MODE_RDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_AXIS => 0 -- : integer := 0 ) port map( backup => '0', backup_marker => '0', clk => CLK, rst => '0', srst => SRST, wr_clk => '0', wr_rst => '0', rd_clk => '0', rd_rst => '0', din => DIN, -- uses this one wr_en => WR_EN, -- uses this one rd_en => RD_EN, -- uses this one prog_empty_thresh => PROG_RDTHRESH_ZEROS, prog_empty_thresh_assert => PROG_RDTHRESH_ZEROS, prog_empty_thresh_negate => PROG_RDTHRESH_ZEROS, prog_full_thresh => PROG_WRTHRESH_ZEROS, prog_full_thresh_assert => PROG_WRTHRESH_ZEROS, prog_full_thresh_negate => PROG_WRTHRESH_ZEROS, int_clk => '0', injectdbiterr => '0', injectsbiterr => '0', dout => DOUT, -- uses this one full => FULL, -- uses this one almost_full => ALMOST_FULL, wr_ack => WR_ACK, overflow => OVERFLOW, empty => EMPTY, -- uses this one almost_empty => ALMOST_EMPTY, valid => VALID, underflow => UNDERFLOW, data_count => DATA_COUNT, -- uses this one rd_data_count => RD_DATA_COUNT, wr_data_count => WR_DATA_COUNT, prog_full => PROG_FULL, prog_empty => PROG_EMPTY, sbiterr => SBITERR, dbiterr => DBITERR, -- AXI Global Signal m_aclk => '0', -- : IN std_logic := '0'; s_aclk => '0', -- : IN std_logic := '0'; s_aresetn => '0', -- : IN std_logic := '0'; m_aclk_en => '0', -- : IN std_logic := '0'; s_aclk_en => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Slave Write Channel (write side) s_axi_awid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awaddr => "00000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlen => "00000000", --(others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awsize => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awburst => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlock => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awcache => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awprot => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awqos => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awregion => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awvalid => '0', -- : IN std_logic := '0'; s_axi_awready => S_AXI_AWREADY, -- : OUT std_logic; s_axi_wid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wstrb => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wlast => '0', -- : IN std_logic := '0'; s_axi_wuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wvalid => '0', -- : IN std_logic := '0'; s_axi_wready => S_AXI_WREADY, -- : OUT std_logic; s_axi_bid => S_AXI_BID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_bresp => S_AXI_BRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_buser => S_AXI_BUSER, -- : OUT std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0); s_axi_bvalid => S_AXI_BVALID, -- : OUT std_logic; s_axi_bready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Write Channel (Read side) m_axi_awid => M_AXI_AWID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_awaddr => M_AXI_AWADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_awlen => M_AXI_AWLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_awsize => M_AXI_AWSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awburst => M_AXI_AWBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awlock => M_AXI_AWLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awcache => M_AXI_AWCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awprot => M_AXI_AWPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awqos => M_AXI_AWQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awregion => M_AXI_AWREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awuser => M_AXI_AWUSER, -- : OUT std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0); m_axi_awvalid => M_AXI_AWVALID, -- : OUT std_logic; m_axi_awready => '0', -- : IN std_logic := '0'; m_axi_wid => M_AXI_WID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_wdata => M_AXI_WDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); m_axi_wstrb => M_AXI_WSTRB, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0); m_axi_wlast => M_AXI_WLAST, -- : OUT std_logic; m_axi_wuser => M_AXI_WUSER, -- : OUT std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0); m_axi_wvalid => M_AXI_WVALID, -- : OUT std_logic; m_axi_wready => '0', -- : IN std_logic := '0'; m_axi_bid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_buser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bvalid => '0', -- : IN std_logic := '0'; m_axi_bready => M_AXI_BREADY, -- : OUT std_logic; -- AXI Full/Lite Slave Read Channel (Write side) s_axi_arid => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_araddr => "00000000000000000000000000000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlen => "00000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arsize => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arburst => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlock => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arcache => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arprot => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arqos => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arregion => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_aruser => "0", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arvalid => '0', -- : IN std_logic := '0'; s_axi_arready => S_AXI_ARREADY, -- : OUT std_logic; s_axi_rid => S_AXI_RID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); s_axi_rdata => S_AXI_RDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); s_axi_rresp => S_AXI_RRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_rlast => S_AXI_RLAST, -- : OUT std_logic; s_axi_ruser => S_AXI_RUSER, -- : OUT std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0); s_axi_rvalid => S_AXI_RVALID, -- : OUT std_logic; s_axi_rready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Read Channel (Read side) m_axi_arid => M_AXI_ARID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_araddr => M_AXI_ARADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_arlen => M_AXI_ARLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_arsize => M_AXI_ARSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arburst => M_AXI_ARBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arlock => M_AXI_ARLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arcache => M_AXI_ARCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arprot => M_AXI_ARPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arqos => M_AXI_ARQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arregion => M_AXI_ARREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_aruser => M_AXI_ARUSER, -- : OUT std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0); m_axi_arvalid => M_AXI_ARVALID, -- : OUT std_logic; m_axi_arready => '0', -- : IN std_logic := '0'; m_axi_rid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rlast => '0', -- : IN std_logic := '0'; m_axi_ruser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rvalid => '0', -- : IN std_logic := '0'; m_axi_rready => M_AXI_RREADY, -- : OUT std_logic; -- AXI Streaming Slave Signals (Write side) s_axis_tvalid => '0', -- : IN std_logic := '0'; s_axis_tready => S_AXIS_TREADY, -- : OUT std_logic; s_axis_tdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tstrb => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tkeep => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tlast => '0', -- : IN std_logic := '0'; s_axis_tid => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tdest => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tuser => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- AXI Streaming Master Signals (Read side) m_axis_tvalid => M_AXIS_TVALID, -- : OUT std_logic; m_axis_tready => '0', -- : IN std_logic := '0'; m_axis_tdata => M_AXIS_TDATA, -- : OUT std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0); m_axis_tstrb => M_AXIS_TSTRB, -- : OUT std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0); m_axis_tkeep => M_AXIS_TKEEP, -- : OUT std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0); m_axis_tlast => M_AXIS_TLAST, -- : OUT std_logic; m_axis_tid => M_AXIS_TID, -- : OUT std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0); m_axis_tdest => M_AXIS_TDEST, -- : OUT std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0); m_axis_tuser => M_AXIS_TUSER, -- : OUT std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals axi_aw_injectsbiterr => '0', -- : IN std_logic := '0'; axi_aw_injectdbiterr => '0', -- : IN std_logic := '0'; axi_aw_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_data_count => AXI_AW_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_wr_data_count => AXI_AW_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_rd_data_count => AXI_AW_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_sbiterr => AXI_AW_SBITERR, -- : OUT std_logic; axi_aw_dbiterr => AXI_AW_DBITERR, -- : OUT std_logic; axi_aw_overflow => AXI_AW_OVERFLOW, -- : OUT std_logic; axi_aw_underflow => AXI_AW_UNDERFLOW, -- : OUT std_logic; axi_aw_prog_full => AXI_AW_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_aw_prog_empty => AXI_AW_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Data Channel Signals axi_w_injectsbiterr => '0', -- : IN std_logic := '0'; axi_w_injectdbiterr => '0', -- : IN std_logic := '0'; axi_w_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_data_count => AXI_W_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_wr_data_count => AXI_W_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_rd_data_count => AXI_W_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_sbiterr => AXI_W_SBITERR, -- : OUT std_logic; axi_w_dbiterr => AXI_W_DBITERR, -- : OUT std_logic; axi_w_overflow => AXI_W_OVERFLOW, -- : OUT std_logic; axi_w_underflow => AXI_W_UNDERFLOW, -- : OUT std_logic; axi_w_prog_full => AXI_W_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_w_prog_empty => AXI_W_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Response Channel Signals axi_b_injectsbiterr => '0', -- : IN std_logic := '0'; axi_b_injectdbiterr => '0', -- : IN std_logic := '0'; axi_b_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_data_count => AXI_B_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_wr_data_count => AXI_B_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_rd_data_count => AXI_B_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_sbiterr => AXI_B_SBITERR, -- : OUT std_logic; axi_b_dbiterr => AXI_B_DBITERR, -- : OUT std_logic; axi_b_overflow => AXI_B_OVERFLOW, -- : OUT std_logic; axi_b_underflow => AXI_B_UNDERFLOW, -- : OUT std_logic; axi_b_prog_full => AXI_B_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_b_prog_empty => AXI_B_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Address Channel Signals axi_ar_injectsbiterr => '0', -- : IN std_logic := '0'; axi_ar_injectdbiterr => '0', -- : IN std_logic := '0'; axi_ar_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_data_count => AXI_AR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_wr_data_count => AXI_AR_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_rd_data_count => AXI_AR_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_sbiterr => AXI_AR_SBITERR, -- : OUT std_logic; axi_ar_dbiterr => AXI_AR_DBITERR, -- : OUT std_logic; axi_ar_overflow => AXI_AR_OVERFLOW, -- : OUT std_logic; axi_ar_underflow => AXI_AR_UNDERFLOW, -- : OUT std_logic; axi_ar_prog_full => AXI_AR_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_ar_prog_empty => AXI_AR_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Data Channel Signals axi_r_injectsbiterr => '0', -- : IN std_logic := '0'; axi_r_injectdbiterr => '0', -- : IN std_logic := '0'; axi_r_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_data_count => AXI_R_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_wr_data_count => AXI_R_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_rd_data_count => AXI_R_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_sbiterr => AXI_R_SBITERR, -- : OUT std_logic; axi_r_dbiterr => AXI_R_DBITERR, -- : OUT std_logic; axi_r_overflow => AXI_R_OVERFLOW, -- : OUT std_logic; axi_r_underflow => AXI_R_UNDERFLOW, -- : OUT std_logic; axi_r_prog_full => AXI_R_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_r_prog_empty => AXI_R_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Streaming FIFO Related Signals axis_injectsbiterr => '0', -- : IN std_logic := '0'; axis_injectdbiterr => '0', -- : IN std_logic := '0'; axis_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_data_count => AXIS_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_wr_data_count => AXIS_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_rd_data_count => AXIS_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_sbiterr => AXIS_SBITERR, -- : OUT std_logic; axis_dbiterr => AXIS_DBITERR, -- : OUT std_logic; axis_overflow => AXIS_OVERFLOW, -- : OUT std_logic; axis_underflow => AXIS_UNDERFLOW, -- : OUT std_logic axis_prog_full => AXIS_PROG_FULL, -- : OUT STD_LOGIC := '0'; axis_prog_empty => AXIS_PROG_EMPTY -- : OUT STD_LOGIC := '1'; ); end implementation;
------------------------------------------------------------------------------- -- basic_sfifo_fg.vhd ------------------------------------------------------------------------------- -- -- ************************************************************************* -- -- (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- ************************************************************************* -- ------------------------------------------------------------------------------- -- Filename: basic_sfifo_fg.vhd -- -- Description: -- This HDL file implements a basic synchronous (single clock) fifo using the -- FIFO Generator tool. It is intended to offer a simple interface to the user -- with the complexity of the FIFO Generator interface hidden from the user. -- -- Note that in normal op mode (not First Word Fall Through FWFT) the data count -- output goes to zero when the FIFO goes full. This the way FIFO Generator works. -- -- -- VHDL-Standard: VHDL'93 ------------------------------------------------------------------------------- -- Structure: -- basic_sfifo_fg.vhd -- | -- |-- fifo_generator_v8_2 -- ------------------------------------------------------------------------------- -- Revision History: -- -- -- Author: DET -- Revision: $Revision: 1.0 $ -- Date: $3/07/2011$ -- -- History: -- DET 3/07/2011 Initial Version -- ------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library fifo_generator_v11_0; use fifo_generator_v11_0.all; library proc_common_v4_0; use proc_common_v4_0.proc_common_pkg.all; use proc_common_v4_0.proc_common_pkg.log2; --use proc_common_v4_0.coregen_comp_defs.all; -- synopsys translate_off --library XilinxCoreLib; --use XilinxCoreLib.all; -- synopsys translate_on ------------------------------------------------------------------------------- entity basic_sfifo_fg is generic ( C_DWIDTH : Integer := 32 ; -- FIFO data Width (Read and write data ports are symetric) C_DEPTH : Integer := 512 ; -- FIFO Depth (set to power of 2) C_HAS_DATA_COUNT : integer := 1 ; -- 0 = Data Count output not needed -- 1 = Data Count output needed C_DATA_COUNT_WIDTH : integer := 10 ; -- Data Count bit width (Max value is log2(C_DEPTH)) C_IMPLEMENTATION_TYPE : integer range 0 to 1 := 0; -- 0 = Common Clock BRAM / Distributed RAM (Synchronous FIFO) -- 1 = Common Clock Shift Register (Synchronous FIFO) C_MEMORY_TYPE : integer := 1; -- 0 = Any -- 1 = BRAM -- 2 = Distributed Memory -- 3 = Shift Registers C_PRELOAD_REGS : integer := 1; -- 0 = normal -- 1 = FWFT C_PRELOAD_LATENCY : integer := 0; -- 0 = FWFT -- 1 = normal C_USE_FWFT_DATA_COUNT : integer := 0; -- 0 = normal -- 1 for FWFT C_SYNCHRONIZER_STAGE : integer := 2; -- valid values are 0 to 8; C_FAMILY : string := "virtex6" ); port ( CLK : IN std_logic := '0'; DIN : IN std_logic_vector(C_DWIDTH-1 DOWNTO 0) := (OTHERS => '0'); RD_EN : IN std_logic := '0'; SRST : IN std_logic := '0'; WR_EN : IN std_logic := '0'; DATA_COUNT : OUT std_logic_vector(C_DATA_COUNT_WIDTH-1 DOWNTO 0); DOUT : OUT std_logic_vector(C_DWIDTH-1 DOWNTO 0); EMPTY : OUT std_logic; FULL : OUT std_logic ); end entity basic_sfifo_fg; architecture implementation of basic_sfifo_fg is -- Constant Declarations ---------------------------------------------- Constant POINTER_WIDTH : integer := log2(C_DEPTH); -- Constant zeros for programmable threshold inputs signal PROG_RDTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); signal PROG_WRTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- Signals --Signals added to fix MTI and XSIM issues caused by fix for VCS issues not to use "LIBRARY_SCAN = TRUE" signal ALMOST_FULL : std_logic; signal WR_ACK : std_logic; signal OVERFLOW : std_logic; signal VALID : std_logic; signal UNDERFLOW : std_logic; signal ALMOST_EMPTY : std_logic; signal RD_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal WR_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal PROG_FULL : std_logic; signal PROG_EMPTY : std_logic; signal SBITERR : std_logic; signal DBITERR : std_logic; signal S_AXI_AWREADY : std_logic; signal S_AXI_WREADY : std_logic; signal S_AXI_BID : std_logic_vector(3 DOWNTO 0); signal S_AXI_BRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_BUSER : std_logic_vector(0 downto 0); signal S_AXI_BVALID : std_logic; -- AXI Full/Lite Master Write Channel (Read side) signal M_AXI_AWID : std_logic_vector(3 DOWNTO 0); signal M_AXI_AWADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_AWLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_AWSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWUSER : std_logic_vector(0 downto 0); signal M_AXI_AWVALID : std_logic; signal M_AXI_WID : std_logic_vector(3 DOWNTO 0); signal M_AXI_WDATA : std_logic_vector(63 DOWNTO 0); signal M_AXI_WSTRB : std_logic_vector(7 DOWNTO 0); signal M_AXI_WLAST : std_logic; signal M_AXI_WUSER : std_logic_vector(0 downto 0); signal M_AXI_WVALID : std_logic; signal M_AXI_BREADY : std_logic; -- AXI Full/Lite Slave Read Channel (Write side) signal S_AXI_ARREADY : std_logic; signal S_AXI_RID : std_logic_vector(3 DOWNTO 0); signal S_AXI_RDATA : std_logic_vector(63 DOWNTO 0); signal S_AXI_RRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_RLAST : std_logic; signal S_AXI_RUSER : std_logic_vector(0 downto 0); signal S_AXI_RVALID : std_logic; -- AXI Full/Lite Master Read Channel (Read side) signal M_AXI_ARID : std_logic_vector(3 DOWNTO 0); signal M_AXI_ARADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_ARLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_ARSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARUSER : std_logic_vector(0 downto 0); signal M_AXI_ARVALID : std_logic; signal M_AXI_RREADY : std_logic; -- AXI Streaming Slave Signals (Write side) signal S_AXIS_TREADY : std_logic; -- AXI Streaming Master Signals (Read side) signal M_AXIS_TVALID : std_logic; signal M_AXIS_TDATA : std_logic_vector(63 DOWNTO 0); signal M_AXIS_TSTRB : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TKEEP : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TLAST : std_logic; signal M_AXIS_TID : std_logic_vector(7 DOWNTO 0); signal M_AXIS_TDEST : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TUSER : std_logic_vector(3 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals signal AXI_AW_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_SBITERR : std_logic; signal AXI_AW_DBITERR : std_logic; signal AXI_AW_OVERFLOW : std_logic; signal AXI_AW_UNDERFLOW : std_logic; signal AXI_AW_PROG_FULL : STD_LOGIC; signal AXI_AW_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Data Channel Signals signal AXI_W_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_SBITERR : std_logic; signal AXI_W_DBITERR : std_logic; signal AXI_W_OVERFLOW : std_logic; signal AXI_W_UNDERFLOW : std_logic; signal AXI_W_PROG_FULL : STD_LOGIC; signal AXI_W_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Response Channel Signals signal AXI_B_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_SBITERR : std_logic; signal AXI_B_DBITERR : std_logic; signal AXI_B_OVERFLOW : std_logic; signal AXI_B_UNDERFLOW : std_logic; signal AXI_B_PROG_FULL : STD_LOGIC; signal AXI_B_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Address Channel Signals signal AXI_AR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_SBITERR : std_logic; signal AXI_AR_DBITERR : std_logic; signal AXI_AR_OVERFLOW : std_logic; signal AXI_AR_UNDERFLOW : std_logic; signal AXI_AR_PROG_FULL : STD_LOGIC; signal AXI_AR_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Data Channel Signals signal AXI_R_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_SBITERR : std_logic; signal AXI_R_DBITERR : std_logic; signal AXI_R_OVERFLOW : std_logic; signal AXI_R_UNDERFLOW : std_logic; signal AXI_R_PROG_FULL : STD_LOGIC; signal AXI_R_PROG_EMPTY : STD_LOGIC; -- AXI Streaming FIFO Related Signals signal AXIS_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_SBITERR : std_logic; signal AXIS_DBITERR : std_logic; signal AXIS_OVERFLOW : std_logic; signal AXIS_UNDERFLOW : std_logic; signal AXIS_PROG_FULL : STD_LOGIC; signal AXIS_PROG_EMPTY : STD_LOGIC; begin --(architecture implementation) ------------------------------------------------------------------------------- -- Instantiate the generalized FIFO Generator instance -- -- NOTE: -- DO NOT CHANGE TO DIRECT ENTITY INSTANTIATION!!! -- This is a Coregen FIFO Generator Call module for -- BRAM implementations of a basic Sync FIFO -- ------------------------------------------------------------------------------- I_BASIC_SFIFO : entity fifo_generator_v11_0.fifo_generator_v11_0 generic map( C_COMMON_CLOCK => 1, C_COUNT_TYPE => 0, C_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_DEFAULT_VALUE => "BlankString", C_DIN_WIDTH => C_DWIDTH, C_DOUT_RST_VAL => "0", C_DOUT_WIDTH => C_DWIDTH, C_ENABLE_RLOCS => 0, -- n0 C_FAMILY => C_FAMILY, C_HAS_ALMOST_EMPTY => 0, -- n0 C_HAS_ALMOST_FULL => 0, -- n0 C_HAS_BACKUP => 0, -- n0 C_HAS_DATA_COUNT => C_HAS_DATA_COUNT, C_HAS_MEMINIT_FILE => 0, -- n0 C_HAS_OVERFLOW => 0, -- n0 C_HAS_RD_DATA_COUNT => 0, -- n0 C_HAS_RD_RST => 0, -- n0 C_HAS_RST => 0, -- n0 C_HAS_SRST => 1, -- yes C_HAS_UNDERFLOW => 0, -- n0 C_HAS_VALID => 0, -- n0 C_HAS_WR_ACK => 0, -- n0 C_HAS_WR_DATA_COUNT => 0, -- n0 C_HAS_WR_RST => 0, -- n0 C_IMPLEMENTATION_TYPE => 0, -- Common clock BRAM C_INIT_WR_PNTR_VAL => 0, C_MEMORY_TYPE => C_MEMORY_TYPE, C_MIF_FILE_NAME => "BlankString", C_OPTIMIZATION_MODE => 0, C_OVERFLOW_LOW => 0, C_PRELOAD_LATENCY => C_PRELOAD_LATENCY, C_PRELOAD_REGS => C_PRELOAD_REGS, C_PRIM_FIFO_TYPE => "512x36", C_PROG_EMPTY_THRESH_ASSERT_VAL => 0, C_PROG_EMPTY_THRESH_NEGATE_VAL => 0, C_PROG_EMPTY_TYPE => 0, C_PROG_FULL_THRESH_ASSERT_VAL => 0, C_PROG_FULL_THRESH_NEGATE_VAL => 0, C_PROG_FULL_TYPE => 0, C_RD_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_RD_DEPTH => C_DEPTH, C_RD_FREQ => 1, C_RD_PNTR_WIDTH => POINTER_WIDTH, C_UNDERFLOW_LOW => 0, C_USE_DOUT_RST => 1, C_USE_EMBEDDED_REG => 0, C_USE_FIFO16_FLAGS => 0, C_USE_FWFT_DATA_COUNT => C_USE_FWFT_DATA_COUNT, C_VALID_LOW => 0, C_WR_ACK_LOW => 0, C_WR_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_WR_DEPTH => C_DEPTH, C_WR_FREQ => 1, C_WR_PNTR_WIDTH => POINTER_WIDTH, C_WR_RESPONSE_LATENCY => 1, C_USE_ECC => 0, C_FULL_FLAGS_RST_VAL => 0, C_ENABLE_RST_SYNC => 1, C_ERROR_INJECTION_TYPE => 0, C_SYNCHRONIZER_STAGE => C_SYNCHRONIZER_STAGE, C_HAS_INT_CLK => 0, C_MSGON_VAL => 1, -- AXI Interface related parameters start here C_INTERFACE_TYPE => 0, -- : integer := 0; -- 0: Native Interface; 1: AXI Interface C_AXI_TYPE => 0, -- : integer := 0; -- 0: AXI Stream; 1: AXI Full; 2: AXI Lite C_HAS_AXI_WR_CHANNEL => 0, -- : integer := 0; C_HAS_AXI_RD_CHANNEL => 0, -- : integer := 0; C_HAS_SLAVE_CE => 0, -- : integer := 0; C_HAS_MASTER_CE => 0, -- : integer := 0; C_ADD_NGC_CONSTRAINT => 0, -- : integer := 0; C_USE_COMMON_OVERFLOW => 0, -- : integer := 0; C_USE_COMMON_UNDERFLOW => 0, -- : integer := 0; C_USE_DEFAULT_SETTINGS => 0, -- : integer := 0; -- AXI Full/Lite C_AXI_ID_WIDTH => 4 , -- : integer := 0; C_AXI_ADDR_WIDTH => 32, -- : integer := 0; C_AXI_DATA_WIDTH => 64, -- : integer := 0; C_AXI_LEN_WIDTH => 8, -- : integer := 8; C_AXI_LOCK_WIDTH => 2, -- : integer := 2; C_HAS_AXI_ID => 0, -- : integer := 0; C_HAS_AXI_AWUSER => 0 , -- : integer := 0; C_HAS_AXI_WUSER => 0 , -- : integer := 0; C_HAS_AXI_BUSER => 0 , -- : integer := 0; C_HAS_AXI_ARUSER => 0 , -- : integer := 0; C_HAS_AXI_RUSER => 0 , -- : integer := 0; C_AXI_ARUSER_WIDTH => 1 , -- : integer := 0; C_AXI_AWUSER_WIDTH => 1 , -- : integer := 0; C_AXI_WUSER_WIDTH => 1 , -- : integer := 0; C_AXI_BUSER_WIDTH => 1 , -- : integer := 0; C_AXI_RUSER_WIDTH => 1 , -- : integer := 0; -- AXI Streaming C_HAS_AXIS_TDATA => 0 , -- : integer := 0; C_HAS_AXIS_TID => 0 , -- : integer := 0; C_HAS_AXIS_TDEST => 0 , -- : integer := 0; C_HAS_AXIS_TUSER => 0 , -- : integer := 0; C_HAS_AXIS_TREADY => 1 , -- : integer := 0; C_HAS_AXIS_TLAST => 0 , -- : integer := 0; C_HAS_AXIS_TSTRB => 0 , -- : integer := 0; C_HAS_AXIS_TKEEP => 0 , -- : integer := 0; C_AXIS_TDATA_WIDTH => 64, -- : integer := 1; C_AXIS_TID_WIDTH => 8 , -- : integer := 1; C_AXIS_TDEST_WIDTH => 4 , -- : integer := 1; C_AXIS_TUSER_WIDTH => 4 , -- : integer := 1; C_AXIS_TSTRB_WIDTH => 4 , -- : integer := 1; C_AXIS_TKEEP_WIDTH => 4 , -- : integer := 1; -- AXI Channel Type -- WACH --> Write Address Channel -- WDCH --> Write Data Channel -- WRCH --> Write Response Channel -- RACH --> Read Address Channel -- RDCH --> Read Data Channel -- AXIS --> AXI Streaming C_WACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logic C_WDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_WRCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_AXIS_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie -- AXI Implementation Type -- 1 = Common Clock Block RAM FIFO -- 2 = Common Clock Distributed RAM FIFO -- 11 = Independent Clock Block RAM FIFO -- 12 = Independent Clock Distributed RAM FIFO C_IMPLEMENTATION_TYPE_WACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WRCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_AXIS => 1, -- : integer := 0; -- AXI FIFO Type -- 0 = Data FIFO -- 1 = Packet FIFO -- 2 = Low Latency Data FIFO C_APPLICATION_TYPE_WACH => 0, -- : integer := 0; C_APPLICATION_TYPE_WDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_WRCH => 0, -- : integer := 0; C_APPLICATION_TYPE_RACH => 0, -- : integer := 0; C_APPLICATION_TYPE_RDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_AXIS => 0, -- : integer := 0; -- Enable ECC -- 0 = ECC disabled -- 1 = ECC enabled C_USE_ECC_WACH => 0, -- : integer := 0; C_USE_ECC_WDCH => 0, -- : integer := 0; C_USE_ECC_WRCH => 0, -- : integer := 0; C_USE_ECC_RACH => 0, -- : integer := 0; C_USE_ECC_RDCH => 0, -- : integer := 0; C_USE_ECC_AXIS => 0, -- : integer := 0; -- ECC Error Injection Type -- 0 = No Error Injection -- 1 = Single Bit Error Injection -- 2 = Double Bit Error Injection -- 3 = Single Bit and Double Bit Error Injection C_ERROR_INJECTION_TYPE_WACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WRCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_AXIS => 0, -- : integer := 0; -- Input Data Width -- Accumulation of all AXI input signal's width C_DIN_WIDTH_WACH => 32, -- : integer := 1; C_DIN_WIDTH_WDCH => 64, -- : integer := 1; C_DIN_WIDTH_WRCH => 2 , -- : integer := 1; C_DIN_WIDTH_RACH => 32, -- : integer := 1; C_DIN_WIDTH_RDCH => 64, -- : integer := 1; C_DIN_WIDTH_AXIS => 1 , -- : integer := 1; C_WR_DEPTH_WACH => 16 , -- : integer := 16; C_WR_DEPTH_WDCH => 1024, -- : integer := 16; C_WR_DEPTH_WRCH => 16 , -- : integer := 16; C_WR_DEPTH_RACH => 16 , -- : integer := 16; C_WR_DEPTH_RDCH => 1024, -- : integer := 16; C_WR_DEPTH_AXIS => 1024, -- : integer := 16; C_WR_PNTR_WIDTH_WACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_WDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_WRCH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_AXIS => 10, -- : integer := 4; C_HAS_DATA_COUNTS_WACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WRCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_AXIS => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WRCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_AXIS => 0, -- : integer := 0; C_PROG_FULL_TYPE_WACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WRCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_AXIS => 1023, -- : integer := 0; C_PROG_EMPTY_TYPE_WACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS => 1022, -- : integer := 0; C_REG_SLICE_MODE_WACH => 0, -- : integer := 0; C_REG_SLICE_MODE_WDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_WRCH => 0, -- : integer := 0; C_REG_SLICE_MODE_RACH => 0, -- : integer := 0; C_REG_SLICE_MODE_RDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_AXIS => 0 -- : integer := 0 ) port map( backup => '0', backup_marker => '0', clk => CLK, rst => '0', srst => SRST, wr_clk => '0', wr_rst => '0', rd_clk => '0', rd_rst => '0', din => DIN, -- uses this one wr_en => WR_EN, -- uses this one rd_en => RD_EN, -- uses this one prog_empty_thresh => PROG_RDTHRESH_ZEROS, prog_empty_thresh_assert => PROG_RDTHRESH_ZEROS, prog_empty_thresh_negate => PROG_RDTHRESH_ZEROS, prog_full_thresh => PROG_WRTHRESH_ZEROS, prog_full_thresh_assert => PROG_WRTHRESH_ZEROS, prog_full_thresh_negate => PROG_WRTHRESH_ZEROS, int_clk => '0', injectdbiterr => '0', injectsbiterr => '0', dout => DOUT, -- uses this one full => FULL, -- uses this one almost_full => ALMOST_FULL, wr_ack => WR_ACK, overflow => OVERFLOW, empty => EMPTY, -- uses this one almost_empty => ALMOST_EMPTY, valid => VALID, underflow => UNDERFLOW, data_count => DATA_COUNT, -- uses this one rd_data_count => RD_DATA_COUNT, wr_data_count => WR_DATA_COUNT, prog_full => PROG_FULL, prog_empty => PROG_EMPTY, sbiterr => SBITERR, dbiterr => DBITERR, -- AXI Global Signal m_aclk => '0', -- : IN std_logic := '0'; s_aclk => '0', -- : IN std_logic := '0'; s_aresetn => '0', -- : IN std_logic := '0'; m_aclk_en => '0', -- : IN std_logic := '0'; s_aclk_en => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Slave Write Channel (write side) s_axi_awid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awaddr => "00000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlen => "00000000", --(others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awsize => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awburst => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlock => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awcache => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awprot => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awqos => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awregion => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awvalid => '0', -- : IN std_logic := '0'; s_axi_awready => S_AXI_AWREADY, -- : OUT std_logic; s_axi_wid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wstrb => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wlast => '0', -- : IN std_logic := '0'; s_axi_wuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wvalid => '0', -- : IN std_logic := '0'; s_axi_wready => S_AXI_WREADY, -- : OUT std_logic; s_axi_bid => S_AXI_BID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_bresp => S_AXI_BRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_buser => S_AXI_BUSER, -- : OUT std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0); s_axi_bvalid => S_AXI_BVALID, -- : OUT std_logic; s_axi_bready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Write Channel (Read side) m_axi_awid => M_AXI_AWID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_awaddr => M_AXI_AWADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_awlen => M_AXI_AWLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_awsize => M_AXI_AWSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awburst => M_AXI_AWBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awlock => M_AXI_AWLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awcache => M_AXI_AWCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awprot => M_AXI_AWPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awqos => M_AXI_AWQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awregion => M_AXI_AWREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awuser => M_AXI_AWUSER, -- : OUT std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0); m_axi_awvalid => M_AXI_AWVALID, -- : OUT std_logic; m_axi_awready => '0', -- : IN std_logic := '0'; m_axi_wid => M_AXI_WID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_wdata => M_AXI_WDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); m_axi_wstrb => M_AXI_WSTRB, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0); m_axi_wlast => M_AXI_WLAST, -- : OUT std_logic; m_axi_wuser => M_AXI_WUSER, -- : OUT std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0); m_axi_wvalid => M_AXI_WVALID, -- : OUT std_logic; m_axi_wready => '0', -- : IN std_logic := '0'; m_axi_bid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_buser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bvalid => '0', -- : IN std_logic := '0'; m_axi_bready => M_AXI_BREADY, -- : OUT std_logic; -- AXI Full/Lite Slave Read Channel (Write side) s_axi_arid => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_araddr => "00000000000000000000000000000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlen => "00000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arsize => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arburst => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlock => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arcache => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arprot => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arqos => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arregion => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_aruser => "0", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arvalid => '0', -- : IN std_logic := '0'; s_axi_arready => S_AXI_ARREADY, -- : OUT std_logic; s_axi_rid => S_AXI_RID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); s_axi_rdata => S_AXI_RDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); s_axi_rresp => S_AXI_RRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_rlast => S_AXI_RLAST, -- : OUT std_logic; s_axi_ruser => S_AXI_RUSER, -- : OUT std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0); s_axi_rvalid => S_AXI_RVALID, -- : OUT std_logic; s_axi_rready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Read Channel (Read side) m_axi_arid => M_AXI_ARID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_araddr => M_AXI_ARADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_arlen => M_AXI_ARLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_arsize => M_AXI_ARSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arburst => M_AXI_ARBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arlock => M_AXI_ARLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arcache => M_AXI_ARCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arprot => M_AXI_ARPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arqos => M_AXI_ARQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arregion => M_AXI_ARREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_aruser => M_AXI_ARUSER, -- : OUT std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0); m_axi_arvalid => M_AXI_ARVALID, -- : OUT std_logic; m_axi_arready => '0', -- : IN std_logic := '0'; m_axi_rid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rlast => '0', -- : IN std_logic := '0'; m_axi_ruser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rvalid => '0', -- : IN std_logic := '0'; m_axi_rready => M_AXI_RREADY, -- : OUT std_logic; -- AXI Streaming Slave Signals (Write side) s_axis_tvalid => '0', -- : IN std_logic := '0'; s_axis_tready => S_AXIS_TREADY, -- : OUT std_logic; s_axis_tdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tstrb => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tkeep => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tlast => '0', -- : IN std_logic := '0'; s_axis_tid => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tdest => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tuser => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- AXI Streaming Master Signals (Read side) m_axis_tvalid => M_AXIS_TVALID, -- : OUT std_logic; m_axis_tready => '0', -- : IN std_logic := '0'; m_axis_tdata => M_AXIS_TDATA, -- : OUT std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0); m_axis_tstrb => M_AXIS_TSTRB, -- : OUT std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0); m_axis_tkeep => M_AXIS_TKEEP, -- : OUT std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0); m_axis_tlast => M_AXIS_TLAST, -- : OUT std_logic; m_axis_tid => M_AXIS_TID, -- : OUT std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0); m_axis_tdest => M_AXIS_TDEST, -- : OUT std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0); m_axis_tuser => M_AXIS_TUSER, -- : OUT std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals axi_aw_injectsbiterr => '0', -- : IN std_logic := '0'; axi_aw_injectdbiterr => '0', -- : IN std_logic := '0'; axi_aw_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_data_count => AXI_AW_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_wr_data_count => AXI_AW_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_rd_data_count => AXI_AW_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_sbiterr => AXI_AW_SBITERR, -- : OUT std_logic; axi_aw_dbiterr => AXI_AW_DBITERR, -- : OUT std_logic; axi_aw_overflow => AXI_AW_OVERFLOW, -- : OUT std_logic; axi_aw_underflow => AXI_AW_UNDERFLOW, -- : OUT std_logic; axi_aw_prog_full => AXI_AW_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_aw_prog_empty => AXI_AW_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Data Channel Signals axi_w_injectsbiterr => '0', -- : IN std_logic := '0'; axi_w_injectdbiterr => '0', -- : IN std_logic := '0'; axi_w_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_data_count => AXI_W_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_wr_data_count => AXI_W_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_rd_data_count => AXI_W_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_sbiterr => AXI_W_SBITERR, -- : OUT std_logic; axi_w_dbiterr => AXI_W_DBITERR, -- : OUT std_logic; axi_w_overflow => AXI_W_OVERFLOW, -- : OUT std_logic; axi_w_underflow => AXI_W_UNDERFLOW, -- : OUT std_logic; axi_w_prog_full => AXI_W_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_w_prog_empty => AXI_W_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Response Channel Signals axi_b_injectsbiterr => '0', -- : IN std_logic := '0'; axi_b_injectdbiterr => '0', -- : IN std_logic := '0'; axi_b_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_data_count => AXI_B_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_wr_data_count => AXI_B_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_rd_data_count => AXI_B_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_sbiterr => AXI_B_SBITERR, -- : OUT std_logic; axi_b_dbiterr => AXI_B_DBITERR, -- : OUT std_logic; axi_b_overflow => AXI_B_OVERFLOW, -- : OUT std_logic; axi_b_underflow => AXI_B_UNDERFLOW, -- : OUT std_logic; axi_b_prog_full => AXI_B_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_b_prog_empty => AXI_B_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Address Channel Signals axi_ar_injectsbiterr => '0', -- : IN std_logic := '0'; axi_ar_injectdbiterr => '0', -- : IN std_logic := '0'; axi_ar_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_data_count => AXI_AR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_wr_data_count => AXI_AR_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_rd_data_count => AXI_AR_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_sbiterr => AXI_AR_SBITERR, -- : OUT std_logic; axi_ar_dbiterr => AXI_AR_DBITERR, -- : OUT std_logic; axi_ar_overflow => AXI_AR_OVERFLOW, -- : OUT std_logic; axi_ar_underflow => AXI_AR_UNDERFLOW, -- : OUT std_logic; axi_ar_prog_full => AXI_AR_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_ar_prog_empty => AXI_AR_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Data Channel Signals axi_r_injectsbiterr => '0', -- : IN std_logic := '0'; axi_r_injectdbiterr => '0', -- : IN std_logic := '0'; axi_r_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_data_count => AXI_R_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_wr_data_count => AXI_R_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_rd_data_count => AXI_R_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_sbiterr => AXI_R_SBITERR, -- : OUT std_logic; axi_r_dbiterr => AXI_R_DBITERR, -- : OUT std_logic; axi_r_overflow => AXI_R_OVERFLOW, -- : OUT std_logic; axi_r_underflow => AXI_R_UNDERFLOW, -- : OUT std_logic; axi_r_prog_full => AXI_R_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_r_prog_empty => AXI_R_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Streaming FIFO Related Signals axis_injectsbiterr => '0', -- : IN std_logic := '0'; axis_injectdbiterr => '0', -- : IN std_logic := '0'; axis_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_data_count => AXIS_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_wr_data_count => AXIS_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_rd_data_count => AXIS_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_sbiterr => AXIS_SBITERR, -- : OUT std_logic; axis_dbiterr => AXIS_DBITERR, -- : OUT std_logic; axis_overflow => AXIS_OVERFLOW, -- : OUT std_logic; axis_underflow => AXIS_UNDERFLOW, -- : OUT std_logic axis_prog_full => AXIS_PROG_FULL, -- : OUT STD_LOGIC := '0'; axis_prog_empty => AXIS_PROG_EMPTY -- : OUT STD_LOGIC := '1'; ); end implementation;
------------------------------------------------------------------------------- -- basic_sfifo_fg.vhd ------------------------------------------------------------------------------- -- -- ************************************************************************* -- -- (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- ************************************************************************* -- ------------------------------------------------------------------------------- -- Filename: basic_sfifo_fg.vhd -- -- Description: -- This HDL file implements a basic synchronous (single clock) fifo using the -- FIFO Generator tool. It is intended to offer a simple interface to the user -- with the complexity of the FIFO Generator interface hidden from the user. -- -- Note that in normal op mode (not First Word Fall Through FWFT) the data count -- output goes to zero when the FIFO goes full. This the way FIFO Generator works. -- -- -- VHDL-Standard: VHDL'93 ------------------------------------------------------------------------------- -- Structure: -- basic_sfifo_fg.vhd -- | -- |-- fifo_generator_v8_2 -- ------------------------------------------------------------------------------- -- Revision History: -- -- -- Author: DET -- Revision: $Revision: 1.0 $ -- Date: $3/07/2011$ -- -- History: -- DET 3/07/2011 Initial Version -- ------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library fifo_generator_v11_0; use fifo_generator_v11_0.all; library proc_common_v4_0; use proc_common_v4_0.proc_common_pkg.all; use proc_common_v4_0.proc_common_pkg.log2; --use proc_common_v4_0.coregen_comp_defs.all; -- synopsys translate_off --library XilinxCoreLib; --use XilinxCoreLib.all; -- synopsys translate_on ------------------------------------------------------------------------------- entity basic_sfifo_fg is generic ( C_DWIDTH : Integer := 32 ; -- FIFO data Width (Read and write data ports are symetric) C_DEPTH : Integer := 512 ; -- FIFO Depth (set to power of 2) C_HAS_DATA_COUNT : integer := 1 ; -- 0 = Data Count output not needed -- 1 = Data Count output needed C_DATA_COUNT_WIDTH : integer := 10 ; -- Data Count bit width (Max value is log2(C_DEPTH)) C_IMPLEMENTATION_TYPE : integer range 0 to 1 := 0; -- 0 = Common Clock BRAM / Distributed RAM (Synchronous FIFO) -- 1 = Common Clock Shift Register (Synchronous FIFO) C_MEMORY_TYPE : integer := 1; -- 0 = Any -- 1 = BRAM -- 2 = Distributed Memory -- 3 = Shift Registers C_PRELOAD_REGS : integer := 1; -- 0 = normal -- 1 = FWFT C_PRELOAD_LATENCY : integer := 0; -- 0 = FWFT -- 1 = normal C_USE_FWFT_DATA_COUNT : integer := 0; -- 0 = normal -- 1 for FWFT C_SYNCHRONIZER_STAGE : integer := 2; -- valid values are 0 to 8; C_FAMILY : string := "virtex6" ); port ( CLK : IN std_logic := '0'; DIN : IN std_logic_vector(C_DWIDTH-1 DOWNTO 0) := (OTHERS => '0'); RD_EN : IN std_logic := '0'; SRST : IN std_logic := '0'; WR_EN : IN std_logic := '0'; DATA_COUNT : OUT std_logic_vector(C_DATA_COUNT_WIDTH-1 DOWNTO 0); DOUT : OUT std_logic_vector(C_DWIDTH-1 DOWNTO 0); EMPTY : OUT std_logic; FULL : OUT std_logic ); end entity basic_sfifo_fg; architecture implementation of basic_sfifo_fg is -- Constant Declarations ---------------------------------------------- Constant POINTER_WIDTH : integer := log2(C_DEPTH); -- Constant zeros for programmable threshold inputs signal PROG_RDTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); signal PROG_WRTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- Signals --Signals added to fix MTI and XSIM issues caused by fix for VCS issues not to use "LIBRARY_SCAN = TRUE" signal ALMOST_FULL : std_logic; signal WR_ACK : std_logic; signal OVERFLOW : std_logic; signal VALID : std_logic; signal UNDERFLOW : std_logic; signal ALMOST_EMPTY : std_logic; signal RD_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal WR_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal PROG_FULL : std_logic; signal PROG_EMPTY : std_logic; signal SBITERR : std_logic; signal DBITERR : std_logic; signal S_AXI_AWREADY : std_logic; signal S_AXI_WREADY : std_logic; signal S_AXI_BID : std_logic_vector(3 DOWNTO 0); signal S_AXI_BRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_BUSER : std_logic_vector(0 downto 0); signal S_AXI_BVALID : std_logic; -- AXI Full/Lite Master Write Channel (Read side) signal M_AXI_AWID : std_logic_vector(3 DOWNTO 0); signal M_AXI_AWADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_AWLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_AWSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWUSER : std_logic_vector(0 downto 0); signal M_AXI_AWVALID : std_logic; signal M_AXI_WID : std_logic_vector(3 DOWNTO 0); signal M_AXI_WDATA : std_logic_vector(63 DOWNTO 0); signal M_AXI_WSTRB : std_logic_vector(7 DOWNTO 0); signal M_AXI_WLAST : std_logic; signal M_AXI_WUSER : std_logic_vector(0 downto 0); signal M_AXI_WVALID : std_logic; signal M_AXI_BREADY : std_logic; -- AXI Full/Lite Slave Read Channel (Write side) signal S_AXI_ARREADY : std_logic; signal S_AXI_RID : std_logic_vector(3 DOWNTO 0); signal S_AXI_RDATA : std_logic_vector(63 DOWNTO 0); signal S_AXI_RRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_RLAST : std_logic; signal S_AXI_RUSER : std_logic_vector(0 downto 0); signal S_AXI_RVALID : std_logic; -- AXI Full/Lite Master Read Channel (Read side) signal M_AXI_ARID : std_logic_vector(3 DOWNTO 0); signal M_AXI_ARADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_ARLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_ARSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARUSER : std_logic_vector(0 downto 0); signal M_AXI_ARVALID : std_logic; signal M_AXI_RREADY : std_logic; -- AXI Streaming Slave Signals (Write side) signal S_AXIS_TREADY : std_logic; -- AXI Streaming Master Signals (Read side) signal M_AXIS_TVALID : std_logic; signal M_AXIS_TDATA : std_logic_vector(63 DOWNTO 0); signal M_AXIS_TSTRB : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TKEEP : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TLAST : std_logic; signal M_AXIS_TID : std_logic_vector(7 DOWNTO 0); signal M_AXIS_TDEST : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TUSER : std_logic_vector(3 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals signal AXI_AW_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_SBITERR : std_logic; signal AXI_AW_DBITERR : std_logic; signal AXI_AW_OVERFLOW : std_logic; signal AXI_AW_UNDERFLOW : std_logic; signal AXI_AW_PROG_FULL : STD_LOGIC; signal AXI_AW_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Data Channel Signals signal AXI_W_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_SBITERR : std_logic; signal AXI_W_DBITERR : std_logic; signal AXI_W_OVERFLOW : std_logic; signal AXI_W_UNDERFLOW : std_logic; signal AXI_W_PROG_FULL : STD_LOGIC; signal AXI_W_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Response Channel Signals signal AXI_B_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_SBITERR : std_logic; signal AXI_B_DBITERR : std_logic; signal AXI_B_OVERFLOW : std_logic; signal AXI_B_UNDERFLOW : std_logic; signal AXI_B_PROG_FULL : STD_LOGIC; signal AXI_B_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Address Channel Signals signal AXI_AR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_SBITERR : std_logic; signal AXI_AR_DBITERR : std_logic; signal AXI_AR_OVERFLOW : std_logic; signal AXI_AR_UNDERFLOW : std_logic; signal AXI_AR_PROG_FULL : STD_LOGIC; signal AXI_AR_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Data Channel Signals signal AXI_R_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_SBITERR : std_logic; signal AXI_R_DBITERR : std_logic; signal AXI_R_OVERFLOW : std_logic; signal AXI_R_UNDERFLOW : std_logic; signal AXI_R_PROG_FULL : STD_LOGIC; signal AXI_R_PROG_EMPTY : STD_LOGIC; -- AXI Streaming FIFO Related Signals signal AXIS_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_SBITERR : std_logic; signal AXIS_DBITERR : std_logic; signal AXIS_OVERFLOW : std_logic; signal AXIS_UNDERFLOW : std_logic; signal AXIS_PROG_FULL : STD_LOGIC; signal AXIS_PROG_EMPTY : STD_LOGIC; begin --(architecture implementation) ------------------------------------------------------------------------------- -- Instantiate the generalized FIFO Generator instance -- -- NOTE: -- DO NOT CHANGE TO DIRECT ENTITY INSTANTIATION!!! -- This is a Coregen FIFO Generator Call module for -- BRAM implementations of a basic Sync FIFO -- ------------------------------------------------------------------------------- I_BASIC_SFIFO : entity fifo_generator_v11_0.fifo_generator_v11_0 generic map( C_COMMON_CLOCK => 1, C_COUNT_TYPE => 0, C_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_DEFAULT_VALUE => "BlankString", C_DIN_WIDTH => C_DWIDTH, C_DOUT_RST_VAL => "0", C_DOUT_WIDTH => C_DWIDTH, C_ENABLE_RLOCS => 0, -- n0 C_FAMILY => C_FAMILY, C_HAS_ALMOST_EMPTY => 0, -- n0 C_HAS_ALMOST_FULL => 0, -- n0 C_HAS_BACKUP => 0, -- n0 C_HAS_DATA_COUNT => C_HAS_DATA_COUNT, C_HAS_MEMINIT_FILE => 0, -- n0 C_HAS_OVERFLOW => 0, -- n0 C_HAS_RD_DATA_COUNT => 0, -- n0 C_HAS_RD_RST => 0, -- n0 C_HAS_RST => 0, -- n0 C_HAS_SRST => 1, -- yes C_HAS_UNDERFLOW => 0, -- n0 C_HAS_VALID => 0, -- n0 C_HAS_WR_ACK => 0, -- n0 C_HAS_WR_DATA_COUNT => 0, -- n0 C_HAS_WR_RST => 0, -- n0 C_IMPLEMENTATION_TYPE => 0, -- Common clock BRAM C_INIT_WR_PNTR_VAL => 0, C_MEMORY_TYPE => C_MEMORY_TYPE, C_MIF_FILE_NAME => "BlankString", C_OPTIMIZATION_MODE => 0, C_OVERFLOW_LOW => 0, C_PRELOAD_LATENCY => C_PRELOAD_LATENCY, C_PRELOAD_REGS => C_PRELOAD_REGS, C_PRIM_FIFO_TYPE => "512x36", C_PROG_EMPTY_THRESH_ASSERT_VAL => 0, C_PROG_EMPTY_THRESH_NEGATE_VAL => 0, C_PROG_EMPTY_TYPE => 0, C_PROG_FULL_THRESH_ASSERT_VAL => 0, C_PROG_FULL_THRESH_NEGATE_VAL => 0, C_PROG_FULL_TYPE => 0, C_RD_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_RD_DEPTH => C_DEPTH, C_RD_FREQ => 1, C_RD_PNTR_WIDTH => POINTER_WIDTH, C_UNDERFLOW_LOW => 0, C_USE_DOUT_RST => 1, C_USE_EMBEDDED_REG => 0, C_USE_FIFO16_FLAGS => 0, C_USE_FWFT_DATA_COUNT => C_USE_FWFT_DATA_COUNT, C_VALID_LOW => 0, C_WR_ACK_LOW => 0, C_WR_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_WR_DEPTH => C_DEPTH, C_WR_FREQ => 1, C_WR_PNTR_WIDTH => POINTER_WIDTH, C_WR_RESPONSE_LATENCY => 1, C_USE_ECC => 0, C_FULL_FLAGS_RST_VAL => 0, C_ENABLE_RST_SYNC => 1, C_ERROR_INJECTION_TYPE => 0, C_SYNCHRONIZER_STAGE => C_SYNCHRONIZER_STAGE, C_HAS_INT_CLK => 0, C_MSGON_VAL => 1, -- AXI Interface related parameters start here C_INTERFACE_TYPE => 0, -- : integer := 0; -- 0: Native Interface; 1: AXI Interface C_AXI_TYPE => 0, -- : integer := 0; -- 0: AXI Stream; 1: AXI Full; 2: AXI Lite C_HAS_AXI_WR_CHANNEL => 0, -- : integer := 0; C_HAS_AXI_RD_CHANNEL => 0, -- : integer := 0; C_HAS_SLAVE_CE => 0, -- : integer := 0; C_HAS_MASTER_CE => 0, -- : integer := 0; C_ADD_NGC_CONSTRAINT => 0, -- : integer := 0; C_USE_COMMON_OVERFLOW => 0, -- : integer := 0; C_USE_COMMON_UNDERFLOW => 0, -- : integer := 0; C_USE_DEFAULT_SETTINGS => 0, -- : integer := 0; -- AXI Full/Lite C_AXI_ID_WIDTH => 4 , -- : integer := 0; C_AXI_ADDR_WIDTH => 32, -- : integer := 0; C_AXI_DATA_WIDTH => 64, -- : integer := 0; C_AXI_LEN_WIDTH => 8, -- : integer := 8; C_AXI_LOCK_WIDTH => 2, -- : integer := 2; C_HAS_AXI_ID => 0, -- : integer := 0; C_HAS_AXI_AWUSER => 0 , -- : integer := 0; C_HAS_AXI_WUSER => 0 , -- : integer := 0; C_HAS_AXI_BUSER => 0 , -- : integer := 0; C_HAS_AXI_ARUSER => 0 , -- : integer := 0; C_HAS_AXI_RUSER => 0 , -- : integer := 0; C_AXI_ARUSER_WIDTH => 1 , -- : integer := 0; C_AXI_AWUSER_WIDTH => 1 , -- : integer := 0; C_AXI_WUSER_WIDTH => 1 , -- : integer := 0; C_AXI_BUSER_WIDTH => 1 , -- : integer := 0; C_AXI_RUSER_WIDTH => 1 , -- : integer := 0; -- AXI Streaming C_HAS_AXIS_TDATA => 0 , -- : integer := 0; C_HAS_AXIS_TID => 0 , -- : integer := 0; C_HAS_AXIS_TDEST => 0 , -- : integer := 0; C_HAS_AXIS_TUSER => 0 , -- : integer := 0; C_HAS_AXIS_TREADY => 1 , -- : integer := 0; C_HAS_AXIS_TLAST => 0 , -- : integer := 0; C_HAS_AXIS_TSTRB => 0 , -- : integer := 0; C_HAS_AXIS_TKEEP => 0 , -- : integer := 0; C_AXIS_TDATA_WIDTH => 64, -- : integer := 1; C_AXIS_TID_WIDTH => 8 , -- : integer := 1; C_AXIS_TDEST_WIDTH => 4 , -- : integer := 1; C_AXIS_TUSER_WIDTH => 4 , -- : integer := 1; C_AXIS_TSTRB_WIDTH => 4 , -- : integer := 1; C_AXIS_TKEEP_WIDTH => 4 , -- : integer := 1; -- AXI Channel Type -- WACH --> Write Address Channel -- WDCH --> Write Data Channel -- WRCH --> Write Response Channel -- RACH --> Read Address Channel -- RDCH --> Read Data Channel -- AXIS --> AXI Streaming C_WACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logic C_WDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_WRCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_AXIS_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie -- AXI Implementation Type -- 1 = Common Clock Block RAM FIFO -- 2 = Common Clock Distributed RAM FIFO -- 11 = Independent Clock Block RAM FIFO -- 12 = Independent Clock Distributed RAM FIFO C_IMPLEMENTATION_TYPE_WACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WRCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_AXIS => 1, -- : integer := 0; -- AXI FIFO Type -- 0 = Data FIFO -- 1 = Packet FIFO -- 2 = Low Latency Data FIFO C_APPLICATION_TYPE_WACH => 0, -- : integer := 0; C_APPLICATION_TYPE_WDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_WRCH => 0, -- : integer := 0; C_APPLICATION_TYPE_RACH => 0, -- : integer := 0; C_APPLICATION_TYPE_RDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_AXIS => 0, -- : integer := 0; -- Enable ECC -- 0 = ECC disabled -- 1 = ECC enabled C_USE_ECC_WACH => 0, -- : integer := 0; C_USE_ECC_WDCH => 0, -- : integer := 0; C_USE_ECC_WRCH => 0, -- : integer := 0; C_USE_ECC_RACH => 0, -- : integer := 0; C_USE_ECC_RDCH => 0, -- : integer := 0; C_USE_ECC_AXIS => 0, -- : integer := 0; -- ECC Error Injection Type -- 0 = No Error Injection -- 1 = Single Bit Error Injection -- 2 = Double Bit Error Injection -- 3 = Single Bit and Double Bit Error Injection C_ERROR_INJECTION_TYPE_WACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WRCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_AXIS => 0, -- : integer := 0; -- Input Data Width -- Accumulation of all AXI input signal's width C_DIN_WIDTH_WACH => 32, -- : integer := 1; C_DIN_WIDTH_WDCH => 64, -- : integer := 1; C_DIN_WIDTH_WRCH => 2 , -- : integer := 1; C_DIN_WIDTH_RACH => 32, -- : integer := 1; C_DIN_WIDTH_RDCH => 64, -- : integer := 1; C_DIN_WIDTH_AXIS => 1 , -- : integer := 1; C_WR_DEPTH_WACH => 16 , -- : integer := 16; C_WR_DEPTH_WDCH => 1024, -- : integer := 16; C_WR_DEPTH_WRCH => 16 , -- : integer := 16; C_WR_DEPTH_RACH => 16 , -- : integer := 16; C_WR_DEPTH_RDCH => 1024, -- : integer := 16; C_WR_DEPTH_AXIS => 1024, -- : integer := 16; C_WR_PNTR_WIDTH_WACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_WDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_WRCH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_AXIS => 10, -- : integer := 4; C_HAS_DATA_COUNTS_WACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WRCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_AXIS => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WRCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_AXIS => 0, -- : integer := 0; C_PROG_FULL_TYPE_WACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WRCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_AXIS => 1023, -- : integer := 0; C_PROG_EMPTY_TYPE_WACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS => 1022, -- : integer := 0; C_REG_SLICE_MODE_WACH => 0, -- : integer := 0; C_REG_SLICE_MODE_WDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_WRCH => 0, -- : integer := 0; C_REG_SLICE_MODE_RACH => 0, -- : integer := 0; C_REG_SLICE_MODE_RDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_AXIS => 0 -- : integer := 0 ) port map( backup => '0', backup_marker => '0', clk => CLK, rst => '0', srst => SRST, wr_clk => '0', wr_rst => '0', rd_clk => '0', rd_rst => '0', din => DIN, -- uses this one wr_en => WR_EN, -- uses this one rd_en => RD_EN, -- uses this one prog_empty_thresh => PROG_RDTHRESH_ZEROS, prog_empty_thresh_assert => PROG_RDTHRESH_ZEROS, prog_empty_thresh_negate => PROG_RDTHRESH_ZEROS, prog_full_thresh => PROG_WRTHRESH_ZEROS, prog_full_thresh_assert => PROG_WRTHRESH_ZEROS, prog_full_thresh_negate => PROG_WRTHRESH_ZEROS, int_clk => '0', injectdbiterr => '0', injectsbiterr => '0', dout => DOUT, -- uses this one full => FULL, -- uses this one almost_full => ALMOST_FULL, wr_ack => WR_ACK, overflow => OVERFLOW, empty => EMPTY, -- uses this one almost_empty => ALMOST_EMPTY, valid => VALID, underflow => UNDERFLOW, data_count => DATA_COUNT, -- uses this one rd_data_count => RD_DATA_COUNT, wr_data_count => WR_DATA_COUNT, prog_full => PROG_FULL, prog_empty => PROG_EMPTY, sbiterr => SBITERR, dbiterr => DBITERR, -- AXI Global Signal m_aclk => '0', -- : IN std_logic := '0'; s_aclk => '0', -- : IN std_logic := '0'; s_aresetn => '0', -- : IN std_logic := '0'; m_aclk_en => '0', -- : IN std_logic := '0'; s_aclk_en => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Slave Write Channel (write side) s_axi_awid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awaddr => "00000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlen => "00000000", --(others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awsize => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awburst => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlock => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awcache => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awprot => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awqos => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awregion => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awvalid => '0', -- : IN std_logic := '0'; s_axi_awready => S_AXI_AWREADY, -- : OUT std_logic; s_axi_wid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wstrb => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wlast => '0', -- : IN std_logic := '0'; s_axi_wuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wvalid => '0', -- : IN std_logic := '0'; s_axi_wready => S_AXI_WREADY, -- : OUT std_logic; s_axi_bid => S_AXI_BID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_bresp => S_AXI_BRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_buser => S_AXI_BUSER, -- : OUT std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0); s_axi_bvalid => S_AXI_BVALID, -- : OUT std_logic; s_axi_bready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Write Channel (Read side) m_axi_awid => M_AXI_AWID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_awaddr => M_AXI_AWADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_awlen => M_AXI_AWLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_awsize => M_AXI_AWSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awburst => M_AXI_AWBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awlock => M_AXI_AWLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awcache => M_AXI_AWCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awprot => M_AXI_AWPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awqos => M_AXI_AWQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awregion => M_AXI_AWREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awuser => M_AXI_AWUSER, -- : OUT std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0); m_axi_awvalid => M_AXI_AWVALID, -- : OUT std_logic; m_axi_awready => '0', -- : IN std_logic := '0'; m_axi_wid => M_AXI_WID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_wdata => M_AXI_WDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); m_axi_wstrb => M_AXI_WSTRB, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0); m_axi_wlast => M_AXI_WLAST, -- : OUT std_logic; m_axi_wuser => M_AXI_WUSER, -- : OUT std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0); m_axi_wvalid => M_AXI_WVALID, -- : OUT std_logic; m_axi_wready => '0', -- : IN std_logic := '0'; m_axi_bid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_buser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bvalid => '0', -- : IN std_logic := '0'; m_axi_bready => M_AXI_BREADY, -- : OUT std_logic; -- AXI Full/Lite Slave Read Channel (Write side) s_axi_arid => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_araddr => "00000000000000000000000000000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlen => "00000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arsize => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arburst => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlock => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arcache => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arprot => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arqos => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arregion => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_aruser => "0", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arvalid => '0', -- : IN std_logic := '0'; s_axi_arready => S_AXI_ARREADY, -- : OUT std_logic; s_axi_rid => S_AXI_RID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); s_axi_rdata => S_AXI_RDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); s_axi_rresp => S_AXI_RRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_rlast => S_AXI_RLAST, -- : OUT std_logic; s_axi_ruser => S_AXI_RUSER, -- : OUT std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0); s_axi_rvalid => S_AXI_RVALID, -- : OUT std_logic; s_axi_rready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Read Channel (Read side) m_axi_arid => M_AXI_ARID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_araddr => M_AXI_ARADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_arlen => M_AXI_ARLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_arsize => M_AXI_ARSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arburst => M_AXI_ARBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arlock => M_AXI_ARLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arcache => M_AXI_ARCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arprot => M_AXI_ARPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arqos => M_AXI_ARQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arregion => M_AXI_ARREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_aruser => M_AXI_ARUSER, -- : OUT std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0); m_axi_arvalid => M_AXI_ARVALID, -- : OUT std_logic; m_axi_arready => '0', -- : IN std_logic := '0'; m_axi_rid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rlast => '0', -- : IN std_logic := '0'; m_axi_ruser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rvalid => '0', -- : IN std_logic := '0'; m_axi_rready => M_AXI_RREADY, -- : OUT std_logic; -- AXI Streaming Slave Signals (Write side) s_axis_tvalid => '0', -- : IN std_logic := '0'; s_axis_tready => S_AXIS_TREADY, -- : OUT std_logic; s_axis_tdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tstrb => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tkeep => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tlast => '0', -- : IN std_logic := '0'; s_axis_tid => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tdest => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tuser => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- AXI Streaming Master Signals (Read side) m_axis_tvalid => M_AXIS_TVALID, -- : OUT std_logic; m_axis_tready => '0', -- : IN std_logic := '0'; m_axis_tdata => M_AXIS_TDATA, -- : OUT std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0); m_axis_tstrb => M_AXIS_TSTRB, -- : OUT std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0); m_axis_tkeep => M_AXIS_TKEEP, -- : OUT std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0); m_axis_tlast => M_AXIS_TLAST, -- : OUT std_logic; m_axis_tid => M_AXIS_TID, -- : OUT std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0); m_axis_tdest => M_AXIS_TDEST, -- : OUT std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0); m_axis_tuser => M_AXIS_TUSER, -- : OUT std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals axi_aw_injectsbiterr => '0', -- : IN std_logic := '0'; axi_aw_injectdbiterr => '0', -- : IN std_logic := '0'; axi_aw_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_data_count => AXI_AW_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_wr_data_count => AXI_AW_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_rd_data_count => AXI_AW_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_sbiterr => AXI_AW_SBITERR, -- : OUT std_logic; axi_aw_dbiterr => AXI_AW_DBITERR, -- : OUT std_logic; axi_aw_overflow => AXI_AW_OVERFLOW, -- : OUT std_logic; axi_aw_underflow => AXI_AW_UNDERFLOW, -- : OUT std_logic; axi_aw_prog_full => AXI_AW_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_aw_prog_empty => AXI_AW_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Data Channel Signals axi_w_injectsbiterr => '0', -- : IN std_logic := '0'; axi_w_injectdbiterr => '0', -- : IN std_logic := '0'; axi_w_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_data_count => AXI_W_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_wr_data_count => AXI_W_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_rd_data_count => AXI_W_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_sbiterr => AXI_W_SBITERR, -- : OUT std_logic; axi_w_dbiterr => AXI_W_DBITERR, -- : OUT std_logic; axi_w_overflow => AXI_W_OVERFLOW, -- : OUT std_logic; axi_w_underflow => AXI_W_UNDERFLOW, -- : OUT std_logic; axi_w_prog_full => AXI_W_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_w_prog_empty => AXI_W_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Response Channel Signals axi_b_injectsbiterr => '0', -- : IN std_logic := '0'; axi_b_injectdbiterr => '0', -- : IN std_logic := '0'; axi_b_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_data_count => AXI_B_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_wr_data_count => AXI_B_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_rd_data_count => AXI_B_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_sbiterr => AXI_B_SBITERR, -- : OUT std_logic; axi_b_dbiterr => AXI_B_DBITERR, -- : OUT std_logic; axi_b_overflow => AXI_B_OVERFLOW, -- : OUT std_logic; axi_b_underflow => AXI_B_UNDERFLOW, -- : OUT std_logic; axi_b_prog_full => AXI_B_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_b_prog_empty => AXI_B_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Address Channel Signals axi_ar_injectsbiterr => '0', -- : IN std_logic := '0'; axi_ar_injectdbiterr => '0', -- : IN std_logic := '0'; axi_ar_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_data_count => AXI_AR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_wr_data_count => AXI_AR_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_rd_data_count => AXI_AR_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_sbiterr => AXI_AR_SBITERR, -- : OUT std_logic; axi_ar_dbiterr => AXI_AR_DBITERR, -- : OUT std_logic; axi_ar_overflow => AXI_AR_OVERFLOW, -- : OUT std_logic; axi_ar_underflow => AXI_AR_UNDERFLOW, -- : OUT std_logic; axi_ar_prog_full => AXI_AR_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_ar_prog_empty => AXI_AR_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Data Channel Signals axi_r_injectsbiterr => '0', -- : IN std_logic := '0'; axi_r_injectdbiterr => '0', -- : IN std_logic := '0'; axi_r_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_data_count => AXI_R_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_wr_data_count => AXI_R_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_rd_data_count => AXI_R_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_sbiterr => AXI_R_SBITERR, -- : OUT std_logic; axi_r_dbiterr => AXI_R_DBITERR, -- : OUT std_logic; axi_r_overflow => AXI_R_OVERFLOW, -- : OUT std_logic; axi_r_underflow => AXI_R_UNDERFLOW, -- : OUT std_logic; axi_r_prog_full => AXI_R_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_r_prog_empty => AXI_R_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Streaming FIFO Related Signals axis_injectsbiterr => '0', -- : IN std_logic := '0'; axis_injectdbiterr => '0', -- : IN std_logic := '0'; axis_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_data_count => AXIS_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_wr_data_count => AXIS_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_rd_data_count => AXIS_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_sbiterr => AXIS_SBITERR, -- : OUT std_logic; axis_dbiterr => AXIS_DBITERR, -- : OUT std_logic; axis_overflow => AXIS_OVERFLOW, -- : OUT std_logic; axis_underflow => AXIS_UNDERFLOW, -- : OUT std_logic axis_prog_full => AXIS_PROG_FULL, -- : OUT STD_LOGIC := '0'; axis_prog_empty => AXIS_PROG_EMPTY -- : OUT STD_LOGIC := '1'; ); end implementation;
------------------------------------------------------------------------------- -- basic_sfifo_fg.vhd ------------------------------------------------------------------------------- -- -- ************************************************************************* -- -- (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- ************************************************************************* -- ------------------------------------------------------------------------------- -- Filename: basic_sfifo_fg.vhd -- -- Description: -- This HDL file implements a basic synchronous (single clock) fifo using the -- FIFO Generator tool. It is intended to offer a simple interface to the user -- with the complexity of the FIFO Generator interface hidden from the user. -- -- Note that in normal op mode (not First Word Fall Through FWFT) the data count -- output goes to zero when the FIFO goes full. This the way FIFO Generator works. -- -- -- VHDL-Standard: VHDL'93 ------------------------------------------------------------------------------- -- Structure: -- basic_sfifo_fg.vhd -- | -- |-- fifo_generator_v8_2 -- ------------------------------------------------------------------------------- -- Revision History: -- -- -- Author: DET -- Revision: $Revision: 1.0 $ -- Date: $3/07/2011$ -- -- History: -- DET 3/07/2011 Initial Version -- ------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library fifo_generator_v11_0; use fifo_generator_v11_0.all; library proc_common_v4_0; use proc_common_v4_0.proc_common_pkg.all; use proc_common_v4_0.proc_common_pkg.log2; --use proc_common_v4_0.coregen_comp_defs.all; -- synopsys translate_off --library XilinxCoreLib; --use XilinxCoreLib.all; -- synopsys translate_on ------------------------------------------------------------------------------- entity basic_sfifo_fg is generic ( C_DWIDTH : Integer := 32 ; -- FIFO data Width (Read and write data ports are symetric) C_DEPTH : Integer := 512 ; -- FIFO Depth (set to power of 2) C_HAS_DATA_COUNT : integer := 1 ; -- 0 = Data Count output not needed -- 1 = Data Count output needed C_DATA_COUNT_WIDTH : integer := 10 ; -- Data Count bit width (Max value is log2(C_DEPTH)) C_IMPLEMENTATION_TYPE : integer range 0 to 1 := 0; -- 0 = Common Clock BRAM / Distributed RAM (Synchronous FIFO) -- 1 = Common Clock Shift Register (Synchronous FIFO) C_MEMORY_TYPE : integer := 1; -- 0 = Any -- 1 = BRAM -- 2 = Distributed Memory -- 3 = Shift Registers C_PRELOAD_REGS : integer := 1; -- 0 = normal -- 1 = FWFT C_PRELOAD_LATENCY : integer := 0; -- 0 = FWFT -- 1 = normal C_USE_FWFT_DATA_COUNT : integer := 0; -- 0 = normal -- 1 for FWFT C_SYNCHRONIZER_STAGE : integer := 2; -- valid values are 0 to 8; C_FAMILY : string := "virtex6" ); port ( CLK : IN std_logic := '0'; DIN : IN std_logic_vector(C_DWIDTH-1 DOWNTO 0) := (OTHERS => '0'); RD_EN : IN std_logic := '0'; SRST : IN std_logic := '0'; WR_EN : IN std_logic := '0'; DATA_COUNT : OUT std_logic_vector(C_DATA_COUNT_WIDTH-1 DOWNTO 0); DOUT : OUT std_logic_vector(C_DWIDTH-1 DOWNTO 0); EMPTY : OUT std_logic; FULL : OUT std_logic ); end entity basic_sfifo_fg; architecture implementation of basic_sfifo_fg is -- Constant Declarations ---------------------------------------------- Constant POINTER_WIDTH : integer := log2(C_DEPTH); -- Constant zeros for programmable threshold inputs signal PROG_RDTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); signal PROG_WRTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- Signals --Signals added to fix MTI and XSIM issues caused by fix for VCS issues not to use "LIBRARY_SCAN = TRUE" signal ALMOST_FULL : std_logic; signal WR_ACK : std_logic; signal OVERFLOW : std_logic; signal VALID : std_logic; signal UNDERFLOW : std_logic; signal ALMOST_EMPTY : std_logic; signal RD_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal WR_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal PROG_FULL : std_logic; signal PROG_EMPTY : std_logic; signal SBITERR : std_logic; signal DBITERR : std_logic; signal S_AXI_AWREADY : std_logic; signal S_AXI_WREADY : std_logic; signal S_AXI_BID : std_logic_vector(3 DOWNTO 0); signal S_AXI_BRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_BUSER : std_logic_vector(0 downto 0); signal S_AXI_BVALID : std_logic; -- AXI Full/Lite Master Write Channel (Read side) signal M_AXI_AWID : std_logic_vector(3 DOWNTO 0); signal M_AXI_AWADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_AWLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_AWSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWUSER : std_logic_vector(0 downto 0); signal M_AXI_AWVALID : std_logic; signal M_AXI_WID : std_logic_vector(3 DOWNTO 0); signal M_AXI_WDATA : std_logic_vector(63 DOWNTO 0); signal M_AXI_WSTRB : std_logic_vector(7 DOWNTO 0); signal M_AXI_WLAST : std_logic; signal M_AXI_WUSER : std_logic_vector(0 downto 0); signal M_AXI_WVALID : std_logic; signal M_AXI_BREADY : std_logic; -- AXI Full/Lite Slave Read Channel (Write side) signal S_AXI_ARREADY : std_logic; signal S_AXI_RID : std_logic_vector(3 DOWNTO 0); signal S_AXI_RDATA : std_logic_vector(63 DOWNTO 0); signal S_AXI_RRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_RLAST : std_logic; signal S_AXI_RUSER : std_logic_vector(0 downto 0); signal S_AXI_RVALID : std_logic; -- AXI Full/Lite Master Read Channel (Read side) signal M_AXI_ARID : std_logic_vector(3 DOWNTO 0); signal M_AXI_ARADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_ARLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_ARSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARUSER : std_logic_vector(0 downto 0); signal M_AXI_ARVALID : std_logic; signal M_AXI_RREADY : std_logic; -- AXI Streaming Slave Signals (Write side) signal S_AXIS_TREADY : std_logic; -- AXI Streaming Master Signals (Read side) signal M_AXIS_TVALID : std_logic; signal M_AXIS_TDATA : std_logic_vector(63 DOWNTO 0); signal M_AXIS_TSTRB : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TKEEP : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TLAST : std_logic; signal M_AXIS_TID : std_logic_vector(7 DOWNTO 0); signal M_AXIS_TDEST : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TUSER : std_logic_vector(3 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals signal AXI_AW_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_SBITERR : std_logic; signal AXI_AW_DBITERR : std_logic; signal AXI_AW_OVERFLOW : std_logic; signal AXI_AW_UNDERFLOW : std_logic; signal AXI_AW_PROG_FULL : STD_LOGIC; signal AXI_AW_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Data Channel Signals signal AXI_W_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_SBITERR : std_logic; signal AXI_W_DBITERR : std_logic; signal AXI_W_OVERFLOW : std_logic; signal AXI_W_UNDERFLOW : std_logic; signal AXI_W_PROG_FULL : STD_LOGIC; signal AXI_W_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Response Channel Signals signal AXI_B_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_SBITERR : std_logic; signal AXI_B_DBITERR : std_logic; signal AXI_B_OVERFLOW : std_logic; signal AXI_B_UNDERFLOW : std_logic; signal AXI_B_PROG_FULL : STD_LOGIC; signal AXI_B_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Address Channel Signals signal AXI_AR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_SBITERR : std_logic; signal AXI_AR_DBITERR : std_logic; signal AXI_AR_OVERFLOW : std_logic; signal AXI_AR_UNDERFLOW : std_logic; signal AXI_AR_PROG_FULL : STD_LOGIC; signal AXI_AR_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Data Channel Signals signal AXI_R_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_SBITERR : std_logic; signal AXI_R_DBITERR : std_logic; signal AXI_R_OVERFLOW : std_logic; signal AXI_R_UNDERFLOW : std_logic; signal AXI_R_PROG_FULL : STD_LOGIC; signal AXI_R_PROG_EMPTY : STD_LOGIC; -- AXI Streaming FIFO Related Signals signal AXIS_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_SBITERR : std_logic; signal AXIS_DBITERR : std_logic; signal AXIS_OVERFLOW : std_logic; signal AXIS_UNDERFLOW : std_logic; signal AXIS_PROG_FULL : STD_LOGIC; signal AXIS_PROG_EMPTY : STD_LOGIC; begin --(architecture implementation) ------------------------------------------------------------------------------- -- Instantiate the generalized FIFO Generator instance -- -- NOTE: -- DO NOT CHANGE TO DIRECT ENTITY INSTANTIATION!!! -- This is a Coregen FIFO Generator Call module for -- BRAM implementations of a basic Sync FIFO -- ------------------------------------------------------------------------------- I_BASIC_SFIFO : entity fifo_generator_v11_0.fifo_generator_v11_0 generic map( C_COMMON_CLOCK => 1, C_COUNT_TYPE => 0, C_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_DEFAULT_VALUE => "BlankString", C_DIN_WIDTH => C_DWIDTH, C_DOUT_RST_VAL => "0", C_DOUT_WIDTH => C_DWIDTH, C_ENABLE_RLOCS => 0, -- n0 C_FAMILY => C_FAMILY, C_HAS_ALMOST_EMPTY => 0, -- n0 C_HAS_ALMOST_FULL => 0, -- n0 C_HAS_BACKUP => 0, -- n0 C_HAS_DATA_COUNT => C_HAS_DATA_COUNT, C_HAS_MEMINIT_FILE => 0, -- n0 C_HAS_OVERFLOW => 0, -- n0 C_HAS_RD_DATA_COUNT => 0, -- n0 C_HAS_RD_RST => 0, -- n0 C_HAS_RST => 0, -- n0 C_HAS_SRST => 1, -- yes C_HAS_UNDERFLOW => 0, -- n0 C_HAS_VALID => 0, -- n0 C_HAS_WR_ACK => 0, -- n0 C_HAS_WR_DATA_COUNT => 0, -- n0 C_HAS_WR_RST => 0, -- n0 C_IMPLEMENTATION_TYPE => 0, -- Common clock BRAM C_INIT_WR_PNTR_VAL => 0, C_MEMORY_TYPE => C_MEMORY_TYPE, C_MIF_FILE_NAME => "BlankString", C_OPTIMIZATION_MODE => 0, C_OVERFLOW_LOW => 0, C_PRELOAD_LATENCY => C_PRELOAD_LATENCY, C_PRELOAD_REGS => C_PRELOAD_REGS, C_PRIM_FIFO_TYPE => "512x36", C_PROG_EMPTY_THRESH_ASSERT_VAL => 0, C_PROG_EMPTY_THRESH_NEGATE_VAL => 0, C_PROG_EMPTY_TYPE => 0, C_PROG_FULL_THRESH_ASSERT_VAL => 0, C_PROG_FULL_THRESH_NEGATE_VAL => 0, C_PROG_FULL_TYPE => 0, C_RD_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_RD_DEPTH => C_DEPTH, C_RD_FREQ => 1, C_RD_PNTR_WIDTH => POINTER_WIDTH, C_UNDERFLOW_LOW => 0, C_USE_DOUT_RST => 1, C_USE_EMBEDDED_REG => 0, C_USE_FIFO16_FLAGS => 0, C_USE_FWFT_DATA_COUNT => C_USE_FWFT_DATA_COUNT, C_VALID_LOW => 0, C_WR_ACK_LOW => 0, C_WR_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_WR_DEPTH => C_DEPTH, C_WR_FREQ => 1, C_WR_PNTR_WIDTH => POINTER_WIDTH, C_WR_RESPONSE_LATENCY => 1, C_USE_ECC => 0, C_FULL_FLAGS_RST_VAL => 0, C_ENABLE_RST_SYNC => 1, C_ERROR_INJECTION_TYPE => 0, C_SYNCHRONIZER_STAGE => C_SYNCHRONIZER_STAGE, C_HAS_INT_CLK => 0, C_MSGON_VAL => 1, -- AXI Interface related parameters start here C_INTERFACE_TYPE => 0, -- : integer := 0; -- 0: Native Interface; 1: AXI Interface C_AXI_TYPE => 0, -- : integer := 0; -- 0: AXI Stream; 1: AXI Full; 2: AXI Lite C_HAS_AXI_WR_CHANNEL => 0, -- : integer := 0; C_HAS_AXI_RD_CHANNEL => 0, -- : integer := 0; C_HAS_SLAVE_CE => 0, -- : integer := 0; C_HAS_MASTER_CE => 0, -- : integer := 0; C_ADD_NGC_CONSTRAINT => 0, -- : integer := 0; C_USE_COMMON_OVERFLOW => 0, -- : integer := 0; C_USE_COMMON_UNDERFLOW => 0, -- : integer := 0; C_USE_DEFAULT_SETTINGS => 0, -- : integer := 0; -- AXI Full/Lite C_AXI_ID_WIDTH => 4 , -- : integer := 0; C_AXI_ADDR_WIDTH => 32, -- : integer := 0; C_AXI_DATA_WIDTH => 64, -- : integer := 0; C_AXI_LEN_WIDTH => 8, -- : integer := 8; C_AXI_LOCK_WIDTH => 2, -- : integer := 2; C_HAS_AXI_ID => 0, -- : integer := 0; C_HAS_AXI_AWUSER => 0 , -- : integer := 0; C_HAS_AXI_WUSER => 0 , -- : integer := 0; C_HAS_AXI_BUSER => 0 , -- : integer := 0; C_HAS_AXI_ARUSER => 0 , -- : integer := 0; C_HAS_AXI_RUSER => 0 , -- : integer := 0; C_AXI_ARUSER_WIDTH => 1 , -- : integer := 0; C_AXI_AWUSER_WIDTH => 1 , -- : integer := 0; C_AXI_WUSER_WIDTH => 1 , -- : integer := 0; C_AXI_BUSER_WIDTH => 1 , -- : integer := 0; C_AXI_RUSER_WIDTH => 1 , -- : integer := 0; -- AXI Streaming C_HAS_AXIS_TDATA => 0 , -- : integer := 0; C_HAS_AXIS_TID => 0 , -- : integer := 0; C_HAS_AXIS_TDEST => 0 , -- : integer := 0; C_HAS_AXIS_TUSER => 0 , -- : integer := 0; C_HAS_AXIS_TREADY => 1 , -- : integer := 0; C_HAS_AXIS_TLAST => 0 , -- : integer := 0; C_HAS_AXIS_TSTRB => 0 , -- : integer := 0; C_HAS_AXIS_TKEEP => 0 , -- : integer := 0; C_AXIS_TDATA_WIDTH => 64, -- : integer := 1; C_AXIS_TID_WIDTH => 8 , -- : integer := 1; C_AXIS_TDEST_WIDTH => 4 , -- : integer := 1; C_AXIS_TUSER_WIDTH => 4 , -- : integer := 1; C_AXIS_TSTRB_WIDTH => 4 , -- : integer := 1; C_AXIS_TKEEP_WIDTH => 4 , -- : integer := 1; -- AXI Channel Type -- WACH --> Write Address Channel -- WDCH --> Write Data Channel -- WRCH --> Write Response Channel -- RACH --> Read Address Channel -- RDCH --> Read Data Channel -- AXIS --> AXI Streaming C_WACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logic C_WDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_WRCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_AXIS_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie -- AXI Implementation Type -- 1 = Common Clock Block RAM FIFO -- 2 = Common Clock Distributed RAM FIFO -- 11 = Independent Clock Block RAM FIFO -- 12 = Independent Clock Distributed RAM FIFO C_IMPLEMENTATION_TYPE_WACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WRCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_AXIS => 1, -- : integer := 0; -- AXI FIFO Type -- 0 = Data FIFO -- 1 = Packet FIFO -- 2 = Low Latency Data FIFO C_APPLICATION_TYPE_WACH => 0, -- : integer := 0; C_APPLICATION_TYPE_WDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_WRCH => 0, -- : integer := 0; C_APPLICATION_TYPE_RACH => 0, -- : integer := 0; C_APPLICATION_TYPE_RDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_AXIS => 0, -- : integer := 0; -- Enable ECC -- 0 = ECC disabled -- 1 = ECC enabled C_USE_ECC_WACH => 0, -- : integer := 0; C_USE_ECC_WDCH => 0, -- : integer := 0; C_USE_ECC_WRCH => 0, -- : integer := 0; C_USE_ECC_RACH => 0, -- : integer := 0; C_USE_ECC_RDCH => 0, -- : integer := 0; C_USE_ECC_AXIS => 0, -- : integer := 0; -- ECC Error Injection Type -- 0 = No Error Injection -- 1 = Single Bit Error Injection -- 2 = Double Bit Error Injection -- 3 = Single Bit and Double Bit Error Injection C_ERROR_INJECTION_TYPE_WACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WRCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_AXIS => 0, -- : integer := 0; -- Input Data Width -- Accumulation of all AXI input signal's width C_DIN_WIDTH_WACH => 32, -- : integer := 1; C_DIN_WIDTH_WDCH => 64, -- : integer := 1; C_DIN_WIDTH_WRCH => 2 , -- : integer := 1; C_DIN_WIDTH_RACH => 32, -- : integer := 1; C_DIN_WIDTH_RDCH => 64, -- : integer := 1; C_DIN_WIDTH_AXIS => 1 , -- : integer := 1; C_WR_DEPTH_WACH => 16 , -- : integer := 16; C_WR_DEPTH_WDCH => 1024, -- : integer := 16; C_WR_DEPTH_WRCH => 16 , -- : integer := 16; C_WR_DEPTH_RACH => 16 , -- : integer := 16; C_WR_DEPTH_RDCH => 1024, -- : integer := 16; C_WR_DEPTH_AXIS => 1024, -- : integer := 16; C_WR_PNTR_WIDTH_WACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_WDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_WRCH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_AXIS => 10, -- : integer := 4; C_HAS_DATA_COUNTS_WACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WRCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_AXIS => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WRCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_AXIS => 0, -- : integer := 0; C_PROG_FULL_TYPE_WACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WRCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_AXIS => 1023, -- : integer := 0; C_PROG_EMPTY_TYPE_WACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS => 1022, -- : integer := 0; C_REG_SLICE_MODE_WACH => 0, -- : integer := 0; C_REG_SLICE_MODE_WDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_WRCH => 0, -- : integer := 0; C_REG_SLICE_MODE_RACH => 0, -- : integer := 0; C_REG_SLICE_MODE_RDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_AXIS => 0 -- : integer := 0 ) port map( backup => '0', backup_marker => '0', clk => CLK, rst => '0', srst => SRST, wr_clk => '0', wr_rst => '0', rd_clk => '0', rd_rst => '0', din => DIN, -- uses this one wr_en => WR_EN, -- uses this one rd_en => RD_EN, -- uses this one prog_empty_thresh => PROG_RDTHRESH_ZEROS, prog_empty_thresh_assert => PROG_RDTHRESH_ZEROS, prog_empty_thresh_negate => PROG_RDTHRESH_ZEROS, prog_full_thresh => PROG_WRTHRESH_ZEROS, prog_full_thresh_assert => PROG_WRTHRESH_ZEROS, prog_full_thresh_negate => PROG_WRTHRESH_ZEROS, int_clk => '0', injectdbiterr => '0', injectsbiterr => '0', dout => DOUT, -- uses this one full => FULL, -- uses this one almost_full => ALMOST_FULL, wr_ack => WR_ACK, overflow => OVERFLOW, empty => EMPTY, -- uses this one almost_empty => ALMOST_EMPTY, valid => VALID, underflow => UNDERFLOW, data_count => DATA_COUNT, -- uses this one rd_data_count => RD_DATA_COUNT, wr_data_count => WR_DATA_COUNT, prog_full => PROG_FULL, prog_empty => PROG_EMPTY, sbiterr => SBITERR, dbiterr => DBITERR, -- AXI Global Signal m_aclk => '0', -- : IN std_logic := '0'; s_aclk => '0', -- : IN std_logic := '0'; s_aresetn => '0', -- : IN std_logic := '0'; m_aclk_en => '0', -- : IN std_logic := '0'; s_aclk_en => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Slave Write Channel (write side) s_axi_awid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awaddr => "00000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlen => "00000000", --(others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awsize => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awburst => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlock => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awcache => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awprot => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awqos => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awregion => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awvalid => '0', -- : IN std_logic := '0'; s_axi_awready => S_AXI_AWREADY, -- : OUT std_logic; s_axi_wid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wstrb => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wlast => '0', -- : IN std_logic := '0'; s_axi_wuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wvalid => '0', -- : IN std_logic := '0'; s_axi_wready => S_AXI_WREADY, -- : OUT std_logic; s_axi_bid => S_AXI_BID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_bresp => S_AXI_BRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_buser => S_AXI_BUSER, -- : OUT std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0); s_axi_bvalid => S_AXI_BVALID, -- : OUT std_logic; s_axi_bready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Write Channel (Read side) m_axi_awid => M_AXI_AWID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_awaddr => M_AXI_AWADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_awlen => M_AXI_AWLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_awsize => M_AXI_AWSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awburst => M_AXI_AWBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awlock => M_AXI_AWLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awcache => M_AXI_AWCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awprot => M_AXI_AWPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awqos => M_AXI_AWQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awregion => M_AXI_AWREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awuser => M_AXI_AWUSER, -- : OUT std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0); m_axi_awvalid => M_AXI_AWVALID, -- : OUT std_logic; m_axi_awready => '0', -- : IN std_logic := '0'; m_axi_wid => M_AXI_WID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_wdata => M_AXI_WDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); m_axi_wstrb => M_AXI_WSTRB, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0); m_axi_wlast => M_AXI_WLAST, -- : OUT std_logic; m_axi_wuser => M_AXI_WUSER, -- : OUT std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0); m_axi_wvalid => M_AXI_WVALID, -- : OUT std_logic; m_axi_wready => '0', -- : IN std_logic := '0'; m_axi_bid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_buser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bvalid => '0', -- : IN std_logic := '0'; m_axi_bready => M_AXI_BREADY, -- : OUT std_logic; -- AXI Full/Lite Slave Read Channel (Write side) s_axi_arid => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_araddr => "00000000000000000000000000000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlen => "00000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arsize => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arburst => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlock => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arcache => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arprot => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arqos => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arregion => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_aruser => "0", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arvalid => '0', -- : IN std_logic := '0'; s_axi_arready => S_AXI_ARREADY, -- : OUT std_logic; s_axi_rid => S_AXI_RID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); s_axi_rdata => S_AXI_RDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); s_axi_rresp => S_AXI_RRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_rlast => S_AXI_RLAST, -- : OUT std_logic; s_axi_ruser => S_AXI_RUSER, -- : OUT std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0); s_axi_rvalid => S_AXI_RVALID, -- : OUT std_logic; s_axi_rready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Read Channel (Read side) m_axi_arid => M_AXI_ARID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_araddr => M_AXI_ARADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_arlen => M_AXI_ARLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_arsize => M_AXI_ARSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arburst => M_AXI_ARBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arlock => M_AXI_ARLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arcache => M_AXI_ARCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arprot => M_AXI_ARPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arqos => M_AXI_ARQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arregion => M_AXI_ARREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_aruser => M_AXI_ARUSER, -- : OUT std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0); m_axi_arvalid => M_AXI_ARVALID, -- : OUT std_logic; m_axi_arready => '0', -- : IN std_logic := '0'; m_axi_rid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rlast => '0', -- : IN std_logic := '0'; m_axi_ruser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rvalid => '0', -- : IN std_logic := '0'; m_axi_rready => M_AXI_RREADY, -- : OUT std_logic; -- AXI Streaming Slave Signals (Write side) s_axis_tvalid => '0', -- : IN std_logic := '0'; s_axis_tready => S_AXIS_TREADY, -- : OUT std_logic; s_axis_tdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tstrb => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tkeep => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tlast => '0', -- : IN std_logic := '0'; s_axis_tid => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tdest => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tuser => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- AXI Streaming Master Signals (Read side) m_axis_tvalid => M_AXIS_TVALID, -- : OUT std_logic; m_axis_tready => '0', -- : IN std_logic := '0'; m_axis_tdata => M_AXIS_TDATA, -- : OUT std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0); m_axis_tstrb => M_AXIS_TSTRB, -- : OUT std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0); m_axis_tkeep => M_AXIS_TKEEP, -- : OUT std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0); m_axis_tlast => M_AXIS_TLAST, -- : OUT std_logic; m_axis_tid => M_AXIS_TID, -- : OUT std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0); m_axis_tdest => M_AXIS_TDEST, -- : OUT std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0); m_axis_tuser => M_AXIS_TUSER, -- : OUT std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals axi_aw_injectsbiterr => '0', -- : IN std_logic := '0'; axi_aw_injectdbiterr => '0', -- : IN std_logic := '0'; axi_aw_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_data_count => AXI_AW_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_wr_data_count => AXI_AW_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_rd_data_count => AXI_AW_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_sbiterr => AXI_AW_SBITERR, -- : OUT std_logic; axi_aw_dbiterr => AXI_AW_DBITERR, -- : OUT std_logic; axi_aw_overflow => AXI_AW_OVERFLOW, -- : OUT std_logic; axi_aw_underflow => AXI_AW_UNDERFLOW, -- : OUT std_logic; axi_aw_prog_full => AXI_AW_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_aw_prog_empty => AXI_AW_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Data Channel Signals axi_w_injectsbiterr => '0', -- : IN std_logic := '0'; axi_w_injectdbiterr => '0', -- : IN std_logic := '0'; axi_w_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_data_count => AXI_W_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_wr_data_count => AXI_W_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_rd_data_count => AXI_W_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_sbiterr => AXI_W_SBITERR, -- : OUT std_logic; axi_w_dbiterr => AXI_W_DBITERR, -- : OUT std_logic; axi_w_overflow => AXI_W_OVERFLOW, -- : OUT std_logic; axi_w_underflow => AXI_W_UNDERFLOW, -- : OUT std_logic; axi_w_prog_full => AXI_W_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_w_prog_empty => AXI_W_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Response Channel Signals axi_b_injectsbiterr => '0', -- : IN std_logic := '0'; axi_b_injectdbiterr => '0', -- : IN std_logic := '0'; axi_b_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_data_count => AXI_B_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_wr_data_count => AXI_B_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_rd_data_count => AXI_B_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_sbiterr => AXI_B_SBITERR, -- : OUT std_logic; axi_b_dbiterr => AXI_B_DBITERR, -- : OUT std_logic; axi_b_overflow => AXI_B_OVERFLOW, -- : OUT std_logic; axi_b_underflow => AXI_B_UNDERFLOW, -- : OUT std_logic; axi_b_prog_full => AXI_B_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_b_prog_empty => AXI_B_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Address Channel Signals axi_ar_injectsbiterr => '0', -- : IN std_logic := '0'; axi_ar_injectdbiterr => '0', -- : IN std_logic := '0'; axi_ar_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_data_count => AXI_AR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_wr_data_count => AXI_AR_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_rd_data_count => AXI_AR_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_sbiterr => AXI_AR_SBITERR, -- : OUT std_logic; axi_ar_dbiterr => AXI_AR_DBITERR, -- : OUT std_logic; axi_ar_overflow => AXI_AR_OVERFLOW, -- : OUT std_logic; axi_ar_underflow => AXI_AR_UNDERFLOW, -- : OUT std_logic; axi_ar_prog_full => AXI_AR_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_ar_prog_empty => AXI_AR_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Data Channel Signals axi_r_injectsbiterr => '0', -- : IN std_logic := '0'; axi_r_injectdbiterr => '0', -- : IN std_logic := '0'; axi_r_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_data_count => AXI_R_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_wr_data_count => AXI_R_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_rd_data_count => AXI_R_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_sbiterr => AXI_R_SBITERR, -- : OUT std_logic; axi_r_dbiterr => AXI_R_DBITERR, -- : OUT std_logic; axi_r_overflow => AXI_R_OVERFLOW, -- : OUT std_logic; axi_r_underflow => AXI_R_UNDERFLOW, -- : OUT std_logic; axi_r_prog_full => AXI_R_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_r_prog_empty => AXI_R_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Streaming FIFO Related Signals axis_injectsbiterr => '0', -- : IN std_logic := '0'; axis_injectdbiterr => '0', -- : IN std_logic := '0'; axis_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_data_count => AXIS_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_wr_data_count => AXIS_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_rd_data_count => AXIS_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_sbiterr => AXIS_SBITERR, -- : OUT std_logic; axis_dbiterr => AXIS_DBITERR, -- : OUT std_logic; axis_overflow => AXIS_OVERFLOW, -- : OUT std_logic; axis_underflow => AXIS_UNDERFLOW, -- : OUT std_logic axis_prog_full => AXIS_PROG_FULL, -- : OUT STD_LOGIC := '0'; axis_prog_empty => AXIS_PROG_EMPTY -- : OUT STD_LOGIC := '1'; ); end implementation;
------------------------------------------------------------------------------- -- basic_sfifo_fg.vhd ------------------------------------------------------------------------------- -- -- ************************************************************************* -- -- (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- ************************************************************************* -- ------------------------------------------------------------------------------- -- Filename: basic_sfifo_fg.vhd -- -- Description: -- This HDL file implements a basic synchronous (single clock) fifo using the -- FIFO Generator tool. It is intended to offer a simple interface to the user -- with the complexity of the FIFO Generator interface hidden from the user. -- -- Note that in normal op mode (not First Word Fall Through FWFT) the data count -- output goes to zero when the FIFO goes full. This the way FIFO Generator works. -- -- -- VHDL-Standard: VHDL'93 ------------------------------------------------------------------------------- -- Structure: -- basic_sfifo_fg.vhd -- | -- |-- fifo_generator_v8_2 -- ------------------------------------------------------------------------------- -- Revision History: -- -- -- Author: DET -- Revision: $Revision: 1.0 $ -- Date: $3/07/2011$ -- -- History: -- DET 3/07/2011 Initial Version -- ------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library fifo_generator_v11_0; use fifo_generator_v11_0.all; library proc_common_v4_0; use proc_common_v4_0.proc_common_pkg.all; use proc_common_v4_0.proc_common_pkg.log2; --use proc_common_v4_0.coregen_comp_defs.all; -- synopsys translate_off --library XilinxCoreLib; --use XilinxCoreLib.all; -- synopsys translate_on ------------------------------------------------------------------------------- entity basic_sfifo_fg is generic ( C_DWIDTH : Integer := 32 ; -- FIFO data Width (Read and write data ports are symetric) C_DEPTH : Integer := 512 ; -- FIFO Depth (set to power of 2) C_HAS_DATA_COUNT : integer := 1 ; -- 0 = Data Count output not needed -- 1 = Data Count output needed C_DATA_COUNT_WIDTH : integer := 10 ; -- Data Count bit width (Max value is log2(C_DEPTH)) C_IMPLEMENTATION_TYPE : integer range 0 to 1 := 0; -- 0 = Common Clock BRAM / Distributed RAM (Synchronous FIFO) -- 1 = Common Clock Shift Register (Synchronous FIFO) C_MEMORY_TYPE : integer := 1; -- 0 = Any -- 1 = BRAM -- 2 = Distributed Memory -- 3 = Shift Registers C_PRELOAD_REGS : integer := 1; -- 0 = normal -- 1 = FWFT C_PRELOAD_LATENCY : integer := 0; -- 0 = FWFT -- 1 = normal C_USE_FWFT_DATA_COUNT : integer := 0; -- 0 = normal -- 1 for FWFT C_SYNCHRONIZER_STAGE : integer := 2; -- valid values are 0 to 8; C_FAMILY : string := "virtex6" ); port ( CLK : IN std_logic := '0'; DIN : IN std_logic_vector(C_DWIDTH-1 DOWNTO 0) := (OTHERS => '0'); RD_EN : IN std_logic := '0'; SRST : IN std_logic := '0'; WR_EN : IN std_logic := '0'; DATA_COUNT : OUT std_logic_vector(C_DATA_COUNT_WIDTH-1 DOWNTO 0); DOUT : OUT std_logic_vector(C_DWIDTH-1 DOWNTO 0); EMPTY : OUT std_logic; FULL : OUT std_logic ); end entity basic_sfifo_fg; architecture implementation of basic_sfifo_fg is -- Constant Declarations ---------------------------------------------- Constant POINTER_WIDTH : integer := log2(C_DEPTH); -- Constant zeros for programmable threshold inputs signal PROG_RDTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); signal PROG_WRTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- Signals --Signals added to fix MTI and XSIM issues caused by fix for VCS issues not to use "LIBRARY_SCAN = TRUE" signal ALMOST_FULL : std_logic; signal WR_ACK : std_logic; signal OVERFLOW : std_logic; signal VALID : std_logic; signal UNDERFLOW : std_logic; signal ALMOST_EMPTY : std_logic; signal RD_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal WR_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal PROG_FULL : std_logic; signal PROG_EMPTY : std_logic; signal SBITERR : std_logic; signal DBITERR : std_logic; signal S_AXI_AWREADY : std_logic; signal S_AXI_WREADY : std_logic; signal S_AXI_BID : std_logic_vector(3 DOWNTO 0); signal S_AXI_BRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_BUSER : std_logic_vector(0 downto 0); signal S_AXI_BVALID : std_logic; -- AXI Full/Lite Master Write Channel (Read side) signal M_AXI_AWID : std_logic_vector(3 DOWNTO 0); signal M_AXI_AWADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_AWLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_AWSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWUSER : std_logic_vector(0 downto 0); signal M_AXI_AWVALID : std_logic; signal M_AXI_WID : std_logic_vector(3 DOWNTO 0); signal M_AXI_WDATA : std_logic_vector(63 DOWNTO 0); signal M_AXI_WSTRB : std_logic_vector(7 DOWNTO 0); signal M_AXI_WLAST : std_logic; signal M_AXI_WUSER : std_logic_vector(0 downto 0); signal M_AXI_WVALID : std_logic; signal M_AXI_BREADY : std_logic; -- AXI Full/Lite Slave Read Channel (Write side) signal S_AXI_ARREADY : std_logic; signal S_AXI_RID : std_logic_vector(3 DOWNTO 0); signal S_AXI_RDATA : std_logic_vector(63 DOWNTO 0); signal S_AXI_RRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_RLAST : std_logic; signal S_AXI_RUSER : std_logic_vector(0 downto 0); signal S_AXI_RVALID : std_logic; -- AXI Full/Lite Master Read Channel (Read side) signal M_AXI_ARID : std_logic_vector(3 DOWNTO 0); signal M_AXI_ARADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_ARLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_ARSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARUSER : std_logic_vector(0 downto 0); signal M_AXI_ARVALID : std_logic; signal M_AXI_RREADY : std_logic; -- AXI Streaming Slave Signals (Write side) signal S_AXIS_TREADY : std_logic; -- AXI Streaming Master Signals (Read side) signal M_AXIS_TVALID : std_logic; signal M_AXIS_TDATA : std_logic_vector(63 DOWNTO 0); signal M_AXIS_TSTRB : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TKEEP : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TLAST : std_logic; signal M_AXIS_TID : std_logic_vector(7 DOWNTO 0); signal M_AXIS_TDEST : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TUSER : std_logic_vector(3 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals signal AXI_AW_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_SBITERR : std_logic; signal AXI_AW_DBITERR : std_logic; signal AXI_AW_OVERFLOW : std_logic; signal AXI_AW_UNDERFLOW : std_logic; signal AXI_AW_PROG_FULL : STD_LOGIC; signal AXI_AW_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Data Channel Signals signal AXI_W_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_SBITERR : std_logic; signal AXI_W_DBITERR : std_logic; signal AXI_W_OVERFLOW : std_logic; signal AXI_W_UNDERFLOW : std_logic; signal AXI_W_PROG_FULL : STD_LOGIC; signal AXI_W_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Response Channel Signals signal AXI_B_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_SBITERR : std_logic; signal AXI_B_DBITERR : std_logic; signal AXI_B_OVERFLOW : std_logic; signal AXI_B_UNDERFLOW : std_logic; signal AXI_B_PROG_FULL : STD_LOGIC; signal AXI_B_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Address Channel Signals signal AXI_AR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_SBITERR : std_logic; signal AXI_AR_DBITERR : std_logic; signal AXI_AR_OVERFLOW : std_logic; signal AXI_AR_UNDERFLOW : std_logic; signal AXI_AR_PROG_FULL : STD_LOGIC; signal AXI_AR_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Data Channel Signals signal AXI_R_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_SBITERR : std_logic; signal AXI_R_DBITERR : std_logic; signal AXI_R_OVERFLOW : std_logic; signal AXI_R_UNDERFLOW : std_logic; signal AXI_R_PROG_FULL : STD_LOGIC; signal AXI_R_PROG_EMPTY : STD_LOGIC; -- AXI Streaming FIFO Related Signals signal AXIS_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_SBITERR : std_logic; signal AXIS_DBITERR : std_logic; signal AXIS_OVERFLOW : std_logic; signal AXIS_UNDERFLOW : std_logic; signal AXIS_PROG_FULL : STD_LOGIC; signal AXIS_PROG_EMPTY : STD_LOGIC; begin --(architecture implementation) ------------------------------------------------------------------------------- -- Instantiate the generalized FIFO Generator instance -- -- NOTE: -- DO NOT CHANGE TO DIRECT ENTITY INSTANTIATION!!! -- This is a Coregen FIFO Generator Call module for -- BRAM implementations of a basic Sync FIFO -- ------------------------------------------------------------------------------- I_BASIC_SFIFO : entity fifo_generator_v11_0.fifo_generator_v11_0 generic map( C_COMMON_CLOCK => 1, C_COUNT_TYPE => 0, C_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_DEFAULT_VALUE => "BlankString", C_DIN_WIDTH => C_DWIDTH, C_DOUT_RST_VAL => "0", C_DOUT_WIDTH => C_DWIDTH, C_ENABLE_RLOCS => 0, -- n0 C_FAMILY => C_FAMILY, C_HAS_ALMOST_EMPTY => 0, -- n0 C_HAS_ALMOST_FULL => 0, -- n0 C_HAS_BACKUP => 0, -- n0 C_HAS_DATA_COUNT => C_HAS_DATA_COUNT, C_HAS_MEMINIT_FILE => 0, -- n0 C_HAS_OVERFLOW => 0, -- n0 C_HAS_RD_DATA_COUNT => 0, -- n0 C_HAS_RD_RST => 0, -- n0 C_HAS_RST => 0, -- n0 C_HAS_SRST => 1, -- yes C_HAS_UNDERFLOW => 0, -- n0 C_HAS_VALID => 0, -- n0 C_HAS_WR_ACK => 0, -- n0 C_HAS_WR_DATA_COUNT => 0, -- n0 C_HAS_WR_RST => 0, -- n0 C_IMPLEMENTATION_TYPE => 0, -- Common clock BRAM C_INIT_WR_PNTR_VAL => 0, C_MEMORY_TYPE => C_MEMORY_TYPE, C_MIF_FILE_NAME => "BlankString", C_OPTIMIZATION_MODE => 0, C_OVERFLOW_LOW => 0, C_PRELOAD_LATENCY => C_PRELOAD_LATENCY, C_PRELOAD_REGS => C_PRELOAD_REGS, C_PRIM_FIFO_TYPE => "512x36", C_PROG_EMPTY_THRESH_ASSERT_VAL => 0, C_PROG_EMPTY_THRESH_NEGATE_VAL => 0, C_PROG_EMPTY_TYPE => 0, C_PROG_FULL_THRESH_ASSERT_VAL => 0, C_PROG_FULL_THRESH_NEGATE_VAL => 0, C_PROG_FULL_TYPE => 0, C_RD_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_RD_DEPTH => C_DEPTH, C_RD_FREQ => 1, C_RD_PNTR_WIDTH => POINTER_WIDTH, C_UNDERFLOW_LOW => 0, C_USE_DOUT_RST => 1, C_USE_EMBEDDED_REG => 0, C_USE_FIFO16_FLAGS => 0, C_USE_FWFT_DATA_COUNT => C_USE_FWFT_DATA_COUNT, C_VALID_LOW => 0, C_WR_ACK_LOW => 0, C_WR_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_WR_DEPTH => C_DEPTH, C_WR_FREQ => 1, C_WR_PNTR_WIDTH => POINTER_WIDTH, C_WR_RESPONSE_LATENCY => 1, C_USE_ECC => 0, C_FULL_FLAGS_RST_VAL => 0, C_ENABLE_RST_SYNC => 1, C_ERROR_INJECTION_TYPE => 0, C_SYNCHRONIZER_STAGE => C_SYNCHRONIZER_STAGE, C_HAS_INT_CLK => 0, C_MSGON_VAL => 1, -- AXI Interface related parameters start here C_INTERFACE_TYPE => 0, -- : integer := 0; -- 0: Native Interface; 1: AXI Interface C_AXI_TYPE => 0, -- : integer := 0; -- 0: AXI Stream; 1: AXI Full; 2: AXI Lite C_HAS_AXI_WR_CHANNEL => 0, -- : integer := 0; C_HAS_AXI_RD_CHANNEL => 0, -- : integer := 0; C_HAS_SLAVE_CE => 0, -- : integer := 0; C_HAS_MASTER_CE => 0, -- : integer := 0; C_ADD_NGC_CONSTRAINT => 0, -- : integer := 0; C_USE_COMMON_OVERFLOW => 0, -- : integer := 0; C_USE_COMMON_UNDERFLOW => 0, -- : integer := 0; C_USE_DEFAULT_SETTINGS => 0, -- : integer := 0; -- AXI Full/Lite C_AXI_ID_WIDTH => 4 , -- : integer := 0; C_AXI_ADDR_WIDTH => 32, -- : integer := 0; C_AXI_DATA_WIDTH => 64, -- : integer := 0; C_AXI_LEN_WIDTH => 8, -- : integer := 8; C_AXI_LOCK_WIDTH => 2, -- : integer := 2; C_HAS_AXI_ID => 0, -- : integer := 0; C_HAS_AXI_AWUSER => 0 , -- : integer := 0; C_HAS_AXI_WUSER => 0 , -- : integer := 0; C_HAS_AXI_BUSER => 0 , -- : integer := 0; C_HAS_AXI_ARUSER => 0 , -- : integer := 0; C_HAS_AXI_RUSER => 0 , -- : integer := 0; C_AXI_ARUSER_WIDTH => 1 , -- : integer := 0; C_AXI_AWUSER_WIDTH => 1 , -- : integer := 0; C_AXI_WUSER_WIDTH => 1 , -- : integer := 0; C_AXI_BUSER_WIDTH => 1 , -- : integer := 0; C_AXI_RUSER_WIDTH => 1 , -- : integer := 0; -- AXI Streaming C_HAS_AXIS_TDATA => 0 , -- : integer := 0; C_HAS_AXIS_TID => 0 , -- : integer := 0; C_HAS_AXIS_TDEST => 0 , -- : integer := 0; C_HAS_AXIS_TUSER => 0 , -- : integer := 0; C_HAS_AXIS_TREADY => 1 , -- : integer := 0; C_HAS_AXIS_TLAST => 0 , -- : integer := 0; C_HAS_AXIS_TSTRB => 0 , -- : integer := 0; C_HAS_AXIS_TKEEP => 0 , -- : integer := 0; C_AXIS_TDATA_WIDTH => 64, -- : integer := 1; C_AXIS_TID_WIDTH => 8 , -- : integer := 1; C_AXIS_TDEST_WIDTH => 4 , -- : integer := 1; C_AXIS_TUSER_WIDTH => 4 , -- : integer := 1; C_AXIS_TSTRB_WIDTH => 4 , -- : integer := 1; C_AXIS_TKEEP_WIDTH => 4 , -- : integer := 1; -- AXI Channel Type -- WACH --> Write Address Channel -- WDCH --> Write Data Channel -- WRCH --> Write Response Channel -- RACH --> Read Address Channel -- RDCH --> Read Data Channel -- AXIS --> AXI Streaming C_WACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logic C_WDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_WRCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_AXIS_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie -- AXI Implementation Type -- 1 = Common Clock Block RAM FIFO -- 2 = Common Clock Distributed RAM FIFO -- 11 = Independent Clock Block RAM FIFO -- 12 = Independent Clock Distributed RAM FIFO C_IMPLEMENTATION_TYPE_WACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WRCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_AXIS => 1, -- : integer := 0; -- AXI FIFO Type -- 0 = Data FIFO -- 1 = Packet FIFO -- 2 = Low Latency Data FIFO C_APPLICATION_TYPE_WACH => 0, -- : integer := 0; C_APPLICATION_TYPE_WDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_WRCH => 0, -- : integer := 0; C_APPLICATION_TYPE_RACH => 0, -- : integer := 0; C_APPLICATION_TYPE_RDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_AXIS => 0, -- : integer := 0; -- Enable ECC -- 0 = ECC disabled -- 1 = ECC enabled C_USE_ECC_WACH => 0, -- : integer := 0; C_USE_ECC_WDCH => 0, -- : integer := 0; C_USE_ECC_WRCH => 0, -- : integer := 0; C_USE_ECC_RACH => 0, -- : integer := 0; C_USE_ECC_RDCH => 0, -- : integer := 0; C_USE_ECC_AXIS => 0, -- : integer := 0; -- ECC Error Injection Type -- 0 = No Error Injection -- 1 = Single Bit Error Injection -- 2 = Double Bit Error Injection -- 3 = Single Bit and Double Bit Error Injection C_ERROR_INJECTION_TYPE_WACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WRCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_AXIS => 0, -- : integer := 0; -- Input Data Width -- Accumulation of all AXI input signal's width C_DIN_WIDTH_WACH => 32, -- : integer := 1; C_DIN_WIDTH_WDCH => 64, -- : integer := 1; C_DIN_WIDTH_WRCH => 2 , -- : integer := 1; C_DIN_WIDTH_RACH => 32, -- : integer := 1; C_DIN_WIDTH_RDCH => 64, -- : integer := 1; C_DIN_WIDTH_AXIS => 1 , -- : integer := 1; C_WR_DEPTH_WACH => 16 , -- : integer := 16; C_WR_DEPTH_WDCH => 1024, -- : integer := 16; C_WR_DEPTH_WRCH => 16 , -- : integer := 16; C_WR_DEPTH_RACH => 16 , -- : integer := 16; C_WR_DEPTH_RDCH => 1024, -- : integer := 16; C_WR_DEPTH_AXIS => 1024, -- : integer := 16; C_WR_PNTR_WIDTH_WACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_WDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_WRCH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_AXIS => 10, -- : integer := 4; C_HAS_DATA_COUNTS_WACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WRCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_AXIS => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WRCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_AXIS => 0, -- : integer := 0; C_PROG_FULL_TYPE_WACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WRCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_AXIS => 1023, -- : integer := 0; C_PROG_EMPTY_TYPE_WACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS => 1022, -- : integer := 0; C_REG_SLICE_MODE_WACH => 0, -- : integer := 0; C_REG_SLICE_MODE_WDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_WRCH => 0, -- : integer := 0; C_REG_SLICE_MODE_RACH => 0, -- : integer := 0; C_REG_SLICE_MODE_RDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_AXIS => 0 -- : integer := 0 ) port map( backup => '0', backup_marker => '0', clk => CLK, rst => '0', srst => SRST, wr_clk => '0', wr_rst => '0', rd_clk => '0', rd_rst => '0', din => DIN, -- uses this one wr_en => WR_EN, -- uses this one rd_en => RD_EN, -- uses this one prog_empty_thresh => PROG_RDTHRESH_ZEROS, prog_empty_thresh_assert => PROG_RDTHRESH_ZEROS, prog_empty_thresh_negate => PROG_RDTHRESH_ZEROS, prog_full_thresh => PROG_WRTHRESH_ZEROS, prog_full_thresh_assert => PROG_WRTHRESH_ZEROS, prog_full_thresh_negate => PROG_WRTHRESH_ZEROS, int_clk => '0', injectdbiterr => '0', injectsbiterr => '0', dout => DOUT, -- uses this one full => FULL, -- uses this one almost_full => ALMOST_FULL, wr_ack => WR_ACK, overflow => OVERFLOW, empty => EMPTY, -- uses this one almost_empty => ALMOST_EMPTY, valid => VALID, underflow => UNDERFLOW, data_count => DATA_COUNT, -- uses this one rd_data_count => RD_DATA_COUNT, wr_data_count => WR_DATA_COUNT, prog_full => PROG_FULL, prog_empty => PROG_EMPTY, sbiterr => SBITERR, dbiterr => DBITERR, -- AXI Global Signal m_aclk => '0', -- : IN std_logic := '0'; s_aclk => '0', -- : IN std_logic := '0'; s_aresetn => '0', -- : IN std_logic := '0'; m_aclk_en => '0', -- : IN std_logic := '0'; s_aclk_en => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Slave Write Channel (write side) s_axi_awid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awaddr => "00000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlen => "00000000", --(others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awsize => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awburst => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlock => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awcache => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awprot => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awqos => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awregion => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awvalid => '0', -- : IN std_logic := '0'; s_axi_awready => S_AXI_AWREADY, -- : OUT std_logic; s_axi_wid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wstrb => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wlast => '0', -- : IN std_logic := '0'; s_axi_wuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wvalid => '0', -- : IN std_logic := '0'; s_axi_wready => S_AXI_WREADY, -- : OUT std_logic; s_axi_bid => S_AXI_BID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_bresp => S_AXI_BRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_buser => S_AXI_BUSER, -- : OUT std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0); s_axi_bvalid => S_AXI_BVALID, -- : OUT std_logic; s_axi_bready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Write Channel (Read side) m_axi_awid => M_AXI_AWID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_awaddr => M_AXI_AWADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_awlen => M_AXI_AWLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_awsize => M_AXI_AWSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awburst => M_AXI_AWBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awlock => M_AXI_AWLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awcache => M_AXI_AWCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awprot => M_AXI_AWPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awqos => M_AXI_AWQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awregion => M_AXI_AWREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awuser => M_AXI_AWUSER, -- : OUT std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0); m_axi_awvalid => M_AXI_AWVALID, -- : OUT std_logic; m_axi_awready => '0', -- : IN std_logic := '0'; m_axi_wid => M_AXI_WID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_wdata => M_AXI_WDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); m_axi_wstrb => M_AXI_WSTRB, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0); m_axi_wlast => M_AXI_WLAST, -- : OUT std_logic; m_axi_wuser => M_AXI_WUSER, -- : OUT std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0); m_axi_wvalid => M_AXI_WVALID, -- : OUT std_logic; m_axi_wready => '0', -- : IN std_logic := '0'; m_axi_bid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_buser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bvalid => '0', -- : IN std_logic := '0'; m_axi_bready => M_AXI_BREADY, -- : OUT std_logic; -- AXI Full/Lite Slave Read Channel (Write side) s_axi_arid => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_araddr => "00000000000000000000000000000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlen => "00000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arsize => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arburst => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlock => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arcache => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arprot => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arqos => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arregion => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_aruser => "0", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arvalid => '0', -- : IN std_logic := '0'; s_axi_arready => S_AXI_ARREADY, -- : OUT std_logic; s_axi_rid => S_AXI_RID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); s_axi_rdata => S_AXI_RDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); s_axi_rresp => S_AXI_RRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_rlast => S_AXI_RLAST, -- : OUT std_logic; s_axi_ruser => S_AXI_RUSER, -- : OUT std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0); s_axi_rvalid => S_AXI_RVALID, -- : OUT std_logic; s_axi_rready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Read Channel (Read side) m_axi_arid => M_AXI_ARID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_araddr => M_AXI_ARADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_arlen => M_AXI_ARLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_arsize => M_AXI_ARSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arburst => M_AXI_ARBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arlock => M_AXI_ARLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arcache => M_AXI_ARCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arprot => M_AXI_ARPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arqos => M_AXI_ARQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arregion => M_AXI_ARREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_aruser => M_AXI_ARUSER, -- : OUT std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0); m_axi_arvalid => M_AXI_ARVALID, -- : OUT std_logic; m_axi_arready => '0', -- : IN std_logic := '0'; m_axi_rid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rlast => '0', -- : IN std_logic := '0'; m_axi_ruser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rvalid => '0', -- : IN std_logic := '0'; m_axi_rready => M_AXI_RREADY, -- : OUT std_logic; -- AXI Streaming Slave Signals (Write side) s_axis_tvalid => '0', -- : IN std_logic := '0'; s_axis_tready => S_AXIS_TREADY, -- : OUT std_logic; s_axis_tdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tstrb => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tkeep => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tlast => '0', -- : IN std_logic := '0'; s_axis_tid => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tdest => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tuser => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- AXI Streaming Master Signals (Read side) m_axis_tvalid => M_AXIS_TVALID, -- : OUT std_logic; m_axis_tready => '0', -- : IN std_logic := '0'; m_axis_tdata => M_AXIS_TDATA, -- : OUT std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0); m_axis_tstrb => M_AXIS_TSTRB, -- : OUT std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0); m_axis_tkeep => M_AXIS_TKEEP, -- : OUT std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0); m_axis_tlast => M_AXIS_TLAST, -- : OUT std_logic; m_axis_tid => M_AXIS_TID, -- : OUT std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0); m_axis_tdest => M_AXIS_TDEST, -- : OUT std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0); m_axis_tuser => M_AXIS_TUSER, -- : OUT std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals axi_aw_injectsbiterr => '0', -- : IN std_logic := '0'; axi_aw_injectdbiterr => '0', -- : IN std_logic := '0'; axi_aw_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_data_count => AXI_AW_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_wr_data_count => AXI_AW_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_rd_data_count => AXI_AW_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_sbiterr => AXI_AW_SBITERR, -- : OUT std_logic; axi_aw_dbiterr => AXI_AW_DBITERR, -- : OUT std_logic; axi_aw_overflow => AXI_AW_OVERFLOW, -- : OUT std_logic; axi_aw_underflow => AXI_AW_UNDERFLOW, -- : OUT std_logic; axi_aw_prog_full => AXI_AW_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_aw_prog_empty => AXI_AW_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Data Channel Signals axi_w_injectsbiterr => '0', -- : IN std_logic := '0'; axi_w_injectdbiterr => '0', -- : IN std_logic := '0'; axi_w_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_data_count => AXI_W_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_wr_data_count => AXI_W_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_rd_data_count => AXI_W_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_sbiterr => AXI_W_SBITERR, -- : OUT std_logic; axi_w_dbiterr => AXI_W_DBITERR, -- : OUT std_logic; axi_w_overflow => AXI_W_OVERFLOW, -- : OUT std_logic; axi_w_underflow => AXI_W_UNDERFLOW, -- : OUT std_logic; axi_w_prog_full => AXI_W_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_w_prog_empty => AXI_W_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Response Channel Signals axi_b_injectsbiterr => '0', -- : IN std_logic := '0'; axi_b_injectdbiterr => '0', -- : IN std_logic := '0'; axi_b_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_data_count => AXI_B_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_wr_data_count => AXI_B_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_rd_data_count => AXI_B_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_sbiterr => AXI_B_SBITERR, -- : OUT std_logic; axi_b_dbiterr => AXI_B_DBITERR, -- : OUT std_logic; axi_b_overflow => AXI_B_OVERFLOW, -- : OUT std_logic; axi_b_underflow => AXI_B_UNDERFLOW, -- : OUT std_logic; axi_b_prog_full => AXI_B_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_b_prog_empty => AXI_B_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Address Channel Signals axi_ar_injectsbiterr => '0', -- : IN std_logic := '0'; axi_ar_injectdbiterr => '0', -- : IN std_logic := '0'; axi_ar_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_data_count => AXI_AR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_wr_data_count => AXI_AR_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_rd_data_count => AXI_AR_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_sbiterr => AXI_AR_SBITERR, -- : OUT std_logic; axi_ar_dbiterr => AXI_AR_DBITERR, -- : OUT std_logic; axi_ar_overflow => AXI_AR_OVERFLOW, -- : OUT std_logic; axi_ar_underflow => AXI_AR_UNDERFLOW, -- : OUT std_logic; axi_ar_prog_full => AXI_AR_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_ar_prog_empty => AXI_AR_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Data Channel Signals axi_r_injectsbiterr => '0', -- : IN std_logic := '0'; axi_r_injectdbiterr => '0', -- : IN std_logic := '0'; axi_r_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_data_count => AXI_R_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_wr_data_count => AXI_R_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_rd_data_count => AXI_R_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_sbiterr => AXI_R_SBITERR, -- : OUT std_logic; axi_r_dbiterr => AXI_R_DBITERR, -- : OUT std_logic; axi_r_overflow => AXI_R_OVERFLOW, -- : OUT std_logic; axi_r_underflow => AXI_R_UNDERFLOW, -- : OUT std_logic; axi_r_prog_full => AXI_R_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_r_prog_empty => AXI_R_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Streaming FIFO Related Signals axis_injectsbiterr => '0', -- : IN std_logic := '0'; axis_injectdbiterr => '0', -- : IN std_logic := '0'; axis_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_data_count => AXIS_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_wr_data_count => AXIS_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_rd_data_count => AXIS_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_sbiterr => AXIS_SBITERR, -- : OUT std_logic; axis_dbiterr => AXIS_DBITERR, -- : OUT std_logic; axis_overflow => AXIS_OVERFLOW, -- : OUT std_logic; axis_underflow => AXIS_UNDERFLOW, -- : OUT std_logic axis_prog_full => AXIS_PROG_FULL, -- : OUT STD_LOGIC := '0'; axis_prog_empty => AXIS_PROG_EMPTY -- : OUT STD_LOGIC := '1'; ); end implementation;
------------------------------------------------------------------------------- -- basic_sfifo_fg.vhd ------------------------------------------------------------------------------- -- -- ************************************************************************* -- -- (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- ************************************************************************* -- ------------------------------------------------------------------------------- -- Filename: basic_sfifo_fg.vhd -- -- Description: -- This HDL file implements a basic synchronous (single clock) fifo using the -- FIFO Generator tool. It is intended to offer a simple interface to the user -- with the complexity of the FIFO Generator interface hidden from the user. -- -- Note that in normal op mode (not First Word Fall Through FWFT) the data count -- output goes to zero when the FIFO goes full. This the way FIFO Generator works. -- -- -- VHDL-Standard: VHDL'93 ------------------------------------------------------------------------------- -- Structure: -- basic_sfifo_fg.vhd -- | -- |-- fifo_generator_v8_2 -- ------------------------------------------------------------------------------- -- Revision History: -- -- -- Author: DET -- Revision: $Revision: 1.0 $ -- Date: $3/07/2011$ -- -- History: -- DET 3/07/2011 Initial Version -- ------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library fifo_generator_v11_0; use fifo_generator_v11_0.all; library proc_common_v4_0; use proc_common_v4_0.proc_common_pkg.all; use proc_common_v4_0.proc_common_pkg.log2; --use proc_common_v4_0.coregen_comp_defs.all; -- synopsys translate_off --library XilinxCoreLib; --use XilinxCoreLib.all; -- synopsys translate_on ------------------------------------------------------------------------------- entity basic_sfifo_fg is generic ( C_DWIDTH : Integer := 32 ; -- FIFO data Width (Read and write data ports are symetric) C_DEPTH : Integer := 512 ; -- FIFO Depth (set to power of 2) C_HAS_DATA_COUNT : integer := 1 ; -- 0 = Data Count output not needed -- 1 = Data Count output needed C_DATA_COUNT_WIDTH : integer := 10 ; -- Data Count bit width (Max value is log2(C_DEPTH)) C_IMPLEMENTATION_TYPE : integer range 0 to 1 := 0; -- 0 = Common Clock BRAM / Distributed RAM (Synchronous FIFO) -- 1 = Common Clock Shift Register (Synchronous FIFO) C_MEMORY_TYPE : integer := 1; -- 0 = Any -- 1 = BRAM -- 2 = Distributed Memory -- 3 = Shift Registers C_PRELOAD_REGS : integer := 1; -- 0 = normal -- 1 = FWFT C_PRELOAD_LATENCY : integer := 0; -- 0 = FWFT -- 1 = normal C_USE_FWFT_DATA_COUNT : integer := 0; -- 0 = normal -- 1 for FWFT C_SYNCHRONIZER_STAGE : integer := 2; -- valid values are 0 to 8; C_FAMILY : string := "virtex6" ); port ( CLK : IN std_logic := '0'; DIN : IN std_logic_vector(C_DWIDTH-1 DOWNTO 0) := (OTHERS => '0'); RD_EN : IN std_logic := '0'; SRST : IN std_logic := '0'; WR_EN : IN std_logic := '0'; DATA_COUNT : OUT std_logic_vector(C_DATA_COUNT_WIDTH-1 DOWNTO 0); DOUT : OUT std_logic_vector(C_DWIDTH-1 DOWNTO 0); EMPTY : OUT std_logic; FULL : OUT std_logic ); end entity basic_sfifo_fg; architecture implementation of basic_sfifo_fg is -- Constant Declarations ---------------------------------------------- Constant POINTER_WIDTH : integer := log2(C_DEPTH); -- Constant zeros for programmable threshold inputs signal PROG_RDTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); signal PROG_WRTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- Signals --Signals added to fix MTI and XSIM issues caused by fix for VCS issues not to use "LIBRARY_SCAN = TRUE" signal ALMOST_FULL : std_logic; signal WR_ACK : std_logic; signal OVERFLOW : std_logic; signal VALID : std_logic; signal UNDERFLOW : std_logic; signal ALMOST_EMPTY : std_logic; signal RD_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal WR_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal PROG_FULL : std_logic; signal PROG_EMPTY : std_logic; signal SBITERR : std_logic; signal DBITERR : std_logic; signal S_AXI_AWREADY : std_logic; signal S_AXI_WREADY : std_logic; signal S_AXI_BID : std_logic_vector(3 DOWNTO 0); signal S_AXI_BRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_BUSER : std_logic_vector(0 downto 0); signal S_AXI_BVALID : std_logic; -- AXI Full/Lite Master Write Channel (Read side) signal M_AXI_AWID : std_logic_vector(3 DOWNTO 0); signal M_AXI_AWADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_AWLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_AWSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWUSER : std_logic_vector(0 downto 0); signal M_AXI_AWVALID : std_logic; signal M_AXI_WID : std_logic_vector(3 DOWNTO 0); signal M_AXI_WDATA : std_logic_vector(63 DOWNTO 0); signal M_AXI_WSTRB : std_logic_vector(7 DOWNTO 0); signal M_AXI_WLAST : std_logic; signal M_AXI_WUSER : std_logic_vector(0 downto 0); signal M_AXI_WVALID : std_logic; signal M_AXI_BREADY : std_logic; -- AXI Full/Lite Slave Read Channel (Write side) signal S_AXI_ARREADY : std_logic; signal S_AXI_RID : std_logic_vector(3 DOWNTO 0); signal S_AXI_RDATA : std_logic_vector(63 DOWNTO 0); signal S_AXI_RRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_RLAST : std_logic; signal S_AXI_RUSER : std_logic_vector(0 downto 0); signal S_AXI_RVALID : std_logic; -- AXI Full/Lite Master Read Channel (Read side) signal M_AXI_ARID : std_logic_vector(3 DOWNTO 0); signal M_AXI_ARADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_ARLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_ARSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARUSER : std_logic_vector(0 downto 0); signal M_AXI_ARVALID : std_logic; signal M_AXI_RREADY : std_logic; -- AXI Streaming Slave Signals (Write side) signal S_AXIS_TREADY : std_logic; -- AXI Streaming Master Signals (Read side) signal M_AXIS_TVALID : std_logic; signal M_AXIS_TDATA : std_logic_vector(63 DOWNTO 0); signal M_AXIS_TSTRB : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TKEEP : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TLAST : std_logic; signal M_AXIS_TID : std_logic_vector(7 DOWNTO 0); signal M_AXIS_TDEST : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TUSER : std_logic_vector(3 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals signal AXI_AW_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_SBITERR : std_logic; signal AXI_AW_DBITERR : std_logic; signal AXI_AW_OVERFLOW : std_logic; signal AXI_AW_UNDERFLOW : std_logic; signal AXI_AW_PROG_FULL : STD_LOGIC; signal AXI_AW_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Data Channel Signals signal AXI_W_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_SBITERR : std_logic; signal AXI_W_DBITERR : std_logic; signal AXI_W_OVERFLOW : std_logic; signal AXI_W_UNDERFLOW : std_logic; signal AXI_W_PROG_FULL : STD_LOGIC; signal AXI_W_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Response Channel Signals signal AXI_B_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_SBITERR : std_logic; signal AXI_B_DBITERR : std_logic; signal AXI_B_OVERFLOW : std_logic; signal AXI_B_UNDERFLOW : std_logic; signal AXI_B_PROG_FULL : STD_LOGIC; signal AXI_B_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Address Channel Signals signal AXI_AR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_SBITERR : std_logic; signal AXI_AR_DBITERR : std_logic; signal AXI_AR_OVERFLOW : std_logic; signal AXI_AR_UNDERFLOW : std_logic; signal AXI_AR_PROG_FULL : STD_LOGIC; signal AXI_AR_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Data Channel Signals signal AXI_R_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_SBITERR : std_logic; signal AXI_R_DBITERR : std_logic; signal AXI_R_OVERFLOW : std_logic; signal AXI_R_UNDERFLOW : std_logic; signal AXI_R_PROG_FULL : STD_LOGIC; signal AXI_R_PROG_EMPTY : STD_LOGIC; -- AXI Streaming FIFO Related Signals signal AXIS_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_SBITERR : std_logic; signal AXIS_DBITERR : std_logic; signal AXIS_OVERFLOW : std_logic; signal AXIS_UNDERFLOW : std_logic; signal AXIS_PROG_FULL : STD_LOGIC; signal AXIS_PROG_EMPTY : STD_LOGIC; begin --(architecture implementation) ------------------------------------------------------------------------------- -- Instantiate the generalized FIFO Generator instance -- -- NOTE: -- DO NOT CHANGE TO DIRECT ENTITY INSTANTIATION!!! -- This is a Coregen FIFO Generator Call module for -- BRAM implementations of a basic Sync FIFO -- ------------------------------------------------------------------------------- I_BASIC_SFIFO : entity fifo_generator_v11_0.fifo_generator_v11_0 generic map( C_COMMON_CLOCK => 1, C_COUNT_TYPE => 0, C_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_DEFAULT_VALUE => "BlankString", C_DIN_WIDTH => C_DWIDTH, C_DOUT_RST_VAL => "0", C_DOUT_WIDTH => C_DWIDTH, C_ENABLE_RLOCS => 0, -- n0 C_FAMILY => C_FAMILY, C_HAS_ALMOST_EMPTY => 0, -- n0 C_HAS_ALMOST_FULL => 0, -- n0 C_HAS_BACKUP => 0, -- n0 C_HAS_DATA_COUNT => C_HAS_DATA_COUNT, C_HAS_MEMINIT_FILE => 0, -- n0 C_HAS_OVERFLOW => 0, -- n0 C_HAS_RD_DATA_COUNT => 0, -- n0 C_HAS_RD_RST => 0, -- n0 C_HAS_RST => 0, -- n0 C_HAS_SRST => 1, -- yes C_HAS_UNDERFLOW => 0, -- n0 C_HAS_VALID => 0, -- n0 C_HAS_WR_ACK => 0, -- n0 C_HAS_WR_DATA_COUNT => 0, -- n0 C_HAS_WR_RST => 0, -- n0 C_IMPLEMENTATION_TYPE => 0, -- Common clock BRAM C_INIT_WR_PNTR_VAL => 0, C_MEMORY_TYPE => C_MEMORY_TYPE, C_MIF_FILE_NAME => "BlankString", C_OPTIMIZATION_MODE => 0, C_OVERFLOW_LOW => 0, C_PRELOAD_LATENCY => C_PRELOAD_LATENCY, C_PRELOAD_REGS => C_PRELOAD_REGS, C_PRIM_FIFO_TYPE => "512x36", C_PROG_EMPTY_THRESH_ASSERT_VAL => 0, C_PROG_EMPTY_THRESH_NEGATE_VAL => 0, C_PROG_EMPTY_TYPE => 0, C_PROG_FULL_THRESH_ASSERT_VAL => 0, C_PROG_FULL_THRESH_NEGATE_VAL => 0, C_PROG_FULL_TYPE => 0, C_RD_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_RD_DEPTH => C_DEPTH, C_RD_FREQ => 1, C_RD_PNTR_WIDTH => POINTER_WIDTH, C_UNDERFLOW_LOW => 0, C_USE_DOUT_RST => 1, C_USE_EMBEDDED_REG => 0, C_USE_FIFO16_FLAGS => 0, C_USE_FWFT_DATA_COUNT => C_USE_FWFT_DATA_COUNT, C_VALID_LOW => 0, C_WR_ACK_LOW => 0, C_WR_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_WR_DEPTH => C_DEPTH, C_WR_FREQ => 1, C_WR_PNTR_WIDTH => POINTER_WIDTH, C_WR_RESPONSE_LATENCY => 1, C_USE_ECC => 0, C_FULL_FLAGS_RST_VAL => 0, C_ENABLE_RST_SYNC => 1, C_ERROR_INJECTION_TYPE => 0, C_SYNCHRONIZER_STAGE => C_SYNCHRONIZER_STAGE, C_HAS_INT_CLK => 0, C_MSGON_VAL => 1, -- AXI Interface related parameters start here C_INTERFACE_TYPE => 0, -- : integer := 0; -- 0: Native Interface; 1: AXI Interface C_AXI_TYPE => 0, -- : integer := 0; -- 0: AXI Stream; 1: AXI Full; 2: AXI Lite C_HAS_AXI_WR_CHANNEL => 0, -- : integer := 0; C_HAS_AXI_RD_CHANNEL => 0, -- : integer := 0; C_HAS_SLAVE_CE => 0, -- : integer := 0; C_HAS_MASTER_CE => 0, -- : integer := 0; C_ADD_NGC_CONSTRAINT => 0, -- : integer := 0; C_USE_COMMON_OVERFLOW => 0, -- : integer := 0; C_USE_COMMON_UNDERFLOW => 0, -- : integer := 0; C_USE_DEFAULT_SETTINGS => 0, -- : integer := 0; -- AXI Full/Lite C_AXI_ID_WIDTH => 4 , -- : integer := 0; C_AXI_ADDR_WIDTH => 32, -- : integer := 0; C_AXI_DATA_WIDTH => 64, -- : integer := 0; C_AXI_LEN_WIDTH => 8, -- : integer := 8; C_AXI_LOCK_WIDTH => 2, -- : integer := 2; C_HAS_AXI_ID => 0, -- : integer := 0; C_HAS_AXI_AWUSER => 0 , -- : integer := 0; C_HAS_AXI_WUSER => 0 , -- : integer := 0; C_HAS_AXI_BUSER => 0 , -- : integer := 0; C_HAS_AXI_ARUSER => 0 , -- : integer := 0; C_HAS_AXI_RUSER => 0 , -- : integer := 0; C_AXI_ARUSER_WIDTH => 1 , -- : integer := 0; C_AXI_AWUSER_WIDTH => 1 , -- : integer := 0; C_AXI_WUSER_WIDTH => 1 , -- : integer := 0; C_AXI_BUSER_WIDTH => 1 , -- : integer := 0; C_AXI_RUSER_WIDTH => 1 , -- : integer := 0; -- AXI Streaming C_HAS_AXIS_TDATA => 0 , -- : integer := 0; C_HAS_AXIS_TID => 0 , -- : integer := 0; C_HAS_AXIS_TDEST => 0 , -- : integer := 0; C_HAS_AXIS_TUSER => 0 , -- : integer := 0; C_HAS_AXIS_TREADY => 1 , -- : integer := 0; C_HAS_AXIS_TLAST => 0 , -- : integer := 0; C_HAS_AXIS_TSTRB => 0 , -- : integer := 0; C_HAS_AXIS_TKEEP => 0 , -- : integer := 0; C_AXIS_TDATA_WIDTH => 64, -- : integer := 1; C_AXIS_TID_WIDTH => 8 , -- : integer := 1; C_AXIS_TDEST_WIDTH => 4 , -- : integer := 1; C_AXIS_TUSER_WIDTH => 4 , -- : integer := 1; C_AXIS_TSTRB_WIDTH => 4 , -- : integer := 1; C_AXIS_TKEEP_WIDTH => 4 , -- : integer := 1; -- AXI Channel Type -- WACH --> Write Address Channel -- WDCH --> Write Data Channel -- WRCH --> Write Response Channel -- RACH --> Read Address Channel -- RDCH --> Read Data Channel -- AXIS --> AXI Streaming C_WACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logic C_WDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_WRCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_AXIS_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie -- AXI Implementation Type -- 1 = Common Clock Block RAM FIFO -- 2 = Common Clock Distributed RAM FIFO -- 11 = Independent Clock Block RAM FIFO -- 12 = Independent Clock Distributed RAM FIFO C_IMPLEMENTATION_TYPE_WACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WRCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_AXIS => 1, -- : integer := 0; -- AXI FIFO Type -- 0 = Data FIFO -- 1 = Packet FIFO -- 2 = Low Latency Data FIFO C_APPLICATION_TYPE_WACH => 0, -- : integer := 0; C_APPLICATION_TYPE_WDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_WRCH => 0, -- : integer := 0; C_APPLICATION_TYPE_RACH => 0, -- : integer := 0; C_APPLICATION_TYPE_RDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_AXIS => 0, -- : integer := 0; -- Enable ECC -- 0 = ECC disabled -- 1 = ECC enabled C_USE_ECC_WACH => 0, -- : integer := 0; C_USE_ECC_WDCH => 0, -- : integer := 0; C_USE_ECC_WRCH => 0, -- : integer := 0; C_USE_ECC_RACH => 0, -- : integer := 0; C_USE_ECC_RDCH => 0, -- : integer := 0; C_USE_ECC_AXIS => 0, -- : integer := 0; -- ECC Error Injection Type -- 0 = No Error Injection -- 1 = Single Bit Error Injection -- 2 = Double Bit Error Injection -- 3 = Single Bit and Double Bit Error Injection C_ERROR_INJECTION_TYPE_WACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WRCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_AXIS => 0, -- : integer := 0; -- Input Data Width -- Accumulation of all AXI input signal's width C_DIN_WIDTH_WACH => 32, -- : integer := 1; C_DIN_WIDTH_WDCH => 64, -- : integer := 1; C_DIN_WIDTH_WRCH => 2 , -- : integer := 1; C_DIN_WIDTH_RACH => 32, -- : integer := 1; C_DIN_WIDTH_RDCH => 64, -- : integer := 1; C_DIN_WIDTH_AXIS => 1 , -- : integer := 1; C_WR_DEPTH_WACH => 16 , -- : integer := 16; C_WR_DEPTH_WDCH => 1024, -- : integer := 16; C_WR_DEPTH_WRCH => 16 , -- : integer := 16; C_WR_DEPTH_RACH => 16 , -- : integer := 16; C_WR_DEPTH_RDCH => 1024, -- : integer := 16; C_WR_DEPTH_AXIS => 1024, -- : integer := 16; C_WR_PNTR_WIDTH_WACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_WDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_WRCH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_AXIS => 10, -- : integer := 4; C_HAS_DATA_COUNTS_WACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WRCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_AXIS => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WRCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_AXIS => 0, -- : integer := 0; C_PROG_FULL_TYPE_WACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WRCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_AXIS => 1023, -- : integer := 0; C_PROG_EMPTY_TYPE_WACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS => 1022, -- : integer := 0; C_REG_SLICE_MODE_WACH => 0, -- : integer := 0; C_REG_SLICE_MODE_WDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_WRCH => 0, -- : integer := 0; C_REG_SLICE_MODE_RACH => 0, -- : integer := 0; C_REG_SLICE_MODE_RDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_AXIS => 0 -- : integer := 0 ) port map( backup => '0', backup_marker => '0', clk => CLK, rst => '0', srst => SRST, wr_clk => '0', wr_rst => '0', rd_clk => '0', rd_rst => '0', din => DIN, -- uses this one wr_en => WR_EN, -- uses this one rd_en => RD_EN, -- uses this one prog_empty_thresh => PROG_RDTHRESH_ZEROS, prog_empty_thresh_assert => PROG_RDTHRESH_ZEROS, prog_empty_thresh_negate => PROG_RDTHRESH_ZEROS, prog_full_thresh => PROG_WRTHRESH_ZEROS, prog_full_thresh_assert => PROG_WRTHRESH_ZEROS, prog_full_thresh_negate => PROG_WRTHRESH_ZEROS, int_clk => '0', injectdbiterr => '0', injectsbiterr => '0', dout => DOUT, -- uses this one full => FULL, -- uses this one almost_full => ALMOST_FULL, wr_ack => WR_ACK, overflow => OVERFLOW, empty => EMPTY, -- uses this one almost_empty => ALMOST_EMPTY, valid => VALID, underflow => UNDERFLOW, data_count => DATA_COUNT, -- uses this one rd_data_count => RD_DATA_COUNT, wr_data_count => WR_DATA_COUNT, prog_full => PROG_FULL, prog_empty => PROG_EMPTY, sbiterr => SBITERR, dbiterr => DBITERR, -- AXI Global Signal m_aclk => '0', -- : IN std_logic := '0'; s_aclk => '0', -- : IN std_logic := '0'; s_aresetn => '0', -- : IN std_logic := '0'; m_aclk_en => '0', -- : IN std_logic := '0'; s_aclk_en => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Slave Write Channel (write side) s_axi_awid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awaddr => "00000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlen => "00000000", --(others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awsize => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awburst => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlock => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awcache => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awprot => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awqos => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awregion => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awvalid => '0', -- : IN std_logic := '0'; s_axi_awready => S_AXI_AWREADY, -- : OUT std_logic; s_axi_wid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wstrb => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wlast => '0', -- : IN std_logic := '0'; s_axi_wuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wvalid => '0', -- : IN std_logic := '0'; s_axi_wready => S_AXI_WREADY, -- : OUT std_logic; s_axi_bid => S_AXI_BID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_bresp => S_AXI_BRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_buser => S_AXI_BUSER, -- : OUT std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0); s_axi_bvalid => S_AXI_BVALID, -- : OUT std_logic; s_axi_bready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Write Channel (Read side) m_axi_awid => M_AXI_AWID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_awaddr => M_AXI_AWADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_awlen => M_AXI_AWLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_awsize => M_AXI_AWSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awburst => M_AXI_AWBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awlock => M_AXI_AWLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awcache => M_AXI_AWCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awprot => M_AXI_AWPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awqos => M_AXI_AWQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awregion => M_AXI_AWREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awuser => M_AXI_AWUSER, -- : OUT std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0); m_axi_awvalid => M_AXI_AWVALID, -- : OUT std_logic; m_axi_awready => '0', -- : IN std_logic := '0'; m_axi_wid => M_AXI_WID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_wdata => M_AXI_WDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); m_axi_wstrb => M_AXI_WSTRB, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0); m_axi_wlast => M_AXI_WLAST, -- : OUT std_logic; m_axi_wuser => M_AXI_WUSER, -- : OUT std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0); m_axi_wvalid => M_AXI_WVALID, -- : OUT std_logic; m_axi_wready => '0', -- : IN std_logic := '0'; m_axi_bid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_buser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bvalid => '0', -- : IN std_logic := '0'; m_axi_bready => M_AXI_BREADY, -- : OUT std_logic; -- AXI Full/Lite Slave Read Channel (Write side) s_axi_arid => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_araddr => "00000000000000000000000000000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlen => "00000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arsize => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arburst => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlock => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arcache => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arprot => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arqos => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arregion => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_aruser => "0", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arvalid => '0', -- : IN std_logic := '0'; s_axi_arready => S_AXI_ARREADY, -- : OUT std_logic; s_axi_rid => S_AXI_RID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); s_axi_rdata => S_AXI_RDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); s_axi_rresp => S_AXI_RRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_rlast => S_AXI_RLAST, -- : OUT std_logic; s_axi_ruser => S_AXI_RUSER, -- : OUT std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0); s_axi_rvalid => S_AXI_RVALID, -- : OUT std_logic; s_axi_rready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Read Channel (Read side) m_axi_arid => M_AXI_ARID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_araddr => M_AXI_ARADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_arlen => M_AXI_ARLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_arsize => M_AXI_ARSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arburst => M_AXI_ARBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arlock => M_AXI_ARLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arcache => M_AXI_ARCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arprot => M_AXI_ARPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arqos => M_AXI_ARQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arregion => M_AXI_ARREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_aruser => M_AXI_ARUSER, -- : OUT std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0); m_axi_arvalid => M_AXI_ARVALID, -- : OUT std_logic; m_axi_arready => '0', -- : IN std_logic := '0'; m_axi_rid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rlast => '0', -- : IN std_logic := '0'; m_axi_ruser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rvalid => '0', -- : IN std_logic := '0'; m_axi_rready => M_AXI_RREADY, -- : OUT std_logic; -- AXI Streaming Slave Signals (Write side) s_axis_tvalid => '0', -- : IN std_logic := '0'; s_axis_tready => S_AXIS_TREADY, -- : OUT std_logic; s_axis_tdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tstrb => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tkeep => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tlast => '0', -- : IN std_logic := '0'; s_axis_tid => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tdest => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tuser => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- AXI Streaming Master Signals (Read side) m_axis_tvalid => M_AXIS_TVALID, -- : OUT std_logic; m_axis_tready => '0', -- : IN std_logic := '0'; m_axis_tdata => M_AXIS_TDATA, -- : OUT std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0); m_axis_tstrb => M_AXIS_TSTRB, -- : OUT std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0); m_axis_tkeep => M_AXIS_TKEEP, -- : OUT std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0); m_axis_tlast => M_AXIS_TLAST, -- : OUT std_logic; m_axis_tid => M_AXIS_TID, -- : OUT std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0); m_axis_tdest => M_AXIS_TDEST, -- : OUT std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0); m_axis_tuser => M_AXIS_TUSER, -- : OUT std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals axi_aw_injectsbiterr => '0', -- : IN std_logic := '0'; axi_aw_injectdbiterr => '0', -- : IN std_logic := '0'; axi_aw_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_data_count => AXI_AW_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_wr_data_count => AXI_AW_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_rd_data_count => AXI_AW_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_sbiterr => AXI_AW_SBITERR, -- : OUT std_logic; axi_aw_dbiterr => AXI_AW_DBITERR, -- : OUT std_logic; axi_aw_overflow => AXI_AW_OVERFLOW, -- : OUT std_logic; axi_aw_underflow => AXI_AW_UNDERFLOW, -- : OUT std_logic; axi_aw_prog_full => AXI_AW_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_aw_prog_empty => AXI_AW_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Data Channel Signals axi_w_injectsbiterr => '0', -- : IN std_logic := '0'; axi_w_injectdbiterr => '0', -- : IN std_logic := '0'; axi_w_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_data_count => AXI_W_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_wr_data_count => AXI_W_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_rd_data_count => AXI_W_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_sbiterr => AXI_W_SBITERR, -- : OUT std_logic; axi_w_dbiterr => AXI_W_DBITERR, -- : OUT std_logic; axi_w_overflow => AXI_W_OVERFLOW, -- : OUT std_logic; axi_w_underflow => AXI_W_UNDERFLOW, -- : OUT std_logic; axi_w_prog_full => AXI_W_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_w_prog_empty => AXI_W_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Response Channel Signals axi_b_injectsbiterr => '0', -- : IN std_logic := '0'; axi_b_injectdbiterr => '0', -- : IN std_logic := '0'; axi_b_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_data_count => AXI_B_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_wr_data_count => AXI_B_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_rd_data_count => AXI_B_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_sbiterr => AXI_B_SBITERR, -- : OUT std_logic; axi_b_dbiterr => AXI_B_DBITERR, -- : OUT std_logic; axi_b_overflow => AXI_B_OVERFLOW, -- : OUT std_logic; axi_b_underflow => AXI_B_UNDERFLOW, -- : OUT std_logic; axi_b_prog_full => AXI_B_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_b_prog_empty => AXI_B_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Address Channel Signals axi_ar_injectsbiterr => '0', -- : IN std_logic := '0'; axi_ar_injectdbiterr => '0', -- : IN std_logic := '0'; axi_ar_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_data_count => AXI_AR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_wr_data_count => AXI_AR_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_rd_data_count => AXI_AR_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_sbiterr => AXI_AR_SBITERR, -- : OUT std_logic; axi_ar_dbiterr => AXI_AR_DBITERR, -- : OUT std_logic; axi_ar_overflow => AXI_AR_OVERFLOW, -- : OUT std_logic; axi_ar_underflow => AXI_AR_UNDERFLOW, -- : OUT std_logic; axi_ar_prog_full => AXI_AR_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_ar_prog_empty => AXI_AR_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Data Channel Signals axi_r_injectsbiterr => '0', -- : IN std_logic := '0'; axi_r_injectdbiterr => '0', -- : IN std_logic := '0'; axi_r_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_data_count => AXI_R_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_wr_data_count => AXI_R_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_rd_data_count => AXI_R_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_sbiterr => AXI_R_SBITERR, -- : OUT std_logic; axi_r_dbiterr => AXI_R_DBITERR, -- : OUT std_logic; axi_r_overflow => AXI_R_OVERFLOW, -- : OUT std_logic; axi_r_underflow => AXI_R_UNDERFLOW, -- : OUT std_logic; axi_r_prog_full => AXI_R_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_r_prog_empty => AXI_R_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Streaming FIFO Related Signals axis_injectsbiterr => '0', -- : IN std_logic := '0'; axis_injectdbiterr => '0', -- : IN std_logic := '0'; axis_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_data_count => AXIS_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_wr_data_count => AXIS_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_rd_data_count => AXIS_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_sbiterr => AXIS_SBITERR, -- : OUT std_logic; axis_dbiterr => AXIS_DBITERR, -- : OUT std_logic; axis_overflow => AXIS_OVERFLOW, -- : OUT std_logic; axis_underflow => AXIS_UNDERFLOW, -- : OUT std_logic axis_prog_full => AXIS_PROG_FULL, -- : OUT STD_LOGIC := '0'; axis_prog_empty => AXIS_PROG_EMPTY -- : OUT STD_LOGIC := '1'; ); end implementation;
------------------------------------------------------------------------------- -- basic_sfifo_fg.vhd ------------------------------------------------------------------------------- -- -- ************************************************************************* -- -- (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- ************************************************************************* -- ------------------------------------------------------------------------------- -- Filename: basic_sfifo_fg.vhd -- -- Description: -- This HDL file implements a basic synchronous (single clock) fifo using the -- FIFO Generator tool. It is intended to offer a simple interface to the user -- with the complexity of the FIFO Generator interface hidden from the user. -- -- Note that in normal op mode (not First Word Fall Through FWFT) the data count -- output goes to zero when the FIFO goes full. This the way FIFO Generator works. -- -- -- VHDL-Standard: VHDL'93 ------------------------------------------------------------------------------- -- Structure: -- basic_sfifo_fg.vhd -- | -- |-- fifo_generator_v8_2 -- ------------------------------------------------------------------------------- -- Revision History: -- -- -- Author: DET -- Revision: $Revision: 1.0 $ -- Date: $3/07/2011$ -- -- History: -- DET 3/07/2011 Initial Version -- ------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library fifo_generator_v11_0; use fifo_generator_v11_0.all; library proc_common_v4_0; use proc_common_v4_0.proc_common_pkg.all; use proc_common_v4_0.proc_common_pkg.log2; --use proc_common_v4_0.coregen_comp_defs.all; -- synopsys translate_off --library XilinxCoreLib; --use XilinxCoreLib.all; -- synopsys translate_on ------------------------------------------------------------------------------- entity basic_sfifo_fg is generic ( C_DWIDTH : Integer := 32 ; -- FIFO data Width (Read and write data ports are symetric) C_DEPTH : Integer := 512 ; -- FIFO Depth (set to power of 2) C_HAS_DATA_COUNT : integer := 1 ; -- 0 = Data Count output not needed -- 1 = Data Count output needed C_DATA_COUNT_WIDTH : integer := 10 ; -- Data Count bit width (Max value is log2(C_DEPTH)) C_IMPLEMENTATION_TYPE : integer range 0 to 1 := 0; -- 0 = Common Clock BRAM / Distributed RAM (Synchronous FIFO) -- 1 = Common Clock Shift Register (Synchronous FIFO) C_MEMORY_TYPE : integer := 1; -- 0 = Any -- 1 = BRAM -- 2 = Distributed Memory -- 3 = Shift Registers C_PRELOAD_REGS : integer := 1; -- 0 = normal -- 1 = FWFT C_PRELOAD_LATENCY : integer := 0; -- 0 = FWFT -- 1 = normal C_USE_FWFT_DATA_COUNT : integer := 0; -- 0 = normal -- 1 for FWFT C_SYNCHRONIZER_STAGE : integer := 2; -- valid values are 0 to 8; C_FAMILY : string := "virtex6" ); port ( CLK : IN std_logic := '0'; DIN : IN std_logic_vector(C_DWIDTH-1 DOWNTO 0) := (OTHERS => '0'); RD_EN : IN std_logic := '0'; SRST : IN std_logic := '0'; WR_EN : IN std_logic := '0'; DATA_COUNT : OUT std_logic_vector(C_DATA_COUNT_WIDTH-1 DOWNTO 0); DOUT : OUT std_logic_vector(C_DWIDTH-1 DOWNTO 0); EMPTY : OUT std_logic; FULL : OUT std_logic ); end entity basic_sfifo_fg; architecture implementation of basic_sfifo_fg is -- Constant Declarations ---------------------------------------------- Constant POINTER_WIDTH : integer := log2(C_DEPTH); -- Constant zeros for programmable threshold inputs signal PROG_RDTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); signal PROG_WRTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- Signals --Signals added to fix MTI and XSIM issues caused by fix for VCS issues not to use "LIBRARY_SCAN = TRUE" signal ALMOST_FULL : std_logic; signal WR_ACK : std_logic; signal OVERFLOW : std_logic; signal VALID : std_logic; signal UNDERFLOW : std_logic; signal ALMOST_EMPTY : std_logic; signal RD_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal WR_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal PROG_FULL : std_logic; signal PROG_EMPTY : std_logic; signal SBITERR : std_logic; signal DBITERR : std_logic; signal S_AXI_AWREADY : std_logic; signal S_AXI_WREADY : std_logic; signal S_AXI_BID : std_logic_vector(3 DOWNTO 0); signal S_AXI_BRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_BUSER : std_logic_vector(0 downto 0); signal S_AXI_BVALID : std_logic; -- AXI Full/Lite Master Write Channel (Read side) signal M_AXI_AWID : std_logic_vector(3 DOWNTO 0); signal M_AXI_AWADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_AWLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_AWSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWUSER : std_logic_vector(0 downto 0); signal M_AXI_AWVALID : std_logic; signal M_AXI_WID : std_logic_vector(3 DOWNTO 0); signal M_AXI_WDATA : std_logic_vector(63 DOWNTO 0); signal M_AXI_WSTRB : std_logic_vector(7 DOWNTO 0); signal M_AXI_WLAST : std_logic; signal M_AXI_WUSER : std_logic_vector(0 downto 0); signal M_AXI_WVALID : std_logic; signal M_AXI_BREADY : std_logic; -- AXI Full/Lite Slave Read Channel (Write side) signal S_AXI_ARREADY : std_logic; signal S_AXI_RID : std_logic_vector(3 DOWNTO 0); signal S_AXI_RDATA : std_logic_vector(63 DOWNTO 0); signal S_AXI_RRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_RLAST : std_logic; signal S_AXI_RUSER : std_logic_vector(0 downto 0); signal S_AXI_RVALID : std_logic; -- AXI Full/Lite Master Read Channel (Read side) signal M_AXI_ARID : std_logic_vector(3 DOWNTO 0); signal M_AXI_ARADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_ARLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_ARSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARUSER : std_logic_vector(0 downto 0); signal M_AXI_ARVALID : std_logic; signal M_AXI_RREADY : std_logic; -- AXI Streaming Slave Signals (Write side) signal S_AXIS_TREADY : std_logic; -- AXI Streaming Master Signals (Read side) signal M_AXIS_TVALID : std_logic; signal M_AXIS_TDATA : std_logic_vector(63 DOWNTO 0); signal M_AXIS_TSTRB : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TKEEP : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TLAST : std_logic; signal M_AXIS_TID : std_logic_vector(7 DOWNTO 0); signal M_AXIS_TDEST : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TUSER : std_logic_vector(3 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals signal AXI_AW_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_SBITERR : std_logic; signal AXI_AW_DBITERR : std_logic; signal AXI_AW_OVERFLOW : std_logic; signal AXI_AW_UNDERFLOW : std_logic; signal AXI_AW_PROG_FULL : STD_LOGIC; signal AXI_AW_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Data Channel Signals signal AXI_W_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_SBITERR : std_logic; signal AXI_W_DBITERR : std_logic; signal AXI_W_OVERFLOW : std_logic; signal AXI_W_UNDERFLOW : std_logic; signal AXI_W_PROG_FULL : STD_LOGIC; signal AXI_W_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Response Channel Signals signal AXI_B_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_SBITERR : std_logic; signal AXI_B_DBITERR : std_logic; signal AXI_B_OVERFLOW : std_logic; signal AXI_B_UNDERFLOW : std_logic; signal AXI_B_PROG_FULL : STD_LOGIC; signal AXI_B_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Address Channel Signals signal AXI_AR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_SBITERR : std_logic; signal AXI_AR_DBITERR : std_logic; signal AXI_AR_OVERFLOW : std_logic; signal AXI_AR_UNDERFLOW : std_logic; signal AXI_AR_PROG_FULL : STD_LOGIC; signal AXI_AR_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Data Channel Signals signal AXI_R_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_SBITERR : std_logic; signal AXI_R_DBITERR : std_logic; signal AXI_R_OVERFLOW : std_logic; signal AXI_R_UNDERFLOW : std_logic; signal AXI_R_PROG_FULL : STD_LOGIC; signal AXI_R_PROG_EMPTY : STD_LOGIC; -- AXI Streaming FIFO Related Signals signal AXIS_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_SBITERR : std_logic; signal AXIS_DBITERR : std_logic; signal AXIS_OVERFLOW : std_logic; signal AXIS_UNDERFLOW : std_logic; signal AXIS_PROG_FULL : STD_LOGIC; signal AXIS_PROG_EMPTY : STD_LOGIC; begin --(architecture implementation) ------------------------------------------------------------------------------- -- Instantiate the generalized FIFO Generator instance -- -- NOTE: -- DO NOT CHANGE TO DIRECT ENTITY INSTANTIATION!!! -- This is a Coregen FIFO Generator Call module for -- BRAM implementations of a basic Sync FIFO -- ------------------------------------------------------------------------------- I_BASIC_SFIFO : entity fifo_generator_v11_0.fifo_generator_v11_0 generic map( C_COMMON_CLOCK => 1, C_COUNT_TYPE => 0, C_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_DEFAULT_VALUE => "BlankString", C_DIN_WIDTH => C_DWIDTH, C_DOUT_RST_VAL => "0", C_DOUT_WIDTH => C_DWIDTH, C_ENABLE_RLOCS => 0, -- n0 C_FAMILY => C_FAMILY, C_HAS_ALMOST_EMPTY => 0, -- n0 C_HAS_ALMOST_FULL => 0, -- n0 C_HAS_BACKUP => 0, -- n0 C_HAS_DATA_COUNT => C_HAS_DATA_COUNT, C_HAS_MEMINIT_FILE => 0, -- n0 C_HAS_OVERFLOW => 0, -- n0 C_HAS_RD_DATA_COUNT => 0, -- n0 C_HAS_RD_RST => 0, -- n0 C_HAS_RST => 0, -- n0 C_HAS_SRST => 1, -- yes C_HAS_UNDERFLOW => 0, -- n0 C_HAS_VALID => 0, -- n0 C_HAS_WR_ACK => 0, -- n0 C_HAS_WR_DATA_COUNT => 0, -- n0 C_HAS_WR_RST => 0, -- n0 C_IMPLEMENTATION_TYPE => 0, -- Common clock BRAM C_INIT_WR_PNTR_VAL => 0, C_MEMORY_TYPE => C_MEMORY_TYPE, C_MIF_FILE_NAME => "BlankString", C_OPTIMIZATION_MODE => 0, C_OVERFLOW_LOW => 0, C_PRELOAD_LATENCY => C_PRELOAD_LATENCY, C_PRELOAD_REGS => C_PRELOAD_REGS, C_PRIM_FIFO_TYPE => "512x36", C_PROG_EMPTY_THRESH_ASSERT_VAL => 0, C_PROG_EMPTY_THRESH_NEGATE_VAL => 0, C_PROG_EMPTY_TYPE => 0, C_PROG_FULL_THRESH_ASSERT_VAL => 0, C_PROG_FULL_THRESH_NEGATE_VAL => 0, C_PROG_FULL_TYPE => 0, C_RD_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_RD_DEPTH => C_DEPTH, C_RD_FREQ => 1, C_RD_PNTR_WIDTH => POINTER_WIDTH, C_UNDERFLOW_LOW => 0, C_USE_DOUT_RST => 1, C_USE_EMBEDDED_REG => 0, C_USE_FIFO16_FLAGS => 0, C_USE_FWFT_DATA_COUNT => C_USE_FWFT_DATA_COUNT, C_VALID_LOW => 0, C_WR_ACK_LOW => 0, C_WR_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_WR_DEPTH => C_DEPTH, C_WR_FREQ => 1, C_WR_PNTR_WIDTH => POINTER_WIDTH, C_WR_RESPONSE_LATENCY => 1, C_USE_ECC => 0, C_FULL_FLAGS_RST_VAL => 0, C_ENABLE_RST_SYNC => 1, C_ERROR_INJECTION_TYPE => 0, C_SYNCHRONIZER_STAGE => C_SYNCHRONIZER_STAGE, C_HAS_INT_CLK => 0, C_MSGON_VAL => 1, -- AXI Interface related parameters start here C_INTERFACE_TYPE => 0, -- : integer := 0; -- 0: Native Interface; 1: AXI Interface C_AXI_TYPE => 0, -- : integer := 0; -- 0: AXI Stream; 1: AXI Full; 2: AXI Lite C_HAS_AXI_WR_CHANNEL => 0, -- : integer := 0; C_HAS_AXI_RD_CHANNEL => 0, -- : integer := 0; C_HAS_SLAVE_CE => 0, -- : integer := 0; C_HAS_MASTER_CE => 0, -- : integer := 0; C_ADD_NGC_CONSTRAINT => 0, -- : integer := 0; C_USE_COMMON_OVERFLOW => 0, -- : integer := 0; C_USE_COMMON_UNDERFLOW => 0, -- : integer := 0; C_USE_DEFAULT_SETTINGS => 0, -- : integer := 0; -- AXI Full/Lite C_AXI_ID_WIDTH => 4 , -- : integer := 0; C_AXI_ADDR_WIDTH => 32, -- : integer := 0; C_AXI_DATA_WIDTH => 64, -- : integer := 0; C_AXI_LEN_WIDTH => 8, -- : integer := 8; C_AXI_LOCK_WIDTH => 2, -- : integer := 2; C_HAS_AXI_ID => 0, -- : integer := 0; C_HAS_AXI_AWUSER => 0 , -- : integer := 0; C_HAS_AXI_WUSER => 0 , -- : integer := 0; C_HAS_AXI_BUSER => 0 , -- : integer := 0; C_HAS_AXI_ARUSER => 0 , -- : integer := 0; C_HAS_AXI_RUSER => 0 , -- : integer := 0; C_AXI_ARUSER_WIDTH => 1 , -- : integer := 0; C_AXI_AWUSER_WIDTH => 1 , -- : integer := 0; C_AXI_WUSER_WIDTH => 1 , -- : integer := 0; C_AXI_BUSER_WIDTH => 1 , -- : integer := 0; C_AXI_RUSER_WIDTH => 1 , -- : integer := 0; -- AXI Streaming C_HAS_AXIS_TDATA => 0 , -- : integer := 0; C_HAS_AXIS_TID => 0 , -- : integer := 0; C_HAS_AXIS_TDEST => 0 , -- : integer := 0; C_HAS_AXIS_TUSER => 0 , -- : integer := 0; C_HAS_AXIS_TREADY => 1 , -- : integer := 0; C_HAS_AXIS_TLAST => 0 , -- : integer := 0; C_HAS_AXIS_TSTRB => 0 , -- : integer := 0; C_HAS_AXIS_TKEEP => 0 , -- : integer := 0; C_AXIS_TDATA_WIDTH => 64, -- : integer := 1; C_AXIS_TID_WIDTH => 8 , -- : integer := 1; C_AXIS_TDEST_WIDTH => 4 , -- : integer := 1; C_AXIS_TUSER_WIDTH => 4 , -- : integer := 1; C_AXIS_TSTRB_WIDTH => 4 , -- : integer := 1; C_AXIS_TKEEP_WIDTH => 4 , -- : integer := 1; -- AXI Channel Type -- WACH --> Write Address Channel -- WDCH --> Write Data Channel -- WRCH --> Write Response Channel -- RACH --> Read Address Channel -- RDCH --> Read Data Channel -- AXIS --> AXI Streaming C_WACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logic C_WDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_WRCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_AXIS_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie -- AXI Implementation Type -- 1 = Common Clock Block RAM FIFO -- 2 = Common Clock Distributed RAM FIFO -- 11 = Independent Clock Block RAM FIFO -- 12 = Independent Clock Distributed RAM FIFO C_IMPLEMENTATION_TYPE_WACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WRCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_AXIS => 1, -- : integer := 0; -- AXI FIFO Type -- 0 = Data FIFO -- 1 = Packet FIFO -- 2 = Low Latency Data FIFO C_APPLICATION_TYPE_WACH => 0, -- : integer := 0; C_APPLICATION_TYPE_WDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_WRCH => 0, -- : integer := 0; C_APPLICATION_TYPE_RACH => 0, -- : integer := 0; C_APPLICATION_TYPE_RDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_AXIS => 0, -- : integer := 0; -- Enable ECC -- 0 = ECC disabled -- 1 = ECC enabled C_USE_ECC_WACH => 0, -- : integer := 0; C_USE_ECC_WDCH => 0, -- : integer := 0; C_USE_ECC_WRCH => 0, -- : integer := 0; C_USE_ECC_RACH => 0, -- : integer := 0; C_USE_ECC_RDCH => 0, -- : integer := 0; C_USE_ECC_AXIS => 0, -- : integer := 0; -- ECC Error Injection Type -- 0 = No Error Injection -- 1 = Single Bit Error Injection -- 2 = Double Bit Error Injection -- 3 = Single Bit and Double Bit Error Injection C_ERROR_INJECTION_TYPE_WACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WRCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_AXIS => 0, -- : integer := 0; -- Input Data Width -- Accumulation of all AXI input signal's width C_DIN_WIDTH_WACH => 32, -- : integer := 1; C_DIN_WIDTH_WDCH => 64, -- : integer := 1; C_DIN_WIDTH_WRCH => 2 , -- : integer := 1; C_DIN_WIDTH_RACH => 32, -- : integer := 1; C_DIN_WIDTH_RDCH => 64, -- : integer := 1; C_DIN_WIDTH_AXIS => 1 , -- : integer := 1; C_WR_DEPTH_WACH => 16 , -- : integer := 16; C_WR_DEPTH_WDCH => 1024, -- : integer := 16; C_WR_DEPTH_WRCH => 16 , -- : integer := 16; C_WR_DEPTH_RACH => 16 , -- : integer := 16; C_WR_DEPTH_RDCH => 1024, -- : integer := 16; C_WR_DEPTH_AXIS => 1024, -- : integer := 16; C_WR_PNTR_WIDTH_WACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_WDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_WRCH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_AXIS => 10, -- : integer := 4; C_HAS_DATA_COUNTS_WACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WRCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_AXIS => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WRCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_AXIS => 0, -- : integer := 0; C_PROG_FULL_TYPE_WACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WRCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_AXIS => 1023, -- : integer := 0; C_PROG_EMPTY_TYPE_WACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS => 1022, -- : integer := 0; C_REG_SLICE_MODE_WACH => 0, -- : integer := 0; C_REG_SLICE_MODE_WDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_WRCH => 0, -- : integer := 0; C_REG_SLICE_MODE_RACH => 0, -- : integer := 0; C_REG_SLICE_MODE_RDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_AXIS => 0 -- : integer := 0 ) port map( backup => '0', backup_marker => '0', clk => CLK, rst => '0', srst => SRST, wr_clk => '0', wr_rst => '0', rd_clk => '0', rd_rst => '0', din => DIN, -- uses this one wr_en => WR_EN, -- uses this one rd_en => RD_EN, -- uses this one prog_empty_thresh => PROG_RDTHRESH_ZEROS, prog_empty_thresh_assert => PROG_RDTHRESH_ZEROS, prog_empty_thresh_negate => PROG_RDTHRESH_ZEROS, prog_full_thresh => PROG_WRTHRESH_ZEROS, prog_full_thresh_assert => PROG_WRTHRESH_ZEROS, prog_full_thresh_negate => PROG_WRTHRESH_ZEROS, int_clk => '0', injectdbiterr => '0', injectsbiterr => '0', dout => DOUT, -- uses this one full => FULL, -- uses this one almost_full => ALMOST_FULL, wr_ack => WR_ACK, overflow => OVERFLOW, empty => EMPTY, -- uses this one almost_empty => ALMOST_EMPTY, valid => VALID, underflow => UNDERFLOW, data_count => DATA_COUNT, -- uses this one rd_data_count => RD_DATA_COUNT, wr_data_count => WR_DATA_COUNT, prog_full => PROG_FULL, prog_empty => PROG_EMPTY, sbiterr => SBITERR, dbiterr => DBITERR, -- AXI Global Signal m_aclk => '0', -- : IN std_logic := '0'; s_aclk => '0', -- : IN std_logic := '0'; s_aresetn => '0', -- : IN std_logic := '0'; m_aclk_en => '0', -- : IN std_logic := '0'; s_aclk_en => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Slave Write Channel (write side) s_axi_awid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awaddr => "00000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlen => "00000000", --(others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awsize => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awburst => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlock => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awcache => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awprot => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awqos => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awregion => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awvalid => '0', -- : IN std_logic := '0'; s_axi_awready => S_AXI_AWREADY, -- : OUT std_logic; s_axi_wid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wstrb => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wlast => '0', -- : IN std_logic := '0'; s_axi_wuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wvalid => '0', -- : IN std_logic := '0'; s_axi_wready => S_AXI_WREADY, -- : OUT std_logic; s_axi_bid => S_AXI_BID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_bresp => S_AXI_BRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_buser => S_AXI_BUSER, -- : OUT std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0); s_axi_bvalid => S_AXI_BVALID, -- : OUT std_logic; s_axi_bready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Write Channel (Read side) m_axi_awid => M_AXI_AWID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_awaddr => M_AXI_AWADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_awlen => M_AXI_AWLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_awsize => M_AXI_AWSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awburst => M_AXI_AWBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awlock => M_AXI_AWLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awcache => M_AXI_AWCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awprot => M_AXI_AWPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awqos => M_AXI_AWQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awregion => M_AXI_AWREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awuser => M_AXI_AWUSER, -- : OUT std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0); m_axi_awvalid => M_AXI_AWVALID, -- : OUT std_logic; m_axi_awready => '0', -- : IN std_logic := '0'; m_axi_wid => M_AXI_WID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_wdata => M_AXI_WDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); m_axi_wstrb => M_AXI_WSTRB, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0); m_axi_wlast => M_AXI_WLAST, -- : OUT std_logic; m_axi_wuser => M_AXI_WUSER, -- : OUT std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0); m_axi_wvalid => M_AXI_WVALID, -- : OUT std_logic; m_axi_wready => '0', -- : IN std_logic := '0'; m_axi_bid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_buser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bvalid => '0', -- : IN std_logic := '0'; m_axi_bready => M_AXI_BREADY, -- : OUT std_logic; -- AXI Full/Lite Slave Read Channel (Write side) s_axi_arid => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_araddr => "00000000000000000000000000000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlen => "00000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arsize => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arburst => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlock => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arcache => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arprot => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arqos => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arregion => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_aruser => "0", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arvalid => '0', -- : IN std_logic := '0'; s_axi_arready => S_AXI_ARREADY, -- : OUT std_logic; s_axi_rid => S_AXI_RID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); s_axi_rdata => S_AXI_RDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); s_axi_rresp => S_AXI_RRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_rlast => S_AXI_RLAST, -- : OUT std_logic; s_axi_ruser => S_AXI_RUSER, -- : OUT std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0); s_axi_rvalid => S_AXI_RVALID, -- : OUT std_logic; s_axi_rready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Read Channel (Read side) m_axi_arid => M_AXI_ARID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_araddr => M_AXI_ARADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_arlen => M_AXI_ARLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_arsize => M_AXI_ARSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arburst => M_AXI_ARBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arlock => M_AXI_ARLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arcache => M_AXI_ARCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arprot => M_AXI_ARPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arqos => M_AXI_ARQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arregion => M_AXI_ARREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_aruser => M_AXI_ARUSER, -- : OUT std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0); m_axi_arvalid => M_AXI_ARVALID, -- : OUT std_logic; m_axi_arready => '0', -- : IN std_logic := '0'; m_axi_rid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rlast => '0', -- : IN std_logic := '0'; m_axi_ruser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rvalid => '0', -- : IN std_logic := '0'; m_axi_rready => M_AXI_RREADY, -- : OUT std_logic; -- AXI Streaming Slave Signals (Write side) s_axis_tvalid => '0', -- : IN std_logic := '0'; s_axis_tready => S_AXIS_TREADY, -- : OUT std_logic; s_axis_tdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tstrb => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tkeep => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tlast => '0', -- : IN std_logic := '0'; s_axis_tid => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tdest => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tuser => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- AXI Streaming Master Signals (Read side) m_axis_tvalid => M_AXIS_TVALID, -- : OUT std_logic; m_axis_tready => '0', -- : IN std_logic := '0'; m_axis_tdata => M_AXIS_TDATA, -- : OUT std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0); m_axis_tstrb => M_AXIS_TSTRB, -- : OUT std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0); m_axis_tkeep => M_AXIS_TKEEP, -- : OUT std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0); m_axis_tlast => M_AXIS_TLAST, -- : OUT std_logic; m_axis_tid => M_AXIS_TID, -- : OUT std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0); m_axis_tdest => M_AXIS_TDEST, -- : OUT std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0); m_axis_tuser => M_AXIS_TUSER, -- : OUT std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals axi_aw_injectsbiterr => '0', -- : IN std_logic := '0'; axi_aw_injectdbiterr => '0', -- : IN std_logic := '0'; axi_aw_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_data_count => AXI_AW_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_wr_data_count => AXI_AW_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_rd_data_count => AXI_AW_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_sbiterr => AXI_AW_SBITERR, -- : OUT std_logic; axi_aw_dbiterr => AXI_AW_DBITERR, -- : OUT std_logic; axi_aw_overflow => AXI_AW_OVERFLOW, -- : OUT std_logic; axi_aw_underflow => AXI_AW_UNDERFLOW, -- : OUT std_logic; axi_aw_prog_full => AXI_AW_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_aw_prog_empty => AXI_AW_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Data Channel Signals axi_w_injectsbiterr => '0', -- : IN std_logic := '0'; axi_w_injectdbiterr => '0', -- : IN std_logic := '0'; axi_w_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_data_count => AXI_W_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_wr_data_count => AXI_W_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_rd_data_count => AXI_W_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_sbiterr => AXI_W_SBITERR, -- : OUT std_logic; axi_w_dbiterr => AXI_W_DBITERR, -- : OUT std_logic; axi_w_overflow => AXI_W_OVERFLOW, -- : OUT std_logic; axi_w_underflow => AXI_W_UNDERFLOW, -- : OUT std_logic; axi_w_prog_full => AXI_W_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_w_prog_empty => AXI_W_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Response Channel Signals axi_b_injectsbiterr => '0', -- : IN std_logic := '0'; axi_b_injectdbiterr => '0', -- : IN std_logic := '0'; axi_b_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_data_count => AXI_B_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_wr_data_count => AXI_B_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_rd_data_count => AXI_B_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_sbiterr => AXI_B_SBITERR, -- : OUT std_logic; axi_b_dbiterr => AXI_B_DBITERR, -- : OUT std_logic; axi_b_overflow => AXI_B_OVERFLOW, -- : OUT std_logic; axi_b_underflow => AXI_B_UNDERFLOW, -- : OUT std_logic; axi_b_prog_full => AXI_B_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_b_prog_empty => AXI_B_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Address Channel Signals axi_ar_injectsbiterr => '0', -- : IN std_logic := '0'; axi_ar_injectdbiterr => '0', -- : IN std_logic := '0'; axi_ar_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_data_count => AXI_AR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_wr_data_count => AXI_AR_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_rd_data_count => AXI_AR_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_sbiterr => AXI_AR_SBITERR, -- : OUT std_logic; axi_ar_dbiterr => AXI_AR_DBITERR, -- : OUT std_logic; axi_ar_overflow => AXI_AR_OVERFLOW, -- : OUT std_logic; axi_ar_underflow => AXI_AR_UNDERFLOW, -- : OUT std_logic; axi_ar_prog_full => AXI_AR_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_ar_prog_empty => AXI_AR_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Data Channel Signals axi_r_injectsbiterr => '0', -- : IN std_logic := '0'; axi_r_injectdbiterr => '0', -- : IN std_logic := '0'; axi_r_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_data_count => AXI_R_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_wr_data_count => AXI_R_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_rd_data_count => AXI_R_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_sbiterr => AXI_R_SBITERR, -- : OUT std_logic; axi_r_dbiterr => AXI_R_DBITERR, -- : OUT std_logic; axi_r_overflow => AXI_R_OVERFLOW, -- : OUT std_logic; axi_r_underflow => AXI_R_UNDERFLOW, -- : OUT std_logic; axi_r_prog_full => AXI_R_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_r_prog_empty => AXI_R_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Streaming FIFO Related Signals axis_injectsbiterr => '0', -- : IN std_logic := '0'; axis_injectdbiterr => '0', -- : IN std_logic := '0'; axis_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_data_count => AXIS_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_wr_data_count => AXIS_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_rd_data_count => AXIS_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_sbiterr => AXIS_SBITERR, -- : OUT std_logic; axis_dbiterr => AXIS_DBITERR, -- : OUT std_logic; axis_overflow => AXIS_OVERFLOW, -- : OUT std_logic; axis_underflow => AXIS_UNDERFLOW, -- : OUT std_logic axis_prog_full => AXIS_PROG_FULL, -- : OUT STD_LOGIC := '0'; axis_prog_empty => AXIS_PROG_EMPTY -- : OUT STD_LOGIC := '1'; ); end implementation;
------------------------------------------------------------------------------- -- basic_sfifo_fg.vhd ------------------------------------------------------------------------------- -- -- ************************************************************************* -- -- (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- ************************************************************************* -- ------------------------------------------------------------------------------- -- Filename: basic_sfifo_fg.vhd -- -- Description: -- This HDL file implements a basic synchronous (single clock) fifo using the -- FIFO Generator tool. It is intended to offer a simple interface to the user -- with the complexity of the FIFO Generator interface hidden from the user. -- -- Note that in normal op mode (not First Word Fall Through FWFT) the data count -- output goes to zero when the FIFO goes full. This the way FIFO Generator works. -- -- -- VHDL-Standard: VHDL'93 ------------------------------------------------------------------------------- -- Structure: -- basic_sfifo_fg.vhd -- | -- |-- fifo_generator_v8_2 -- ------------------------------------------------------------------------------- -- Revision History: -- -- -- Author: DET -- Revision: $Revision: 1.0 $ -- Date: $3/07/2011$ -- -- History: -- DET 3/07/2011 Initial Version -- ------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library fifo_generator_v11_0; use fifo_generator_v11_0.all; library proc_common_v4_0; use proc_common_v4_0.proc_common_pkg.all; use proc_common_v4_0.proc_common_pkg.log2; --use proc_common_v4_0.coregen_comp_defs.all; -- synopsys translate_off --library XilinxCoreLib; --use XilinxCoreLib.all; -- synopsys translate_on ------------------------------------------------------------------------------- entity basic_sfifo_fg is generic ( C_DWIDTH : Integer := 32 ; -- FIFO data Width (Read and write data ports are symetric) C_DEPTH : Integer := 512 ; -- FIFO Depth (set to power of 2) C_HAS_DATA_COUNT : integer := 1 ; -- 0 = Data Count output not needed -- 1 = Data Count output needed C_DATA_COUNT_WIDTH : integer := 10 ; -- Data Count bit width (Max value is log2(C_DEPTH)) C_IMPLEMENTATION_TYPE : integer range 0 to 1 := 0; -- 0 = Common Clock BRAM / Distributed RAM (Synchronous FIFO) -- 1 = Common Clock Shift Register (Synchronous FIFO) C_MEMORY_TYPE : integer := 1; -- 0 = Any -- 1 = BRAM -- 2 = Distributed Memory -- 3 = Shift Registers C_PRELOAD_REGS : integer := 1; -- 0 = normal -- 1 = FWFT C_PRELOAD_LATENCY : integer := 0; -- 0 = FWFT -- 1 = normal C_USE_FWFT_DATA_COUNT : integer := 0; -- 0 = normal -- 1 for FWFT C_SYNCHRONIZER_STAGE : integer := 2; -- valid values are 0 to 8; C_FAMILY : string := "virtex6" ); port ( CLK : IN std_logic := '0'; DIN : IN std_logic_vector(C_DWIDTH-1 DOWNTO 0) := (OTHERS => '0'); RD_EN : IN std_logic := '0'; SRST : IN std_logic := '0'; WR_EN : IN std_logic := '0'; DATA_COUNT : OUT std_logic_vector(C_DATA_COUNT_WIDTH-1 DOWNTO 0); DOUT : OUT std_logic_vector(C_DWIDTH-1 DOWNTO 0); EMPTY : OUT std_logic; FULL : OUT std_logic ); end entity basic_sfifo_fg; architecture implementation of basic_sfifo_fg is -- Constant Declarations ---------------------------------------------- Constant POINTER_WIDTH : integer := log2(C_DEPTH); -- Constant zeros for programmable threshold inputs signal PROG_RDTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); signal PROG_WRTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- Signals --Signals added to fix MTI and XSIM issues caused by fix for VCS issues not to use "LIBRARY_SCAN = TRUE" signal ALMOST_FULL : std_logic; signal WR_ACK : std_logic; signal OVERFLOW : std_logic; signal VALID : std_logic; signal UNDERFLOW : std_logic; signal ALMOST_EMPTY : std_logic; signal RD_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal WR_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal PROG_FULL : std_logic; signal PROG_EMPTY : std_logic; signal SBITERR : std_logic; signal DBITERR : std_logic; signal S_AXI_AWREADY : std_logic; signal S_AXI_WREADY : std_logic; signal S_AXI_BID : std_logic_vector(3 DOWNTO 0); signal S_AXI_BRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_BUSER : std_logic_vector(0 downto 0); signal S_AXI_BVALID : std_logic; -- AXI Full/Lite Master Write Channel (Read side) signal M_AXI_AWID : std_logic_vector(3 DOWNTO 0); signal M_AXI_AWADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_AWLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_AWSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWUSER : std_logic_vector(0 downto 0); signal M_AXI_AWVALID : std_logic; signal M_AXI_WID : std_logic_vector(3 DOWNTO 0); signal M_AXI_WDATA : std_logic_vector(63 DOWNTO 0); signal M_AXI_WSTRB : std_logic_vector(7 DOWNTO 0); signal M_AXI_WLAST : std_logic; signal M_AXI_WUSER : std_logic_vector(0 downto 0); signal M_AXI_WVALID : std_logic; signal M_AXI_BREADY : std_logic; -- AXI Full/Lite Slave Read Channel (Write side) signal S_AXI_ARREADY : std_logic; signal S_AXI_RID : std_logic_vector(3 DOWNTO 0); signal S_AXI_RDATA : std_logic_vector(63 DOWNTO 0); signal S_AXI_RRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_RLAST : std_logic; signal S_AXI_RUSER : std_logic_vector(0 downto 0); signal S_AXI_RVALID : std_logic; -- AXI Full/Lite Master Read Channel (Read side) signal M_AXI_ARID : std_logic_vector(3 DOWNTO 0); signal M_AXI_ARADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_ARLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_ARSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARUSER : std_logic_vector(0 downto 0); signal M_AXI_ARVALID : std_logic; signal M_AXI_RREADY : std_logic; -- AXI Streaming Slave Signals (Write side) signal S_AXIS_TREADY : std_logic; -- AXI Streaming Master Signals (Read side) signal M_AXIS_TVALID : std_logic; signal M_AXIS_TDATA : std_logic_vector(63 DOWNTO 0); signal M_AXIS_TSTRB : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TKEEP : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TLAST : std_logic; signal M_AXIS_TID : std_logic_vector(7 DOWNTO 0); signal M_AXIS_TDEST : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TUSER : std_logic_vector(3 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals signal AXI_AW_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_SBITERR : std_logic; signal AXI_AW_DBITERR : std_logic; signal AXI_AW_OVERFLOW : std_logic; signal AXI_AW_UNDERFLOW : std_logic; signal AXI_AW_PROG_FULL : STD_LOGIC; signal AXI_AW_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Data Channel Signals signal AXI_W_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_SBITERR : std_logic; signal AXI_W_DBITERR : std_logic; signal AXI_W_OVERFLOW : std_logic; signal AXI_W_UNDERFLOW : std_logic; signal AXI_W_PROG_FULL : STD_LOGIC; signal AXI_W_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Response Channel Signals signal AXI_B_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_SBITERR : std_logic; signal AXI_B_DBITERR : std_logic; signal AXI_B_OVERFLOW : std_logic; signal AXI_B_UNDERFLOW : std_logic; signal AXI_B_PROG_FULL : STD_LOGIC; signal AXI_B_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Address Channel Signals signal AXI_AR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_SBITERR : std_logic; signal AXI_AR_DBITERR : std_logic; signal AXI_AR_OVERFLOW : std_logic; signal AXI_AR_UNDERFLOW : std_logic; signal AXI_AR_PROG_FULL : STD_LOGIC; signal AXI_AR_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Data Channel Signals signal AXI_R_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_SBITERR : std_logic; signal AXI_R_DBITERR : std_logic; signal AXI_R_OVERFLOW : std_logic; signal AXI_R_UNDERFLOW : std_logic; signal AXI_R_PROG_FULL : STD_LOGIC; signal AXI_R_PROG_EMPTY : STD_LOGIC; -- AXI Streaming FIFO Related Signals signal AXIS_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_SBITERR : std_logic; signal AXIS_DBITERR : std_logic; signal AXIS_OVERFLOW : std_logic; signal AXIS_UNDERFLOW : std_logic; signal AXIS_PROG_FULL : STD_LOGIC; signal AXIS_PROG_EMPTY : STD_LOGIC; begin --(architecture implementation) ------------------------------------------------------------------------------- -- Instantiate the generalized FIFO Generator instance -- -- NOTE: -- DO NOT CHANGE TO DIRECT ENTITY INSTANTIATION!!! -- This is a Coregen FIFO Generator Call module for -- BRAM implementations of a basic Sync FIFO -- ------------------------------------------------------------------------------- I_BASIC_SFIFO : entity fifo_generator_v11_0.fifo_generator_v11_0 generic map( C_COMMON_CLOCK => 1, C_COUNT_TYPE => 0, C_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_DEFAULT_VALUE => "BlankString", C_DIN_WIDTH => C_DWIDTH, C_DOUT_RST_VAL => "0", C_DOUT_WIDTH => C_DWIDTH, C_ENABLE_RLOCS => 0, -- n0 C_FAMILY => C_FAMILY, C_HAS_ALMOST_EMPTY => 0, -- n0 C_HAS_ALMOST_FULL => 0, -- n0 C_HAS_BACKUP => 0, -- n0 C_HAS_DATA_COUNT => C_HAS_DATA_COUNT, C_HAS_MEMINIT_FILE => 0, -- n0 C_HAS_OVERFLOW => 0, -- n0 C_HAS_RD_DATA_COUNT => 0, -- n0 C_HAS_RD_RST => 0, -- n0 C_HAS_RST => 0, -- n0 C_HAS_SRST => 1, -- yes C_HAS_UNDERFLOW => 0, -- n0 C_HAS_VALID => 0, -- n0 C_HAS_WR_ACK => 0, -- n0 C_HAS_WR_DATA_COUNT => 0, -- n0 C_HAS_WR_RST => 0, -- n0 C_IMPLEMENTATION_TYPE => 0, -- Common clock BRAM C_INIT_WR_PNTR_VAL => 0, C_MEMORY_TYPE => C_MEMORY_TYPE, C_MIF_FILE_NAME => "BlankString", C_OPTIMIZATION_MODE => 0, C_OVERFLOW_LOW => 0, C_PRELOAD_LATENCY => C_PRELOAD_LATENCY, C_PRELOAD_REGS => C_PRELOAD_REGS, C_PRIM_FIFO_TYPE => "512x36", C_PROG_EMPTY_THRESH_ASSERT_VAL => 0, C_PROG_EMPTY_THRESH_NEGATE_VAL => 0, C_PROG_EMPTY_TYPE => 0, C_PROG_FULL_THRESH_ASSERT_VAL => 0, C_PROG_FULL_THRESH_NEGATE_VAL => 0, C_PROG_FULL_TYPE => 0, C_RD_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_RD_DEPTH => C_DEPTH, C_RD_FREQ => 1, C_RD_PNTR_WIDTH => POINTER_WIDTH, C_UNDERFLOW_LOW => 0, C_USE_DOUT_RST => 1, C_USE_EMBEDDED_REG => 0, C_USE_FIFO16_FLAGS => 0, C_USE_FWFT_DATA_COUNT => C_USE_FWFT_DATA_COUNT, C_VALID_LOW => 0, C_WR_ACK_LOW => 0, C_WR_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_WR_DEPTH => C_DEPTH, C_WR_FREQ => 1, C_WR_PNTR_WIDTH => POINTER_WIDTH, C_WR_RESPONSE_LATENCY => 1, C_USE_ECC => 0, C_FULL_FLAGS_RST_VAL => 0, C_ENABLE_RST_SYNC => 1, C_ERROR_INJECTION_TYPE => 0, C_SYNCHRONIZER_STAGE => C_SYNCHRONIZER_STAGE, C_HAS_INT_CLK => 0, C_MSGON_VAL => 1, -- AXI Interface related parameters start here C_INTERFACE_TYPE => 0, -- : integer := 0; -- 0: Native Interface; 1: AXI Interface C_AXI_TYPE => 0, -- : integer := 0; -- 0: AXI Stream; 1: AXI Full; 2: AXI Lite C_HAS_AXI_WR_CHANNEL => 0, -- : integer := 0; C_HAS_AXI_RD_CHANNEL => 0, -- : integer := 0; C_HAS_SLAVE_CE => 0, -- : integer := 0; C_HAS_MASTER_CE => 0, -- : integer := 0; C_ADD_NGC_CONSTRAINT => 0, -- : integer := 0; C_USE_COMMON_OVERFLOW => 0, -- : integer := 0; C_USE_COMMON_UNDERFLOW => 0, -- : integer := 0; C_USE_DEFAULT_SETTINGS => 0, -- : integer := 0; -- AXI Full/Lite C_AXI_ID_WIDTH => 4 , -- : integer := 0; C_AXI_ADDR_WIDTH => 32, -- : integer := 0; C_AXI_DATA_WIDTH => 64, -- : integer := 0; C_AXI_LEN_WIDTH => 8, -- : integer := 8; C_AXI_LOCK_WIDTH => 2, -- : integer := 2; C_HAS_AXI_ID => 0, -- : integer := 0; C_HAS_AXI_AWUSER => 0 , -- : integer := 0; C_HAS_AXI_WUSER => 0 , -- : integer := 0; C_HAS_AXI_BUSER => 0 , -- : integer := 0; C_HAS_AXI_ARUSER => 0 , -- : integer := 0; C_HAS_AXI_RUSER => 0 , -- : integer := 0; C_AXI_ARUSER_WIDTH => 1 , -- : integer := 0; C_AXI_AWUSER_WIDTH => 1 , -- : integer := 0; C_AXI_WUSER_WIDTH => 1 , -- : integer := 0; C_AXI_BUSER_WIDTH => 1 , -- : integer := 0; C_AXI_RUSER_WIDTH => 1 , -- : integer := 0; -- AXI Streaming C_HAS_AXIS_TDATA => 0 , -- : integer := 0; C_HAS_AXIS_TID => 0 , -- : integer := 0; C_HAS_AXIS_TDEST => 0 , -- : integer := 0; C_HAS_AXIS_TUSER => 0 , -- : integer := 0; C_HAS_AXIS_TREADY => 1 , -- : integer := 0; C_HAS_AXIS_TLAST => 0 , -- : integer := 0; C_HAS_AXIS_TSTRB => 0 , -- : integer := 0; C_HAS_AXIS_TKEEP => 0 , -- : integer := 0; C_AXIS_TDATA_WIDTH => 64, -- : integer := 1; C_AXIS_TID_WIDTH => 8 , -- : integer := 1; C_AXIS_TDEST_WIDTH => 4 , -- : integer := 1; C_AXIS_TUSER_WIDTH => 4 , -- : integer := 1; C_AXIS_TSTRB_WIDTH => 4 , -- : integer := 1; C_AXIS_TKEEP_WIDTH => 4 , -- : integer := 1; -- AXI Channel Type -- WACH --> Write Address Channel -- WDCH --> Write Data Channel -- WRCH --> Write Response Channel -- RACH --> Read Address Channel -- RDCH --> Read Data Channel -- AXIS --> AXI Streaming C_WACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logic C_WDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_WRCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_AXIS_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie -- AXI Implementation Type -- 1 = Common Clock Block RAM FIFO -- 2 = Common Clock Distributed RAM FIFO -- 11 = Independent Clock Block RAM FIFO -- 12 = Independent Clock Distributed RAM FIFO C_IMPLEMENTATION_TYPE_WACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WRCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_AXIS => 1, -- : integer := 0; -- AXI FIFO Type -- 0 = Data FIFO -- 1 = Packet FIFO -- 2 = Low Latency Data FIFO C_APPLICATION_TYPE_WACH => 0, -- : integer := 0; C_APPLICATION_TYPE_WDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_WRCH => 0, -- : integer := 0; C_APPLICATION_TYPE_RACH => 0, -- : integer := 0; C_APPLICATION_TYPE_RDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_AXIS => 0, -- : integer := 0; -- Enable ECC -- 0 = ECC disabled -- 1 = ECC enabled C_USE_ECC_WACH => 0, -- : integer := 0; C_USE_ECC_WDCH => 0, -- : integer := 0; C_USE_ECC_WRCH => 0, -- : integer := 0; C_USE_ECC_RACH => 0, -- : integer := 0; C_USE_ECC_RDCH => 0, -- : integer := 0; C_USE_ECC_AXIS => 0, -- : integer := 0; -- ECC Error Injection Type -- 0 = No Error Injection -- 1 = Single Bit Error Injection -- 2 = Double Bit Error Injection -- 3 = Single Bit and Double Bit Error Injection C_ERROR_INJECTION_TYPE_WACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WRCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_AXIS => 0, -- : integer := 0; -- Input Data Width -- Accumulation of all AXI input signal's width C_DIN_WIDTH_WACH => 32, -- : integer := 1; C_DIN_WIDTH_WDCH => 64, -- : integer := 1; C_DIN_WIDTH_WRCH => 2 , -- : integer := 1; C_DIN_WIDTH_RACH => 32, -- : integer := 1; C_DIN_WIDTH_RDCH => 64, -- : integer := 1; C_DIN_WIDTH_AXIS => 1 , -- : integer := 1; C_WR_DEPTH_WACH => 16 , -- : integer := 16; C_WR_DEPTH_WDCH => 1024, -- : integer := 16; C_WR_DEPTH_WRCH => 16 , -- : integer := 16; C_WR_DEPTH_RACH => 16 , -- : integer := 16; C_WR_DEPTH_RDCH => 1024, -- : integer := 16; C_WR_DEPTH_AXIS => 1024, -- : integer := 16; C_WR_PNTR_WIDTH_WACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_WDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_WRCH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_AXIS => 10, -- : integer := 4; C_HAS_DATA_COUNTS_WACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WRCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_AXIS => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WRCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_AXIS => 0, -- : integer := 0; C_PROG_FULL_TYPE_WACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WRCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_AXIS => 1023, -- : integer := 0; C_PROG_EMPTY_TYPE_WACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS => 1022, -- : integer := 0; C_REG_SLICE_MODE_WACH => 0, -- : integer := 0; C_REG_SLICE_MODE_WDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_WRCH => 0, -- : integer := 0; C_REG_SLICE_MODE_RACH => 0, -- : integer := 0; C_REG_SLICE_MODE_RDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_AXIS => 0 -- : integer := 0 ) port map( backup => '0', backup_marker => '0', clk => CLK, rst => '0', srst => SRST, wr_clk => '0', wr_rst => '0', rd_clk => '0', rd_rst => '0', din => DIN, -- uses this one wr_en => WR_EN, -- uses this one rd_en => RD_EN, -- uses this one prog_empty_thresh => PROG_RDTHRESH_ZEROS, prog_empty_thresh_assert => PROG_RDTHRESH_ZEROS, prog_empty_thresh_negate => PROG_RDTHRESH_ZEROS, prog_full_thresh => PROG_WRTHRESH_ZEROS, prog_full_thresh_assert => PROG_WRTHRESH_ZEROS, prog_full_thresh_negate => PROG_WRTHRESH_ZEROS, int_clk => '0', injectdbiterr => '0', injectsbiterr => '0', dout => DOUT, -- uses this one full => FULL, -- uses this one almost_full => ALMOST_FULL, wr_ack => WR_ACK, overflow => OVERFLOW, empty => EMPTY, -- uses this one almost_empty => ALMOST_EMPTY, valid => VALID, underflow => UNDERFLOW, data_count => DATA_COUNT, -- uses this one rd_data_count => RD_DATA_COUNT, wr_data_count => WR_DATA_COUNT, prog_full => PROG_FULL, prog_empty => PROG_EMPTY, sbiterr => SBITERR, dbiterr => DBITERR, -- AXI Global Signal m_aclk => '0', -- : IN std_logic := '0'; s_aclk => '0', -- : IN std_logic := '0'; s_aresetn => '0', -- : IN std_logic := '0'; m_aclk_en => '0', -- : IN std_logic := '0'; s_aclk_en => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Slave Write Channel (write side) s_axi_awid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awaddr => "00000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlen => "00000000", --(others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awsize => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awburst => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlock => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awcache => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awprot => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awqos => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awregion => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awvalid => '0', -- : IN std_logic := '0'; s_axi_awready => S_AXI_AWREADY, -- : OUT std_logic; s_axi_wid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wstrb => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wlast => '0', -- : IN std_logic := '0'; s_axi_wuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wvalid => '0', -- : IN std_logic := '0'; s_axi_wready => S_AXI_WREADY, -- : OUT std_logic; s_axi_bid => S_AXI_BID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_bresp => S_AXI_BRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_buser => S_AXI_BUSER, -- : OUT std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0); s_axi_bvalid => S_AXI_BVALID, -- : OUT std_logic; s_axi_bready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Write Channel (Read side) m_axi_awid => M_AXI_AWID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_awaddr => M_AXI_AWADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_awlen => M_AXI_AWLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_awsize => M_AXI_AWSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awburst => M_AXI_AWBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awlock => M_AXI_AWLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awcache => M_AXI_AWCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awprot => M_AXI_AWPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awqos => M_AXI_AWQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awregion => M_AXI_AWREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awuser => M_AXI_AWUSER, -- : OUT std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0); m_axi_awvalid => M_AXI_AWVALID, -- : OUT std_logic; m_axi_awready => '0', -- : IN std_logic := '0'; m_axi_wid => M_AXI_WID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_wdata => M_AXI_WDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); m_axi_wstrb => M_AXI_WSTRB, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0); m_axi_wlast => M_AXI_WLAST, -- : OUT std_logic; m_axi_wuser => M_AXI_WUSER, -- : OUT std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0); m_axi_wvalid => M_AXI_WVALID, -- : OUT std_logic; m_axi_wready => '0', -- : IN std_logic := '0'; m_axi_bid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_buser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bvalid => '0', -- : IN std_logic := '0'; m_axi_bready => M_AXI_BREADY, -- : OUT std_logic; -- AXI Full/Lite Slave Read Channel (Write side) s_axi_arid => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_araddr => "00000000000000000000000000000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlen => "00000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arsize => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arburst => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlock => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arcache => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arprot => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arqos => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arregion => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_aruser => "0", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arvalid => '0', -- : IN std_logic := '0'; s_axi_arready => S_AXI_ARREADY, -- : OUT std_logic; s_axi_rid => S_AXI_RID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); s_axi_rdata => S_AXI_RDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); s_axi_rresp => S_AXI_RRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_rlast => S_AXI_RLAST, -- : OUT std_logic; s_axi_ruser => S_AXI_RUSER, -- : OUT std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0); s_axi_rvalid => S_AXI_RVALID, -- : OUT std_logic; s_axi_rready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Read Channel (Read side) m_axi_arid => M_AXI_ARID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_araddr => M_AXI_ARADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_arlen => M_AXI_ARLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_arsize => M_AXI_ARSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arburst => M_AXI_ARBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arlock => M_AXI_ARLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arcache => M_AXI_ARCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arprot => M_AXI_ARPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arqos => M_AXI_ARQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arregion => M_AXI_ARREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_aruser => M_AXI_ARUSER, -- : OUT std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0); m_axi_arvalid => M_AXI_ARVALID, -- : OUT std_logic; m_axi_arready => '0', -- : IN std_logic := '0'; m_axi_rid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rlast => '0', -- : IN std_logic := '0'; m_axi_ruser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rvalid => '0', -- : IN std_logic := '0'; m_axi_rready => M_AXI_RREADY, -- : OUT std_logic; -- AXI Streaming Slave Signals (Write side) s_axis_tvalid => '0', -- : IN std_logic := '0'; s_axis_tready => S_AXIS_TREADY, -- : OUT std_logic; s_axis_tdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tstrb => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tkeep => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tlast => '0', -- : IN std_logic := '0'; s_axis_tid => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tdest => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tuser => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- AXI Streaming Master Signals (Read side) m_axis_tvalid => M_AXIS_TVALID, -- : OUT std_logic; m_axis_tready => '0', -- : IN std_logic := '0'; m_axis_tdata => M_AXIS_TDATA, -- : OUT std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0); m_axis_tstrb => M_AXIS_TSTRB, -- : OUT std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0); m_axis_tkeep => M_AXIS_TKEEP, -- : OUT std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0); m_axis_tlast => M_AXIS_TLAST, -- : OUT std_logic; m_axis_tid => M_AXIS_TID, -- : OUT std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0); m_axis_tdest => M_AXIS_TDEST, -- : OUT std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0); m_axis_tuser => M_AXIS_TUSER, -- : OUT std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals axi_aw_injectsbiterr => '0', -- : IN std_logic := '0'; axi_aw_injectdbiterr => '0', -- : IN std_logic := '0'; axi_aw_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_data_count => AXI_AW_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_wr_data_count => AXI_AW_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_rd_data_count => AXI_AW_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_sbiterr => AXI_AW_SBITERR, -- : OUT std_logic; axi_aw_dbiterr => AXI_AW_DBITERR, -- : OUT std_logic; axi_aw_overflow => AXI_AW_OVERFLOW, -- : OUT std_logic; axi_aw_underflow => AXI_AW_UNDERFLOW, -- : OUT std_logic; axi_aw_prog_full => AXI_AW_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_aw_prog_empty => AXI_AW_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Data Channel Signals axi_w_injectsbiterr => '0', -- : IN std_logic := '0'; axi_w_injectdbiterr => '0', -- : IN std_logic := '0'; axi_w_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_data_count => AXI_W_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_wr_data_count => AXI_W_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_rd_data_count => AXI_W_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_sbiterr => AXI_W_SBITERR, -- : OUT std_logic; axi_w_dbiterr => AXI_W_DBITERR, -- : OUT std_logic; axi_w_overflow => AXI_W_OVERFLOW, -- : OUT std_logic; axi_w_underflow => AXI_W_UNDERFLOW, -- : OUT std_logic; axi_w_prog_full => AXI_W_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_w_prog_empty => AXI_W_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Response Channel Signals axi_b_injectsbiterr => '0', -- : IN std_logic := '0'; axi_b_injectdbiterr => '0', -- : IN std_logic := '0'; axi_b_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_data_count => AXI_B_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_wr_data_count => AXI_B_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_rd_data_count => AXI_B_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_sbiterr => AXI_B_SBITERR, -- : OUT std_logic; axi_b_dbiterr => AXI_B_DBITERR, -- : OUT std_logic; axi_b_overflow => AXI_B_OVERFLOW, -- : OUT std_logic; axi_b_underflow => AXI_B_UNDERFLOW, -- : OUT std_logic; axi_b_prog_full => AXI_B_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_b_prog_empty => AXI_B_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Address Channel Signals axi_ar_injectsbiterr => '0', -- : IN std_logic := '0'; axi_ar_injectdbiterr => '0', -- : IN std_logic := '0'; axi_ar_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_data_count => AXI_AR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_wr_data_count => AXI_AR_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_rd_data_count => AXI_AR_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_sbiterr => AXI_AR_SBITERR, -- : OUT std_logic; axi_ar_dbiterr => AXI_AR_DBITERR, -- : OUT std_logic; axi_ar_overflow => AXI_AR_OVERFLOW, -- : OUT std_logic; axi_ar_underflow => AXI_AR_UNDERFLOW, -- : OUT std_logic; axi_ar_prog_full => AXI_AR_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_ar_prog_empty => AXI_AR_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Data Channel Signals axi_r_injectsbiterr => '0', -- : IN std_logic := '0'; axi_r_injectdbiterr => '0', -- : IN std_logic := '0'; axi_r_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_data_count => AXI_R_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_wr_data_count => AXI_R_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_rd_data_count => AXI_R_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_sbiterr => AXI_R_SBITERR, -- : OUT std_logic; axi_r_dbiterr => AXI_R_DBITERR, -- : OUT std_logic; axi_r_overflow => AXI_R_OVERFLOW, -- : OUT std_logic; axi_r_underflow => AXI_R_UNDERFLOW, -- : OUT std_logic; axi_r_prog_full => AXI_R_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_r_prog_empty => AXI_R_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Streaming FIFO Related Signals axis_injectsbiterr => '0', -- : IN std_logic := '0'; axis_injectdbiterr => '0', -- : IN std_logic := '0'; axis_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_data_count => AXIS_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_wr_data_count => AXIS_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_rd_data_count => AXIS_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_sbiterr => AXIS_SBITERR, -- : OUT std_logic; axis_dbiterr => AXIS_DBITERR, -- : OUT std_logic; axis_overflow => AXIS_OVERFLOW, -- : OUT std_logic; axis_underflow => AXIS_UNDERFLOW, -- : OUT std_logic axis_prog_full => AXIS_PROG_FULL, -- : OUT STD_LOGIC := '0'; axis_prog_empty => AXIS_PROG_EMPTY -- : OUT STD_LOGIC := '1'; ); end implementation;
------------------------------------------------------------------------------- -- basic_sfifo_fg.vhd ------------------------------------------------------------------------------- -- -- ************************************************************************* -- -- (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- ************************************************************************* -- ------------------------------------------------------------------------------- -- Filename: basic_sfifo_fg.vhd -- -- Description: -- This HDL file implements a basic synchronous (single clock) fifo using the -- FIFO Generator tool. It is intended to offer a simple interface to the user -- with the complexity of the FIFO Generator interface hidden from the user. -- -- Note that in normal op mode (not First Word Fall Through FWFT) the data count -- output goes to zero when the FIFO goes full. This the way FIFO Generator works. -- -- -- VHDL-Standard: VHDL'93 ------------------------------------------------------------------------------- -- Structure: -- basic_sfifo_fg.vhd -- | -- |-- fifo_generator_v8_2 -- ------------------------------------------------------------------------------- -- Revision History: -- -- -- Author: DET -- Revision: $Revision: 1.0 $ -- Date: $3/07/2011$ -- -- History: -- DET 3/07/2011 Initial Version -- ------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library fifo_generator_v11_0; use fifo_generator_v11_0.all; library proc_common_v4_0; use proc_common_v4_0.proc_common_pkg.all; use proc_common_v4_0.proc_common_pkg.log2; --use proc_common_v4_0.coregen_comp_defs.all; -- synopsys translate_off --library XilinxCoreLib; --use XilinxCoreLib.all; -- synopsys translate_on ------------------------------------------------------------------------------- entity basic_sfifo_fg is generic ( C_DWIDTH : Integer := 32 ; -- FIFO data Width (Read and write data ports are symetric) C_DEPTH : Integer := 512 ; -- FIFO Depth (set to power of 2) C_HAS_DATA_COUNT : integer := 1 ; -- 0 = Data Count output not needed -- 1 = Data Count output needed C_DATA_COUNT_WIDTH : integer := 10 ; -- Data Count bit width (Max value is log2(C_DEPTH)) C_IMPLEMENTATION_TYPE : integer range 0 to 1 := 0; -- 0 = Common Clock BRAM / Distributed RAM (Synchronous FIFO) -- 1 = Common Clock Shift Register (Synchronous FIFO) C_MEMORY_TYPE : integer := 1; -- 0 = Any -- 1 = BRAM -- 2 = Distributed Memory -- 3 = Shift Registers C_PRELOAD_REGS : integer := 1; -- 0 = normal -- 1 = FWFT C_PRELOAD_LATENCY : integer := 0; -- 0 = FWFT -- 1 = normal C_USE_FWFT_DATA_COUNT : integer := 0; -- 0 = normal -- 1 for FWFT C_SYNCHRONIZER_STAGE : integer := 2; -- valid values are 0 to 8; C_FAMILY : string := "virtex6" ); port ( CLK : IN std_logic := '0'; DIN : IN std_logic_vector(C_DWIDTH-1 DOWNTO 0) := (OTHERS => '0'); RD_EN : IN std_logic := '0'; SRST : IN std_logic := '0'; WR_EN : IN std_logic := '0'; DATA_COUNT : OUT std_logic_vector(C_DATA_COUNT_WIDTH-1 DOWNTO 0); DOUT : OUT std_logic_vector(C_DWIDTH-1 DOWNTO 0); EMPTY : OUT std_logic; FULL : OUT std_logic ); end entity basic_sfifo_fg; architecture implementation of basic_sfifo_fg is -- Constant Declarations ---------------------------------------------- Constant POINTER_WIDTH : integer := log2(C_DEPTH); -- Constant zeros for programmable threshold inputs signal PROG_RDTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); signal PROG_WRTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- Signals --Signals added to fix MTI and XSIM issues caused by fix for VCS issues not to use "LIBRARY_SCAN = TRUE" signal ALMOST_FULL : std_logic; signal WR_ACK : std_logic; signal OVERFLOW : std_logic; signal VALID : std_logic; signal UNDERFLOW : std_logic; signal ALMOST_EMPTY : std_logic; signal RD_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal WR_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal PROG_FULL : std_logic; signal PROG_EMPTY : std_logic; signal SBITERR : std_logic; signal DBITERR : std_logic; signal S_AXI_AWREADY : std_logic; signal S_AXI_WREADY : std_logic; signal S_AXI_BID : std_logic_vector(3 DOWNTO 0); signal S_AXI_BRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_BUSER : std_logic_vector(0 downto 0); signal S_AXI_BVALID : std_logic; -- AXI Full/Lite Master Write Channel (Read side) signal M_AXI_AWID : std_logic_vector(3 DOWNTO 0); signal M_AXI_AWADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_AWLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_AWSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWUSER : std_logic_vector(0 downto 0); signal M_AXI_AWVALID : std_logic; signal M_AXI_WID : std_logic_vector(3 DOWNTO 0); signal M_AXI_WDATA : std_logic_vector(63 DOWNTO 0); signal M_AXI_WSTRB : std_logic_vector(7 DOWNTO 0); signal M_AXI_WLAST : std_logic; signal M_AXI_WUSER : std_logic_vector(0 downto 0); signal M_AXI_WVALID : std_logic; signal M_AXI_BREADY : std_logic; -- AXI Full/Lite Slave Read Channel (Write side) signal S_AXI_ARREADY : std_logic; signal S_AXI_RID : std_logic_vector(3 DOWNTO 0); signal S_AXI_RDATA : std_logic_vector(63 DOWNTO 0); signal S_AXI_RRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_RLAST : std_logic; signal S_AXI_RUSER : std_logic_vector(0 downto 0); signal S_AXI_RVALID : std_logic; -- AXI Full/Lite Master Read Channel (Read side) signal M_AXI_ARID : std_logic_vector(3 DOWNTO 0); signal M_AXI_ARADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_ARLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_ARSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARUSER : std_logic_vector(0 downto 0); signal M_AXI_ARVALID : std_logic; signal M_AXI_RREADY : std_logic; -- AXI Streaming Slave Signals (Write side) signal S_AXIS_TREADY : std_logic; -- AXI Streaming Master Signals (Read side) signal M_AXIS_TVALID : std_logic; signal M_AXIS_TDATA : std_logic_vector(63 DOWNTO 0); signal M_AXIS_TSTRB : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TKEEP : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TLAST : std_logic; signal M_AXIS_TID : std_logic_vector(7 DOWNTO 0); signal M_AXIS_TDEST : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TUSER : std_logic_vector(3 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals signal AXI_AW_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_SBITERR : std_logic; signal AXI_AW_DBITERR : std_logic; signal AXI_AW_OVERFLOW : std_logic; signal AXI_AW_UNDERFLOW : std_logic; signal AXI_AW_PROG_FULL : STD_LOGIC; signal AXI_AW_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Data Channel Signals signal AXI_W_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_SBITERR : std_logic; signal AXI_W_DBITERR : std_logic; signal AXI_W_OVERFLOW : std_logic; signal AXI_W_UNDERFLOW : std_logic; signal AXI_W_PROG_FULL : STD_LOGIC; signal AXI_W_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Response Channel Signals signal AXI_B_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_SBITERR : std_logic; signal AXI_B_DBITERR : std_logic; signal AXI_B_OVERFLOW : std_logic; signal AXI_B_UNDERFLOW : std_logic; signal AXI_B_PROG_FULL : STD_LOGIC; signal AXI_B_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Address Channel Signals signal AXI_AR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_SBITERR : std_logic; signal AXI_AR_DBITERR : std_logic; signal AXI_AR_OVERFLOW : std_logic; signal AXI_AR_UNDERFLOW : std_logic; signal AXI_AR_PROG_FULL : STD_LOGIC; signal AXI_AR_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Data Channel Signals signal AXI_R_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_SBITERR : std_logic; signal AXI_R_DBITERR : std_logic; signal AXI_R_OVERFLOW : std_logic; signal AXI_R_UNDERFLOW : std_logic; signal AXI_R_PROG_FULL : STD_LOGIC; signal AXI_R_PROG_EMPTY : STD_LOGIC; -- AXI Streaming FIFO Related Signals signal AXIS_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_SBITERR : std_logic; signal AXIS_DBITERR : std_logic; signal AXIS_OVERFLOW : std_logic; signal AXIS_UNDERFLOW : std_logic; signal AXIS_PROG_FULL : STD_LOGIC; signal AXIS_PROG_EMPTY : STD_LOGIC; begin --(architecture implementation) ------------------------------------------------------------------------------- -- Instantiate the generalized FIFO Generator instance -- -- NOTE: -- DO NOT CHANGE TO DIRECT ENTITY INSTANTIATION!!! -- This is a Coregen FIFO Generator Call module for -- BRAM implementations of a basic Sync FIFO -- ------------------------------------------------------------------------------- I_BASIC_SFIFO : entity fifo_generator_v11_0.fifo_generator_v11_0 generic map( C_COMMON_CLOCK => 1, C_COUNT_TYPE => 0, C_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_DEFAULT_VALUE => "BlankString", C_DIN_WIDTH => C_DWIDTH, C_DOUT_RST_VAL => "0", C_DOUT_WIDTH => C_DWIDTH, C_ENABLE_RLOCS => 0, -- n0 C_FAMILY => C_FAMILY, C_HAS_ALMOST_EMPTY => 0, -- n0 C_HAS_ALMOST_FULL => 0, -- n0 C_HAS_BACKUP => 0, -- n0 C_HAS_DATA_COUNT => C_HAS_DATA_COUNT, C_HAS_MEMINIT_FILE => 0, -- n0 C_HAS_OVERFLOW => 0, -- n0 C_HAS_RD_DATA_COUNT => 0, -- n0 C_HAS_RD_RST => 0, -- n0 C_HAS_RST => 0, -- n0 C_HAS_SRST => 1, -- yes C_HAS_UNDERFLOW => 0, -- n0 C_HAS_VALID => 0, -- n0 C_HAS_WR_ACK => 0, -- n0 C_HAS_WR_DATA_COUNT => 0, -- n0 C_HAS_WR_RST => 0, -- n0 C_IMPLEMENTATION_TYPE => 0, -- Common clock BRAM C_INIT_WR_PNTR_VAL => 0, C_MEMORY_TYPE => C_MEMORY_TYPE, C_MIF_FILE_NAME => "BlankString", C_OPTIMIZATION_MODE => 0, C_OVERFLOW_LOW => 0, C_PRELOAD_LATENCY => C_PRELOAD_LATENCY, C_PRELOAD_REGS => C_PRELOAD_REGS, C_PRIM_FIFO_TYPE => "512x36", C_PROG_EMPTY_THRESH_ASSERT_VAL => 0, C_PROG_EMPTY_THRESH_NEGATE_VAL => 0, C_PROG_EMPTY_TYPE => 0, C_PROG_FULL_THRESH_ASSERT_VAL => 0, C_PROG_FULL_THRESH_NEGATE_VAL => 0, C_PROG_FULL_TYPE => 0, C_RD_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_RD_DEPTH => C_DEPTH, C_RD_FREQ => 1, C_RD_PNTR_WIDTH => POINTER_WIDTH, C_UNDERFLOW_LOW => 0, C_USE_DOUT_RST => 1, C_USE_EMBEDDED_REG => 0, C_USE_FIFO16_FLAGS => 0, C_USE_FWFT_DATA_COUNT => C_USE_FWFT_DATA_COUNT, C_VALID_LOW => 0, C_WR_ACK_LOW => 0, C_WR_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_WR_DEPTH => C_DEPTH, C_WR_FREQ => 1, C_WR_PNTR_WIDTH => POINTER_WIDTH, C_WR_RESPONSE_LATENCY => 1, C_USE_ECC => 0, C_FULL_FLAGS_RST_VAL => 0, C_ENABLE_RST_SYNC => 1, C_ERROR_INJECTION_TYPE => 0, C_SYNCHRONIZER_STAGE => C_SYNCHRONIZER_STAGE, C_HAS_INT_CLK => 0, C_MSGON_VAL => 1, -- AXI Interface related parameters start here C_INTERFACE_TYPE => 0, -- : integer := 0; -- 0: Native Interface; 1: AXI Interface C_AXI_TYPE => 0, -- : integer := 0; -- 0: AXI Stream; 1: AXI Full; 2: AXI Lite C_HAS_AXI_WR_CHANNEL => 0, -- : integer := 0; C_HAS_AXI_RD_CHANNEL => 0, -- : integer := 0; C_HAS_SLAVE_CE => 0, -- : integer := 0; C_HAS_MASTER_CE => 0, -- : integer := 0; C_ADD_NGC_CONSTRAINT => 0, -- : integer := 0; C_USE_COMMON_OVERFLOW => 0, -- : integer := 0; C_USE_COMMON_UNDERFLOW => 0, -- : integer := 0; C_USE_DEFAULT_SETTINGS => 0, -- : integer := 0; -- AXI Full/Lite C_AXI_ID_WIDTH => 4 , -- : integer := 0; C_AXI_ADDR_WIDTH => 32, -- : integer := 0; C_AXI_DATA_WIDTH => 64, -- : integer := 0; C_AXI_LEN_WIDTH => 8, -- : integer := 8; C_AXI_LOCK_WIDTH => 2, -- : integer := 2; C_HAS_AXI_ID => 0, -- : integer := 0; C_HAS_AXI_AWUSER => 0 , -- : integer := 0; C_HAS_AXI_WUSER => 0 , -- : integer := 0; C_HAS_AXI_BUSER => 0 , -- : integer := 0; C_HAS_AXI_ARUSER => 0 , -- : integer := 0; C_HAS_AXI_RUSER => 0 , -- : integer := 0; C_AXI_ARUSER_WIDTH => 1 , -- : integer := 0; C_AXI_AWUSER_WIDTH => 1 , -- : integer := 0; C_AXI_WUSER_WIDTH => 1 , -- : integer := 0; C_AXI_BUSER_WIDTH => 1 , -- : integer := 0; C_AXI_RUSER_WIDTH => 1 , -- : integer := 0; -- AXI Streaming C_HAS_AXIS_TDATA => 0 , -- : integer := 0; C_HAS_AXIS_TID => 0 , -- : integer := 0; C_HAS_AXIS_TDEST => 0 , -- : integer := 0; C_HAS_AXIS_TUSER => 0 , -- : integer := 0; C_HAS_AXIS_TREADY => 1 , -- : integer := 0; C_HAS_AXIS_TLAST => 0 , -- : integer := 0; C_HAS_AXIS_TSTRB => 0 , -- : integer := 0; C_HAS_AXIS_TKEEP => 0 , -- : integer := 0; C_AXIS_TDATA_WIDTH => 64, -- : integer := 1; C_AXIS_TID_WIDTH => 8 , -- : integer := 1; C_AXIS_TDEST_WIDTH => 4 , -- : integer := 1; C_AXIS_TUSER_WIDTH => 4 , -- : integer := 1; C_AXIS_TSTRB_WIDTH => 4 , -- : integer := 1; C_AXIS_TKEEP_WIDTH => 4 , -- : integer := 1; -- AXI Channel Type -- WACH --> Write Address Channel -- WDCH --> Write Data Channel -- WRCH --> Write Response Channel -- RACH --> Read Address Channel -- RDCH --> Read Data Channel -- AXIS --> AXI Streaming C_WACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logic C_WDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_WRCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_AXIS_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie -- AXI Implementation Type -- 1 = Common Clock Block RAM FIFO -- 2 = Common Clock Distributed RAM FIFO -- 11 = Independent Clock Block RAM FIFO -- 12 = Independent Clock Distributed RAM FIFO C_IMPLEMENTATION_TYPE_WACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WRCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_AXIS => 1, -- : integer := 0; -- AXI FIFO Type -- 0 = Data FIFO -- 1 = Packet FIFO -- 2 = Low Latency Data FIFO C_APPLICATION_TYPE_WACH => 0, -- : integer := 0; C_APPLICATION_TYPE_WDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_WRCH => 0, -- : integer := 0; C_APPLICATION_TYPE_RACH => 0, -- : integer := 0; C_APPLICATION_TYPE_RDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_AXIS => 0, -- : integer := 0; -- Enable ECC -- 0 = ECC disabled -- 1 = ECC enabled C_USE_ECC_WACH => 0, -- : integer := 0; C_USE_ECC_WDCH => 0, -- : integer := 0; C_USE_ECC_WRCH => 0, -- : integer := 0; C_USE_ECC_RACH => 0, -- : integer := 0; C_USE_ECC_RDCH => 0, -- : integer := 0; C_USE_ECC_AXIS => 0, -- : integer := 0; -- ECC Error Injection Type -- 0 = No Error Injection -- 1 = Single Bit Error Injection -- 2 = Double Bit Error Injection -- 3 = Single Bit and Double Bit Error Injection C_ERROR_INJECTION_TYPE_WACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WRCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_AXIS => 0, -- : integer := 0; -- Input Data Width -- Accumulation of all AXI input signal's width C_DIN_WIDTH_WACH => 32, -- : integer := 1; C_DIN_WIDTH_WDCH => 64, -- : integer := 1; C_DIN_WIDTH_WRCH => 2 , -- : integer := 1; C_DIN_WIDTH_RACH => 32, -- : integer := 1; C_DIN_WIDTH_RDCH => 64, -- : integer := 1; C_DIN_WIDTH_AXIS => 1 , -- : integer := 1; C_WR_DEPTH_WACH => 16 , -- : integer := 16; C_WR_DEPTH_WDCH => 1024, -- : integer := 16; C_WR_DEPTH_WRCH => 16 , -- : integer := 16; C_WR_DEPTH_RACH => 16 , -- : integer := 16; C_WR_DEPTH_RDCH => 1024, -- : integer := 16; C_WR_DEPTH_AXIS => 1024, -- : integer := 16; C_WR_PNTR_WIDTH_WACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_WDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_WRCH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_AXIS => 10, -- : integer := 4; C_HAS_DATA_COUNTS_WACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WRCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_AXIS => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WRCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_AXIS => 0, -- : integer := 0; C_PROG_FULL_TYPE_WACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WRCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_AXIS => 1023, -- : integer := 0; C_PROG_EMPTY_TYPE_WACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS => 1022, -- : integer := 0; C_REG_SLICE_MODE_WACH => 0, -- : integer := 0; C_REG_SLICE_MODE_WDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_WRCH => 0, -- : integer := 0; C_REG_SLICE_MODE_RACH => 0, -- : integer := 0; C_REG_SLICE_MODE_RDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_AXIS => 0 -- : integer := 0 ) port map( backup => '0', backup_marker => '0', clk => CLK, rst => '0', srst => SRST, wr_clk => '0', wr_rst => '0', rd_clk => '0', rd_rst => '0', din => DIN, -- uses this one wr_en => WR_EN, -- uses this one rd_en => RD_EN, -- uses this one prog_empty_thresh => PROG_RDTHRESH_ZEROS, prog_empty_thresh_assert => PROG_RDTHRESH_ZEROS, prog_empty_thresh_negate => PROG_RDTHRESH_ZEROS, prog_full_thresh => PROG_WRTHRESH_ZEROS, prog_full_thresh_assert => PROG_WRTHRESH_ZEROS, prog_full_thresh_negate => PROG_WRTHRESH_ZEROS, int_clk => '0', injectdbiterr => '0', injectsbiterr => '0', dout => DOUT, -- uses this one full => FULL, -- uses this one almost_full => ALMOST_FULL, wr_ack => WR_ACK, overflow => OVERFLOW, empty => EMPTY, -- uses this one almost_empty => ALMOST_EMPTY, valid => VALID, underflow => UNDERFLOW, data_count => DATA_COUNT, -- uses this one rd_data_count => RD_DATA_COUNT, wr_data_count => WR_DATA_COUNT, prog_full => PROG_FULL, prog_empty => PROG_EMPTY, sbiterr => SBITERR, dbiterr => DBITERR, -- AXI Global Signal m_aclk => '0', -- : IN std_logic := '0'; s_aclk => '0', -- : IN std_logic := '0'; s_aresetn => '0', -- : IN std_logic := '0'; m_aclk_en => '0', -- : IN std_logic := '0'; s_aclk_en => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Slave Write Channel (write side) s_axi_awid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awaddr => "00000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlen => "00000000", --(others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awsize => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awburst => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlock => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awcache => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awprot => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awqos => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awregion => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awvalid => '0', -- : IN std_logic := '0'; s_axi_awready => S_AXI_AWREADY, -- : OUT std_logic; s_axi_wid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wstrb => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wlast => '0', -- : IN std_logic := '0'; s_axi_wuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wvalid => '0', -- : IN std_logic := '0'; s_axi_wready => S_AXI_WREADY, -- : OUT std_logic; s_axi_bid => S_AXI_BID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_bresp => S_AXI_BRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_buser => S_AXI_BUSER, -- : OUT std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0); s_axi_bvalid => S_AXI_BVALID, -- : OUT std_logic; s_axi_bready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Write Channel (Read side) m_axi_awid => M_AXI_AWID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_awaddr => M_AXI_AWADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_awlen => M_AXI_AWLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_awsize => M_AXI_AWSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awburst => M_AXI_AWBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awlock => M_AXI_AWLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awcache => M_AXI_AWCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awprot => M_AXI_AWPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awqos => M_AXI_AWQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awregion => M_AXI_AWREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awuser => M_AXI_AWUSER, -- : OUT std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0); m_axi_awvalid => M_AXI_AWVALID, -- : OUT std_logic; m_axi_awready => '0', -- : IN std_logic := '0'; m_axi_wid => M_AXI_WID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_wdata => M_AXI_WDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); m_axi_wstrb => M_AXI_WSTRB, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0); m_axi_wlast => M_AXI_WLAST, -- : OUT std_logic; m_axi_wuser => M_AXI_WUSER, -- : OUT std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0); m_axi_wvalid => M_AXI_WVALID, -- : OUT std_logic; m_axi_wready => '0', -- : IN std_logic := '0'; m_axi_bid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_buser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bvalid => '0', -- : IN std_logic := '0'; m_axi_bready => M_AXI_BREADY, -- : OUT std_logic; -- AXI Full/Lite Slave Read Channel (Write side) s_axi_arid => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_araddr => "00000000000000000000000000000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlen => "00000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arsize => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arburst => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlock => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arcache => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arprot => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arqos => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arregion => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_aruser => "0", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arvalid => '0', -- : IN std_logic := '0'; s_axi_arready => S_AXI_ARREADY, -- : OUT std_logic; s_axi_rid => S_AXI_RID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); s_axi_rdata => S_AXI_RDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); s_axi_rresp => S_AXI_RRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_rlast => S_AXI_RLAST, -- : OUT std_logic; s_axi_ruser => S_AXI_RUSER, -- : OUT std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0); s_axi_rvalid => S_AXI_RVALID, -- : OUT std_logic; s_axi_rready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Read Channel (Read side) m_axi_arid => M_AXI_ARID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_araddr => M_AXI_ARADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_arlen => M_AXI_ARLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_arsize => M_AXI_ARSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arburst => M_AXI_ARBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arlock => M_AXI_ARLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arcache => M_AXI_ARCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arprot => M_AXI_ARPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arqos => M_AXI_ARQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arregion => M_AXI_ARREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_aruser => M_AXI_ARUSER, -- : OUT std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0); m_axi_arvalid => M_AXI_ARVALID, -- : OUT std_logic; m_axi_arready => '0', -- : IN std_logic := '0'; m_axi_rid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rlast => '0', -- : IN std_logic := '0'; m_axi_ruser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rvalid => '0', -- : IN std_logic := '0'; m_axi_rready => M_AXI_RREADY, -- : OUT std_logic; -- AXI Streaming Slave Signals (Write side) s_axis_tvalid => '0', -- : IN std_logic := '0'; s_axis_tready => S_AXIS_TREADY, -- : OUT std_logic; s_axis_tdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tstrb => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tkeep => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tlast => '0', -- : IN std_logic := '0'; s_axis_tid => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tdest => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tuser => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- AXI Streaming Master Signals (Read side) m_axis_tvalid => M_AXIS_TVALID, -- : OUT std_logic; m_axis_tready => '0', -- : IN std_logic := '0'; m_axis_tdata => M_AXIS_TDATA, -- : OUT std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0); m_axis_tstrb => M_AXIS_TSTRB, -- : OUT std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0); m_axis_tkeep => M_AXIS_TKEEP, -- : OUT std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0); m_axis_tlast => M_AXIS_TLAST, -- : OUT std_logic; m_axis_tid => M_AXIS_TID, -- : OUT std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0); m_axis_tdest => M_AXIS_TDEST, -- : OUT std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0); m_axis_tuser => M_AXIS_TUSER, -- : OUT std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals axi_aw_injectsbiterr => '0', -- : IN std_logic := '0'; axi_aw_injectdbiterr => '0', -- : IN std_logic := '0'; axi_aw_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_data_count => AXI_AW_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_wr_data_count => AXI_AW_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_rd_data_count => AXI_AW_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_sbiterr => AXI_AW_SBITERR, -- : OUT std_logic; axi_aw_dbiterr => AXI_AW_DBITERR, -- : OUT std_logic; axi_aw_overflow => AXI_AW_OVERFLOW, -- : OUT std_logic; axi_aw_underflow => AXI_AW_UNDERFLOW, -- : OUT std_logic; axi_aw_prog_full => AXI_AW_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_aw_prog_empty => AXI_AW_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Data Channel Signals axi_w_injectsbiterr => '0', -- : IN std_logic := '0'; axi_w_injectdbiterr => '0', -- : IN std_logic := '0'; axi_w_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_data_count => AXI_W_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_wr_data_count => AXI_W_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_rd_data_count => AXI_W_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_sbiterr => AXI_W_SBITERR, -- : OUT std_logic; axi_w_dbiterr => AXI_W_DBITERR, -- : OUT std_logic; axi_w_overflow => AXI_W_OVERFLOW, -- : OUT std_logic; axi_w_underflow => AXI_W_UNDERFLOW, -- : OUT std_logic; axi_w_prog_full => AXI_W_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_w_prog_empty => AXI_W_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Response Channel Signals axi_b_injectsbiterr => '0', -- : IN std_logic := '0'; axi_b_injectdbiterr => '0', -- : IN std_logic := '0'; axi_b_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_data_count => AXI_B_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_wr_data_count => AXI_B_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_rd_data_count => AXI_B_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_sbiterr => AXI_B_SBITERR, -- : OUT std_logic; axi_b_dbiterr => AXI_B_DBITERR, -- : OUT std_logic; axi_b_overflow => AXI_B_OVERFLOW, -- : OUT std_logic; axi_b_underflow => AXI_B_UNDERFLOW, -- : OUT std_logic; axi_b_prog_full => AXI_B_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_b_prog_empty => AXI_B_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Address Channel Signals axi_ar_injectsbiterr => '0', -- : IN std_logic := '0'; axi_ar_injectdbiterr => '0', -- : IN std_logic := '0'; axi_ar_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_data_count => AXI_AR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_wr_data_count => AXI_AR_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_rd_data_count => AXI_AR_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_sbiterr => AXI_AR_SBITERR, -- : OUT std_logic; axi_ar_dbiterr => AXI_AR_DBITERR, -- : OUT std_logic; axi_ar_overflow => AXI_AR_OVERFLOW, -- : OUT std_logic; axi_ar_underflow => AXI_AR_UNDERFLOW, -- : OUT std_logic; axi_ar_prog_full => AXI_AR_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_ar_prog_empty => AXI_AR_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Data Channel Signals axi_r_injectsbiterr => '0', -- : IN std_logic := '0'; axi_r_injectdbiterr => '0', -- : IN std_logic := '0'; axi_r_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_data_count => AXI_R_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_wr_data_count => AXI_R_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_rd_data_count => AXI_R_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_sbiterr => AXI_R_SBITERR, -- : OUT std_logic; axi_r_dbiterr => AXI_R_DBITERR, -- : OUT std_logic; axi_r_overflow => AXI_R_OVERFLOW, -- : OUT std_logic; axi_r_underflow => AXI_R_UNDERFLOW, -- : OUT std_logic; axi_r_prog_full => AXI_R_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_r_prog_empty => AXI_R_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Streaming FIFO Related Signals axis_injectsbiterr => '0', -- : IN std_logic := '0'; axis_injectdbiterr => '0', -- : IN std_logic := '0'; axis_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_data_count => AXIS_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_wr_data_count => AXIS_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_rd_data_count => AXIS_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_sbiterr => AXIS_SBITERR, -- : OUT std_logic; axis_dbiterr => AXIS_DBITERR, -- : OUT std_logic; axis_overflow => AXIS_OVERFLOW, -- : OUT std_logic; axis_underflow => AXIS_UNDERFLOW, -- : OUT std_logic axis_prog_full => AXIS_PROG_FULL, -- : OUT STD_LOGIC := '0'; axis_prog_empty => AXIS_PROG_EMPTY -- : OUT STD_LOGIC := '1'; ); end implementation;
------------------------------------------------------------------------------- -- basic_sfifo_fg.vhd ------------------------------------------------------------------------------- -- -- ************************************************************************* -- -- (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- ************************************************************************* -- ------------------------------------------------------------------------------- -- Filename: basic_sfifo_fg.vhd -- -- Description: -- This HDL file implements a basic synchronous (single clock) fifo using the -- FIFO Generator tool. It is intended to offer a simple interface to the user -- with the complexity of the FIFO Generator interface hidden from the user. -- -- Note that in normal op mode (not First Word Fall Through FWFT) the data count -- output goes to zero when the FIFO goes full. This the way FIFO Generator works. -- -- -- VHDL-Standard: VHDL'93 ------------------------------------------------------------------------------- -- Structure: -- basic_sfifo_fg.vhd -- | -- |-- fifo_generator_v8_2 -- ------------------------------------------------------------------------------- -- Revision History: -- -- -- Author: DET -- Revision: $Revision: 1.0 $ -- Date: $3/07/2011$ -- -- History: -- DET 3/07/2011 Initial Version -- ------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library fifo_generator_v11_0; use fifo_generator_v11_0.all; library proc_common_v4_0; use proc_common_v4_0.proc_common_pkg.all; use proc_common_v4_0.proc_common_pkg.log2; --use proc_common_v4_0.coregen_comp_defs.all; -- synopsys translate_off --library XilinxCoreLib; --use XilinxCoreLib.all; -- synopsys translate_on ------------------------------------------------------------------------------- entity basic_sfifo_fg is generic ( C_DWIDTH : Integer := 32 ; -- FIFO data Width (Read and write data ports are symetric) C_DEPTH : Integer := 512 ; -- FIFO Depth (set to power of 2) C_HAS_DATA_COUNT : integer := 1 ; -- 0 = Data Count output not needed -- 1 = Data Count output needed C_DATA_COUNT_WIDTH : integer := 10 ; -- Data Count bit width (Max value is log2(C_DEPTH)) C_IMPLEMENTATION_TYPE : integer range 0 to 1 := 0; -- 0 = Common Clock BRAM / Distributed RAM (Synchronous FIFO) -- 1 = Common Clock Shift Register (Synchronous FIFO) C_MEMORY_TYPE : integer := 1; -- 0 = Any -- 1 = BRAM -- 2 = Distributed Memory -- 3 = Shift Registers C_PRELOAD_REGS : integer := 1; -- 0 = normal -- 1 = FWFT C_PRELOAD_LATENCY : integer := 0; -- 0 = FWFT -- 1 = normal C_USE_FWFT_DATA_COUNT : integer := 0; -- 0 = normal -- 1 for FWFT C_SYNCHRONIZER_STAGE : integer := 2; -- valid values are 0 to 8; C_FAMILY : string := "virtex6" ); port ( CLK : IN std_logic := '0'; DIN : IN std_logic_vector(C_DWIDTH-1 DOWNTO 0) := (OTHERS => '0'); RD_EN : IN std_logic := '0'; SRST : IN std_logic := '0'; WR_EN : IN std_logic := '0'; DATA_COUNT : OUT std_logic_vector(C_DATA_COUNT_WIDTH-1 DOWNTO 0); DOUT : OUT std_logic_vector(C_DWIDTH-1 DOWNTO 0); EMPTY : OUT std_logic; FULL : OUT std_logic ); end entity basic_sfifo_fg; architecture implementation of basic_sfifo_fg is -- Constant Declarations ---------------------------------------------- Constant POINTER_WIDTH : integer := log2(C_DEPTH); -- Constant zeros for programmable threshold inputs signal PROG_RDTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); signal PROG_WRTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- Signals --Signals added to fix MTI and XSIM issues caused by fix for VCS issues not to use "LIBRARY_SCAN = TRUE" signal ALMOST_FULL : std_logic; signal WR_ACK : std_logic; signal OVERFLOW : std_logic; signal VALID : std_logic; signal UNDERFLOW : std_logic; signal ALMOST_EMPTY : std_logic; signal RD_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal WR_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal PROG_FULL : std_logic; signal PROG_EMPTY : std_logic; signal SBITERR : std_logic; signal DBITERR : std_logic; signal S_AXI_AWREADY : std_logic; signal S_AXI_WREADY : std_logic; signal S_AXI_BID : std_logic_vector(3 DOWNTO 0); signal S_AXI_BRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_BUSER : std_logic_vector(0 downto 0); signal S_AXI_BVALID : std_logic; -- AXI Full/Lite Master Write Channel (Read side) signal M_AXI_AWID : std_logic_vector(3 DOWNTO 0); signal M_AXI_AWADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_AWLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_AWSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWUSER : std_logic_vector(0 downto 0); signal M_AXI_AWVALID : std_logic; signal M_AXI_WID : std_logic_vector(3 DOWNTO 0); signal M_AXI_WDATA : std_logic_vector(63 DOWNTO 0); signal M_AXI_WSTRB : std_logic_vector(7 DOWNTO 0); signal M_AXI_WLAST : std_logic; signal M_AXI_WUSER : std_logic_vector(0 downto 0); signal M_AXI_WVALID : std_logic; signal M_AXI_BREADY : std_logic; -- AXI Full/Lite Slave Read Channel (Write side) signal S_AXI_ARREADY : std_logic; signal S_AXI_RID : std_logic_vector(3 DOWNTO 0); signal S_AXI_RDATA : std_logic_vector(63 DOWNTO 0); signal S_AXI_RRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_RLAST : std_logic; signal S_AXI_RUSER : std_logic_vector(0 downto 0); signal S_AXI_RVALID : std_logic; -- AXI Full/Lite Master Read Channel (Read side) signal M_AXI_ARID : std_logic_vector(3 DOWNTO 0); signal M_AXI_ARADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_ARLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_ARSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARUSER : std_logic_vector(0 downto 0); signal M_AXI_ARVALID : std_logic; signal M_AXI_RREADY : std_logic; -- AXI Streaming Slave Signals (Write side) signal S_AXIS_TREADY : std_logic; -- AXI Streaming Master Signals (Read side) signal M_AXIS_TVALID : std_logic; signal M_AXIS_TDATA : std_logic_vector(63 DOWNTO 0); signal M_AXIS_TSTRB : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TKEEP : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TLAST : std_logic; signal M_AXIS_TID : std_logic_vector(7 DOWNTO 0); signal M_AXIS_TDEST : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TUSER : std_logic_vector(3 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals signal AXI_AW_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_SBITERR : std_logic; signal AXI_AW_DBITERR : std_logic; signal AXI_AW_OVERFLOW : std_logic; signal AXI_AW_UNDERFLOW : std_logic; signal AXI_AW_PROG_FULL : STD_LOGIC; signal AXI_AW_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Data Channel Signals signal AXI_W_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_SBITERR : std_logic; signal AXI_W_DBITERR : std_logic; signal AXI_W_OVERFLOW : std_logic; signal AXI_W_UNDERFLOW : std_logic; signal AXI_W_PROG_FULL : STD_LOGIC; signal AXI_W_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Response Channel Signals signal AXI_B_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_SBITERR : std_logic; signal AXI_B_DBITERR : std_logic; signal AXI_B_OVERFLOW : std_logic; signal AXI_B_UNDERFLOW : std_logic; signal AXI_B_PROG_FULL : STD_LOGIC; signal AXI_B_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Address Channel Signals signal AXI_AR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_SBITERR : std_logic; signal AXI_AR_DBITERR : std_logic; signal AXI_AR_OVERFLOW : std_logic; signal AXI_AR_UNDERFLOW : std_logic; signal AXI_AR_PROG_FULL : STD_LOGIC; signal AXI_AR_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Data Channel Signals signal AXI_R_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_SBITERR : std_logic; signal AXI_R_DBITERR : std_logic; signal AXI_R_OVERFLOW : std_logic; signal AXI_R_UNDERFLOW : std_logic; signal AXI_R_PROG_FULL : STD_LOGIC; signal AXI_R_PROG_EMPTY : STD_LOGIC; -- AXI Streaming FIFO Related Signals signal AXIS_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_SBITERR : std_logic; signal AXIS_DBITERR : std_logic; signal AXIS_OVERFLOW : std_logic; signal AXIS_UNDERFLOW : std_logic; signal AXIS_PROG_FULL : STD_LOGIC; signal AXIS_PROG_EMPTY : STD_LOGIC; begin --(architecture implementation) ------------------------------------------------------------------------------- -- Instantiate the generalized FIFO Generator instance -- -- NOTE: -- DO NOT CHANGE TO DIRECT ENTITY INSTANTIATION!!! -- This is a Coregen FIFO Generator Call module for -- BRAM implementations of a basic Sync FIFO -- ------------------------------------------------------------------------------- I_BASIC_SFIFO : entity fifo_generator_v11_0.fifo_generator_v11_0 generic map( C_COMMON_CLOCK => 1, C_COUNT_TYPE => 0, C_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_DEFAULT_VALUE => "BlankString", C_DIN_WIDTH => C_DWIDTH, C_DOUT_RST_VAL => "0", C_DOUT_WIDTH => C_DWIDTH, C_ENABLE_RLOCS => 0, -- n0 C_FAMILY => C_FAMILY, C_HAS_ALMOST_EMPTY => 0, -- n0 C_HAS_ALMOST_FULL => 0, -- n0 C_HAS_BACKUP => 0, -- n0 C_HAS_DATA_COUNT => C_HAS_DATA_COUNT, C_HAS_MEMINIT_FILE => 0, -- n0 C_HAS_OVERFLOW => 0, -- n0 C_HAS_RD_DATA_COUNT => 0, -- n0 C_HAS_RD_RST => 0, -- n0 C_HAS_RST => 0, -- n0 C_HAS_SRST => 1, -- yes C_HAS_UNDERFLOW => 0, -- n0 C_HAS_VALID => 0, -- n0 C_HAS_WR_ACK => 0, -- n0 C_HAS_WR_DATA_COUNT => 0, -- n0 C_HAS_WR_RST => 0, -- n0 C_IMPLEMENTATION_TYPE => 0, -- Common clock BRAM C_INIT_WR_PNTR_VAL => 0, C_MEMORY_TYPE => C_MEMORY_TYPE, C_MIF_FILE_NAME => "BlankString", C_OPTIMIZATION_MODE => 0, C_OVERFLOW_LOW => 0, C_PRELOAD_LATENCY => C_PRELOAD_LATENCY, C_PRELOAD_REGS => C_PRELOAD_REGS, C_PRIM_FIFO_TYPE => "512x36", C_PROG_EMPTY_THRESH_ASSERT_VAL => 0, C_PROG_EMPTY_THRESH_NEGATE_VAL => 0, C_PROG_EMPTY_TYPE => 0, C_PROG_FULL_THRESH_ASSERT_VAL => 0, C_PROG_FULL_THRESH_NEGATE_VAL => 0, C_PROG_FULL_TYPE => 0, C_RD_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_RD_DEPTH => C_DEPTH, C_RD_FREQ => 1, C_RD_PNTR_WIDTH => POINTER_WIDTH, C_UNDERFLOW_LOW => 0, C_USE_DOUT_RST => 1, C_USE_EMBEDDED_REG => 0, C_USE_FIFO16_FLAGS => 0, C_USE_FWFT_DATA_COUNT => C_USE_FWFT_DATA_COUNT, C_VALID_LOW => 0, C_WR_ACK_LOW => 0, C_WR_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_WR_DEPTH => C_DEPTH, C_WR_FREQ => 1, C_WR_PNTR_WIDTH => POINTER_WIDTH, C_WR_RESPONSE_LATENCY => 1, C_USE_ECC => 0, C_FULL_FLAGS_RST_VAL => 0, C_ENABLE_RST_SYNC => 1, C_ERROR_INJECTION_TYPE => 0, C_SYNCHRONIZER_STAGE => C_SYNCHRONIZER_STAGE, C_HAS_INT_CLK => 0, C_MSGON_VAL => 1, -- AXI Interface related parameters start here C_INTERFACE_TYPE => 0, -- : integer := 0; -- 0: Native Interface; 1: AXI Interface C_AXI_TYPE => 0, -- : integer := 0; -- 0: AXI Stream; 1: AXI Full; 2: AXI Lite C_HAS_AXI_WR_CHANNEL => 0, -- : integer := 0; C_HAS_AXI_RD_CHANNEL => 0, -- : integer := 0; C_HAS_SLAVE_CE => 0, -- : integer := 0; C_HAS_MASTER_CE => 0, -- : integer := 0; C_ADD_NGC_CONSTRAINT => 0, -- : integer := 0; C_USE_COMMON_OVERFLOW => 0, -- : integer := 0; C_USE_COMMON_UNDERFLOW => 0, -- : integer := 0; C_USE_DEFAULT_SETTINGS => 0, -- : integer := 0; -- AXI Full/Lite C_AXI_ID_WIDTH => 4 , -- : integer := 0; C_AXI_ADDR_WIDTH => 32, -- : integer := 0; C_AXI_DATA_WIDTH => 64, -- : integer := 0; C_AXI_LEN_WIDTH => 8, -- : integer := 8; C_AXI_LOCK_WIDTH => 2, -- : integer := 2; C_HAS_AXI_ID => 0, -- : integer := 0; C_HAS_AXI_AWUSER => 0 , -- : integer := 0; C_HAS_AXI_WUSER => 0 , -- : integer := 0; C_HAS_AXI_BUSER => 0 , -- : integer := 0; C_HAS_AXI_ARUSER => 0 , -- : integer := 0; C_HAS_AXI_RUSER => 0 , -- : integer := 0; C_AXI_ARUSER_WIDTH => 1 , -- : integer := 0; C_AXI_AWUSER_WIDTH => 1 , -- : integer := 0; C_AXI_WUSER_WIDTH => 1 , -- : integer := 0; C_AXI_BUSER_WIDTH => 1 , -- : integer := 0; C_AXI_RUSER_WIDTH => 1 , -- : integer := 0; -- AXI Streaming C_HAS_AXIS_TDATA => 0 , -- : integer := 0; C_HAS_AXIS_TID => 0 , -- : integer := 0; C_HAS_AXIS_TDEST => 0 , -- : integer := 0; C_HAS_AXIS_TUSER => 0 , -- : integer := 0; C_HAS_AXIS_TREADY => 1 , -- : integer := 0; C_HAS_AXIS_TLAST => 0 , -- : integer := 0; C_HAS_AXIS_TSTRB => 0 , -- : integer := 0; C_HAS_AXIS_TKEEP => 0 , -- : integer := 0; C_AXIS_TDATA_WIDTH => 64, -- : integer := 1; C_AXIS_TID_WIDTH => 8 , -- : integer := 1; C_AXIS_TDEST_WIDTH => 4 , -- : integer := 1; C_AXIS_TUSER_WIDTH => 4 , -- : integer := 1; C_AXIS_TSTRB_WIDTH => 4 , -- : integer := 1; C_AXIS_TKEEP_WIDTH => 4 , -- : integer := 1; -- AXI Channel Type -- WACH --> Write Address Channel -- WDCH --> Write Data Channel -- WRCH --> Write Response Channel -- RACH --> Read Address Channel -- RDCH --> Read Data Channel -- AXIS --> AXI Streaming C_WACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logic C_WDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_WRCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_AXIS_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie -- AXI Implementation Type -- 1 = Common Clock Block RAM FIFO -- 2 = Common Clock Distributed RAM FIFO -- 11 = Independent Clock Block RAM FIFO -- 12 = Independent Clock Distributed RAM FIFO C_IMPLEMENTATION_TYPE_WACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WRCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_AXIS => 1, -- : integer := 0; -- AXI FIFO Type -- 0 = Data FIFO -- 1 = Packet FIFO -- 2 = Low Latency Data FIFO C_APPLICATION_TYPE_WACH => 0, -- : integer := 0; C_APPLICATION_TYPE_WDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_WRCH => 0, -- : integer := 0; C_APPLICATION_TYPE_RACH => 0, -- : integer := 0; C_APPLICATION_TYPE_RDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_AXIS => 0, -- : integer := 0; -- Enable ECC -- 0 = ECC disabled -- 1 = ECC enabled C_USE_ECC_WACH => 0, -- : integer := 0; C_USE_ECC_WDCH => 0, -- : integer := 0; C_USE_ECC_WRCH => 0, -- : integer := 0; C_USE_ECC_RACH => 0, -- : integer := 0; C_USE_ECC_RDCH => 0, -- : integer := 0; C_USE_ECC_AXIS => 0, -- : integer := 0; -- ECC Error Injection Type -- 0 = No Error Injection -- 1 = Single Bit Error Injection -- 2 = Double Bit Error Injection -- 3 = Single Bit and Double Bit Error Injection C_ERROR_INJECTION_TYPE_WACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WRCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_AXIS => 0, -- : integer := 0; -- Input Data Width -- Accumulation of all AXI input signal's width C_DIN_WIDTH_WACH => 32, -- : integer := 1; C_DIN_WIDTH_WDCH => 64, -- : integer := 1; C_DIN_WIDTH_WRCH => 2 , -- : integer := 1; C_DIN_WIDTH_RACH => 32, -- : integer := 1; C_DIN_WIDTH_RDCH => 64, -- : integer := 1; C_DIN_WIDTH_AXIS => 1 , -- : integer := 1; C_WR_DEPTH_WACH => 16 , -- : integer := 16; C_WR_DEPTH_WDCH => 1024, -- : integer := 16; C_WR_DEPTH_WRCH => 16 , -- : integer := 16; C_WR_DEPTH_RACH => 16 , -- : integer := 16; C_WR_DEPTH_RDCH => 1024, -- : integer := 16; C_WR_DEPTH_AXIS => 1024, -- : integer := 16; C_WR_PNTR_WIDTH_WACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_WDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_WRCH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_AXIS => 10, -- : integer := 4; C_HAS_DATA_COUNTS_WACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WRCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_AXIS => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WRCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_AXIS => 0, -- : integer := 0; C_PROG_FULL_TYPE_WACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WRCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_AXIS => 1023, -- : integer := 0; C_PROG_EMPTY_TYPE_WACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS => 1022, -- : integer := 0; C_REG_SLICE_MODE_WACH => 0, -- : integer := 0; C_REG_SLICE_MODE_WDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_WRCH => 0, -- : integer := 0; C_REG_SLICE_MODE_RACH => 0, -- : integer := 0; C_REG_SLICE_MODE_RDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_AXIS => 0 -- : integer := 0 ) port map( backup => '0', backup_marker => '0', clk => CLK, rst => '0', srst => SRST, wr_clk => '0', wr_rst => '0', rd_clk => '0', rd_rst => '0', din => DIN, -- uses this one wr_en => WR_EN, -- uses this one rd_en => RD_EN, -- uses this one prog_empty_thresh => PROG_RDTHRESH_ZEROS, prog_empty_thresh_assert => PROG_RDTHRESH_ZEROS, prog_empty_thresh_negate => PROG_RDTHRESH_ZEROS, prog_full_thresh => PROG_WRTHRESH_ZEROS, prog_full_thresh_assert => PROG_WRTHRESH_ZEROS, prog_full_thresh_negate => PROG_WRTHRESH_ZEROS, int_clk => '0', injectdbiterr => '0', injectsbiterr => '0', dout => DOUT, -- uses this one full => FULL, -- uses this one almost_full => ALMOST_FULL, wr_ack => WR_ACK, overflow => OVERFLOW, empty => EMPTY, -- uses this one almost_empty => ALMOST_EMPTY, valid => VALID, underflow => UNDERFLOW, data_count => DATA_COUNT, -- uses this one rd_data_count => RD_DATA_COUNT, wr_data_count => WR_DATA_COUNT, prog_full => PROG_FULL, prog_empty => PROG_EMPTY, sbiterr => SBITERR, dbiterr => DBITERR, -- AXI Global Signal m_aclk => '0', -- : IN std_logic := '0'; s_aclk => '0', -- : IN std_logic := '0'; s_aresetn => '0', -- : IN std_logic := '0'; m_aclk_en => '0', -- : IN std_logic := '0'; s_aclk_en => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Slave Write Channel (write side) s_axi_awid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awaddr => "00000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlen => "00000000", --(others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awsize => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awburst => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlock => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awcache => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awprot => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awqos => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awregion => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awvalid => '0', -- : IN std_logic := '0'; s_axi_awready => S_AXI_AWREADY, -- : OUT std_logic; s_axi_wid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wstrb => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wlast => '0', -- : IN std_logic := '0'; s_axi_wuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wvalid => '0', -- : IN std_logic := '0'; s_axi_wready => S_AXI_WREADY, -- : OUT std_logic; s_axi_bid => S_AXI_BID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_bresp => S_AXI_BRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_buser => S_AXI_BUSER, -- : OUT std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0); s_axi_bvalid => S_AXI_BVALID, -- : OUT std_logic; s_axi_bready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Write Channel (Read side) m_axi_awid => M_AXI_AWID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_awaddr => M_AXI_AWADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_awlen => M_AXI_AWLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_awsize => M_AXI_AWSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awburst => M_AXI_AWBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awlock => M_AXI_AWLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awcache => M_AXI_AWCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awprot => M_AXI_AWPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awqos => M_AXI_AWQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awregion => M_AXI_AWREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awuser => M_AXI_AWUSER, -- : OUT std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0); m_axi_awvalid => M_AXI_AWVALID, -- : OUT std_logic; m_axi_awready => '0', -- : IN std_logic := '0'; m_axi_wid => M_AXI_WID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_wdata => M_AXI_WDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); m_axi_wstrb => M_AXI_WSTRB, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0); m_axi_wlast => M_AXI_WLAST, -- : OUT std_logic; m_axi_wuser => M_AXI_WUSER, -- : OUT std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0); m_axi_wvalid => M_AXI_WVALID, -- : OUT std_logic; m_axi_wready => '0', -- : IN std_logic := '0'; m_axi_bid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_buser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bvalid => '0', -- : IN std_logic := '0'; m_axi_bready => M_AXI_BREADY, -- : OUT std_logic; -- AXI Full/Lite Slave Read Channel (Write side) s_axi_arid => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_araddr => "00000000000000000000000000000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlen => "00000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arsize => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arburst => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlock => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arcache => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arprot => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arqos => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arregion => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_aruser => "0", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arvalid => '0', -- : IN std_logic := '0'; s_axi_arready => S_AXI_ARREADY, -- : OUT std_logic; s_axi_rid => S_AXI_RID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); s_axi_rdata => S_AXI_RDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); s_axi_rresp => S_AXI_RRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_rlast => S_AXI_RLAST, -- : OUT std_logic; s_axi_ruser => S_AXI_RUSER, -- : OUT std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0); s_axi_rvalid => S_AXI_RVALID, -- : OUT std_logic; s_axi_rready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Read Channel (Read side) m_axi_arid => M_AXI_ARID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_araddr => M_AXI_ARADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_arlen => M_AXI_ARLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_arsize => M_AXI_ARSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arburst => M_AXI_ARBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arlock => M_AXI_ARLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arcache => M_AXI_ARCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arprot => M_AXI_ARPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arqos => M_AXI_ARQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arregion => M_AXI_ARREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_aruser => M_AXI_ARUSER, -- : OUT std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0); m_axi_arvalid => M_AXI_ARVALID, -- : OUT std_logic; m_axi_arready => '0', -- : IN std_logic := '0'; m_axi_rid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rlast => '0', -- : IN std_logic := '0'; m_axi_ruser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rvalid => '0', -- : IN std_logic := '0'; m_axi_rready => M_AXI_RREADY, -- : OUT std_logic; -- AXI Streaming Slave Signals (Write side) s_axis_tvalid => '0', -- : IN std_logic := '0'; s_axis_tready => S_AXIS_TREADY, -- : OUT std_logic; s_axis_tdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tstrb => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tkeep => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tlast => '0', -- : IN std_logic := '0'; s_axis_tid => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tdest => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tuser => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- AXI Streaming Master Signals (Read side) m_axis_tvalid => M_AXIS_TVALID, -- : OUT std_logic; m_axis_tready => '0', -- : IN std_logic := '0'; m_axis_tdata => M_AXIS_TDATA, -- : OUT std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0); m_axis_tstrb => M_AXIS_TSTRB, -- : OUT std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0); m_axis_tkeep => M_AXIS_TKEEP, -- : OUT std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0); m_axis_tlast => M_AXIS_TLAST, -- : OUT std_logic; m_axis_tid => M_AXIS_TID, -- : OUT std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0); m_axis_tdest => M_AXIS_TDEST, -- : OUT std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0); m_axis_tuser => M_AXIS_TUSER, -- : OUT std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals axi_aw_injectsbiterr => '0', -- : IN std_logic := '0'; axi_aw_injectdbiterr => '0', -- : IN std_logic := '0'; axi_aw_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_data_count => AXI_AW_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_wr_data_count => AXI_AW_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_rd_data_count => AXI_AW_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_sbiterr => AXI_AW_SBITERR, -- : OUT std_logic; axi_aw_dbiterr => AXI_AW_DBITERR, -- : OUT std_logic; axi_aw_overflow => AXI_AW_OVERFLOW, -- : OUT std_logic; axi_aw_underflow => AXI_AW_UNDERFLOW, -- : OUT std_logic; axi_aw_prog_full => AXI_AW_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_aw_prog_empty => AXI_AW_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Data Channel Signals axi_w_injectsbiterr => '0', -- : IN std_logic := '0'; axi_w_injectdbiterr => '0', -- : IN std_logic := '0'; axi_w_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_data_count => AXI_W_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_wr_data_count => AXI_W_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_rd_data_count => AXI_W_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_sbiterr => AXI_W_SBITERR, -- : OUT std_logic; axi_w_dbiterr => AXI_W_DBITERR, -- : OUT std_logic; axi_w_overflow => AXI_W_OVERFLOW, -- : OUT std_logic; axi_w_underflow => AXI_W_UNDERFLOW, -- : OUT std_logic; axi_w_prog_full => AXI_W_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_w_prog_empty => AXI_W_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Response Channel Signals axi_b_injectsbiterr => '0', -- : IN std_logic := '0'; axi_b_injectdbiterr => '0', -- : IN std_logic := '0'; axi_b_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_data_count => AXI_B_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_wr_data_count => AXI_B_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_rd_data_count => AXI_B_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_sbiterr => AXI_B_SBITERR, -- : OUT std_logic; axi_b_dbiterr => AXI_B_DBITERR, -- : OUT std_logic; axi_b_overflow => AXI_B_OVERFLOW, -- : OUT std_logic; axi_b_underflow => AXI_B_UNDERFLOW, -- : OUT std_logic; axi_b_prog_full => AXI_B_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_b_prog_empty => AXI_B_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Address Channel Signals axi_ar_injectsbiterr => '0', -- : IN std_logic := '0'; axi_ar_injectdbiterr => '0', -- : IN std_logic := '0'; axi_ar_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_data_count => AXI_AR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_wr_data_count => AXI_AR_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_rd_data_count => AXI_AR_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_sbiterr => AXI_AR_SBITERR, -- : OUT std_logic; axi_ar_dbiterr => AXI_AR_DBITERR, -- : OUT std_logic; axi_ar_overflow => AXI_AR_OVERFLOW, -- : OUT std_logic; axi_ar_underflow => AXI_AR_UNDERFLOW, -- : OUT std_logic; axi_ar_prog_full => AXI_AR_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_ar_prog_empty => AXI_AR_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Data Channel Signals axi_r_injectsbiterr => '0', -- : IN std_logic := '0'; axi_r_injectdbiterr => '0', -- : IN std_logic := '0'; axi_r_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_data_count => AXI_R_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_wr_data_count => AXI_R_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_rd_data_count => AXI_R_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_sbiterr => AXI_R_SBITERR, -- : OUT std_logic; axi_r_dbiterr => AXI_R_DBITERR, -- : OUT std_logic; axi_r_overflow => AXI_R_OVERFLOW, -- : OUT std_logic; axi_r_underflow => AXI_R_UNDERFLOW, -- : OUT std_logic; axi_r_prog_full => AXI_R_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_r_prog_empty => AXI_R_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Streaming FIFO Related Signals axis_injectsbiterr => '0', -- : IN std_logic := '0'; axis_injectdbiterr => '0', -- : IN std_logic := '0'; axis_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_data_count => AXIS_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_wr_data_count => AXIS_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_rd_data_count => AXIS_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_sbiterr => AXIS_SBITERR, -- : OUT std_logic; axis_dbiterr => AXIS_DBITERR, -- : OUT std_logic; axis_overflow => AXIS_OVERFLOW, -- : OUT std_logic; axis_underflow => AXIS_UNDERFLOW, -- : OUT std_logic axis_prog_full => AXIS_PROG_FULL, -- : OUT STD_LOGIC := '0'; axis_prog_empty => AXIS_PROG_EMPTY -- : OUT STD_LOGIC := '1'; ); end implementation;
------------------------------------------------------------------------------- -- basic_sfifo_fg.vhd ------------------------------------------------------------------------------- -- -- ************************************************************************* -- -- (c) Copyright 2010-2011 Xilinx, Inc. All rights reserved. -- -- This file contains confidential and proprietary information -- of Xilinx, Inc. and is protected under U.S. and -- international copyright and other intellectual property -- laws. -- -- DISCLAIMER -- This disclaimer is not a license and does not grant any -- rights to the materials distributed herewith. Except as -- otherwise provided in a valid license issued to you by -- Xilinx, and to the maximum extent permitted by applicable -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON- -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and -- (2) Xilinx shall not be liable (whether in contract or tort, -- including negligence, or under any other theory of -- liability) for any loss or damage of any kind or nature -- related to, arising under or in connection with these -- materials, including for any direct, or any indirect, -- special, incidental, or consequential loss or damage -- (including loss of data, profits, goodwill, or any type of -- loss or damage suffered as a result of any action brought -- by a third party) even if such damage or loss was -- reasonably foreseeable or Xilinx had been advised of the -- possibility of the same. -- -- CRITICAL APPLICATIONS -- Xilinx products are not designed or intended to be fail- -- safe, or for use in any application requiring fail-safe -- performance, such as life-support or safety devices or -- systems, Class III medical devices, nuclear facilities, -- applications related to the deployment of airbags, or any -- other applications that could lead to death, personal -- injury, or severe property or environmental damage -- (individually and collectively, "Critical -- Applications"). Customer assumes the sole risk and -- liability of any use of Xilinx products in Critical -- Applications, subject only to applicable laws and -- regulations governing limitations on product liability. -- -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS -- PART OF THIS FILE AT ALL TIMES. -- -- ************************************************************************* -- ------------------------------------------------------------------------------- -- Filename: basic_sfifo_fg.vhd -- -- Description: -- This HDL file implements a basic synchronous (single clock) fifo using the -- FIFO Generator tool. It is intended to offer a simple interface to the user -- with the complexity of the FIFO Generator interface hidden from the user. -- -- Note that in normal op mode (not First Word Fall Through FWFT) the data count -- output goes to zero when the FIFO goes full. This the way FIFO Generator works. -- -- -- VHDL-Standard: VHDL'93 ------------------------------------------------------------------------------- -- Structure: -- basic_sfifo_fg.vhd -- | -- |-- fifo_generator_v8_2 -- ------------------------------------------------------------------------------- -- Revision History: -- -- -- Author: DET -- Revision: $Revision: 1.0 $ -- Date: $3/07/2011$ -- -- History: -- DET 3/07/2011 Initial Version -- ------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library fifo_generator_v11_0; use fifo_generator_v11_0.all; library proc_common_v4_0; use proc_common_v4_0.proc_common_pkg.all; use proc_common_v4_0.proc_common_pkg.log2; --use proc_common_v4_0.coregen_comp_defs.all; -- synopsys translate_off --library XilinxCoreLib; --use XilinxCoreLib.all; -- synopsys translate_on ------------------------------------------------------------------------------- entity basic_sfifo_fg is generic ( C_DWIDTH : Integer := 32 ; -- FIFO data Width (Read and write data ports are symetric) C_DEPTH : Integer := 512 ; -- FIFO Depth (set to power of 2) C_HAS_DATA_COUNT : integer := 1 ; -- 0 = Data Count output not needed -- 1 = Data Count output needed C_DATA_COUNT_WIDTH : integer := 10 ; -- Data Count bit width (Max value is log2(C_DEPTH)) C_IMPLEMENTATION_TYPE : integer range 0 to 1 := 0; -- 0 = Common Clock BRAM / Distributed RAM (Synchronous FIFO) -- 1 = Common Clock Shift Register (Synchronous FIFO) C_MEMORY_TYPE : integer := 1; -- 0 = Any -- 1 = BRAM -- 2 = Distributed Memory -- 3 = Shift Registers C_PRELOAD_REGS : integer := 1; -- 0 = normal -- 1 = FWFT C_PRELOAD_LATENCY : integer := 0; -- 0 = FWFT -- 1 = normal C_USE_FWFT_DATA_COUNT : integer := 0; -- 0 = normal -- 1 for FWFT C_SYNCHRONIZER_STAGE : integer := 2; -- valid values are 0 to 8; C_FAMILY : string := "virtex6" ); port ( CLK : IN std_logic := '0'; DIN : IN std_logic_vector(C_DWIDTH-1 DOWNTO 0) := (OTHERS => '0'); RD_EN : IN std_logic := '0'; SRST : IN std_logic := '0'; WR_EN : IN std_logic := '0'; DATA_COUNT : OUT std_logic_vector(C_DATA_COUNT_WIDTH-1 DOWNTO 0); DOUT : OUT std_logic_vector(C_DWIDTH-1 DOWNTO 0); EMPTY : OUT std_logic; FULL : OUT std_logic ); end entity basic_sfifo_fg; architecture implementation of basic_sfifo_fg is -- Constant Declarations ---------------------------------------------- Constant POINTER_WIDTH : integer := log2(C_DEPTH); -- Constant zeros for programmable threshold inputs signal PROG_RDTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); signal PROG_WRTHRESH_ZEROS : std_logic_vector(POINTER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- Signals --Signals added to fix MTI and XSIM issues caused by fix for VCS issues not to use "LIBRARY_SCAN = TRUE" signal ALMOST_FULL : std_logic; signal WR_ACK : std_logic; signal OVERFLOW : std_logic; signal VALID : std_logic; signal UNDERFLOW : std_logic; signal ALMOST_EMPTY : std_logic; signal RD_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal WR_DATA_COUNT : std_logic_vector(C_DATA_COUNT_WIDTH-1 downto 0); signal PROG_FULL : std_logic; signal PROG_EMPTY : std_logic; signal SBITERR : std_logic; signal DBITERR : std_logic; signal S_AXI_AWREADY : std_logic; signal S_AXI_WREADY : std_logic; signal S_AXI_BID : std_logic_vector(3 DOWNTO 0); signal S_AXI_BRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_BUSER : std_logic_vector(0 downto 0); signal S_AXI_BVALID : std_logic; -- AXI Full/Lite Master Write Channel (Read side) signal M_AXI_AWID : std_logic_vector(3 DOWNTO 0); signal M_AXI_AWADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_AWLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_AWSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_AWCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_AWQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_AWUSER : std_logic_vector(0 downto 0); signal M_AXI_AWVALID : std_logic; signal M_AXI_WID : std_logic_vector(3 DOWNTO 0); signal M_AXI_WDATA : std_logic_vector(63 DOWNTO 0); signal M_AXI_WSTRB : std_logic_vector(7 DOWNTO 0); signal M_AXI_WLAST : std_logic; signal M_AXI_WUSER : std_logic_vector(0 downto 0); signal M_AXI_WVALID : std_logic; signal M_AXI_BREADY : std_logic; -- AXI Full/Lite Slave Read Channel (Write side) signal S_AXI_ARREADY : std_logic; signal S_AXI_RID : std_logic_vector(3 DOWNTO 0); signal S_AXI_RDATA : std_logic_vector(63 DOWNTO 0); signal S_AXI_RRESP : std_logic_vector(2-1 DOWNTO 0); signal S_AXI_RLAST : std_logic; signal S_AXI_RUSER : std_logic_vector(0 downto 0); signal S_AXI_RVALID : std_logic; -- AXI Full/Lite Master Read Channel (Read side) signal M_AXI_ARID : std_logic_vector(3 DOWNTO 0); signal M_AXI_ARADDR : std_logic_vector(31 DOWNTO 0); signal M_AXI_ARLEN : std_logic_vector(8-1 DOWNTO 0); signal M_AXI_ARSIZE : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARBURST : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARLOCK : std_logic_vector(2-1 DOWNTO 0); signal M_AXI_ARCACHE : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARPROT : std_logic_vector(3-1 DOWNTO 0); signal M_AXI_ARQOS : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARREGION : std_logic_vector(4-1 DOWNTO 0); signal M_AXI_ARUSER : std_logic_vector(0 downto 0); signal M_AXI_ARVALID : std_logic; signal M_AXI_RREADY : std_logic; -- AXI Streaming Slave Signals (Write side) signal S_AXIS_TREADY : std_logic; -- AXI Streaming Master Signals (Read side) signal M_AXIS_TVALID : std_logic; signal M_AXIS_TDATA : std_logic_vector(63 DOWNTO 0); signal M_AXIS_TSTRB : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TKEEP : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TLAST : std_logic; signal M_AXIS_TID : std_logic_vector(7 DOWNTO 0); signal M_AXIS_TDEST : std_logic_vector(3 DOWNTO 0); signal M_AXIS_TUSER : std_logic_vector(3 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals signal AXI_AW_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AW_SBITERR : std_logic; signal AXI_AW_DBITERR : std_logic; signal AXI_AW_OVERFLOW : std_logic; signal AXI_AW_UNDERFLOW : std_logic; signal AXI_AW_PROG_FULL : STD_LOGIC; signal AXI_AW_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Data Channel Signals signal AXI_W_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_W_SBITERR : std_logic; signal AXI_W_DBITERR : std_logic; signal AXI_W_OVERFLOW : std_logic; signal AXI_W_UNDERFLOW : std_logic; signal AXI_W_PROG_FULL : STD_LOGIC; signal AXI_W_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Write Response Channel Signals signal AXI_B_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_B_SBITERR : std_logic; signal AXI_B_DBITERR : std_logic; signal AXI_B_OVERFLOW : std_logic; signal AXI_B_UNDERFLOW : std_logic; signal AXI_B_PROG_FULL : STD_LOGIC; signal AXI_B_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Address Channel Signals signal AXI_AR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_WR_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_RD_DATA_COUNT : std_logic_vector(4 DOWNTO 0); signal AXI_AR_SBITERR : std_logic; signal AXI_AR_DBITERR : std_logic; signal AXI_AR_OVERFLOW : std_logic; signal AXI_AR_UNDERFLOW : std_logic; signal AXI_AR_PROG_FULL : STD_LOGIC; signal AXI_AR_PROG_EMPTY : STD_LOGIC; -- AXI Full/Lite Read Data Channel Signals signal AXI_R_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXI_R_SBITERR : std_logic; signal AXI_R_DBITERR : std_logic; signal AXI_R_OVERFLOW : std_logic; signal AXI_R_UNDERFLOW : std_logic; signal AXI_R_PROG_FULL : STD_LOGIC; signal AXI_R_PROG_EMPTY : STD_LOGIC; -- AXI Streaming FIFO Related Signals signal AXIS_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_WR_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_RD_DATA_COUNT : std_logic_vector(10 DOWNTO 0); signal AXIS_SBITERR : std_logic; signal AXIS_DBITERR : std_logic; signal AXIS_OVERFLOW : std_logic; signal AXIS_UNDERFLOW : std_logic; signal AXIS_PROG_FULL : STD_LOGIC; signal AXIS_PROG_EMPTY : STD_LOGIC; begin --(architecture implementation) ------------------------------------------------------------------------------- -- Instantiate the generalized FIFO Generator instance -- -- NOTE: -- DO NOT CHANGE TO DIRECT ENTITY INSTANTIATION!!! -- This is a Coregen FIFO Generator Call module for -- BRAM implementations of a basic Sync FIFO -- ------------------------------------------------------------------------------- I_BASIC_SFIFO : entity fifo_generator_v11_0.fifo_generator_v11_0 generic map( C_COMMON_CLOCK => 1, C_COUNT_TYPE => 0, C_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_DEFAULT_VALUE => "BlankString", C_DIN_WIDTH => C_DWIDTH, C_DOUT_RST_VAL => "0", C_DOUT_WIDTH => C_DWIDTH, C_ENABLE_RLOCS => 0, -- n0 C_FAMILY => C_FAMILY, C_HAS_ALMOST_EMPTY => 0, -- n0 C_HAS_ALMOST_FULL => 0, -- n0 C_HAS_BACKUP => 0, -- n0 C_HAS_DATA_COUNT => C_HAS_DATA_COUNT, C_HAS_MEMINIT_FILE => 0, -- n0 C_HAS_OVERFLOW => 0, -- n0 C_HAS_RD_DATA_COUNT => 0, -- n0 C_HAS_RD_RST => 0, -- n0 C_HAS_RST => 0, -- n0 C_HAS_SRST => 1, -- yes C_HAS_UNDERFLOW => 0, -- n0 C_HAS_VALID => 0, -- n0 C_HAS_WR_ACK => 0, -- n0 C_HAS_WR_DATA_COUNT => 0, -- n0 C_HAS_WR_RST => 0, -- n0 C_IMPLEMENTATION_TYPE => 0, -- Common clock BRAM C_INIT_WR_PNTR_VAL => 0, C_MEMORY_TYPE => C_MEMORY_TYPE, C_MIF_FILE_NAME => "BlankString", C_OPTIMIZATION_MODE => 0, C_OVERFLOW_LOW => 0, C_PRELOAD_LATENCY => C_PRELOAD_LATENCY, C_PRELOAD_REGS => C_PRELOAD_REGS, C_PRIM_FIFO_TYPE => "512x36", C_PROG_EMPTY_THRESH_ASSERT_VAL => 0, C_PROG_EMPTY_THRESH_NEGATE_VAL => 0, C_PROG_EMPTY_TYPE => 0, C_PROG_FULL_THRESH_ASSERT_VAL => 0, C_PROG_FULL_THRESH_NEGATE_VAL => 0, C_PROG_FULL_TYPE => 0, C_RD_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_RD_DEPTH => C_DEPTH, C_RD_FREQ => 1, C_RD_PNTR_WIDTH => POINTER_WIDTH, C_UNDERFLOW_LOW => 0, C_USE_DOUT_RST => 1, C_USE_EMBEDDED_REG => 0, C_USE_FIFO16_FLAGS => 0, C_USE_FWFT_DATA_COUNT => C_USE_FWFT_DATA_COUNT, C_VALID_LOW => 0, C_WR_ACK_LOW => 0, C_WR_DATA_COUNT_WIDTH => C_DATA_COUNT_WIDTH, C_WR_DEPTH => C_DEPTH, C_WR_FREQ => 1, C_WR_PNTR_WIDTH => POINTER_WIDTH, C_WR_RESPONSE_LATENCY => 1, C_USE_ECC => 0, C_FULL_FLAGS_RST_VAL => 0, C_ENABLE_RST_SYNC => 1, C_ERROR_INJECTION_TYPE => 0, C_SYNCHRONIZER_STAGE => C_SYNCHRONIZER_STAGE, C_HAS_INT_CLK => 0, C_MSGON_VAL => 1, -- AXI Interface related parameters start here C_INTERFACE_TYPE => 0, -- : integer := 0; -- 0: Native Interface; 1: AXI Interface C_AXI_TYPE => 0, -- : integer := 0; -- 0: AXI Stream; 1: AXI Full; 2: AXI Lite C_HAS_AXI_WR_CHANNEL => 0, -- : integer := 0; C_HAS_AXI_RD_CHANNEL => 0, -- : integer := 0; C_HAS_SLAVE_CE => 0, -- : integer := 0; C_HAS_MASTER_CE => 0, -- : integer := 0; C_ADD_NGC_CONSTRAINT => 0, -- : integer := 0; C_USE_COMMON_OVERFLOW => 0, -- : integer := 0; C_USE_COMMON_UNDERFLOW => 0, -- : integer := 0; C_USE_DEFAULT_SETTINGS => 0, -- : integer := 0; -- AXI Full/Lite C_AXI_ID_WIDTH => 4 , -- : integer := 0; C_AXI_ADDR_WIDTH => 32, -- : integer := 0; C_AXI_DATA_WIDTH => 64, -- : integer := 0; C_AXI_LEN_WIDTH => 8, -- : integer := 8; C_AXI_LOCK_WIDTH => 2, -- : integer := 2; C_HAS_AXI_ID => 0, -- : integer := 0; C_HAS_AXI_AWUSER => 0 , -- : integer := 0; C_HAS_AXI_WUSER => 0 , -- : integer := 0; C_HAS_AXI_BUSER => 0 , -- : integer := 0; C_HAS_AXI_ARUSER => 0 , -- : integer := 0; C_HAS_AXI_RUSER => 0 , -- : integer := 0; C_AXI_ARUSER_WIDTH => 1 , -- : integer := 0; C_AXI_AWUSER_WIDTH => 1 , -- : integer := 0; C_AXI_WUSER_WIDTH => 1 , -- : integer := 0; C_AXI_BUSER_WIDTH => 1 , -- : integer := 0; C_AXI_RUSER_WIDTH => 1 , -- : integer := 0; -- AXI Streaming C_HAS_AXIS_TDATA => 0 , -- : integer := 0; C_HAS_AXIS_TID => 0 , -- : integer := 0; C_HAS_AXIS_TDEST => 0 , -- : integer := 0; C_HAS_AXIS_TUSER => 0 , -- : integer := 0; C_HAS_AXIS_TREADY => 1 , -- : integer := 0; C_HAS_AXIS_TLAST => 0 , -- : integer := 0; C_HAS_AXIS_TSTRB => 0 , -- : integer := 0; C_HAS_AXIS_TKEEP => 0 , -- : integer := 0; C_AXIS_TDATA_WIDTH => 64, -- : integer := 1; C_AXIS_TID_WIDTH => 8 , -- : integer := 1; C_AXIS_TDEST_WIDTH => 4 , -- : integer := 1; C_AXIS_TUSER_WIDTH => 4 , -- : integer := 1; C_AXIS_TSTRB_WIDTH => 4 , -- : integer := 1; C_AXIS_TKEEP_WIDTH => 4 , -- : integer := 1; -- AXI Channel Type -- WACH --> Write Address Channel -- WDCH --> Write Data Channel -- WRCH --> Write Response Channel -- RACH --> Read Address Channel -- RDCH --> Read Data Channel -- AXIS --> AXI Streaming C_WACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logic C_WDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_WRCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RACH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_RDCH_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie C_AXIS_TYPE => 0, -- : integer := 0; -- 0 = FIFO; 1 = Register Slice; 2 = Pass Through Logie -- AXI Implementation Type -- 1 = Common Clock Block RAM FIFO -- 2 = Common Clock Distributed RAM FIFO -- 11 = Independent Clock Block RAM FIFO -- 12 = Independent Clock Distributed RAM FIFO C_IMPLEMENTATION_TYPE_WACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_WRCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RACH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_RDCH => 1, -- : integer := 0; C_IMPLEMENTATION_TYPE_AXIS => 1, -- : integer := 0; -- AXI FIFO Type -- 0 = Data FIFO -- 1 = Packet FIFO -- 2 = Low Latency Data FIFO C_APPLICATION_TYPE_WACH => 0, -- : integer := 0; C_APPLICATION_TYPE_WDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_WRCH => 0, -- : integer := 0; C_APPLICATION_TYPE_RACH => 0, -- : integer := 0; C_APPLICATION_TYPE_RDCH => 0, -- : integer := 0; C_APPLICATION_TYPE_AXIS => 0, -- : integer := 0; -- Enable ECC -- 0 = ECC disabled -- 1 = ECC enabled C_USE_ECC_WACH => 0, -- : integer := 0; C_USE_ECC_WDCH => 0, -- : integer := 0; C_USE_ECC_WRCH => 0, -- : integer := 0; C_USE_ECC_RACH => 0, -- : integer := 0; C_USE_ECC_RDCH => 0, -- : integer := 0; C_USE_ECC_AXIS => 0, -- : integer := 0; -- ECC Error Injection Type -- 0 = No Error Injection -- 1 = Single Bit Error Injection -- 2 = Double Bit Error Injection -- 3 = Single Bit and Double Bit Error Injection C_ERROR_INJECTION_TYPE_WACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_WRCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RACH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_RDCH => 0, -- : integer := 0; C_ERROR_INJECTION_TYPE_AXIS => 0, -- : integer := 0; -- Input Data Width -- Accumulation of all AXI input signal's width C_DIN_WIDTH_WACH => 32, -- : integer := 1; C_DIN_WIDTH_WDCH => 64, -- : integer := 1; C_DIN_WIDTH_WRCH => 2 , -- : integer := 1; C_DIN_WIDTH_RACH => 32, -- : integer := 1; C_DIN_WIDTH_RDCH => 64, -- : integer := 1; C_DIN_WIDTH_AXIS => 1 , -- : integer := 1; C_WR_DEPTH_WACH => 16 , -- : integer := 16; C_WR_DEPTH_WDCH => 1024, -- : integer := 16; C_WR_DEPTH_WRCH => 16 , -- : integer := 16; C_WR_DEPTH_RACH => 16 , -- : integer := 16; C_WR_DEPTH_RDCH => 1024, -- : integer := 16; C_WR_DEPTH_AXIS => 1024, -- : integer := 16; C_WR_PNTR_WIDTH_WACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_WDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_WRCH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RACH => 4 , -- : integer := 4; C_WR_PNTR_WIDTH_RDCH => 10, -- : integer := 4; C_WR_PNTR_WIDTH_AXIS => 10, -- : integer := 4; C_HAS_DATA_COUNTS_WACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_WRCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RACH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_RDCH => 0, -- : integer := 0; C_HAS_DATA_COUNTS_AXIS => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_WRCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RACH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_RDCH => 0, -- : integer := 0; C_HAS_PROG_FLAGS_AXIS => 0, -- : integer := 0; C_PROG_FULL_TYPE_WACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RACH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_FULL_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_WRCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RACH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_RDCH => 1023, -- : integer := 0; C_PROG_FULL_THRESH_ASSERT_VAL_AXIS => 1023, -- : integer := 0; C_PROG_EMPTY_TYPE_WACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_WRCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RACH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_RDCH => 5 , -- : integer := 0; C_PROG_EMPTY_TYPE_AXIS => 5 , -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_WRCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RACH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_RDCH => 1022, -- : integer := 0; C_PROG_EMPTY_THRESH_ASSERT_VAL_AXIS => 1022, -- : integer := 0; C_REG_SLICE_MODE_WACH => 0, -- : integer := 0; C_REG_SLICE_MODE_WDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_WRCH => 0, -- : integer := 0; C_REG_SLICE_MODE_RACH => 0, -- : integer := 0; C_REG_SLICE_MODE_RDCH => 0, -- : integer := 0; C_REG_SLICE_MODE_AXIS => 0 -- : integer := 0 ) port map( backup => '0', backup_marker => '0', clk => CLK, rst => '0', srst => SRST, wr_clk => '0', wr_rst => '0', rd_clk => '0', rd_rst => '0', din => DIN, -- uses this one wr_en => WR_EN, -- uses this one rd_en => RD_EN, -- uses this one prog_empty_thresh => PROG_RDTHRESH_ZEROS, prog_empty_thresh_assert => PROG_RDTHRESH_ZEROS, prog_empty_thresh_negate => PROG_RDTHRESH_ZEROS, prog_full_thresh => PROG_WRTHRESH_ZEROS, prog_full_thresh_assert => PROG_WRTHRESH_ZEROS, prog_full_thresh_negate => PROG_WRTHRESH_ZEROS, int_clk => '0', injectdbiterr => '0', injectsbiterr => '0', dout => DOUT, -- uses this one full => FULL, -- uses this one almost_full => ALMOST_FULL, wr_ack => WR_ACK, overflow => OVERFLOW, empty => EMPTY, -- uses this one almost_empty => ALMOST_EMPTY, valid => VALID, underflow => UNDERFLOW, data_count => DATA_COUNT, -- uses this one rd_data_count => RD_DATA_COUNT, wr_data_count => WR_DATA_COUNT, prog_full => PROG_FULL, prog_empty => PROG_EMPTY, sbiterr => SBITERR, dbiterr => DBITERR, -- AXI Global Signal m_aclk => '0', -- : IN std_logic := '0'; s_aclk => '0', -- : IN std_logic := '0'; s_aresetn => '0', -- : IN std_logic := '0'; m_aclk_en => '0', -- : IN std_logic := '0'; s_aclk_en => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Slave Write Channel (write side) s_axi_awid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awaddr => "00000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlen => "00000000", --(others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awsize => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awburst => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awlock => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awcache => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awprot => "000", --(others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awqos => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awregion => "0000", --(others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_awvalid => '0', -- : IN std_logic := '0'; s_axi_awready => S_AXI_AWREADY, -- : OUT std_logic; s_axi_wid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wstrb => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wlast => '0', -- : IN std_logic := '0'; s_axi_wuser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_wvalid => '0', -- : IN std_logic := '0'; s_axi_wready => S_AXI_WREADY, -- : OUT std_logic; s_axi_bid => S_AXI_BID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_bresp => S_AXI_BRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_buser => S_AXI_BUSER, -- : OUT std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0); s_axi_bvalid => S_AXI_BVALID, -- : OUT std_logic; s_axi_bready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Write Channel (Read side) m_axi_awid => M_AXI_AWID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_awaddr => M_AXI_AWADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_awlen => M_AXI_AWLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_awsize => M_AXI_AWSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awburst => M_AXI_AWBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awlock => M_AXI_AWLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_awcache => M_AXI_AWCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awprot => M_AXI_AWPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_awqos => M_AXI_AWQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awregion => M_AXI_AWREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_awuser => M_AXI_AWUSER, -- : OUT std_logic_vector(C_AXI_AWUSER_WIDTH-1 DOWNTO 0); m_axi_awvalid => M_AXI_AWVALID, -- : OUT std_logic; m_axi_awready => '0', -- : IN std_logic := '0'; m_axi_wid => M_AXI_WID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_wdata => M_AXI_WDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); m_axi_wstrb => M_AXI_WSTRB, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH/8-1 DOWNTO 0); m_axi_wlast => M_AXI_WLAST, -- : OUT std_logic; m_axi_wuser => M_AXI_WUSER, -- : OUT std_logic_vector(C_AXI_WUSER_WIDTH-1 DOWNTO 0); m_axi_wvalid => M_AXI_WVALID, -- : OUT std_logic; m_axi_wready => '0', -- : IN std_logic := '0'; m_axi_bid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_buser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_BUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_bvalid => '0', -- : IN std_logic := '0'; m_axi_bready => M_AXI_BREADY, -- : OUT std_logic; -- AXI Full/Lite Slave Read Channel (Write side) s_axi_arid => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_araddr => "00000000000000000000000000000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlen => "00000000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(8-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arsize => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arburst => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arlock => "00", --(others => '0'), (others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arcache => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arprot => "000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(3-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arqos => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arregion => "0000", --(others => '0'), (others => '0'), -- : IN std_logic_vector(4-1 DOWNTO 0) := (OTHERS => '0'); s_axi_aruser => "0", --(others => '0'), (others => '0'), -- : IN std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axi_arvalid => '0', -- : IN std_logic := '0'; s_axi_arready => S_AXI_ARREADY, -- : OUT std_logic; s_axi_rid => S_AXI_RID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); s_axi_rdata => S_AXI_RDATA, -- : OUT std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0); s_axi_rresp => S_AXI_RRESP, -- : OUT std_logic_vector(2-1 DOWNTO 0); s_axi_rlast => S_AXI_RLAST, -- : OUT std_logic; s_axi_ruser => S_AXI_RUSER, -- : OUT std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0); s_axi_rvalid => S_AXI_RVALID, -- : OUT std_logic; s_axi_rready => '0', -- : IN std_logic := '0'; -- AXI Full/Lite Master Read Channel (Read side) m_axi_arid => M_AXI_ARID, -- : OUT std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0); m_axi_araddr => M_AXI_ARADDR, -- : OUT std_logic_vector(C_AXI_ADDR_WIDTH-1 DOWNTO 0); m_axi_arlen => M_AXI_ARLEN, -- : OUT std_logic_vector(8-1 DOWNTO 0); m_axi_arsize => M_AXI_ARSIZE, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arburst => M_AXI_ARBURST, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arlock => M_AXI_ARLOCK, -- : OUT std_logic_vector(2-1 DOWNTO 0); m_axi_arcache => M_AXI_ARCACHE, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arprot => M_AXI_ARPROT, -- : OUT std_logic_vector(3-1 DOWNTO 0); m_axi_arqos => M_AXI_ARQOS, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_arregion => M_AXI_ARREGION, -- : OUT std_logic_vector(4-1 DOWNTO 0); m_axi_aruser => M_AXI_ARUSER, -- : OUT std_logic_vector(C_AXI_ARUSER_WIDTH-1 DOWNTO 0); m_axi_arvalid => M_AXI_ARVALID, -- : OUT std_logic; m_axi_arready => '0', -- : IN std_logic := '0'; m_axi_rid => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXI_ID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXI_DATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rresp => "00", --(others => '0'), -- : IN std_logic_vector(2-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rlast => '0', -- : IN std_logic := '0'; m_axi_ruser => "0", --(others => '0'), -- : IN std_logic_vector(C_AXI_RUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); m_axi_rvalid => '0', -- : IN std_logic := '0'; m_axi_rready => M_AXI_RREADY, -- : OUT std_logic; -- AXI Streaming Slave Signals (Write side) s_axis_tvalid => '0', -- : IN std_logic := '0'; s_axis_tready => S_AXIS_TREADY, -- : OUT std_logic; s_axis_tdata => "0000000000000000000000000000000000000000000000000000000000000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tstrb => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tkeep => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tlast => '0', -- : IN std_logic := '0'; s_axis_tid => "00000000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tdest => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); s_axis_tuser => "0000", --(others => '0'), -- : IN std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0) := (OTHERS => '0'); -- AXI Streaming Master Signals (Read side) m_axis_tvalid => M_AXIS_TVALID, -- : OUT std_logic; m_axis_tready => '0', -- : IN std_logic := '0'; m_axis_tdata => M_AXIS_TDATA, -- : OUT std_logic_vector(C_AXIS_TDATA_WIDTH-1 DOWNTO 0); m_axis_tstrb => M_AXIS_TSTRB, -- : OUT std_logic_vector(C_AXIS_TSTRB_WIDTH-1 DOWNTO 0); m_axis_tkeep => M_AXIS_TKEEP, -- : OUT std_logic_vector(C_AXIS_TKEEP_WIDTH-1 DOWNTO 0); m_axis_tlast => M_AXIS_TLAST, -- : OUT std_logic; m_axis_tid => M_AXIS_TID, -- : OUT std_logic_vector(C_AXIS_TID_WIDTH-1 DOWNTO 0); m_axis_tdest => M_AXIS_TDEST, -- : OUT std_logic_vector(C_AXIS_TDEST_WIDTH-1 DOWNTO 0); m_axis_tuser => M_AXIS_TUSER, -- : OUT std_logic_vector(C_AXIS_TUSER_WIDTH-1 DOWNTO 0); -- AXI Full/Lite Write Address Channel Signals axi_aw_injectsbiterr => '0', -- : IN std_logic := '0'; axi_aw_injectdbiterr => '0', -- : IN std_logic := '0'; axi_aw_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WACH-1 DOWNTO 0) := (OTHERS => '0'); axi_aw_data_count => AXI_AW_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_wr_data_count => AXI_AW_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_rd_data_count => AXI_AW_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WACH DOWNTO 0); axi_aw_sbiterr => AXI_AW_SBITERR, -- : OUT std_logic; axi_aw_dbiterr => AXI_AW_DBITERR, -- : OUT std_logic; axi_aw_overflow => AXI_AW_OVERFLOW, -- : OUT std_logic; axi_aw_underflow => AXI_AW_UNDERFLOW, -- : OUT std_logic; axi_aw_prog_full => AXI_AW_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_aw_prog_empty => AXI_AW_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Data Channel Signals axi_w_injectsbiterr => '0', -- : IN std_logic := '0'; axi_w_injectdbiterr => '0', -- : IN std_logic := '0'; axi_w_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_w_data_count => AXI_W_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_wr_data_count => AXI_W_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_rd_data_count => AXI_W_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WDCH DOWNTO 0); axi_w_sbiterr => AXI_W_SBITERR, -- : OUT std_logic; axi_w_dbiterr => AXI_W_DBITERR, -- : OUT std_logic; axi_w_overflow => AXI_W_OVERFLOW, -- : OUT std_logic; axi_w_underflow => AXI_W_UNDERFLOW, -- : OUT std_logic; axi_w_prog_full => AXI_W_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_w_prog_empty => AXI_W_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Write Response Channel Signals axi_b_injectsbiterr => '0', -- : IN std_logic := '0'; axi_b_injectdbiterr => '0', -- : IN std_logic := '0'; axi_b_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_WRCH-1 DOWNTO 0) := (OTHERS => '0'); axi_b_data_count => AXI_B_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_wr_data_count => AXI_B_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_rd_data_count => AXI_B_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_WRCH DOWNTO 0); axi_b_sbiterr => AXI_B_SBITERR, -- : OUT std_logic; axi_b_dbiterr => AXI_B_DBITERR, -- : OUT std_logic; axi_b_overflow => AXI_B_OVERFLOW, -- : OUT std_logic; axi_b_underflow => AXI_B_UNDERFLOW, -- : OUT std_logic; axi_b_prog_full => AXI_B_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_b_prog_empty => AXI_B_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Address Channel Signals axi_ar_injectsbiterr => '0', -- : IN std_logic := '0'; axi_ar_injectdbiterr => '0', -- : IN std_logic := '0'; axi_ar_prog_full_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_prog_empty_thresh => "0000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RACH-1 DOWNTO 0) := (OTHERS => '0'); axi_ar_data_count => AXI_AR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_wr_data_count => AXI_AR_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_rd_data_count => AXI_AR_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RACH DOWNTO 0); axi_ar_sbiterr => AXI_AR_SBITERR, -- : OUT std_logic; axi_ar_dbiterr => AXI_AR_DBITERR, -- : OUT std_logic; axi_ar_overflow => AXI_AR_OVERFLOW, -- : OUT std_logic; axi_ar_underflow => AXI_AR_UNDERFLOW, -- : OUT std_logic; axi_ar_prog_full => AXI_AR_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_ar_prog_empty => AXI_AR_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Full/Lite Read Data Channel Signals axi_r_injectsbiterr => '0', -- : IN std_logic := '0'; axi_r_injectdbiterr => '0', -- : IN std_logic := '0'; axi_r_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_RDCH-1 DOWNTO 0) := (OTHERS => '0'); axi_r_data_count => AXI_R_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_wr_data_count => AXI_R_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_rd_data_count => AXI_R_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_RDCH DOWNTO 0); axi_r_sbiterr => AXI_R_SBITERR, -- : OUT std_logic; axi_r_dbiterr => AXI_R_DBITERR, -- : OUT std_logic; axi_r_overflow => AXI_R_OVERFLOW, -- : OUT std_logic; axi_r_underflow => AXI_R_UNDERFLOW, -- : OUT std_logic; axi_r_prog_full => AXI_R_PROG_FULL, -- : OUT STD_LOGIC := '0'; axi_r_prog_empty => AXI_R_PROG_EMPTY, -- : OUT STD_LOGIC := '1'; -- AXI Streaming FIFO Related Signals axis_injectsbiterr => '0', -- : IN std_logic := '0'; axis_injectdbiterr => '0', -- : IN std_logic := '0'; axis_prog_full_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_prog_empty_thresh => "0000000000", --(others => '0'), -- : IN std_logic_vector(C_WR_PNTR_WIDTH_AXIS-1 DOWNTO 0) := (OTHERS => '0'); axis_data_count => AXIS_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_wr_data_count => AXIS_WR_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_rd_data_count => AXIS_RD_DATA_COUNT, -- : OUT std_logic_vector(C_WR_PNTR_WIDTH_AXIS DOWNTO 0); axis_sbiterr => AXIS_SBITERR, -- : OUT std_logic; axis_dbiterr => AXIS_DBITERR, -- : OUT std_logic; axis_overflow => AXIS_OVERFLOW, -- : OUT std_logic; axis_underflow => AXIS_UNDERFLOW, -- : OUT std_logic axis_prog_full => AXIS_PROG_FULL, -- : OUT STD_LOGIC := '0'; axis_prog_empty => AXIS_PROG_EMPTY -- : OUT STD_LOGIC := '1'; ); end implementation;
LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY mux IS GENERIC (N : POSITIVE := 8); PORT( a, b, c, d, e : IN std_logic_vector(N-1 DOWNTO 0); sel : IN std_logic_vector(3 DOWNTO 0); S : OUT std_logic_vector(N-1 DOWNTO 0) ); END ENTITY mux; ARCHITECTURE Behavior OF mux IS SIGNAL Qs : STD_LOGIC_VECTOR(N-1 DOWNTO 0); BEGIN mux : PROCESS(sel) BEGIN CASE sel IS when "0100" => Qs <= a; when "0011" => when "0101" => Qs <= c; when "0110" => Qs <= d; when "0111" => Qs <= e; when "1000" => Qs <= f; when others => NULL; END CASE; S <= Qs; END PROCESS mux; END ARCHITECTURE Behavior;
------------------------------------------------------------------------------- -- system_microblaze_0_wrapper.vhd ------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; library UNISIM; use UNISIM.VCOMPONENTS.ALL; library microblaze_v8_40_a; use microblaze_v8_40_a.all; entity system_microblaze_0_wrapper is port ( CLK : in std_logic; RESET : in std_logic; MB_RESET : in std_logic; INTERRUPT : in std_logic; INTERRUPT_ADDRESS : in std_logic_vector(0 to 31); INTERRUPT_ACK : out std_logic_vector(0 to 1); EXT_BRK : in std_logic; EXT_NM_BRK : in std_logic; DBG_STOP : in std_logic; MB_Halted : out std_logic; MB_Error : out std_logic; WAKEUP : in std_logic_vector(0 to 1); SLEEP : out std_logic; DBG_WAKEUP : out std_logic; LOCKSTEP_MASTER_OUT : out std_logic_vector(0 to 4095); LOCKSTEP_SLAVE_IN : in std_logic_vector(0 to 4095); LOCKSTEP_OUT : out std_logic_vector(0 to 4095); INSTR : in std_logic_vector(0 to 31); IREADY : in std_logic; IWAIT : in std_logic; ICE : in std_logic; IUE : in std_logic; INSTR_ADDR : out std_logic_vector(0 to 31); IFETCH : out std_logic; I_AS : out std_logic; IPLB_M_ABort : out std_logic; IPLB_M_ABus : out std_logic_vector(0 to 31); IPLB_M_UABus : out std_logic_vector(0 to 31); IPLB_M_BE : out std_logic_vector(0 to 3); IPLB_M_busLock : out std_logic; IPLB_M_lockErr : out std_logic; IPLB_M_MSize : out std_logic_vector(0 to 1); IPLB_M_priority : out std_logic_vector(0 to 1); IPLB_M_rdBurst : out std_logic; IPLB_M_request : out std_logic; IPLB_M_RNW : out std_logic; IPLB_M_size : out std_logic_vector(0 to 3); IPLB_M_TAttribute : out std_logic_vector(0 to 15); IPLB_M_type : out std_logic_vector(0 to 2); IPLB_M_wrBurst : out std_logic; IPLB_M_wrDBus : out std_logic_vector(0 to 31); IPLB_MBusy : in std_logic; IPLB_MRdErr : in std_logic; IPLB_MWrErr : in std_logic; IPLB_MIRQ : in std_logic; IPLB_MWrBTerm : in std_logic; IPLB_MWrDAck : in std_logic; IPLB_MAddrAck : in std_logic; IPLB_MRdBTerm : in std_logic; IPLB_MRdDAck : in std_logic; IPLB_MRdDBus : in std_logic_vector(0 to 31); IPLB_MRdWdAddr : in std_logic_vector(0 to 3); IPLB_MRearbitrate : in std_logic; IPLB_MSSize : in std_logic_vector(0 to 1); IPLB_MTimeout : in std_logic; DATA_READ : in std_logic_vector(0 to 31); DREADY : in std_logic; DWAIT : in std_logic; DCE : in std_logic; DUE : in std_logic; DATA_WRITE : out std_logic_vector(0 to 31); DATA_ADDR : out std_logic_vector(0 to 31); D_AS : out std_logic; READ_STROBE : out std_logic; WRITE_STROBE : out std_logic; BYTE_ENABLE : out std_logic_vector(0 to 3); DPLB_M_ABort : out std_logic; DPLB_M_ABus : out std_logic_vector(0 to 31); DPLB_M_UABus : out std_logic_vector(0 to 31); DPLB_M_BE : out std_logic_vector(0 to 3); DPLB_M_busLock : out std_logic; DPLB_M_lockErr : out std_logic; DPLB_M_MSize : out std_logic_vector(0 to 1); DPLB_M_priority : out std_logic_vector(0 to 1); DPLB_M_rdBurst : out std_logic; DPLB_M_request : out std_logic; DPLB_M_RNW : out std_logic; DPLB_M_size : out std_logic_vector(0 to 3); DPLB_M_TAttribute : out std_logic_vector(0 to 15); DPLB_M_type : out std_logic_vector(0 to 2); DPLB_M_wrBurst : out std_logic; DPLB_M_wrDBus : out std_logic_vector(0 to 31); DPLB_MBusy : in std_logic; DPLB_MRdErr : in std_logic; DPLB_MWrErr : in std_logic; DPLB_MIRQ : in std_logic; DPLB_MWrBTerm : in std_logic; DPLB_MWrDAck : in std_logic; DPLB_MAddrAck : in std_logic; DPLB_MRdBTerm : in std_logic; DPLB_MRdDAck : in std_logic; DPLB_MRdDBus : in std_logic_vector(0 to 31); DPLB_MRdWdAddr : in std_logic_vector(0 to 3); DPLB_MRearbitrate : in std_logic; DPLB_MSSize : in std_logic_vector(0 to 1); DPLB_MTimeout : in std_logic; M_AXI_IP_AWID : out std_logic_vector(0 downto 0); M_AXI_IP_AWADDR : out std_logic_vector(31 downto 0); M_AXI_IP_AWLEN : out std_logic_vector(7 downto 0); M_AXI_IP_AWSIZE : out std_logic_vector(2 downto 0); M_AXI_IP_AWBURST : out std_logic_vector(1 downto 0); M_AXI_IP_AWLOCK : out std_logic; M_AXI_IP_AWCACHE : out std_logic_vector(3 downto 0); M_AXI_IP_AWPROT : out std_logic_vector(2 downto 0); M_AXI_IP_AWQOS : out std_logic_vector(3 downto 0); M_AXI_IP_AWVALID : out std_logic; M_AXI_IP_AWREADY : in std_logic; M_AXI_IP_WDATA : out std_logic_vector(31 downto 0); M_AXI_IP_WSTRB : out std_logic_vector(3 downto 0); M_AXI_IP_WLAST : out std_logic; M_AXI_IP_WVALID : out std_logic; M_AXI_IP_WREADY : in std_logic; M_AXI_IP_BID : in std_logic_vector(0 downto 0); M_AXI_IP_BRESP : in std_logic_vector(1 downto 0); M_AXI_IP_BVALID : in std_logic; M_AXI_IP_BREADY : out std_logic; M_AXI_IP_ARID : out std_logic_vector(0 downto 0); M_AXI_IP_ARADDR : out std_logic_vector(31 downto 0); M_AXI_IP_ARLEN : out std_logic_vector(7 downto 0); M_AXI_IP_ARSIZE : out std_logic_vector(2 downto 0); M_AXI_IP_ARBURST : out std_logic_vector(1 downto 0); M_AXI_IP_ARLOCK : out std_logic; M_AXI_IP_ARCACHE : out std_logic_vector(3 downto 0); M_AXI_IP_ARPROT : out std_logic_vector(2 downto 0); M_AXI_IP_ARQOS : out std_logic_vector(3 downto 0); M_AXI_IP_ARVALID : out std_logic; M_AXI_IP_ARREADY : in std_logic; M_AXI_IP_RID : in std_logic_vector(0 downto 0); M_AXI_IP_RDATA : in std_logic_vector(31 downto 0); M_AXI_IP_RRESP : in std_logic_vector(1 downto 0); M_AXI_IP_RLAST : in std_logic; M_AXI_IP_RVALID : in std_logic; M_AXI_IP_RREADY : out std_logic; M_AXI_DP_AWID : out std_logic_vector(0 downto 0); M_AXI_DP_AWADDR : out std_logic_vector(31 downto 0); M_AXI_DP_AWLEN : out std_logic_vector(7 downto 0); M_AXI_DP_AWSIZE : out std_logic_vector(2 downto 0); M_AXI_DP_AWBURST : out std_logic_vector(1 downto 0); M_AXI_DP_AWLOCK : out std_logic; M_AXI_DP_AWCACHE : out std_logic_vector(3 downto 0); M_AXI_DP_AWPROT : out std_logic_vector(2 downto 0); M_AXI_DP_AWQOS : out std_logic_vector(3 downto 0); M_AXI_DP_AWVALID : out std_logic; M_AXI_DP_AWREADY : in std_logic; M_AXI_DP_WDATA : out std_logic_vector(31 downto 0); M_AXI_DP_WSTRB : out std_logic_vector(3 downto 0); M_AXI_DP_WLAST : out std_logic; M_AXI_DP_WVALID : out std_logic; M_AXI_DP_WREADY : in std_logic; M_AXI_DP_BID : in std_logic_vector(0 downto 0); M_AXI_DP_BRESP : in std_logic_vector(1 downto 0); M_AXI_DP_BVALID : in std_logic; M_AXI_DP_BREADY : out std_logic; M_AXI_DP_ARID : out std_logic_vector(0 downto 0); M_AXI_DP_ARADDR : out std_logic_vector(31 downto 0); M_AXI_DP_ARLEN : out std_logic_vector(7 downto 0); M_AXI_DP_ARSIZE : out std_logic_vector(2 downto 0); M_AXI_DP_ARBURST : out std_logic_vector(1 downto 0); M_AXI_DP_ARLOCK : out std_logic; M_AXI_DP_ARCACHE : out std_logic_vector(3 downto 0); M_AXI_DP_ARPROT : out std_logic_vector(2 downto 0); M_AXI_DP_ARQOS : out std_logic_vector(3 downto 0); M_AXI_DP_ARVALID : out std_logic; M_AXI_DP_ARREADY : in std_logic; M_AXI_DP_RID : in std_logic_vector(0 downto 0); M_AXI_DP_RDATA : in std_logic_vector(31 downto 0); M_AXI_DP_RRESP : in std_logic_vector(1 downto 0); M_AXI_DP_RLAST : in std_logic; M_AXI_DP_RVALID : in std_logic; M_AXI_DP_RREADY : out std_logic; M_AXI_IC_AWID : out std_logic_vector(0 downto 0); M_AXI_IC_AWADDR : out std_logic_vector(31 downto 0); M_AXI_IC_AWLEN : out std_logic_vector(7 downto 0); M_AXI_IC_AWSIZE : out std_logic_vector(2 downto 0); M_AXI_IC_AWBURST : out std_logic_vector(1 downto 0); M_AXI_IC_AWLOCK : out std_logic; M_AXI_IC_AWCACHE : out std_logic_vector(3 downto 0); M_AXI_IC_AWPROT : out std_logic_vector(2 downto 0); M_AXI_IC_AWQOS : out std_logic_vector(3 downto 0); M_AXI_IC_AWVALID : out std_logic; M_AXI_IC_AWREADY : in std_logic; M_AXI_IC_AWUSER : out std_logic_vector(4 downto 0); M_AXI_IC_WDATA : out std_logic_vector(31 downto 0); M_AXI_IC_WSTRB : out std_logic_vector(3 downto 0); M_AXI_IC_WLAST : out std_logic; M_AXI_IC_WVALID : out std_logic; M_AXI_IC_WREADY : in std_logic; M_AXI_IC_WUSER : out std_logic_vector(0 downto 0); M_AXI_IC_BID : in std_logic_vector(0 downto 0); M_AXI_IC_BRESP : in std_logic_vector(1 downto 0); M_AXI_IC_BVALID : in std_logic; M_AXI_IC_BREADY : out std_logic; M_AXI_IC_BUSER : in std_logic_vector(0 downto 0); M_AXI_IC_ARID : out std_logic_vector(0 downto 0); M_AXI_IC_ARADDR : out std_logic_vector(31 downto 0); M_AXI_IC_ARLEN : out std_logic_vector(7 downto 0); M_AXI_IC_ARSIZE : out std_logic_vector(2 downto 0); M_AXI_IC_ARBURST : out std_logic_vector(1 downto 0); M_AXI_IC_ARLOCK : out std_logic; M_AXI_IC_ARCACHE : out std_logic_vector(3 downto 0); M_AXI_IC_ARPROT : out std_logic_vector(2 downto 0); M_AXI_IC_ARQOS : out std_logic_vector(3 downto 0); M_AXI_IC_ARVALID : out std_logic; M_AXI_IC_ARREADY : in std_logic; M_AXI_IC_ARUSER : out std_logic_vector(4 downto 0); M_AXI_IC_RID : in std_logic_vector(0 downto 0); M_AXI_IC_RDATA : in std_logic_vector(31 downto 0); M_AXI_IC_RRESP : in std_logic_vector(1 downto 0); M_AXI_IC_RLAST : in std_logic; M_AXI_IC_RVALID : in std_logic; M_AXI_IC_RREADY : out std_logic; M_AXI_IC_RUSER : in std_logic_vector(0 downto 0); M_AXI_DC_AWID : out std_logic_vector(0 downto 0); M_AXI_DC_AWADDR : out std_logic_vector(31 downto 0); M_AXI_DC_AWLEN : out std_logic_vector(7 downto 0); M_AXI_DC_AWSIZE : out std_logic_vector(2 downto 0); M_AXI_DC_AWBURST : out std_logic_vector(1 downto 0); M_AXI_DC_AWLOCK : out std_logic; M_AXI_DC_AWCACHE : out std_logic_vector(3 downto 0); M_AXI_DC_AWPROT : out std_logic_vector(2 downto 0); M_AXI_DC_AWQOS : out std_logic_vector(3 downto 0); M_AXI_DC_AWVALID : out std_logic; M_AXI_DC_AWREADY : in std_logic; M_AXI_DC_AWUSER : out std_logic_vector(4 downto 0); M_AXI_DC_WDATA : out std_logic_vector(31 downto 0); M_AXI_DC_WSTRB : out std_logic_vector(3 downto 0); M_AXI_DC_WLAST : out std_logic; M_AXI_DC_WVALID : out std_logic; M_AXI_DC_WREADY : in std_logic; M_AXI_DC_WUSER : out std_logic_vector(0 downto 0); M_AXI_DC_BID : in std_logic_vector(0 downto 0); M_AXI_DC_BRESP : in std_logic_vector(1 downto 0); M_AXI_DC_BVALID : in std_logic; M_AXI_DC_BREADY : out std_logic; M_AXI_DC_BUSER : in std_logic_vector(0 downto 0); M_AXI_DC_ARID : out std_logic_vector(0 downto 0); M_AXI_DC_ARADDR : out std_logic_vector(31 downto 0); M_AXI_DC_ARLEN : out std_logic_vector(7 downto 0); M_AXI_DC_ARSIZE : out std_logic_vector(2 downto 0); M_AXI_DC_ARBURST : out std_logic_vector(1 downto 0); M_AXI_DC_ARLOCK : out std_logic; M_AXI_DC_ARCACHE : out std_logic_vector(3 downto 0); M_AXI_DC_ARPROT : out std_logic_vector(2 downto 0); M_AXI_DC_ARQOS : out std_logic_vector(3 downto 0); M_AXI_DC_ARVALID : out std_logic; M_AXI_DC_ARREADY : in std_logic; M_AXI_DC_ARUSER : out std_logic_vector(4 downto 0); M_AXI_DC_RID : in std_logic_vector(0 downto 0); M_AXI_DC_RDATA : in std_logic_vector(31 downto 0); M_AXI_DC_RRESP : in std_logic_vector(1 downto 0); M_AXI_DC_RLAST : in std_logic; M_AXI_DC_RVALID : in std_logic; M_AXI_DC_RREADY : out std_logic; M_AXI_DC_RUSER : in std_logic_vector(0 downto 0); DBG_CLK : in std_logic; DBG_TDI : in std_logic; DBG_TDO : out std_logic; DBG_REG_EN : in std_logic_vector(0 to 7); DBG_SHIFT : in std_logic; DBG_CAPTURE : in std_logic; DBG_UPDATE : in std_logic; DEBUG_RST : in std_logic; Trace_Instruction : out std_logic_vector(0 to 31); Trace_Valid_Instr : out std_logic; Trace_PC : out std_logic_vector(0 to 31); Trace_Reg_Write : out std_logic; Trace_Reg_Addr : out std_logic_vector(0 to 4); Trace_MSR_Reg : out std_logic_vector(0 to 14); Trace_PID_Reg : out std_logic_vector(0 to 7); Trace_New_Reg_Value : out std_logic_vector(0 to 31); Trace_Exception_Taken : out std_logic; Trace_Exception_Kind : out std_logic_vector(0 to 4); Trace_Jump_Taken : out std_logic; Trace_Delay_Slot : out std_logic; Trace_Data_Address : out std_logic_vector(0 to 31); Trace_Data_Access : out std_logic; Trace_Data_Read : out std_logic; Trace_Data_Write : out std_logic; Trace_Data_Write_Value : out std_logic_vector(0 to 31); Trace_Data_Byte_Enable : out std_logic_vector(0 to 3); Trace_DCache_Req : out std_logic; Trace_DCache_Hit : out std_logic; Trace_DCache_Rdy : out std_logic; Trace_DCache_Read : out std_logic; Trace_ICache_Req : out std_logic; Trace_ICache_Hit : out std_logic; Trace_ICache_Rdy : out std_logic; Trace_OF_PipeRun : out std_logic; Trace_EX_PipeRun : out std_logic; Trace_MEM_PipeRun : out std_logic; Trace_MB_Halted : out std_logic; Trace_Jump_Hit : out std_logic; FSL0_S_CLK : out std_logic; FSL0_S_READ : out std_logic; FSL0_S_DATA : in std_logic_vector(0 to 31); FSL0_S_CONTROL : in std_logic; FSL0_S_EXISTS : in std_logic; FSL0_M_CLK : out std_logic; FSL0_M_WRITE : out std_logic; FSL0_M_DATA : out std_logic_vector(0 to 31); FSL0_M_CONTROL : out std_logic; FSL0_M_FULL : in std_logic; FSL1_S_CLK : out std_logic; FSL1_S_READ : out std_logic; FSL1_S_DATA : in std_logic_vector(0 to 31); FSL1_S_CONTROL : in std_logic; FSL1_S_EXISTS : in std_logic; FSL1_M_CLK : out std_logic; FSL1_M_WRITE : out std_logic; FSL1_M_DATA : out std_logic_vector(0 to 31); FSL1_M_CONTROL : out std_logic; FSL1_M_FULL : in std_logic; FSL2_S_CLK : out std_logic; FSL2_S_READ : out std_logic; FSL2_S_DATA : in std_logic_vector(0 to 31); FSL2_S_CONTROL : in std_logic; FSL2_S_EXISTS : in std_logic; FSL2_M_CLK : out std_logic; FSL2_M_WRITE : out std_logic; FSL2_M_DATA : out std_logic_vector(0 to 31); FSL2_M_CONTROL : out std_logic; FSL2_M_FULL : in std_logic; FSL3_S_CLK : out std_logic; FSL3_S_READ : out std_logic; FSL3_S_DATA : in std_logic_vector(0 to 31); FSL3_S_CONTROL : in std_logic; FSL3_S_EXISTS : in std_logic; FSL3_M_CLK : out std_logic; FSL3_M_WRITE : out std_logic; FSL3_M_DATA : out std_logic_vector(0 to 31); FSL3_M_CONTROL : out std_logic; FSL3_M_FULL : in std_logic; FSL4_S_CLK : out std_logic; FSL4_S_READ : out std_logic; FSL4_S_DATA : in std_logic_vector(0 to 31); FSL4_S_CONTROL : in std_logic; FSL4_S_EXISTS : in std_logic; FSL4_M_CLK : out std_logic; FSL4_M_WRITE : out std_logic; FSL4_M_DATA : out std_logic_vector(0 to 31); FSL4_M_CONTROL : out std_logic; FSL4_M_FULL : in std_logic; FSL5_S_CLK : out std_logic; FSL5_S_READ : out std_logic; FSL5_S_DATA : in std_logic_vector(0 to 31); FSL5_S_CONTROL : in std_logic; FSL5_S_EXISTS : in std_logic; FSL5_M_CLK : out std_logic; FSL5_M_WRITE : out std_logic; FSL5_M_DATA : out std_logic_vector(0 to 31); FSL5_M_CONTROL : out std_logic; FSL5_M_FULL : in std_logic; FSL6_S_CLK : out std_logic; FSL6_S_READ : out std_logic; FSL6_S_DATA : in std_logic_vector(0 to 31); FSL6_S_CONTROL : in std_logic; FSL6_S_EXISTS : in std_logic; FSL6_M_CLK : out std_logic; FSL6_M_WRITE : out std_logic; FSL6_M_DATA : out std_logic_vector(0 to 31); FSL6_M_CONTROL : out std_logic; FSL6_M_FULL : in std_logic; FSL7_S_CLK : out std_logic; FSL7_S_READ : out std_logic; FSL7_S_DATA : in std_logic_vector(0 to 31); FSL7_S_CONTROL : in std_logic; FSL7_S_EXISTS : in std_logic; FSL7_M_CLK : out std_logic; FSL7_M_WRITE : out std_logic; FSL7_M_DATA : out std_logic_vector(0 to 31); FSL7_M_CONTROL : out std_logic; FSL7_M_FULL : in std_logic; FSL8_S_CLK : out std_logic; FSL8_S_READ : out std_logic; FSL8_S_DATA : in std_logic_vector(0 to 31); FSL8_S_CONTROL : in std_logic; FSL8_S_EXISTS : in std_logic; FSL8_M_CLK : out std_logic; FSL8_M_WRITE : out std_logic; FSL8_M_DATA : out std_logic_vector(0 to 31); FSL8_M_CONTROL : out std_logic; FSL8_M_FULL : in std_logic; FSL9_S_CLK : out std_logic; FSL9_S_READ : out std_logic; FSL9_S_DATA : in std_logic_vector(0 to 31); FSL9_S_CONTROL : in std_logic; FSL9_S_EXISTS : in std_logic; FSL9_M_CLK : out std_logic; FSL9_M_WRITE : out std_logic; FSL9_M_DATA : out std_logic_vector(0 to 31); FSL9_M_CONTROL : out std_logic; FSL9_M_FULL : in std_logic; FSL10_S_CLK : out std_logic; FSL10_S_READ : out std_logic; FSL10_S_DATA : in std_logic_vector(0 to 31); FSL10_S_CONTROL : in std_logic; FSL10_S_EXISTS : in std_logic; FSL10_M_CLK : out std_logic; FSL10_M_WRITE : out std_logic; FSL10_M_DATA : out std_logic_vector(0 to 31); FSL10_M_CONTROL : out std_logic; FSL10_M_FULL : in std_logic; FSL11_S_CLK : out std_logic; FSL11_S_READ : out std_logic; FSL11_S_DATA : in std_logic_vector(0 to 31); FSL11_S_CONTROL : in std_logic; FSL11_S_EXISTS : in std_logic; FSL11_M_CLK : out std_logic; FSL11_M_WRITE : out std_logic; FSL11_M_DATA : out std_logic_vector(0 to 31); FSL11_M_CONTROL : out std_logic; FSL11_M_FULL : in std_logic; FSL12_S_CLK : out std_logic; FSL12_S_READ : out std_logic; FSL12_S_DATA : in std_logic_vector(0 to 31); FSL12_S_CONTROL : in std_logic; FSL12_S_EXISTS : in std_logic; FSL12_M_CLK : out std_logic; FSL12_M_WRITE : out std_logic; FSL12_M_DATA : out std_logic_vector(0 to 31); FSL12_M_CONTROL : out std_logic; FSL12_M_FULL : in std_logic; FSL13_S_CLK : out std_logic; FSL13_S_READ : out std_logic; FSL13_S_DATA : in std_logic_vector(0 to 31); FSL13_S_CONTROL : in std_logic; FSL13_S_EXISTS : in std_logic; FSL13_M_CLK : out std_logic; FSL13_M_WRITE : out std_logic; FSL13_M_DATA : out std_logic_vector(0 to 31); FSL13_M_CONTROL : out std_logic; FSL13_M_FULL : in std_logic; FSL14_S_CLK : out std_logic; FSL14_S_READ : out std_logic; FSL14_S_DATA : in std_logic_vector(0 to 31); FSL14_S_CONTROL : in std_logic; FSL14_S_EXISTS : in std_logic; FSL14_M_CLK : out std_logic; FSL14_M_WRITE : out std_logic; FSL14_M_DATA : out std_logic_vector(0 to 31); FSL14_M_CONTROL : out std_logic; FSL14_M_FULL : in std_logic; FSL15_S_CLK : out std_logic; FSL15_S_READ : out std_logic; FSL15_S_DATA : in std_logic_vector(0 to 31); FSL15_S_CONTROL : in std_logic; FSL15_S_EXISTS : in std_logic; FSL15_M_CLK : out std_logic; FSL15_M_WRITE : out std_logic; FSL15_M_DATA : out std_logic_vector(0 to 31); FSL15_M_CONTROL : out std_logic; FSL15_M_FULL : in std_logic; M0_AXIS_TLAST : out std_logic; M0_AXIS_TDATA : out std_logic_vector(31 downto 0); M0_AXIS_TVALID : out std_logic; M0_AXIS_TREADY : in std_logic; S0_AXIS_TLAST : in std_logic; S0_AXIS_TDATA : in std_logic_vector(31 downto 0); S0_AXIS_TVALID : in std_logic; S0_AXIS_TREADY : out std_logic; M1_AXIS_TLAST : out std_logic; M1_AXIS_TDATA : out std_logic_vector(31 downto 0); M1_AXIS_TVALID : out std_logic; M1_AXIS_TREADY : in std_logic; S1_AXIS_TLAST : in std_logic; S1_AXIS_TDATA : in std_logic_vector(31 downto 0); S1_AXIS_TVALID : in std_logic; S1_AXIS_TREADY : out std_logic; M2_AXIS_TLAST : out std_logic; M2_AXIS_TDATA : out std_logic_vector(31 downto 0); M2_AXIS_TVALID : out std_logic; M2_AXIS_TREADY : in std_logic; S2_AXIS_TLAST : in std_logic; S2_AXIS_TDATA : in std_logic_vector(31 downto 0); S2_AXIS_TVALID : in std_logic; S2_AXIS_TREADY : out std_logic; M3_AXIS_TLAST : out std_logic; M3_AXIS_TDATA : out std_logic_vector(31 downto 0); M3_AXIS_TVALID : out std_logic; M3_AXIS_TREADY : in std_logic; S3_AXIS_TLAST : in std_logic; S3_AXIS_TDATA : in std_logic_vector(31 downto 0); S3_AXIS_TVALID : in std_logic; S3_AXIS_TREADY : out std_logic; M4_AXIS_TLAST : out std_logic; M4_AXIS_TDATA : out std_logic_vector(31 downto 0); M4_AXIS_TVALID : out std_logic; M4_AXIS_TREADY : in std_logic; S4_AXIS_TLAST : in std_logic; S4_AXIS_TDATA : in std_logic_vector(31 downto 0); S4_AXIS_TVALID : in std_logic; S4_AXIS_TREADY : out std_logic; M5_AXIS_TLAST : out std_logic; M5_AXIS_TDATA : out std_logic_vector(31 downto 0); M5_AXIS_TVALID : out std_logic; M5_AXIS_TREADY : in std_logic; S5_AXIS_TLAST : in std_logic; S5_AXIS_TDATA : in std_logic_vector(31 downto 0); S5_AXIS_TVALID : in std_logic; S5_AXIS_TREADY : out std_logic; M6_AXIS_TLAST : out std_logic; M6_AXIS_TDATA : out std_logic_vector(31 downto 0); M6_AXIS_TVALID : out std_logic; M6_AXIS_TREADY : in std_logic; S6_AXIS_TLAST : in std_logic; S6_AXIS_TDATA : in std_logic_vector(31 downto 0); S6_AXIS_TVALID : in std_logic; S6_AXIS_TREADY : out std_logic; M7_AXIS_TLAST : out std_logic; M7_AXIS_TDATA : out std_logic_vector(31 downto 0); M7_AXIS_TVALID : out std_logic; M7_AXIS_TREADY : in std_logic; S7_AXIS_TLAST : in std_logic; S7_AXIS_TDATA : in std_logic_vector(31 downto 0); S7_AXIS_TVALID : in std_logic; S7_AXIS_TREADY : out std_logic; M8_AXIS_TLAST : out std_logic; M8_AXIS_TDATA : out std_logic_vector(31 downto 0); M8_AXIS_TVALID : out std_logic; M8_AXIS_TREADY : in std_logic; S8_AXIS_TLAST : in std_logic; S8_AXIS_TDATA : in std_logic_vector(31 downto 0); S8_AXIS_TVALID : in std_logic; S8_AXIS_TREADY : out std_logic; M9_AXIS_TLAST : out std_logic; M9_AXIS_TDATA : out std_logic_vector(31 downto 0); M9_AXIS_TVALID : out std_logic; M9_AXIS_TREADY : in std_logic; S9_AXIS_TLAST : in std_logic; S9_AXIS_TDATA : in std_logic_vector(31 downto 0); S9_AXIS_TVALID : in std_logic; S9_AXIS_TREADY : out std_logic; M10_AXIS_TLAST : out std_logic; M10_AXIS_TDATA : out std_logic_vector(31 downto 0); M10_AXIS_TVALID : out std_logic; M10_AXIS_TREADY : in std_logic; S10_AXIS_TLAST : in std_logic; S10_AXIS_TDATA : in std_logic_vector(31 downto 0); S10_AXIS_TVALID : in std_logic; S10_AXIS_TREADY : out std_logic; M11_AXIS_TLAST : out std_logic; M11_AXIS_TDATA : out std_logic_vector(31 downto 0); M11_AXIS_TVALID : out std_logic; M11_AXIS_TREADY : in std_logic; S11_AXIS_TLAST : in std_logic; S11_AXIS_TDATA : in std_logic_vector(31 downto 0); S11_AXIS_TVALID : in std_logic; S11_AXIS_TREADY : out std_logic; M12_AXIS_TLAST : out std_logic; M12_AXIS_TDATA : out std_logic_vector(31 downto 0); M12_AXIS_TVALID : out std_logic; M12_AXIS_TREADY : in std_logic; S12_AXIS_TLAST : in std_logic; S12_AXIS_TDATA : in std_logic_vector(31 downto 0); S12_AXIS_TVALID : in std_logic; S12_AXIS_TREADY : out std_logic; M13_AXIS_TLAST : out std_logic; M13_AXIS_TDATA : out std_logic_vector(31 downto 0); M13_AXIS_TVALID : out std_logic; M13_AXIS_TREADY : in std_logic; S13_AXIS_TLAST : in std_logic; S13_AXIS_TDATA : in std_logic_vector(31 downto 0); S13_AXIS_TVALID : in std_logic; S13_AXIS_TREADY : out std_logic; M14_AXIS_TLAST : out std_logic; M14_AXIS_TDATA : out std_logic_vector(31 downto 0); M14_AXIS_TVALID : out std_logic; M14_AXIS_TREADY : in std_logic; S14_AXIS_TLAST : in std_logic; S14_AXIS_TDATA : in std_logic_vector(31 downto 0); S14_AXIS_TVALID : in std_logic; S14_AXIS_TREADY : out std_logic; M15_AXIS_TLAST : out std_logic; M15_AXIS_TDATA : out std_logic_vector(31 downto 0); M15_AXIS_TVALID : out std_logic; M15_AXIS_TREADY : in std_logic; S15_AXIS_TLAST : in std_logic; S15_AXIS_TDATA : in std_logic_vector(31 downto 0); S15_AXIS_TVALID : in std_logic; S15_AXIS_TREADY : out std_logic; ICACHE_FSL_IN_CLK : out std_logic; ICACHE_FSL_IN_READ : out std_logic; ICACHE_FSL_IN_DATA : in std_logic_vector(0 to 31); ICACHE_FSL_IN_CONTROL : in std_logic; ICACHE_FSL_IN_EXISTS : in std_logic; ICACHE_FSL_OUT_CLK : out std_logic; ICACHE_FSL_OUT_WRITE : out std_logic; ICACHE_FSL_OUT_DATA : out std_logic_vector(0 to 31); ICACHE_FSL_OUT_CONTROL : out std_logic; ICACHE_FSL_OUT_FULL : in std_logic; DCACHE_FSL_IN_CLK : out std_logic; DCACHE_FSL_IN_READ : out std_logic; DCACHE_FSL_IN_DATA : in std_logic_vector(0 to 31); DCACHE_FSL_IN_CONTROL : in std_logic; DCACHE_FSL_IN_EXISTS : in std_logic; DCACHE_FSL_OUT_CLK : out std_logic; DCACHE_FSL_OUT_WRITE : out std_logic; DCACHE_FSL_OUT_DATA : out std_logic_vector(0 to 31); DCACHE_FSL_OUT_CONTROL : out std_logic; DCACHE_FSL_OUT_FULL : in std_logic ); attribute x_core_info : STRING; attribute x_core_info of system_microblaze_0_wrapper : entity is "microblaze_v8_40_a"; end system_microblaze_0_wrapper; architecture STRUCTURE of system_microblaze_0_wrapper is component microblaze is generic ( C_SCO : integer; C_FREQ : integer; C_DATA_SIZE : integer; C_DYNAMIC_BUS_SIZING : integer; C_FAMILY : string; C_INSTANCE : string; C_AVOID_PRIMITIVES : integer; C_FAULT_TOLERANT : integer; C_ECC_USE_CE_EXCEPTION : integer; C_LOCKSTEP_SLAVE : integer; C_ENDIANNESS : integer; C_AREA_OPTIMIZED : integer; C_OPTIMIZATION : integer; C_INTERCONNECT : integer; C_STREAM_INTERCONNECT : integer; C_DPLB_DWIDTH : integer; C_DPLB_NATIVE_DWIDTH : integer; C_DPLB_BURST_EN : integer; C_DPLB_P2P : integer; C_IPLB_DWIDTH : integer; C_IPLB_NATIVE_DWIDTH : integer; C_IPLB_BURST_EN : integer; C_IPLB_P2P : integer; C_M_AXI_DP_THREAD_ID_WIDTH : integer; C_M_AXI_DP_DATA_WIDTH : integer; C_M_AXI_DP_ADDR_WIDTH : integer; C_M_AXI_DP_EXCLUSIVE_ACCESS : integer; C_M_AXI_IP_THREAD_ID_WIDTH : integer; C_M_AXI_IP_DATA_WIDTH : integer; C_M_AXI_IP_ADDR_WIDTH : integer; C_D_AXI : integer; C_D_PLB : integer; C_D_LMB : integer; C_I_AXI : integer; C_I_PLB : integer; C_I_LMB : integer; C_USE_MSR_INSTR : integer; C_USE_PCMP_INSTR : integer; C_USE_BARREL : integer; C_USE_DIV : integer; C_USE_HW_MUL : integer; C_USE_FPU : integer; C_USE_REORDER_INSTR : integer; C_UNALIGNED_EXCEPTIONS : integer; C_ILL_OPCODE_EXCEPTION : integer; C_M_AXI_I_BUS_EXCEPTION : integer; C_M_AXI_D_BUS_EXCEPTION : integer; C_IPLB_BUS_EXCEPTION : integer; C_DPLB_BUS_EXCEPTION : integer; C_DIV_ZERO_EXCEPTION : integer; C_FPU_EXCEPTION : integer; C_FSL_EXCEPTION : integer; C_USE_STACK_PROTECTION : integer; C_PVR : integer; C_PVR_USER1 : std_logic_vector(0 to 7); C_PVR_USER2 : std_logic_vector(0 to 31); C_DEBUG_ENABLED : integer; C_NUMBER_OF_PC_BRK : integer; C_NUMBER_OF_RD_ADDR_BRK : integer; C_NUMBER_OF_WR_ADDR_BRK : integer; C_INTERRUPT_IS_EDGE : integer; C_EDGE_IS_POSITIVE : integer; C_RESET_MSR : std_logic_vector; C_OPCODE_0x0_ILLEGAL : integer; C_FSL_LINKS : integer; C_FSL_DATA_SIZE : integer; C_USE_EXTENDED_FSL_INSTR : integer; C_M0_AXIS_DATA_WIDTH : integer; C_S0_AXIS_DATA_WIDTH : integer; C_M1_AXIS_DATA_WIDTH : integer; C_S1_AXIS_DATA_WIDTH : integer; C_M2_AXIS_DATA_WIDTH : integer; C_S2_AXIS_DATA_WIDTH : integer; C_M3_AXIS_DATA_WIDTH : integer; C_S3_AXIS_DATA_WIDTH : integer; C_M4_AXIS_DATA_WIDTH : integer; C_S4_AXIS_DATA_WIDTH : integer; C_M5_AXIS_DATA_WIDTH : integer; C_S5_AXIS_DATA_WIDTH : integer; C_M6_AXIS_DATA_WIDTH : integer; C_S6_AXIS_DATA_WIDTH : integer; C_M7_AXIS_DATA_WIDTH : integer; C_S7_AXIS_DATA_WIDTH : integer; C_M8_AXIS_DATA_WIDTH : integer; C_S8_AXIS_DATA_WIDTH : integer; C_M9_AXIS_DATA_WIDTH : integer; C_S9_AXIS_DATA_WIDTH : integer; C_M10_AXIS_DATA_WIDTH : integer; C_S10_AXIS_DATA_WIDTH : integer; C_M11_AXIS_DATA_WIDTH : integer; C_S11_AXIS_DATA_WIDTH : integer; C_M12_AXIS_DATA_WIDTH : integer; C_S12_AXIS_DATA_WIDTH : integer; C_M13_AXIS_DATA_WIDTH : integer; C_S13_AXIS_DATA_WIDTH : integer; C_M14_AXIS_DATA_WIDTH : integer; C_S14_AXIS_DATA_WIDTH : integer; C_M15_AXIS_DATA_WIDTH : integer; C_S15_AXIS_DATA_WIDTH : integer; C_ICACHE_BASEADDR : std_logic_vector; C_ICACHE_HIGHADDR : std_logic_vector; C_USE_ICACHE : integer; C_ALLOW_ICACHE_WR : integer; C_ADDR_TAG_BITS : integer; C_CACHE_BYTE_SIZE : integer; C_ICACHE_USE_FSL : integer; C_ICACHE_LINE_LEN : integer; C_ICACHE_ALWAYS_USED : integer; C_ICACHE_INTERFACE : integer; C_ICACHE_VICTIMS : integer; C_ICACHE_STREAMS : integer; C_ICACHE_FORCE_TAG_LUTRAM : integer; C_ICACHE_DATA_WIDTH : integer; C_M_AXI_IC_THREAD_ID_WIDTH : integer; C_M_AXI_IC_DATA_WIDTH : integer; C_M_AXI_IC_ADDR_WIDTH : integer; C_M_AXI_IC_USER_VALUE : integer; C_M_AXI_IC_AWUSER_WIDTH : integer; C_M_AXI_IC_ARUSER_WIDTH : integer; C_M_AXI_IC_WUSER_WIDTH : integer; C_M_AXI_IC_RUSER_WIDTH : integer; C_M_AXI_IC_BUSER_WIDTH : integer; C_DCACHE_BASEADDR : std_logic_vector; C_DCACHE_HIGHADDR : std_logic_vector; C_USE_DCACHE : integer; C_ALLOW_DCACHE_WR : integer; C_DCACHE_ADDR_TAG : integer; C_DCACHE_BYTE_SIZE : integer; C_DCACHE_USE_FSL : integer; C_DCACHE_LINE_LEN : integer; C_DCACHE_ALWAYS_USED : integer; C_DCACHE_INTERFACE : integer; C_DCACHE_USE_WRITEBACK : integer; C_DCACHE_VICTIMS : integer; C_DCACHE_FORCE_TAG_LUTRAM : integer; C_DCACHE_DATA_WIDTH : integer; C_M_AXI_DC_THREAD_ID_WIDTH : integer; C_M_AXI_DC_DATA_WIDTH : integer; C_M_AXI_DC_ADDR_WIDTH : integer; C_M_AXI_DC_EXCLUSIVE_ACCESS : integer; C_M_AXI_DC_USER_VALUE : integer; C_M_AXI_DC_AWUSER_WIDTH : integer; C_M_AXI_DC_ARUSER_WIDTH : integer; C_M_AXI_DC_WUSER_WIDTH : integer; C_M_AXI_DC_RUSER_WIDTH : integer; C_M_AXI_DC_BUSER_WIDTH : integer; C_USE_MMU : integer; C_MMU_DTLB_SIZE : integer; C_MMU_ITLB_SIZE : integer; C_MMU_TLB_ACCESS : integer; C_MMU_ZONES : integer; C_MMU_PRIVILEGED_INSTR : integer; C_USE_INTERRUPT : integer; C_USE_EXT_BRK : integer; C_USE_EXT_NM_BRK : integer; C_USE_BRANCH_TARGET_CACHE : integer; C_BRANCH_TARGET_CACHE_SIZE : integer; C_PC_WIDTH : integer ); port ( CLK : in std_logic; RESET : in std_logic; MB_RESET : in std_logic; INTERRUPT : in std_logic; INTERRUPT_ADDRESS : in std_logic_vector(0 to 31); INTERRUPT_ACK : out std_logic_vector(0 to 1); EXT_BRK : in std_logic; EXT_NM_BRK : in std_logic; DBG_STOP : in std_logic; MB_Halted : out std_logic; MB_Error : out std_logic; WAKEUP : in std_logic_vector(0 to 1); SLEEP : out std_logic; DBG_WAKEUP : out std_logic; LOCKSTEP_MASTER_OUT : out std_logic_vector(0 to 4095); LOCKSTEP_SLAVE_IN : in std_logic_vector(0 to 4095); LOCKSTEP_OUT : out std_logic_vector(0 to 4095); INSTR : in std_logic_vector(0 to 31); IREADY : in std_logic; IWAIT : in std_logic; ICE : in std_logic; IUE : in std_logic; INSTR_ADDR : out std_logic_vector(0 to 31); IFETCH : out std_logic; I_AS : out std_logic; IPLB_M_ABort : out std_logic; IPLB_M_ABus : out std_logic_vector(0 to 31); IPLB_M_UABus : out std_logic_vector(0 to 31); IPLB_M_BE : out std_logic_vector(0 to (C_IPLB_DWIDTH-1)/8); IPLB_M_busLock : out std_logic; IPLB_M_lockErr : out std_logic; IPLB_M_MSize : out std_logic_vector(0 to 1); IPLB_M_priority : out std_logic_vector(0 to 1); IPLB_M_rdBurst : out std_logic; IPLB_M_request : out std_logic; IPLB_M_RNW : out std_logic; IPLB_M_size : out std_logic_vector(0 to 3); IPLB_M_TAttribute : out std_logic_vector(0 to 15); IPLB_M_type : out std_logic_vector(0 to 2); IPLB_M_wrBurst : out std_logic; IPLB_M_wrDBus : out std_logic_vector(0 to C_IPLB_DWIDTH-1); IPLB_MBusy : in std_logic; IPLB_MRdErr : in std_logic; IPLB_MWrErr : in std_logic; IPLB_MIRQ : in std_logic; IPLB_MWrBTerm : in std_logic; IPLB_MWrDAck : in std_logic; IPLB_MAddrAck : in std_logic; IPLB_MRdBTerm : in std_logic; IPLB_MRdDAck : in std_logic; IPLB_MRdDBus : in std_logic_vector(0 to C_IPLB_DWIDTH-1); IPLB_MRdWdAddr : in std_logic_vector(0 to 3); IPLB_MRearbitrate : in std_logic; IPLB_MSSize : in std_logic_vector(0 to 1); IPLB_MTimeout : in std_logic; DATA_READ : in std_logic_vector(0 to 31); DREADY : in std_logic; DWAIT : in std_logic; DCE : in std_logic; DUE : in std_logic; DATA_WRITE : out std_logic_vector(0 to 31); DATA_ADDR : out std_logic_vector(0 to 31); D_AS : out std_logic; READ_STROBE : out std_logic; WRITE_STROBE : out std_logic; BYTE_ENABLE : out std_logic_vector(0 to 3); DPLB_M_ABort : out std_logic; DPLB_M_ABus : out std_logic_vector(0 to 31); DPLB_M_UABus : out std_logic_vector(0 to 31); DPLB_M_BE : out std_logic_vector(0 to (C_DPLB_DWIDTH-1)/8); DPLB_M_busLock : out std_logic; DPLB_M_lockErr : out std_logic; DPLB_M_MSize : out std_logic_vector(0 to 1); DPLB_M_priority : out std_logic_vector(0 to 1); DPLB_M_rdBurst : out std_logic; DPLB_M_request : out std_logic; DPLB_M_RNW : out std_logic; DPLB_M_size : out std_logic_vector(0 to 3); DPLB_M_TAttribute : out std_logic_vector(0 to 15); DPLB_M_type : out std_logic_vector(0 to 2); DPLB_M_wrBurst : out std_logic; DPLB_M_wrDBus : out std_logic_vector(0 to C_DPLB_DWIDTH-1); DPLB_MBusy : in std_logic; DPLB_MRdErr : in std_logic; DPLB_MWrErr : in std_logic; DPLB_MIRQ : in std_logic; DPLB_MWrBTerm : in std_logic; DPLB_MWrDAck : in std_logic; DPLB_MAddrAck : in std_logic; DPLB_MRdBTerm : in std_logic; DPLB_MRdDAck : in std_logic; DPLB_MRdDBus : in std_logic_vector(0 to C_DPLB_DWIDTH-1); DPLB_MRdWdAddr : in std_logic_vector(0 to 3); DPLB_MRearbitrate : in std_logic; DPLB_MSSize : in std_logic_vector(0 to 1); DPLB_MTimeout : in std_logic; M_AXI_IP_AWID : out std_logic_vector((C_M_AXI_IP_THREAD_ID_WIDTH-1) downto 0); M_AXI_IP_AWADDR : out std_logic_vector((C_M_AXI_IP_ADDR_WIDTH-1) downto 0); M_AXI_IP_AWLEN : out std_logic_vector(7 downto 0); M_AXI_IP_AWSIZE : out std_logic_vector(2 downto 0); M_AXI_IP_AWBURST : out std_logic_vector(1 downto 0); M_AXI_IP_AWLOCK : out std_logic; M_AXI_IP_AWCACHE : out std_logic_vector(3 downto 0); M_AXI_IP_AWPROT : out std_logic_vector(2 downto 0); M_AXI_IP_AWQOS : out std_logic_vector(3 downto 0); M_AXI_IP_AWVALID : out std_logic; M_AXI_IP_AWREADY : in std_logic; M_AXI_IP_WDATA : out std_logic_vector((C_M_AXI_IP_DATA_WIDTH-1) downto 0); M_AXI_IP_WSTRB : out std_logic_vector(((C_M_AXI_IP_DATA_WIDTH/8)-1) downto 0); M_AXI_IP_WLAST : out std_logic; M_AXI_IP_WVALID : out std_logic; M_AXI_IP_WREADY : in std_logic; M_AXI_IP_BID : in std_logic_vector((C_M_AXI_IP_THREAD_ID_WIDTH-1) downto 0); M_AXI_IP_BRESP : in std_logic_vector(1 downto 0); M_AXI_IP_BVALID : in std_logic; M_AXI_IP_BREADY : out std_logic; M_AXI_IP_ARID : out std_logic_vector((C_M_AXI_IP_THREAD_ID_WIDTH-1) downto 0); M_AXI_IP_ARADDR : out std_logic_vector((C_M_AXI_IP_ADDR_WIDTH-1) downto 0); M_AXI_IP_ARLEN : out std_logic_vector(7 downto 0); M_AXI_IP_ARSIZE : out std_logic_vector(2 downto 0); M_AXI_IP_ARBURST : out std_logic_vector(1 downto 0); M_AXI_IP_ARLOCK : out std_logic; M_AXI_IP_ARCACHE : out std_logic_vector(3 downto 0); M_AXI_IP_ARPROT : out std_logic_vector(2 downto 0); M_AXI_IP_ARQOS : out std_logic_vector(3 downto 0); M_AXI_IP_ARVALID : out std_logic; M_AXI_IP_ARREADY : in std_logic; M_AXI_IP_RID : in std_logic_vector((C_M_AXI_IP_THREAD_ID_WIDTH-1) downto 0); M_AXI_IP_RDATA : in std_logic_vector((C_M_AXI_IP_DATA_WIDTH-1) downto 0); M_AXI_IP_RRESP : in std_logic_vector(1 downto 0); M_AXI_IP_RLAST : in std_logic; M_AXI_IP_RVALID : in std_logic; M_AXI_IP_RREADY : out std_logic; M_AXI_DP_AWID : out std_logic_vector((C_M_AXI_DP_THREAD_ID_WIDTH-1) downto 0); M_AXI_DP_AWADDR : out std_logic_vector((C_M_AXI_DP_ADDR_WIDTH-1) downto 0); M_AXI_DP_AWLEN : out std_logic_vector(7 downto 0); M_AXI_DP_AWSIZE : out std_logic_vector(2 downto 0); M_AXI_DP_AWBURST : out std_logic_vector(1 downto 0); M_AXI_DP_AWLOCK : out std_logic; M_AXI_DP_AWCACHE : out std_logic_vector(3 downto 0); M_AXI_DP_AWPROT : out std_logic_vector(2 downto 0); M_AXI_DP_AWQOS : out std_logic_vector(3 downto 0); M_AXI_DP_AWVALID : out std_logic; M_AXI_DP_AWREADY : in std_logic; M_AXI_DP_WDATA : out std_logic_vector((C_M_AXI_DP_DATA_WIDTH-1) downto 0); M_AXI_DP_WSTRB : out std_logic_vector(((C_M_AXI_DP_DATA_WIDTH/8)-1) downto 0); M_AXI_DP_WLAST : out std_logic; M_AXI_DP_WVALID : out std_logic; M_AXI_DP_WREADY : in std_logic; M_AXI_DP_BID : in std_logic_vector((C_M_AXI_DP_THREAD_ID_WIDTH-1) downto 0); M_AXI_DP_BRESP : in std_logic_vector(1 downto 0); M_AXI_DP_BVALID : in std_logic; M_AXI_DP_BREADY : out std_logic; M_AXI_DP_ARID : out std_logic_vector((C_M_AXI_DP_THREAD_ID_WIDTH-1) downto 0); M_AXI_DP_ARADDR : out std_logic_vector((C_M_AXI_DP_ADDR_WIDTH-1) downto 0); M_AXI_DP_ARLEN : out std_logic_vector(7 downto 0); M_AXI_DP_ARSIZE : out std_logic_vector(2 downto 0); M_AXI_DP_ARBURST : out std_logic_vector(1 downto 0); M_AXI_DP_ARLOCK : out std_logic; M_AXI_DP_ARCACHE : out std_logic_vector(3 downto 0); M_AXI_DP_ARPROT : out std_logic_vector(2 downto 0); M_AXI_DP_ARQOS : out std_logic_vector(3 downto 0); M_AXI_DP_ARVALID : out std_logic; M_AXI_DP_ARREADY : in std_logic; M_AXI_DP_RID : in std_logic_vector((C_M_AXI_DP_THREAD_ID_WIDTH-1) downto 0); M_AXI_DP_RDATA : in std_logic_vector((C_M_AXI_DP_DATA_WIDTH-1) downto 0); M_AXI_DP_RRESP : in std_logic_vector(1 downto 0); M_AXI_DP_RLAST : in std_logic; M_AXI_DP_RVALID : in std_logic; M_AXI_DP_RREADY : out std_logic; M_AXI_IC_AWID : out std_logic_vector((C_M_AXI_IC_THREAD_ID_WIDTH-1) downto 0); M_AXI_IC_AWADDR : out std_logic_vector((C_M_AXI_IC_ADDR_WIDTH-1) downto 0); M_AXI_IC_AWLEN : out std_logic_vector(7 downto 0); M_AXI_IC_AWSIZE : out std_logic_vector(2 downto 0); M_AXI_IC_AWBURST : out std_logic_vector(1 downto 0); M_AXI_IC_AWLOCK : out std_logic; M_AXI_IC_AWCACHE : out std_logic_vector(3 downto 0); M_AXI_IC_AWPROT : out std_logic_vector(2 downto 0); M_AXI_IC_AWQOS : out std_logic_vector(3 downto 0); M_AXI_IC_AWVALID : out std_logic; M_AXI_IC_AWREADY : in std_logic; M_AXI_IC_AWUSER : out std_logic_vector((C_M_AXI_IC_AWUSER_WIDTH-1) downto 0); M_AXI_IC_WDATA : out std_logic_vector((C_M_AXI_IC_DATA_WIDTH-1) downto 0); M_AXI_IC_WSTRB : out std_logic_vector(((C_M_AXI_IC_DATA_WIDTH/8)-1) downto 0); M_AXI_IC_WLAST : out std_logic; M_AXI_IC_WVALID : out std_logic; M_AXI_IC_WREADY : in std_logic; M_AXI_IC_WUSER : out std_logic_vector((C_M_AXI_IC_WUSER_WIDTH-1) downto 0); M_AXI_IC_BID : in std_logic_vector((C_M_AXI_IC_THREAD_ID_WIDTH-1) downto 0); M_AXI_IC_BRESP : in std_logic_vector(1 downto 0); M_AXI_IC_BVALID : in std_logic; M_AXI_IC_BREADY : out std_logic; M_AXI_IC_BUSER : in std_logic_vector((C_M_AXI_IC_BUSER_WIDTH-1) downto 0); M_AXI_IC_ARID : out std_logic_vector((C_M_AXI_IC_THREAD_ID_WIDTH-1) downto 0); M_AXI_IC_ARADDR : out std_logic_vector((C_M_AXI_IC_ADDR_WIDTH-1) downto 0); M_AXI_IC_ARLEN : out std_logic_vector(7 downto 0); M_AXI_IC_ARSIZE : out std_logic_vector(2 downto 0); M_AXI_IC_ARBURST : out std_logic_vector(1 downto 0); M_AXI_IC_ARLOCK : out std_logic; M_AXI_IC_ARCACHE : out std_logic_vector(3 downto 0); M_AXI_IC_ARPROT : out std_logic_vector(2 downto 0); M_AXI_IC_ARQOS : out std_logic_vector(3 downto 0); M_AXI_IC_ARVALID : out std_logic; M_AXI_IC_ARREADY : in std_logic; M_AXI_IC_ARUSER : out std_logic_vector((C_M_AXI_IC_ARUSER_WIDTH-1) downto 0); M_AXI_IC_RID : in std_logic_vector((C_M_AXI_IC_THREAD_ID_WIDTH-1) downto 0); M_AXI_IC_RDATA : in std_logic_vector((C_M_AXI_IC_DATA_WIDTH-1) downto 0); M_AXI_IC_RRESP : in std_logic_vector(1 downto 0); M_AXI_IC_RLAST : in std_logic; M_AXI_IC_RVALID : in std_logic; M_AXI_IC_RREADY : out std_logic; M_AXI_IC_RUSER : in std_logic_vector((C_M_AXI_IC_RUSER_WIDTH-1) downto 0); M_AXI_DC_AWID : out std_logic_vector((C_M_AXI_DC_THREAD_ID_WIDTH-1) downto 0); M_AXI_DC_AWADDR : out std_logic_vector((C_M_AXI_DC_ADDR_WIDTH-1) downto 0); M_AXI_DC_AWLEN : out std_logic_vector(7 downto 0); M_AXI_DC_AWSIZE : out std_logic_vector(2 downto 0); M_AXI_DC_AWBURST : out std_logic_vector(1 downto 0); M_AXI_DC_AWLOCK : out std_logic; M_AXI_DC_AWCACHE : out std_logic_vector(3 downto 0); M_AXI_DC_AWPROT : out std_logic_vector(2 downto 0); M_AXI_DC_AWQOS : out std_logic_vector(3 downto 0); M_AXI_DC_AWVALID : out std_logic; M_AXI_DC_AWREADY : in std_logic; M_AXI_DC_AWUSER : out std_logic_vector((C_M_AXI_DC_AWUSER_WIDTH-1) downto 0); M_AXI_DC_WDATA : out std_logic_vector((C_M_AXI_DC_DATA_WIDTH-1) downto 0); M_AXI_DC_WSTRB : out std_logic_vector(((C_M_AXI_DC_DATA_WIDTH/8)-1) downto 0); M_AXI_DC_WLAST : out std_logic; M_AXI_DC_WVALID : out std_logic; M_AXI_DC_WREADY : in std_logic; M_AXI_DC_WUSER : out std_logic_vector((C_M_AXI_DC_WUSER_WIDTH-1) downto 0); M_AXI_DC_BID : in std_logic_vector((C_M_AXI_DC_THREAD_ID_WIDTH-1) downto 0); M_AXI_DC_BRESP : in std_logic_vector(1 downto 0); M_AXI_DC_BVALID : in std_logic; M_AXI_DC_BREADY : out std_logic; M_AXI_DC_BUSER : in std_logic_vector((C_M_AXI_DC_BUSER_WIDTH-1) downto 0); M_AXI_DC_ARID : out std_logic_vector((C_M_AXI_DC_THREAD_ID_WIDTH-1) downto 0); M_AXI_DC_ARADDR : out std_logic_vector((C_M_AXI_DC_ADDR_WIDTH-1) downto 0); M_AXI_DC_ARLEN : out std_logic_vector(7 downto 0); M_AXI_DC_ARSIZE : out std_logic_vector(2 downto 0); M_AXI_DC_ARBURST : out std_logic_vector(1 downto 0); M_AXI_DC_ARLOCK : out std_logic; M_AXI_DC_ARCACHE : out std_logic_vector(3 downto 0); M_AXI_DC_ARPROT : out std_logic_vector(2 downto 0); M_AXI_DC_ARQOS : out std_logic_vector(3 downto 0); M_AXI_DC_ARVALID : out std_logic; M_AXI_DC_ARREADY : in std_logic; M_AXI_DC_ARUSER : out std_logic_vector((C_M_AXI_DC_ARUSER_WIDTH-1) downto 0); M_AXI_DC_RID : in std_logic_vector((C_M_AXI_DC_THREAD_ID_WIDTH-1) downto 0); M_AXI_DC_RDATA : in std_logic_vector((C_M_AXI_DC_DATA_WIDTH-1) downto 0); M_AXI_DC_RRESP : in std_logic_vector(1 downto 0); M_AXI_DC_RLAST : in std_logic; M_AXI_DC_RVALID : in std_logic; M_AXI_DC_RREADY : out std_logic; M_AXI_DC_RUSER : in std_logic_vector((C_M_AXI_DC_RUSER_WIDTH-1) downto 0); DBG_CLK : in std_logic; DBG_TDI : in std_logic; DBG_TDO : out std_logic; DBG_REG_EN : in std_logic_vector(0 to 7); DBG_SHIFT : in std_logic; DBG_CAPTURE : in std_logic; DBG_UPDATE : in std_logic; DEBUG_RST : in std_logic; Trace_Instruction : out std_logic_vector(0 to 31); Trace_Valid_Instr : out std_logic; Trace_PC : out std_logic_vector(0 to 31); Trace_Reg_Write : out std_logic; Trace_Reg_Addr : out std_logic_vector(0 to 4); Trace_MSR_Reg : out std_logic_vector(0 to 14); Trace_PID_Reg : out std_logic_vector(0 to 7); Trace_New_Reg_Value : out std_logic_vector(0 to 31); Trace_Exception_Taken : out std_logic; Trace_Exception_Kind : out std_logic_vector(0 to 4); Trace_Jump_Taken : out std_logic; Trace_Delay_Slot : out std_logic; Trace_Data_Address : out std_logic_vector(0 to 31); Trace_Data_Access : out std_logic; Trace_Data_Read : out std_logic; Trace_Data_Write : out std_logic; Trace_Data_Write_Value : out std_logic_vector(0 to 31); Trace_Data_Byte_Enable : out std_logic_vector(0 to 3); Trace_DCache_Req : out std_logic; Trace_DCache_Hit : out std_logic; Trace_DCache_Rdy : out std_logic; Trace_DCache_Read : out std_logic; Trace_ICache_Req : out std_logic; Trace_ICache_Hit : out std_logic; Trace_ICache_Rdy : out std_logic; Trace_OF_PipeRun : out std_logic; Trace_EX_PipeRun : out std_logic; Trace_MEM_PipeRun : out std_logic; Trace_MB_Halted : out std_logic; Trace_Jump_Hit : out std_logic; FSL0_S_CLK : out std_logic; FSL0_S_READ : out std_logic; FSL0_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL0_S_CONTROL : in std_logic; FSL0_S_EXISTS : in std_logic; FSL0_M_CLK : out std_logic; FSL0_M_WRITE : out std_logic; FSL0_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL0_M_CONTROL : out std_logic; FSL0_M_FULL : in std_logic; FSL1_S_CLK : out std_logic; FSL1_S_READ : out std_logic; FSL1_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL1_S_CONTROL : in std_logic; FSL1_S_EXISTS : in std_logic; FSL1_M_CLK : out std_logic; FSL1_M_WRITE : out std_logic; FSL1_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL1_M_CONTROL : out std_logic; FSL1_M_FULL : in std_logic; FSL2_S_CLK : out std_logic; FSL2_S_READ : out std_logic; FSL2_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL2_S_CONTROL : in std_logic; FSL2_S_EXISTS : in std_logic; FSL2_M_CLK : out std_logic; FSL2_M_WRITE : out std_logic; FSL2_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL2_M_CONTROL : out std_logic; FSL2_M_FULL : in std_logic; FSL3_S_CLK : out std_logic; FSL3_S_READ : out std_logic; FSL3_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL3_S_CONTROL : in std_logic; FSL3_S_EXISTS : in std_logic; FSL3_M_CLK : out std_logic; FSL3_M_WRITE : out std_logic; FSL3_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL3_M_CONTROL : out std_logic; FSL3_M_FULL : in std_logic; FSL4_S_CLK : out std_logic; FSL4_S_READ : out std_logic; FSL4_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL4_S_CONTROL : in std_logic; FSL4_S_EXISTS : in std_logic; FSL4_M_CLK : out std_logic; FSL4_M_WRITE : out std_logic; FSL4_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL4_M_CONTROL : out std_logic; FSL4_M_FULL : in std_logic; FSL5_S_CLK : out std_logic; FSL5_S_READ : out std_logic; FSL5_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL5_S_CONTROL : in std_logic; FSL5_S_EXISTS : in std_logic; FSL5_M_CLK : out std_logic; FSL5_M_WRITE : out std_logic; FSL5_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL5_M_CONTROL : out std_logic; FSL5_M_FULL : in std_logic; FSL6_S_CLK : out std_logic; FSL6_S_READ : out std_logic; FSL6_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL6_S_CONTROL : in std_logic; FSL6_S_EXISTS : in std_logic; FSL6_M_CLK : out std_logic; FSL6_M_WRITE : out std_logic; FSL6_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL6_M_CONTROL : out std_logic; FSL6_M_FULL : in std_logic; FSL7_S_CLK : out std_logic; FSL7_S_READ : out std_logic; FSL7_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL7_S_CONTROL : in std_logic; FSL7_S_EXISTS : in std_logic; FSL7_M_CLK : out std_logic; FSL7_M_WRITE : out std_logic; FSL7_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL7_M_CONTROL : out std_logic; FSL7_M_FULL : in std_logic; FSL8_S_CLK : out std_logic; FSL8_S_READ : out std_logic; FSL8_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL8_S_CONTROL : in std_logic; FSL8_S_EXISTS : in std_logic; FSL8_M_CLK : out std_logic; FSL8_M_WRITE : out std_logic; FSL8_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL8_M_CONTROL : out std_logic; FSL8_M_FULL : in std_logic; FSL9_S_CLK : out std_logic; FSL9_S_READ : out std_logic; FSL9_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL9_S_CONTROL : in std_logic; FSL9_S_EXISTS : in std_logic; FSL9_M_CLK : out std_logic; FSL9_M_WRITE : out std_logic; FSL9_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL9_M_CONTROL : out std_logic; FSL9_M_FULL : in std_logic; FSL10_S_CLK : out std_logic; FSL10_S_READ : out std_logic; FSL10_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL10_S_CONTROL : in std_logic; FSL10_S_EXISTS : in std_logic; FSL10_M_CLK : out std_logic; FSL10_M_WRITE : out std_logic; FSL10_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL10_M_CONTROL : out std_logic; FSL10_M_FULL : in std_logic; FSL11_S_CLK : out std_logic; FSL11_S_READ : out std_logic; FSL11_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL11_S_CONTROL : in std_logic; FSL11_S_EXISTS : in std_logic; FSL11_M_CLK : out std_logic; FSL11_M_WRITE : out std_logic; FSL11_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL11_M_CONTROL : out std_logic; FSL11_M_FULL : in std_logic; FSL12_S_CLK : out std_logic; FSL12_S_READ : out std_logic; FSL12_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL12_S_CONTROL : in std_logic; FSL12_S_EXISTS : in std_logic; FSL12_M_CLK : out std_logic; FSL12_M_WRITE : out std_logic; FSL12_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL12_M_CONTROL : out std_logic; FSL12_M_FULL : in std_logic; FSL13_S_CLK : out std_logic; FSL13_S_READ : out std_logic; FSL13_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL13_S_CONTROL : in std_logic; FSL13_S_EXISTS : in std_logic; FSL13_M_CLK : out std_logic; FSL13_M_WRITE : out std_logic; FSL13_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL13_M_CONTROL : out std_logic; FSL13_M_FULL : in std_logic; FSL14_S_CLK : out std_logic; FSL14_S_READ : out std_logic; FSL14_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL14_S_CONTROL : in std_logic; FSL14_S_EXISTS : in std_logic; FSL14_M_CLK : out std_logic; FSL14_M_WRITE : out std_logic; FSL14_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL14_M_CONTROL : out std_logic; FSL14_M_FULL : in std_logic; FSL15_S_CLK : out std_logic; FSL15_S_READ : out std_logic; FSL15_S_DATA : in std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL15_S_CONTROL : in std_logic; FSL15_S_EXISTS : in std_logic; FSL15_M_CLK : out std_logic; FSL15_M_WRITE : out std_logic; FSL15_M_DATA : out std_logic_vector(0 to C_FSL_DATA_SIZE-1); FSL15_M_CONTROL : out std_logic; FSL15_M_FULL : in std_logic; M0_AXIS_TLAST : out std_logic; M0_AXIS_TDATA : out std_logic_vector(C_M0_AXIS_DATA_WIDTH-1 downto 0); M0_AXIS_TVALID : out std_logic; M0_AXIS_TREADY : in std_logic; S0_AXIS_TLAST : in std_logic; S0_AXIS_TDATA : in std_logic_vector(C_S0_AXIS_DATA_WIDTH-1 downto 0); S0_AXIS_TVALID : in std_logic; S0_AXIS_TREADY : out std_logic; M1_AXIS_TLAST : out std_logic; M1_AXIS_TDATA : out std_logic_vector(C_M1_AXIS_DATA_WIDTH-1 downto 0); M1_AXIS_TVALID : out std_logic; M1_AXIS_TREADY : in std_logic; S1_AXIS_TLAST : in std_logic; S1_AXIS_TDATA : in std_logic_vector(C_S1_AXIS_DATA_WIDTH-1 downto 0); S1_AXIS_TVALID : in std_logic; S1_AXIS_TREADY : out std_logic; M2_AXIS_TLAST : out std_logic; M2_AXIS_TDATA : out std_logic_vector(C_M2_AXIS_DATA_WIDTH-1 downto 0); M2_AXIS_TVALID : out std_logic; M2_AXIS_TREADY : in std_logic; S2_AXIS_TLAST : in std_logic; S2_AXIS_TDATA : in std_logic_vector(C_S2_AXIS_DATA_WIDTH-1 downto 0); S2_AXIS_TVALID : in std_logic; S2_AXIS_TREADY : out std_logic; M3_AXIS_TLAST : out std_logic; M3_AXIS_TDATA : out std_logic_vector(C_M3_AXIS_DATA_WIDTH-1 downto 0); M3_AXIS_TVALID : out std_logic; M3_AXIS_TREADY : in std_logic; S3_AXIS_TLAST : in std_logic; S3_AXIS_TDATA : in std_logic_vector(C_S3_AXIS_DATA_WIDTH-1 downto 0); S3_AXIS_TVALID : in std_logic; S3_AXIS_TREADY : out std_logic; M4_AXIS_TLAST : out std_logic; M4_AXIS_TDATA : out std_logic_vector(C_M4_AXIS_DATA_WIDTH-1 downto 0); M4_AXIS_TVALID : out std_logic; M4_AXIS_TREADY : in std_logic; S4_AXIS_TLAST : in std_logic; S4_AXIS_TDATA : in std_logic_vector(C_S4_AXIS_DATA_WIDTH-1 downto 0); S4_AXIS_TVALID : in std_logic; S4_AXIS_TREADY : out std_logic; M5_AXIS_TLAST : out std_logic; M5_AXIS_TDATA : out std_logic_vector(C_M5_AXIS_DATA_WIDTH-1 downto 0); M5_AXIS_TVALID : out std_logic; M5_AXIS_TREADY : in std_logic; S5_AXIS_TLAST : in std_logic; S5_AXIS_TDATA : in std_logic_vector(C_S5_AXIS_DATA_WIDTH-1 downto 0); S5_AXIS_TVALID : in std_logic; S5_AXIS_TREADY : out std_logic; M6_AXIS_TLAST : out std_logic; M6_AXIS_TDATA : out std_logic_vector(C_M6_AXIS_DATA_WIDTH-1 downto 0); M6_AXIS_TVALID : out std_logic; M6_AXIS_TREADY : in std_logic; S6_AXIS_TLAST : in std_logic; S6_AXIS_TDATA : in std_logic_vector(C_S6_AXIS_DATA_WIDTH-1 downto 0); S6_AXIS_TVALID : in std_logic; S6_AXIS_TREADY : out std_logic; M7_AXIS_TLAST : out std_logic; M7_AXIS_TDATA : out std_logic_vector(C_M7_AXIS_DATA_WIDTH-1 downto 0); M7_AXIS_TVALID : out std_logic; M7_AXIS_TREADY : in std_logic; S7_AXIS_TLAST : in std_logic; S7_AXIS_TDATA : in std_logic_vector(C_S7_AXIS_DATA_WIDTH-1 downto 0); S7_AXIS_TVALID : in std_logic; S7_AXIS_TREADY : out std_logic; M8_AXIS_TLAST : out std_logic; M8_AXIS_TDATA : out std_logic_vector(C_M8_AXIS_DATA_WIDTH-1 downto 0); M8_AXIS_TVALID : out std_logic; M8_AXIS_TREADY : in std_logic; S8_AXIS_TLAST : in std_logic; S8_AXIS_TDATA : in std_logic_vector(C_S8_AXIS_DATA_WIDTH-1 downto 0); S8_AXIS_TVALID : in std_logic; S8_AXIS_TREADY : out std_logic; M9_AXIS_TLAST : out std_logic; M9_AXIS_TDATA : out std_logic_vector(C_M9_AXIS_DATA_WIDTH-1 downto 0); M9_AXIS_TVALID : out std_logic; M9_AXIS_TREADY : in std_logic; S9_AXIS_TLAST : in std_logic; S9_AXIS_TDATA : in std_logic_vector(C_S9_AXIS_DATA_WIDTH-1 downto 0); S9_AXIS_TVALID : in std_logic; S9_AXIS_TREADY : out std_logic; M10_AXIS_TLAST : out std_logic; M10_AXIS_TDATA : out std_logic_vector(C_M10_AXIS_DATA_WIDTH-1 downto 0); M10_AXIS_TVALID : out std_logic; M10_AXIS_TREADY : in std_logic; S10_AXIS_TLAST : in std_logic; S10_AXIS_TDATA : in std_logic_vector(C_S10_AXIS_DATA_WIDTH-1 downto 0); S10_AXIS_TVALID : in std_logic; S10_AXIS_TREADY : out std_logic; M11_AXIS_TLAST : out std_logic; M11_AXIS_TDATA : out std_logic_vector(C_M11_AXIS_DATA_WIDTH-1 downto 0); M11_AXIS_TVALID : out std_logic; M11_AXIS_TREADY : in std_logic; S11_AXIS_TLAST : in std_logic; S11_AXIS_TDATA : in std_logic_vector(C_S11_AXIS_DATA_WIDTH-1 downto 0); S11_AXIS_TVALID : in std_logic; S11_AXIS_TREADY : out std_logic; M12_AXIS_TLAST : out std_logic; M12_AXIS_TDATA : out std_logic_vector(C_M12_AXIS_DATA_WIDTH-1 downto 0); M12_AXIS_TVALID : out std_logic; M12_AXIS_TREADY : in std_logic; S12_AXIS_TLAST : in std_logic; S12_AXIS_TDATA : in std_logic_vector(C_S12_AXIS_DATA_WIDTH-1 downto 0); S12_AXIS_TVALID : in std_logic; S12_AXIS_TREADY : out std_logic; M13_AXIS_TLAST : out std_logic; M13_AXIS_TDATA : out std_logic_vector(C_M13_AXIS_DATA_WIDTH-1 downto 0); M13_AXIS_TVALID : out std_logic; M13_AXIS_TREADY : in std_logic; S13_AXIS_TLAST : in std_logic; S13_AXIS_TDATA : in std_logic_vector(C_S13_AXIS_DATA_WIDTH-1 downto 0); S13_AXIS_TVALID : in std_logic; S13_AXIS_TREADY : out std_logic; M14_AXIS_TLAST : out std_logic; M14_AXIS_TDATA : out std_logic_vector(C_M14_AXIS_DATA_WIDTH-1 downto 0); M14_AXIS_TVALID : out std_logic; M14_AXIS_TREADY : in std_logic; S14_AXIS_TLAST : in std_logic; S14_AXIS_TDATA : in std_logic_vector(C_S14_AXIS_DATA_WIDTH-1 downto 0); S14_AXIS_TVALID : in std_logic; S14_AXIS_TREADY : out std_logic; M15_AXIS_TLAST : out std_logic; M15_AXIS_TDATA : out std_logic_vector(C_M15_AXIS_DATA_WIDTH-1 downto 0); M15_AXIS_TVALID : out std_logic; M15_AXIS_TREADY : in std_logic; S15_AXIS_TLAST : in std_logic; S15_AXIS_TDATA : in std_logic_vector(C_S15_AXIS_DATA_WIDTH-1 downto 0); S15_AXIS_TVALID : in std_logic; S15_AXIS_TREADY : out std_logic; ICACHE_FSL_IN_CLK : out std_logic; ICACHE_FSL_IN_READ : out std_logic; ICACHE_FSL_IN_DATA : in std_logic_vector(0 to 31); ICACHE_FSL_IN_CONTROL : in std_logic; ICACHE_FSL_IN_EXISTS : in std_logic; ICACHE_FSL_OUT_CLK : out std_logic; ICACHE_FSL_OUT_WRITE : out std_logic; ICACHE_FSL_OUT_DATA : out std_logic_vector(0 to 31); ICACHE_FSL_OUT_CONTROL : out std_logic; ICACHE_FSL_OUT_FULL : in std_logic; DCACHE_FSL_IN_CLK : out std_logic; DCACHE_FSL_IN_READ : out std_logic; DCACHE_FSL_IN_DATA : in std_logic_vector(0 to 31); DCACHE_FSL_IN_CONTROL : in std_logic; DCACHE_FSL_IN_EXISTS : in std_logic; DCACHE_FSL_OUT_CLK : out std_logic; DCACHE_FSL_OUT_WRITE : out std_logic; DCACHE_FSL_OUT_DATA : out std_logic_vector(0 to 31); DCACHE_FSL_OUT_CONTROL : out std_logic; DCACHE_FSL_OUT_FULL : in std_logic ); end component; begin microblaze_0 : microblaze generic map ( C_SCO => 0, C_FREQ => 50000000, C_DATA_SIZE => 32, C_DYNAMIC_BUS_SIZING => 1, C_FAMILY => "spartan6", C_INSTANCE => "microblaze_0", C_AVOID_PRIMITIVES => 0, C_FAULT_TOLERANT => 0, C_ECC_USE_CE_EXCEPTION => 0, C_LOCKSTEP_SLAVE => 0, C_ENDIANNESS => 1, C_AREA_OPTIMIZED => 0, C_OPTIMIZATION => 0, C_INTERCONNECT => 2, C_STREAM_INTERCONNECT => 0, C_DPLB_DWIDTH => 32, C_DPLB_NATIVE_DWIDTH => 32, C_DPLB_BURST_EN => 0, C_DPLB_P2P => 0, C_IPLB_DWIDTH => 32, C_IPLB_NATIVE_DWIDTH => 32, C_IPLB_BURST_EN => 0, C_IPLB_P2P => 0, C_M_AXI_DP_THREAD_ID_WIDTH => 1, C_M_AXI_DP_DATA_WIDTH => 32, C_M_AXI_DP_ADDR_WIDTH => 32, C_M_AXI_DP_EXCLUSIVE_ACCESS => 0, C_M_AXI_IP_THREAD_ID_WIDTH => 1, C_M_AXI_IP_DATA_WIDTH => 32, C_M_AXI_IP_ADDR_WIDTH => 32, C_D_AXI => 1, C_D_PLB => 0, C_D_LMB => 1, C_I_AXI => 0, C_I_PLB => 0, C_I_LMB => 1, C_USE_MSR_INSTR => 1, C_USE_PCMP_INSTR => 1, C_USE_BARREL => 1, C_USE_DIV => 0, C_USE_HW_MUL => 1, C_USE_FPU => 0, C_USE_REORDER_INSTR => 1, C_UNALIGNED_EXCEPTIONS => 0, C_ILL_OPCODE_EXCEPTION => 0, C_M_AXI_I_BUS_EXCEPTION => 0, C_M_AXI_D_BUS_EXCEPTION => 0, C_IPLB_BUS_EXCEPTION => 0, C_DPLB_BUS_EXCEPTION => 0, C_DIV_ZERO_EXCEPTION => 0, C_FPU_EXCEPTION => 0, C_FSL_EXCEPTION => 0, C_USE_STACK_PROTECTION => 0, C_PVR => 0, C_PVR_USER1 => X"00", C_PVR_USER2 => X"00000000", C_DEBUG_ENABLED => 1, C_NUMBER_OF_PC_BRK => 1, C_NUMBER_OF_RD_ADDR_BRK => 0, C_NUMBER_OF_WR_ADDR_BRK => 0, C_INTERRUPT_IS_EDGE => 0, C_EDGE_IS_POSITIVE => 1, C_RESET_MSR => X"00000000", C_OPCODE_0x0_ILLEGAL => 0, C_FSL_LINKS => 1, C_FSL_DATA_SIZE => 32, C_USE_EXTENDED_FSL_INSTR => 0, C_M0_AXIS_DATA_WIDTH => 32, C_S0_AXIS_DATA_WIDTH => 32, C_M1_AXIS_DATA_WIDTH => 32, C_S1_AXIS_DATA_WIDTH => 32, C_M2_AXIS_DATA_WIDTH => 32, C_S2_AXIS_DATA_WIDTH => 32, C_M3_AXIS_DATA_WIDTH => 32, C_S3_AXIS_DATA_WIDTH => 32, C_M4_AXIS_DATA_WIDTH => 32, C_S4_AXIS_DATA_WIDTH => 32, C_M5_AXIS_DATA_WIDTH => 32, C_S5_AXIS_DATA_WIDTH => 32, C_M6_AXIS_DATA_WIDTH => 32, C_S6_AXIS_DATA_WIDTH => 32, C_M7_AXIS_DATA_WIDTH => 32, C_S7_AXIS_DATA_WIDTH => 32, C_M8_AXIS_DATA_WIDTH => 32, C_S8_AXIS_DATA_WIDTH => 32, C_M9_AXIS_DATA_WIDTH => 32, C_S9_AXIS_DATA_WIDTH => 32, C_M10_AXIS_DATA_WIDTH => 32, C_S10_AXIS_DATA_WIDTH => 32, C_M11_AXIS_DATA_WIDTH => 32, C_S11_AXIS_DATA_WIDTH => 32, C_M12_AXIS_DATA_WIDTH => 32, C_S12_AXIS_DATA_WIDTH => 32, C_M13_AXIS_DATA_WIDTH => 32, C_S13_AXIS_DATA_WIDTH => 32, C_M14_AXIS_DATA_WIDTH => 32, C_S14_AXIS_DATA_WIDTH => 32, C_M15_AXIS_DATA_WIDTH => 32, C_S15_AXIS_DATA_WIDTH => 32, C_ICACHE_BASEADDR => X"00000000", C_ICACHE_HIGHADDR => X"3FFFFFFF", C_USE_ICACHE => 0, C_ALLOW_ICACHE_WR => 1, C_ADDR_TAG_BITS => 0, C_CACHE_BYTE_SIZE => 8192, C_ICACHE_USE_FSL => 0, C_ICACHE_LINE_LEN => 4, C_ICACHE_ALWAYS_USED => 0, C_ICACHE_INTERFACE => 0, C_ICACHE_VICTIMS => 0, C_ICACHE_STREAMS => 0, C_ICACHE_FORCE_TAG_LUTRAM => 0, C_ICACHE_DATA_WIDTH => 0, C_M_AXI_IC_THREAD_ID_WIDTH => 1, C_M_AXI_IC_DATA_WIDTH => 32, C_M_AXI_IC_ADDR_WIDTH => 32, C_M_AXI_IC_USER_VALUE => 2#11111#, C_M_AXI_IC_AWUSER_WIDTH => 5, C_M_AXI_IC_ARUSER_WIDTH => 5, C_M_AXI_IC_WUSER_WIDTH => 1, C_M_AXI_IC_RUSER_WIDTH => 1, C_M_AXI_IC_BUSER_WIDTH => 1, C_DCACHE_BASEADDR => X"00000000", C_DCACHE_HIGHADDR => X"3FFFFFFF", C_USE_DCACHE => 0, C_ALLOW_DCACHE_WR => 1, C_DCACHE_ADDR_TAG => 0, C_DCACHE_BYTE_SIZE => 8192, C_DCACHE_USE_FSL => 0, C_DCACHE_LINE_LEN => 4, C_DCACHE_ALWAYS_USED => 0, C_DCACHE_INTERFACE => 0, C_DCACHE_USE_WRITEBACK => 0, C_DCACHE_VICTIMS => 0, C_DCACHE_FORCE_TAG_LUTRAM => 0, C_DCACHE_DATA_WIDTH => 0, C_M_AXI_DC_THREAD_ID_WIDTH => 1, C_M_AXI_DC_DATA_WIDTH => 32, C_M_AXI_DC_ADDR_WIDTH => 32, C_M_AXI_DC_EXCLUSIVE_ACCESS => 0, C_M_AXI_DC_USER_VALUE => 2#11111#, C_M_AXI_DC_AWUSER_WIDTH => 5, C_M_AXI_DC_ARUSER_WIDTH => 5, C_M_AXI_DC_WUSER_WIDTH => 1, C_M_AXI_DC_RUSER_WIDTH => 1, C_M_AXI_DC_BUSER_WIDTH => 1, C_USE_MMU => 0, C_MMU_DTLB_SIZE => 4, C_MMU_ITLB_SIZE => 2, C_MMU_TLB_ACCESS => 3, C_MMU_ZONES => 16, C_MMU_PRIVILEGED_INSTR => 0, C_USE_INTERRUPT => 0, C_USE_EXT_BRK => 1, C_USE_EXT_NM_BRK => 1, C_USE_BRANCH_TARGET_CACHE => 0, C_BRANCH_TARGET_CACHE_SIZE => 0, C_PC_WIDTH => 32 ) port map ( CLK => CLK, RESET => RESET, MB_RESET => MB_RESET, INTERRUPT => INTERRUPT, INTERRUPT_ADDRESS => INTERRUPT_ADDRESS, INTERRUPT_ACK => INTERRUPT_ACK, EXT_BRK => EXT_BRK, EXT_NM_BRK => EXT_NM_BRK, DBG_STOP => DBG_STOP, MB_Halted => MB_Halted, MB_Error => MB_Error, WAKEUP => WAKEUP, SLEEP => SLEEP, DBG_WAKEUP => DBG_WAKEUP, LOCKSTEP_MASTER_OUT => LOCKSTEP_MASTER_OUT, LOCKSTEP_SLAVE_IN => LOCKSTEP_SLAVE_IN, LOCKSTEP_OUT => LOCKSTEP_OUT, INSTR => INSTR, IREADY => IREADY, IWAIT => IWAIT, ICE => ICE, IUE => IUE, INSTR_ADDR => INSTR_ADDR, IFETCH => IFETCH, I_AS => I_AS, IPLB_M_ABort => IPLB_M_ABort, IPLB_M_ABus => IPLB_M_ABus, IPLB_M_UABus => IPLB_M_UABus, IPLB_M_BE => IPLB_M_BE, IPLB_M_busLock => IPLB_M_busLock, IPLB_M_lockErr => IPLB_M_lockErr, IPLB_M_MSize => IPLB_M_MSize, IPLB_M_priority => IPLB_M_priority, IPLB_M_rdBurst => IPLB_M_rdBurst, IPLB_M_request => IPLB_M_request, IPLB_M_RNW => IPLB_M_RNW, IPLB_M_size => IPLB_M_size, IPLB_M_TAttribute => IPLB_M_TAttribute, IPLB_M_type => IPLB_M_type, IPLB_M_wrBurst => IPLB_M_wrBurst, IPLB_M_wrDBus => IPLB_M_wrDBus, IPLB_MBusy => IPLB_MBusy, IPLB_MRdErr => IPLB_MRdErr, IPLB_MWrErr => IPLB_MWrErr, IPLB_MIRQ => IPLB_MIRQ, IPLB_MWrBTerm => IPLB_MWrBTerm, IPLB_MWrDAck => IPLB_MWrDAck, IPLB_MAddrAck => IPLB_MAddrAck, IPLB_MRdBTerm => IPLB_MRdBTerm, IPLB_MRdDAck => IPLB_MRdDAck, IPLB_MRdDBus => IPLB_MRdDBus, IPLB_MRdWdAddr => IPLB_MRdWdAddr, IPLB_MRearbitrate => IPLB_MRearbitrate, IPLB_MSSize => IPLB_MSSize, IPLB_MTimeout => IPLB_MTimeout, DATA_READ => DATA_READ, DREADY => DREADY, DWAIT => DWAIT, DCE => DCE, DUE => DUE, DATA_WRITE => DATA_WRITE, DATA_ADDR => DATA_ADDR, D_AS => D_AS, READ_STROBE => READ_STROBE, WRITE_STROBE => WRITE_STROBE, BYTE_ENABLE => BYTE_ENABLE, DPLB_M_ABort => DPLB_M_ABort, DPLB_M_ABus => DPLB_M_ABus, DPLB_M_UABus => DPLB_M_UABus, DPLB_M_BE => DPLB_M_BE, DPLB_M_busLock => DPLB_M_busLock, DPLB_M_lockErr => DPLB_M_lockErr, DPLB_M_MSize => DPLB_M_MSize, DPLB_M_priority => DPLB_M_priority, DPLB_M_rdBurst => DPLB_M_rdBurst, DPLB_M_request => DPLB_M_request, DPLB_M_RNW => DPLB_M_RNW, DPLB_M_size => DPLB_M_size, DPLB_M_TAttribute => DPLB_M_TAttribute, DPLB_M_type => DPLB_M_type, DPLB_M_wrBurst => DPLB_M_wrBurst, DPLB_M_wrDBus => DPLB_M_wrDBus, DPLB_MBusy => DPLB_MBusy, DPLB_MRdErr => DPLB_MRdErr, DPLB_MWrErr => DPLB_MWrErr, DPLB_MIRQ => DPLB_MIRQ, DPLB_MWrBTerm => DPLB_MWrBTerm, DPLB_MWrDAck => DPLB_MWrDAck, DPLB_MAddrAck => DPLB_MAddrAck, DPLB_MRdBTerm => DPLB_MRdBTerm, DPLB_MRdDAck => DPLB_MRdDAck, DPLB_MRdDBus => DPLB_MRdDBus, DPLB_MRdWdAddr => DPLB_MRdWdAddr, DPLB_MRearbitrate => DPLB_MRearbitrate, DPLB_MSSize => DPLB_MSSize, DPLB_MTimeout => DPLB_MTimeout, M_AXI_IP_AWID => M_AXI_IP_AWID, M_AXI_IP_AWADDR => M_AXI_IP_AWADDR, M_AXI_IP_AWLEN => M_AXI_IP_AWLEN, M_AXI_IP_AWSIZE => M_AXI_IP_AWSIZE, M_AXI_IP_AWBURST => M_AXI_IP_AWBURST, M_AXI_IP_AWLOCK => M_AXI_IP_AWLOCK, M_AXI_IP_AWCACHE => M_AXI_IP_AWCACHE, M_AXI_IP_AWPROT => M_AXI_IP_AWPROT, M_AXI_IP_AWQOS => M_AXI_IP_AWQOS, M_AXI_IP_AWVALID => M_AXI_IP_AWVALID, M_AXI_IP_AWREADY => M_AXI_IP_AWREADY, M_AXI_IP_WDATA => M_AXI_IP_WDATA, M_AXI_IP_WSTRB => M_AXI_IP_WSTRB, M_AXI_IP_WLAST => M_AXI_IP_WLAST, M_AXI_IP_WVALID => M_AXI_IP_WVALID, M_AXI_IP_WREADY => M_AXI_IP_WREADY, M_AXI_IP_BID => M_AXI_IP_BID, M_AXI_IP_BRESP => M_AXI_IP_BRESP, M_AXI_IP_BVALID => M_AXI_IP_BVALID, M_AXI_IP_BREADY => M_AXI_IP_BREADY, M_AXI_IP_ARID => M_AXI_IP_ARID, M_AXI_IP_ARADDR => M_AXI_IP_ARADDR, M_AXI_IP_ARLEN => M_AXI_IP_ARLEN, M_AXI_IP_ARSIZE => M_AXI_IP_ARSIZE, M_AXI_IP_ARBURST => M_AXI_IP_ARBURST, M_AXI_IP_ARLOCK => M_AXI_IP_ARLOCK, M_AXI_IP_ARCACHE => M_AXI_IP_ARCACHE, M_AXI_IP_ARPROT => M_AXI_IP_ARPROT, M_AXI_IP_ARQOS => M_AXI_IP_ARQOS, M_AXI_IP_ARVALID => M_AXI_IP_ARVALID, M_AXI_IP_ARREADY => M_AXI_IP_ARREADY, M_AXI_IP_RID => M_AXI_IP_RID, M_AXI_IP_RDATA => M_AXI_IP_RDATA, M_AXI_IP_RRESP => M_AXI_IP_RRESP, M_AXI_IP_RLAST => M_AXI_IP_RLAST, M_AXI_IP_RVALID => M_AXI_IP_RVALID, M_AXI_IP_RREADY => M_AXI_IP_RREADY, M_AXI_DP_AWID => M_AXI_DP_AWID, M_AXI_DP_AWADDR => M_AXI_DP_AWADDR, M_AXI_DP_AWLEN => M_AXI_DP_AWLEN, M_AXI_DP_AWSIZE => M_AXI_DP_AWSIZE, M_AXI_DP_AWBURST => M_AXI_DP_AWBURST, M_AXI_DP_AWLOCK => M_AXI_DP_AWLOCK, M_AXI_DP_AWCACHE => M_AXI_DP_AWCACHE, M_AXI_DP_AWPROT => M_AXI_DP_AWPROT, M_AXI_DP_AWQOS => M_AXI_DP_AWQOS, M_AXI_DP_AWVALID => M_AXI_DP_AWVALID, M_AXI_DP_AWREADY => M_AXI_DP_AWREADY, M_AXI_DP_WDATA => M_AXI_DP_WDATA, M_AXI_DP_WSTRB => M_AXI_DP_WSTRB, M_AXI_DP_WLAST => M_AXI_DP_WLAST, M_AXI_DP_WVALID => M_AXI_DP_WVALID, M_AXI_DP_WREADY => M_AXI_DP_WREADY, M_AXI_DP_BID => M_AXI_DP_BID, M_AXI_DP_BRESP => M_AXI_DP_BRESP, M_AXI_DP_BVALID => M_AXI_DP_BVALID, M_AXI_DP_BREADY => M_AXI_DP_BREADY, M_AXI_DP_ARID => M_AXI_DP_ARID, M_AXI_DP_ARADDR => M_AXI_DP_ARADDR, M_AXI_DP_ARLEN => M_AXI_DP_ARLEN, M_AXI_DP_ARSIZE => M_AXI_DP_ARSIZE, M_AXI_DP_ARBURST => M_AXI_DP_ARBURST, M_AXI_DP_ARLOCK => M_AXI_DP_ARLOCK, M_AXI_DP_ARCACHE => M_AXI_DP_ARCACHE, M_AXI_DP_ARPROT => M_AXI_DP_ARPROT, M_AXI_DP_ARQOS => M_AXI_DP_ARQOS, M_AXI_DP_ARVALID => M_AXI_DP_ARVALID, M_AXI_DP_ARREADY => M_AXI_DP_ARREADY, M_AXI_DP_RID => M_AXI_DP_RID, M_AXI_DP_RDATA => M_AXI_DP_RDATA, M_AXI_DP_RRESP => M_AXI_DP_RRESP, M_AXI_DP_RLAST => M_AXI_DP_RLAST, M_AXI_DP_RVALID => M_AXI_DP_RVALID, M_AXI_DP_RREADY => M_AXI_DP_RREADY, M_AXI_IC_AWID => M_AXI_IC_AWID, M_AXI_IC_AWADDR => M_AXI_IC_AWADDR, M_AXI_IC_AWLEN => M_AXI_IC_AWLEN, M_AXI_IC_AWSIZE => M_AXI_IC_AWSIZE, M_AXI_IC_AWBURST => M_AXI_IC_AWBURST, M_AXI_IC_AWLOCK => M_AXI_IC_AWLOCK, M_AXI_IC_AWCACHE => M_AXI_IC_AWCACHE, M_AXI_IC_AWPROT => M_AXI_IC_AWPROT, M_AXI_IC_AWQOS => M_AXI_IC_AWQOS, M_AXI_IC_AWVALID => M_AXI_IC_AWVALID, M_AXI_IC_AWREADY => M_AXI_IC_AWREADY, M_AXI_IC_AWUSER => M_AXI_IC_AWUSER, M_AXI_IC_WDATA => M_AXI_IC_WDATA, M_AXI_IC_WSTRB => M_AXI_IC_WSTRB, M_AXI_IC_WLAST => M_AXI_IC_WLAST, M_AXI_IC_WVALID => M_AXI_IC_WVALID, M_AXI_IC_WREADY => M_AXI_IC_WREADY, M_AXI_IC_WUSER => M_AXI_IC_WUSER, M_AXI_IC_BID => M_AXI_IC_BID, M_AXI_IC_BRESP => M_AXI_IC_BRESP, M_AXI_IC_BVALID => M_AXI_IC_BVALID, M_AXI_IC_BREADY => M_AXI_IC_BREADY, M_AXI_IC_BUSER => M_AXI_IC_BUSER, M_AXI_IC_ARID => M_AXI_IC_ARID, M_AXI_IC_ARADDR => M_AXI_IC_ARADDR, M_AXI_IC_ARLEN => M_AXI_IC_ARLEN, M_AXI_IC_ARSIZE => M_AXI_IC_ARSIZE, M_AXI_IC_ARBURST => M_AXI_IC_ARBURST, M_AXI_IC_ARLOCK => M_AXI_IC_ARLOCK, M_AXI_IC_ARCACHE => M_AXI_IC_ARCACHE, M_AXI_IC_ARPROT => M_AXI_IC_ARPROT, M_AXI_IC_ARQOS => M_AXI_IC_ARQOS, M_AXI_IC_ARVALID => M_AXI_IC_ARVALID, M_AXI_IC_ARREADY => M_AXI_IC_ARREADY, M_AXI_IC_ARUSER => M_AXI_IC_ARUSER, M_AXI_IC_RID => M_AXI_IC_RID, M_AXI_IC_RDATA => M_AXI_IC_RDATA, M_AXI_IC_RRESP => M_AXI_IC_RRESP, M_AXI_IC_RLAST => M_AXI_IC_RLAST, M_AXI_IC_RVALID => M_AXI_IC_RVALID, M_AXI_IC_RREADY => M_AXI_IC_RREADY, M_AXI_IC_RUSER => M_AXI_IC_RUSER, M_AXI_DC_AWID => M_AXI_DC_AWID, M_AXI_DC_AWADDR => M_AXI_DC_AWADDR, M_AXI_DC_AWLEN => M_AXI_DC_AWLEN, M_AXI_DC_AWSIZE => M_AXI_DC_AWSIZE, M_AXI_DC_AWBURST => M_AXI_DC_AWBURST, M_AXI_DC_AWLOCK => M_AXI_DC_AWLOCK, M_AXI_DC_AWCACHE => M_AXI_DC_AWCACHE, M_AXI_DC_AWPROT => M_AXI_DC_AWPROT, M_AXI_DC_AWQOS => M_AXI_DC_AWQOS, M_AXI_DC_AWVALID => M_AXI_DC_AWVALID, M_AXI_DC_AWREADY => M_AXI_DC_AWREADY, M_AXI_DC_AWUSER => M_AXI_DC_AWUSER, M_AXI_DC_WDATA => M_AXI_DC_WDATA, M_AXI_DC_WSTRB => M_AXI_DC_WSTRB, M_AXI_DC_WLAST => M_AXI_DC_WLAST, M_AXI_DC_WVALID => M_AXI_DC_WVALID, M_AXI_DC_WREADY => M_AXI_DC_WREADY, M_AXI_DC_WUSER => M_AXI_DC_WUSER, M_AXI_DC_BID => M_AXI_DC_BID, M_AXI_DC_BRESP => M_AXI_DC_BRESP, M_AXI_DC_BVALID => M_AXI_DC_BVALID, M_AXI_DC_BREADY => M_AXI_DC_BREADY, M_AXI_DC_BUSER => M_AXI_DC_BUSER, M_AXI_DC_ARID => M_AXI_DC_ARID, M_AXI_DC_ARADDR => M_AXI_DC_ARADDR, M_AXI_DC_ARLEN => M_AXI_DC_ARLEN, M_AXI_DC_ARSIZE => M_AXI_DC_ARSIZE, M_AXI_DC_ARBURST => M_AXI_DC_ARBURST, M_AXI_DC_ARLOCK => M_AXI_DC_ARLOCK, M_AXI_DC_ARCACHE => M_AXI_DC_ARCACHE, M_AXI_DC_ARPROT => M_AXI_DC_ARPROT, M_AXI_DC_ARQOS => M_AXI_DC_ARQOS, M_AXI_DC_ARVALID => M_AXI_DC_ARVALID, M_AXI_DC_ARREADY => M_AXI_DC_ARREADY, M_AXI_DC_ARUSER => M_AXI_DC_ARUSER, M_AXI_DC_RID => M_AXI_DC_RID, M_AXI_DC_RDATA => M_AXI_DC_RDATA, M_AXI_DC_RRESP => M_AXI_DC_RRESP, M_AXI_DC_RLAST => M_AXI_DC_RLAST, M_AXI_DC_RVALID => M_AXI_DC_RVALID, M_AXI_DC_RREADY => M_AXI_DC_RREADY, M_AXI_DC_RUSER => M_AXI_DC_RUSER, DBG_CLK => DBG_CLK, DBG_TDI => DBG_TDI, DBG_TDO => DBG_TDO, DBG_REG_EN => DBG_REG_EN, DBG_SHIFT => DBG_SHIFT, DBG_CAPTURE => DBG_CAPTURE, DBG_UPDATE => DBG_UPDATE, DEBUG_RST => DEBUG_RST, Trace_Instruction => Trace_Instruction, Trace_Valid_Instr => Trace_Valid_Instr, Trace_PC => Trace_PC, Trace_Reg_Write => Trace_Reg_Write, Trace_Reg_Addr => Trace_Reg_Addr, Trace_MSR_Reg => Trace_MSR_Reg, Trace_PID_Reg => Trace_PID_Reg, Trace_New_Reg_Value => Trace_New_Reg_Value, Trace_Exception_Taken => Trace_Exception_Taken, Trace_Exception_Kind => Trace_Exception_Kind, Trace_Jump_Taken => Trace_Jump_Taken, Trace_Delay_Slot => Trace_Delay_Slot, Trace_Data_Address => Trace_Data_Address, Trace_Data_Access => Trace_Data_Access, Trace_Data_Read => Trace_Data_Read, Trace_Data_Write => Trace_Data_Write, Trace_Data_Write_Value => Trace_Data_Write_Value, Trace_Data_Byte_Enable => Trace_Data_Byte_Enable, Trace_DCache_Req => Trace_DCache_Req, Trace_DCache_Hit => Trace_DCache_Hit, Trace_DCache_Rdy => Trace_DCache_Rdy, Trace_DCache_Read => Trace_DCache_Read, Trace_ICache_Req => Trace_ICache_Req, Trace_ICache_Hit => Trace_ICache_Hit, Trace_ICache_Rdy => Trace_ICache_Rdy, Trace_OF_PipeRun => Trace_OF_PipeRun, Trace_EX_PipeRun => Trace_EX_PipeRun, Trace_MEM_PipeRun => Trace_MEM_PipeRun, Trace_MB_Halted => Trace_MB_Halted, Trace_Jump_Hit => Trace_Jump_Hit, FSL0_S_CLK => FSL0_S_CLK, FSL0_S_READ => FSL0_S_READ, FSL0_S_DATA => FSL0_S_DATA, FSL0_S_CONTROL => FSL0_S_CONTROL, FSL0_S_EXISTS => FSL0_S_EXISTS, FSL0_M_CLK => FSL0_M_CLK, FSL0_M_WRITE => FSL0_M_WRITE, FSL0_M_DATA => FSL0_M_DATA, FSL0_M_CONTROL => FSL0_M_CONTROL, FSL0_M_FULL => FSL0_M_FULL, FSL1_S_CLK => FSL1_S_CLK, FSL1_S_READ => FSL1_S_READ, FSL1_S_DATA => FSL1_S_DATA, FSL1_S_CONTROL => FSL1_S_CONTROL, FSL1_S_EXISTS => FSL1_S_EXISTS, FSL1_M_CLK => FSL1_M_CLK, FSL1_M_WRITE => FSL1_M_WRITE, FSL1_M_DATA => FSL1_M_DATA, FSL1_M_CONTROL => FSL1_M_CONTROL, FSL1_M_FULL => FSL1_M_FULL, FSL2_S_CLK => FSL2_S_CLK, FSL2_S_READ => FSL2_S_READ, FSL2_S_DATA => FSL2_S_DATA, FSL2_S_CONTROL => FSL2_S_CONTROL, FSL2_S_EXISTS => FSL2_S_EXISTS, FSL2_M_CLK => FSL2_M_CLK, FSL2_M_WRITE => FSL2_M_WRITE, FSL2_M_DATA => FSL2_M_DATA, FSL2_M_CONTROL => FSL2_M_CONTROL, FSL2_M_FULL => FSL2_M_FULL, FSL3_S_CLK => FSL3_S_CLK, FSL3_S_READ => FSL3_S_READ, FSL3_S_DATA => FSL3_S_DATA, FSL3_S_CONTROL => FSL3_S_CONTROL, FSL3_S_EXISTS => FSL3_S_EXISTS, FSL3_M_CLK => FSL3_M_CLK, FSL3_M_WRITE => FSL3_M_WRITE, FSL3_M_DATA => FSL3_M_DATA, FSL3_M_CONTROL => FSL3_M_CONTROL, FSL3_M_FULL => FSL3_M_FULL, FSL4_S_CLK => FSL4_S_CLK, FSL4_S_READ => FSL4_S_READ, FSL4_S_DATA => FSL4_S_DATA, FSL4_S_CONTROL => FSL4_S_CONTROL, FSL4_S_EXISTS => FSL4_S_EXISTS, FSL4_M_CLK => FSL4_M_CLK, FSL4_M_WRITE => FSL4_M_WRITE, FSL4_M_DATA => FSL4_M_DATA, FSL4_M_CONTROL => FSL4_M_CONTROL, FSL4_M_FULL => FSL4_M_FULL, FSL5_S_CLK => FSL5_S_CLK, FSL5_S_READ => FSL5_S_READ, FSL5_S_DATA => FSL5_S_DATA, FSL5_S_CONTROL => FSL5_S_CONTROL, FSL5_S_EXISTS => FSL5_S_EXISTS, FSL5_M_CLK => FSL5_M_CLK, FSL5_M_WRITE => FSL5_M_WRITE, FSL5_M_DATA => FSL5_M_DATA, FSL5_M_CONTROL => FSL5_M_CONTROL, FSL5_M_FULL => FSL5_M_FULL, FSL6_S_CLK => FSL6_S_CLK, FSL6_S_READ => FSL6_S_READ, FSL6_S_DATA => FSL6_S_DATA, FSL6_S_CONTROL => FSL6_S_CONTROL, FSL6_S_EXISTS => FSL6_S_EXISTS, FSL6_M_CLK => FSL6_M_CLK, FSL6_M_WRITE => FSL6_M_WRITE, FSL6_M_DATA => FSL6_M_DATA, FSL6_M_CONTROL => FSL6_M_CONTROL, FSL6_M_FULL => FSL6_M_FULL, FSL7_S_CLK => FSL7_S_CLK, FSL7_S_READ => FSL7_S_READ, FSL7_S_DATA => FSL7_S_DATA, FSL7_S_CONTROL => FSL7_S_CONTROL, FSL7_S_EXISTS => FSL7_S_EXISTS, FSL7_M_CLK => FSL7_M_CLK, FSL7_M_WRITE => FSL7_M_WRITE, FSL7_M_DATA => FSL7_M_DATA, FSL7_M_CONTROL => FSL7_M_CONTROL, FSL7_M_FULL => FSL7_M_FULL, FSL8_S_CLK => FSL8_S_CLK, FSL8_S_READ => FSL8_S_READ, FSL8_S_DATA => FSL8_S_DATA, FSL8_S_CONTROL => FSL8_S_CONTROL, FSL8_S_EXISTS => FSL8_S_EXISTS, FSL8_M_CLK => FSL8_M_CLK, FSL8_M_WRITE => FSL8_M_WRITE, FSL8_M_DATA => FSL8_M_DATA, FSL8_M_CONTROL => FSL8_M_CONTROL, FSL8_M_FULL => FSL8_M_FULL, FSL9_S_CLK => FSL9_S_CLK, FSL9_S_READ => FSL9_S_READ, FSL9_S_DATA => FSL9_S_DATA, FSL9_S_CONTROL => FSL9_S_CONTROL, FSL9_S_EXISTS => FSL9_S_EXISTS, FSL9_M_CLK => FSL9_M_CLK, FSL9_M_WRITE => FSL9_M_WRITE, FSL9_M_DATA => FSL9_M_DATA, FSL9_M_CONTROL => FSL9_M_CONTROL, FSL9_M_FULL => FSL9_M_FULL, FSL10_S_CLK => FSL10_S_CLK, FSL10_S_READ => FSL10_S_READ, FSL10_S_DATA => FSL10_S_DATA, FSL10_S_CONTROL => FSL10_S_CONTROL, FSL10_S_EXISTS => FSL10_S_EXISTS, FSL10_M_CLK => FSL10_M_CLK, FSL10_M_WRITE => FSL10_M_WRITE, FSL10_M_DATA => FSL10_M_DATA, FSL10_M_CONTROL => FSL10_M_CONTROL, FSL10_M_FULL => FSL10_M_FULL, FSL11_S_CLK => FSL11_S_CLK, FSL11_S_READ => FSL11_S_READ, FSL11_S_DATA => FSL11_S_DATA, FSL11_S_CONTROL => FSL11_S_CONTROL, FSL11_S_EXISTS => FSL11_S_EXISTS, FSL11_M_CLK => FSL11_M_CLK, FSL11_M_WRITE => FSL11_M_WRITE, FSL11_M_DATA => FSL11_M_DATA, FSL11_M_CONTROL => FSL11_M_CONTROL, FSL11_M_FULL => FSL11_M_FULL, FSL12_S_CLK => FSL12_S_CLK, FSL12_S_READ => FSL12_S_READ, FSL12_S_DATA => FSL12_S_DATA, FSL12_S_CONTROL => FSL12_S_CONTROL, FSL12_S_EXISTS => FSL12_S_EXISTS, FSL12_M_CLK => FSL12_M_CLK, FSL12_M_WRITE => FSL12_M_WRITE, FSL12_M_DATA => FSL12_M_DATA, FSL12_M_CONTROL => FSL12_M_CONTROL, FSL12_M_FULL => FSL12_M_FULL, FSL13_S_CLK => FSL13_S_CLK, FSL13_S_READ => FSL13_S_READ, FSL13_S_DATA => FSL13_S_DATA, FSL13_S_CONTROL => FSL13_S_CONTROL, FSL13_S_EXISTS => FSL13_S_EXISTS, FSL13_M_CLK => FSL13_M_CLK, FSL13_M_WRITE => FSL13_M_WRITE, FSL13_M_DATA => FSL13_M_DATA, FSL13_M_CONTROL => FSL13_M_CONTROL, FSL13_M_FULL => FSL13_M_FULL, FSL14_S_CLK => FSL14_S_CLK, FSL14_S_READ => FSL14_S_READ, FSL14_S_DATA => FSL14_S_DATA, FSL14_S_CONTROL => FSL14_S_CONTROL, FSL14_S_EXISTS => FSL14_S_EXISTS, FSL14_M_CLK => FSL14_M_CLK, FSL14_M_WRITE => FSL14_M_WRITE, FSL14_M_DATA => FSL14_M_DATA, FSL14_M_CONTROL => FSL14_M_CONTROL, FSL14_M_FULL => FSL14_M_FULL, FSL15_S_CLK => FSL15_S_CLK, FSL15_S_READ => FSL15_S_READ, FSL15_S_DATA => FSL15_S_DATA, FSL15_S_CONTROL => FSL15_S_CONTROL, FSL15_S_EXISTS => FSL15_S_EXISTS, FSL15_M_CLK => FSL15_M_CLK, FSL15_M_WRITE => FSL15_M_WRITE, FSL15_M_DATA => FSL15_M_DATA, FSL15_M_CONTROL => FSL15_M_CONTROL, FSL15_M_FULL => FSL15_M_FULL, M0_AXIS_TLAST => M0_AXIS_TLAST, M0_AXIS_TDATA => M0_AXIS_TDATA, M0_AXIS_TVALID => M0_AXIS_TVALID, M0_AXIS_TREADY => M0_AXIS_TREADY, S0_AXIS_TLAST => S0_AXIS_TLAST, S0_AXIS_TDATA => S0_AXIS_TDATA, S0_AXIS_TVALID => S0_AXIS_TVALID, S0_AXIS_TREADY => S0_AXIS_TREADY, M1_AXIS_TLAST => M1_AXIS_TLAST, M1_AXIS_TDATA => M1_AXIS_TDATA, M1_AXIS_TVALID => M1_AXIS_TVALID, M1_AXIS_TREADY => M1_AXIS_TREADY, S1_AXIS_TLAST => S1_AXIS_TLAST, S1_AXIS_TDATA => S1_AXIS_TDATA, S1_AXIS_TVALID => S1_AXIS_TVALID, S1_AXIS_TREADY => S1_AXIS_TREADY, M2_AXIS_TLAST => M2_AXIS_TLAST, M2_AXIS_TDATA => M2_AXIS_TDATA, M2_AXIS_TVALID => M2_AXIS_TVALID, M2_AXIS_TREADY => M2_AXIS_TREADY, S2_AXIS_TLAST => S2_AXIS_TLAST, S2_AXIS_TDATA => S2_AXIS_TDATA, S2_AXIS_TVALID => S2_AXIS_TVALID, S2_AXIS_TREADY => S2_AXIS_TREADY, M3_AXIS_TLAST => M3_AXIS_TLAST, M3_AXIS_TDATA => M3_AXIS_TDATA, M3_AXIS_TVALID => M3_AXIS_TVALID, M3_AXIS_TREADY => M3_AXIS_TREADY, S3_AXIS_TLAST => S3_AXIS_TLAST, S3_AXIS_TDATA => S3_AXIS_TDATA, S3_AXIS_TVALID => S3_AXIS_TVALID, S3_AXIS_TREADY => S3_AXIS_TREADY, M4_AXIS_TLAST => M4_AXIS_TLAST, M4_AXIS_TDATA => M4_AXIS_TDATA, M4_AXIS_TVALID => M4_AXIS_TVALID, M4_AXIS_TREADY => M4_AXIS_TREADY, S4_AXIS_TLAST => S4_AXIS_TLAST, S4_AXIS_TDATA => S4_AXIS_TDATA, S4_AXIS_TVALID => S4_AXIS_TVALID, S4_AXIS_TREADY => S4_AXIS_TREADY, M5_AXIS_TLAST => M5_AXIS_TLAST, M5_AXIS_TDATA => M5_AXIS_TDATA, M5_AXIS_TVALID => M5_AXIS_TVALID, M5_AXIS_TREADY => M5_AXIS_TREADY, S5_AXIS_TLAST => S5_AXIS_TLAST, S5_AXIS_TDATA => S5_AXIS_TDATA, S5_AXIS_TVALID => S5_AXIS_TVALID, S5_AXIS_TREADY => S5_AXIS_TREADY, M6_AXIS_TLAST => M6_AXIS_TLAST, M6_AXIS_TDATA => M6_AXIS_TDATA, M6_AXIS_TVALID => M6_AXIS_TVALID, M6_AXIS_TREADY => M6_AXIS_TREADY, S6_AXIS_TLAST => S6_AXIS_TLAST, S6_AXIS_TDATA => S6_AXIS_TDATA, S6_AXIS_TVALID => S6_AXIS_TVALID, S6_AXIS_TREADY => S6_AXIS_TREADY, M7_AXIS_TLAST => M7_AXIS_TLAST, M7_AXIS_TDATA => M7_AXIS_TDATA, M7_AXIS_TVALID => M7_AXIS_TVALID, M7_AXIS_TREADY => M7_AXIS_TREADY, S7_AXIS_TLAST => S7_AXIS_TLAST, S7_AXIS_TDATA => S7_AXIS_TDATA, S7_AXIS_TVALID => S7_AXIS_TVALID, S7_AXIS_TREADY => S7_AXIS_TREADY, M8_AXIS_TLAST => M8_AXIS_TLAST, M8_AXIS_TDATA => M8_AXIS_TDATA, M8_AXIS_TVALID => M8_AXIS_TVALID, M8_AXIS_TREADY => M8_AXIS_TREADY, S8_AXIS_TLAST => S8_AXIS_TLAST, S8_AXIS_TDATA => S8_AXIS_TDATA, S8_AXIS_TVALID => S8_AXIS_TVALID, S8_AXIS_TREADY => S8_AXIS_TREADY, M9_AXIS_TLAST => M9_AXIS_TLAST, M9_AXIS_TDATA => M9_AXIS_TDATA, M9_AXIS_TVALID => M9_AXIS_TVALID, M9_AXIS_TREADY => M9_AXIS_TREADY, S9_AXIS_TLAST => S9_AXIS_TLAST, S9_AXIS_TDATA => S9_AXIS_TDATA, S9_AXIS_TVALID => S9_AXIS_TVALID, S9_AXIS_TREADY => S9_AXIS_TREADY, M10_AXIS_TLAST => M10_AXIS_TLAST, M10_AXIS_TDATA => M10_AXIS_TDATA, M10_AXIS_TVALID => M10_AXIS_TVALID, M10_AXIS_TREADY => M10_AXIS_TREADY, S10_AXIS_TLAST => S10_AXIS_TLAST, S10_AXIS_TDATA => S10_AXIS_TDATA, S10_AXIS_TVALID => S10_AXIS_TVALID, S10_AXIS_TREADY => S10_AXIS_TREADY, M11_AXIS_TLAST => M11_AXIS_TLAST, M11_AXIS_TDATA => M11_AXIS_TDATA, M11_AXIS_TVALID => M11_AXIS_TVALID, M11_AXIS_TREADY => M11_AXIS_TREADY, S11_AXIS_TLAST => S11_AXIS_TLAST, S11_AXIS_TDATA => S11_AXIS_TDATA, S11_AXIS_TVALID => S11_AXIS_TVALID, S11_AXIS_TREADY => S11_AXIS_TREADY, M12_AXIS_TLAST => M12_AXIS_TLAST, M12_AXIS_TDATA => M12_AXIS_TDATA, M12_AXIS_TVALID => M12_AXIS_TVALID, M12_AXIS_TREADY => M12_AXIS_TREADY, S12_AXIS_TLAST => S12_AXIS_TLAST, S12_AXIS_TDATA => S12_AXIS_TDATA, S12_AXIS_TVALID => S12_AXIS_TVALID, S12_AXIS_TREADY => S12_AXIS_TREADY, M13_AXIS_TLAST => M13_AXIS_TLAST, M13_AXIS_TDATA => M13_AXIS_TDATA, M13_AXIS_TVALID => M13_AXIS_TVALID, M13_AXIS_TREADY => M13_AXIS_TREADY, S13_AXIS_TLAST => S13_AXIS_TLAST, S13_AXIS_TDATA => S13_AXIS_TDATA, S13_AXIS_TVALID => S13_AXIS_TVALID, S13_AXIS_TREADY => S13_AXIS_TREADY, M14_AXIS_TLAST => M14_AXIS_TLAST, M14_AXIS_TDATA => M14_AXIS_TDATA, M14_AXIS_TVALID => M14_AXIS_TVALID, M14_AXIS_TREADY => M14_AXIS_TREADY, S14_AXIS_TLAST => S14_AXIS_TLAST, S14_AXIS_TDATA => S14_AXIS_TDATA, S14_AXIS_TVALID => S14_AXIS_TVALID, S14_AXIS_TREADY => S14_AXIS_TREADY, M15_AXIS_TLAST => M15_AXIS_TLAST, M15_AXIS_TDATA => M15_AXIS_TDATA, M15_AXIS_TVALID => M15_AXIS_TVALID, M15_AXIS_TREADY => M15_AXIS_TREADY, S15_AXIS_TLAST => S15_AXIS_TLAST, S15_AXIS_TDATA => S15_AXIS_TDATA, S15_AXIS_TVALID => S15_AXIS_TVALID, S15_AXIS_TREADY => S15_AXIS_TREADY, ICACHE_FSL_IN_CLK => ICACHE_FSL_IN_CLK, ICACHE_FSL_IN_READ => ICACHE_FSL_IN_READ, ICACHE_FSL_IN_DATA => ICACHE_FSL_IN_DATA, ICACHE_FSL_IN_CONTROL => ICACHE_FSL_IN_CONTROL, ICACHE_FSL_IN_EXISTS => ICACHE_FSL_IN_EXISTS, ICACHE_FSL_OUT_CLK => ICACHE_FSL_OUT_CLK, ICACHE_FSL_OUT_WRITE => ICACHE_FSL_OUT_WRITE, ICACHE_FSL_OUT_DATA => ICACHE_FSL_OUT_DATA, ICACHE_FSL_OUT_CONTROL => ICACHE_FSL_OUT_CONTROL, ICACHE_FSL_OUT_FULL => ICACHE_FSL_OUT_FULL, DCACHE_FSL_IN_CLK => DCACHE_FSL_IN_CLK, DCACHE_FSL_IN_READ => DCACHE_FSL_IN_READ, DCACHE_FSL_IN_DATA => DCACHE_FSL_IN_DATA, DCACHE_FSL_IN_CONTROL => DCACHE_FSL_IN_CONTROL, DCACHE_FSL_IN_EXISTS => DCACHE_FSL_IN_EXISTS, DCACHE_FSL_OUT_CLK => DCACHE_FSL_OUT_CLK, DCACHE_FSL_OUT_WRITE => DCACHE_FSL_OUT_WRITE, DCACHE_FSL_OUT_DATA => DCACHE_FSL_OUT_DATA, DCACHE_FSL_OUT_CONTROL => DCACHE_FSL_OUT_CONTROL, DCACHE_FSL_OUT_FULL => DCACHE_FSL_OUT_FULL ); end architecture STRUCTURE;
-- Gray_Processing_GN_Gray_Processing_Gray_Processing_Module.vhd -- Generated using ACDS version 13.1 162 at 2015.02.27.10:14:00 library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity Gray_Processing_GN_Gray_Processing_Gray_Processing_Module is port ( eop : in std_logic := '0'; -- eop.wire Clock : in std_logic := '0'; -- Clock.clk aclr : in std_logic := '0'; -- .reset data_in : in std_logic_vector(23 downto 0) := (others => '0'); -- data_in.wire data_out : out std_logic_vector(23 downto 0); -- data_out.wire sop : in std_logic := '0' -- sop.wire ); end entity Gray_Processing_GN_Gray_Processing_Gray_Processing_Module; architecture rtl of Gray_Processing_GN_Gray_Processing_Gray_Processing_Module is component alt_dspbuilder_clock_GNQFU4PUDH is port ( aclr : in std_logic := 'X'; -- reset aclr_n : in std_logic := 'X'; -- reset_n aclr_out : out std_logic; -- reset clock : in std_logic := 'X'; -- clk clock_out : out std_logic -- clk ); end component alt_dspbuilder_clock_GNQFU4PUDH; component alt_dspbuilder_cast_GNKXX25S2S is generic ( round : natural := 0; saturate : natural := 0 ); port ( input : in std_logic_vector(23 downto 0) := (others => 'X'); -- wire output : out std_logic_vector(7 downto 0) -- wire ); end component alt_dspbuilder_cast_GNKXX25S2S; component alt_dspbuilder_cast_GN6OMCQQS7 is generic ( round : natural := 0; saturate : natural := 0 ); port ( input : in std_logic_vector(23 downto 0) := (others => 'X'); -- wire output : out std_logic_vector(7 downto 0) -- wire ); end component alt_dspbuilder_cast_GN6OMCQQS7; component alt_dspbuilder_cast_GN7IAAYCSZ is generic ( round : natural := 0; saturate : natural := 0 ); port ( input : in std_logic_vector(23 downto 0) := (others => 'X'); -- wire output : out std_logic_vector(7 downto 0) -- wire ); end component alt_dspbuilder_cast_GN7IAAYCSZ; component alt_dspbuilder_logical_bit_op_GNA5ZFEL7V is generic ( LogicalOp : string := "AltAND"; number_inputs : positive := 2 ); port ( result : out std_logic; -- wire data0 : in std_logic := 'X'; -- wire data1 : in std_logic := 'X' -- wire ); end component alt_dspbuilder_logical_bit_op_GNA5ZFEL7V; component alt_dspbuilder_barrelshifter_GNV5DVAGHT is generic ( DISTANCE_WIDTH : natural := 3; NDIRECTION : natural := 0; SIGNED : integer := 1; use_dedicated_circuitry : string := "false"; PIPELINE : natural := 0; WIDTH : natural := 8 ); port ( a : in std_logic_vector(WIDTH-1 downto 0) := (others => 'X'); -- wire aclr : in std_logic := 'X'; -- clk clock : in std_logic := 'X'; -- clk direction : in std_logic := 'X'; -- wire distance : in std_logic_vector(DISTANCE_WIDTH-1 downto 0) := (others => 'X'); -- wire ena : in std_logic := 'X'; -- wire r : out std_logic_vector(WIDTH-1 downto 0); -- wire user_aclr : in std_logic := 'X' -- wire ); end component alt_dspbuilder_barrelshifter_GNV5DVAGHT; component alt_dspbuilder_gnd_GN is port ( output : out std_logic -- wire ); end component alt_dspbuilder_gnd_GN; component alt_dspbuilder_vcc_GN is port ( output : out std_logic -- wire ); end component alt_dspbuilder_vcc_GN; component alt_dspbuilder_multiply_add_GNKLXFKAO3 is generic ( family : string := "Stratix"; direction : string := "AddAdd"; data3b_const : string := "00000000"; data2b_const : string := "00000000"; representation : string := "SIGNED"; dataWidth : integer := 8; data4b_const : string := "00000000"; number_multipliers : integer := 2; pipeline_register : string := "NoRegister"; use_dedicated_circuitry : integer := 0; data1b_const : string := "00000000"; use_b_consts : natural := 0 ); port ( clock : in std_logic := 'X'; -- clk aclr : in std_logic := 'X'; -- reset data1a : in std_logic_vector(7 downto 0) := (others => 'X'); -- wire data2a : in std_logic_vector(7 downto 0) := (others => 'X'); -- wire data3a : in std_logic_vector(7 downto 0) := (others => 'X'); -- wire result : out std_logic_vector(17 downto 0); -- wire user_aclr : in std_logic := 'X'; -- wire ena : in std_logic := 'X' -- wire ); end component alt_dspbuilder_multiply_add_GNKLXFKAO3; component alt_dspbuilder_multiplexer_GNCALBUTDR is generic ( HDLTYPE : string := "STD_LOGIC_VECTOR"; use_one_hot_select_bus : natural := 0; width : positive := 8; pipeline : natural := 0; number_inputs : natural := 4 ); port ( clock : in std_logic := 'X'; -- clk aclr : in std_logic := 'X'; -- reset sel : in std_logic_vector(0 downto 0) := (others => 'X'); -- wire result : out std_logic_vector(23 downto 0); -- wire ena : in std_logic := 'X'; -- wire user_aclr : in std_logic := 'X'; -- wire in0 : in std_logic_vector(23 downto 0) := (others => 'X'); -- wire in1 : in std_logic_vector(23 downto 0) := (others => 'X') -- wire ); end component alt_dspbuilder_multiplexer_GNCALBUTDR; component alt_dspbuilder_cast_GNJGR7GQ2L is generic ( round : natural := 0; saturate : natural := 0 ); port ( input : in std_logic_vector(17 downto 0) := (others => 'X'); -- wire output : out std_logic_vector(7 downto 0) -- wire ); end component alt_dspbuilder_cast_GNJGR7GQ2L; component alt_dspbuilder_constant_GNZEH3JAKA is generic ( HDLTYPE : string := "STD_LOGIC_VECTOR"; BitPattern : string := "0000"; width : natural := 4 ); port ( output : out std_logic_vector(23 downto 0) -- wire ); end component alt_dspbuilder_constant_GNZEH3JAKA; component alt_dspbuilder_if_statement_GN7VA7SRUP is generic ( use_else_output : natural := 0; bwr : natural := 0; use_else_input : natural := 0; signed : natural := 1; HDLTYPE : string := "STD_LOGIC_VECTOR"; if_expression : string := "a"; number_inputs : integer := 1; width : natural := 8 ); port ( true : out std_logic; -- wire a : in std_logic_vector(23 downto 0) := (others => 'X'); -- wire b : in std_logic_vector(23 downto 0) := (others => 'X'); -- wire c : in std_logic_vector(23 downto 0) := (others => 'X') -- wire ); end component alt_dspbuilder_if_statement_GN7VA7SRUP; component alt_dspbuilder_port_GN37ALZBS4 is port ( input : in std_logic := 'X'; -- wire output : out std_logic -- wire ); end component alt_dspbuilder_port_GN37ALZBS4; component alt_dspbuilder_bus_concat_GN55ETJ4VI is generic ( widthB : natural := 8; widthA : natural := 8 ); port ( a : in std_logic_vector(widthA-1 downto 0) := (others => 'X'); -- wire aclr : in std_logic := 'X'; -- clk b : in std_logic_vector(widthB-1 downto 0) := (others => 'X'); -- wire clock : in std_logic := 'X'; -- clk output : out std_logic_vector(widthA+widthB-1 downto 0) -- wire ); end component alt_dspbuilder_bus_concat_GN55ETJ4VI; component alt_dspbuilder_delay_GNHYCSAEGT is generic ( ClockPhase : string := "1"; delay : positive := 1; use_init : natural := 0; BitPattern : string := "00000001"; width : positive := 8 ); port ( aclr : in std_logic := 'X'; -- clk clock : in std_logic := 'X'; -- clk ena : in std_logic := 'X'; -- wire input : in std_logic_vector(width-1 downto 0) := (others => 'X'); -- wire output : out std_logic_vector(width-1 downto 0); -- wire sclr : in std_logic := 'X' -- wire ); end component alt_dspbuilder_delay_GNHYCSAEGT; component alt_dspbuilder_bus_concat_GNIIOZRPJD is generic ( widthB : natural := 8; widthA : natural := 8 ); port ( a : in std_logic_vector(widthA-1 downto 0) := (others => 'X'); -- wire aclr : in std_logic := 'X'; -- clk b : in std_logic_vector(widthB-1 downto 0) := (others => 'X'); -- wire clock : in std_logic := 'X'; -- clk output : out std_logic_vector(widthA+widthB-1 downto 0) -- wire ); end component alt_dspbuilder_bus_concat_GNIIOZRPJD; component alt_dspbuilder_constant_GNNKZSYI73 is generic ( HDLTYPE : string := "STD_LOGIC_VECTOR"; BitPattern : string := "0000"; width : natural := 4 ); port ( output : out std_logic_vector(23 downto 0) -- wire ); end component alt_dspbuilder_constant_GNNKZSYI73; component alt_dspbuilder_delay_GNUECIBFDH is generic ( ClockPhase : string := "1"; delay : positive := 1; use_init : natural := 0; BitPattern : string := "00000001"; width : positive := 8 ); port ( aclr : in std_logic := 'X'; -- clk clock : in std_logic := 'X'; -- clk ena : in std_logic := 'X'; -- wire input : in std_logic_vector(width-1 downto 0) := (others => 'X'); -- wire output : out std_logic_vector(width-1 downto 0); -- wire sclr : in std_logic := 'X' -- wire ); end component alt_dspbuilder_delay_GNUECIBFDH; component alt_dspbuilder_constant_GNPXZ5JSVR is generic ( HDLTYPE : string := "STD_LOGIC_VECTOR"; BitPattern : string := "0000"; width : natural := 4 ); port ( output : out std_logic_vector(3 downto 0) -- wire ); end component alt_dspbuilder_constant_GNPXZ5JSVR; component alt_dspbuilder_port_GNOC3SGKQJ is port ( input : in std_logic_vector(23 downto 0) := (others => 'X'); -- wire output : out std_logic_vector(23 downto 0) -- wire ); end component alt_dspbuilder_port_GNOC3SGKQJ; component alt_dspbuilder_cast_GNSB3OXIQS is generic ( round : natural := 0; saturate : natural := 0 ); port ( input : in std_logic_vector(0 downto 0) := (others => 'X'); -- wire output : out std_logic -- wire ); end component alt_dspbuilder_cast_GNSB3OXIQS; component alt_dspbuilder_cast_GN46N4UJ5S is generic ( round : natural := 0; saturate : natural := 0 ); port ( input : in std_logic := 'X'; -- wire output : out std_logic_vector(0 downto 0) -- wire ); end component alt_dspbuilder_cast_GN46N4UJ5S; signal barrel_shifteruser_aclrgnd_output_wire : std_logic; -- Barrel_Shifteruser_aclrGND:output -> Barrel_Shifter:user_aclr signal barrel_shifterenavcc_output_wire : std_logic; -- Barrel_ShifterenaVCC:output -> Barrel_Shifter:ena signal multiply_adduser_aclrgnd_output_wire : std_logic; -- Multiply_Adduser_aclrGND:output -> Multiply_Add:user_aclr signal multiply_addenavcc_output_wire : std_logic; -- Multiply_AddenaVCC:output -> Multiply_Add:ena signal multiplexeruser_aclrgnd_output_wire : std_logic; -- Multiplexeruser_aclrGND:output -> Multiplexer:user_aclr signal multiplexerenavcc_output_wire : std_logic; -- MultiplexerenaVCC:output -> Multiplexer:ena signal delay1sclrgnd_output_wire : std_logic; -- Delay1sclrGND:output -> Delay1:sclr signal delay1enavcc_output_wire : std_logic; -- Delay1enaVCC:output -> Delay1:ena signal delay2sclrgnd_output_wire : std_logic; -- Delay2sclrGND:output -> Delay2:sclr signal delay2enavcc_output_wire : std_logic; -- Delay2enaVCC:output -> Delay2:ena signal bus_concatenation_output_wire : std_logic_vector(15 downto 0); -- Bus_Concatenation:output -> Bus_Concatenation1:b signal barrel_shifter_r_wire : std_logic_vector(17 downto 0); -- Barrel_Shifter:r -> Bus_Conversion:input signal bus_conversion_output_wire : std_logic_vector(7 downto 0); -- Bus_Conversion:output -> [Bus_Concatenation1:a, Bus_Concatenation:a, Bus_Concatenation:b] signal data_in_0_output_wire : std_logic_vector(23 downto 0); -- data_in_0:output -> [Bus_Conversion1:input, Bus_Conversion2:input, Bus_Conversion3:input, If_Statement1:a, Multiplexer:in0] signal constant1_output_wire : std_logic_vector(3 downto 0); -- Constant1:output -> Barrel_Shifter:distance signal delay2_output_wire : std_logic_vector(0 downto 0); -- Delay2:output -> [Delay:input, cast1:input] signal constant3_output_wire : std_logic_vector(23 downto 0); -- Constant3:output -> If_Statement1:b signal constant4_output_wire : std_logic_vector(23 downto 0); -- Constant4:output -> If_Statement1:c signal if_statement1_true_wire : std_logic; -- If_Statement1:true -> Logical_Bit_Operator:data0 signal sop_0_output_wire : std_logic; -- sop_0:output -> Logical_Bit_Operator:data1 signal eop_0_output_wire : std_logic; -- eop_0:output -> Logical_Bit_Operator1:data0 signal delay_output_wire : std_logic_vector(0 downto 0); -- Delay:output -> [Multiplexer:sel, cast3:input] signal bus_concatenation1_output_wire : std_logic_vector(23 downto 0); -- Bus_Concatenation1:output -> Multiplexer:in1 signal bus_conversion3_output_wire : std_logic_vector(7 downto 0); -- Bus_Conversion3:output -> Multiply_Add:data1a signal bus_conversion2_output_wire : std_logic_vector(7 downto 0); -- Bus_Conversion2:output -> Multiply_Add:data2a signal bus_conversion1_output_wire : std_logic_vector(7 downto 0); -- Bus_Conversion1:output -> Multiply_Add:data3a signal multiply_add_result_wire : std_logic_vector(17 downto 0); -- Multiply_Add:result -> Barrel_Shifter:a signal multiplexer_result_wire : std_logic_vector(23 downto 0); -- Multiplexer:result -> data_out_0:input signal delay1_output_wire : std_logic_vector(0 downto 0); -- Delay1:output -> cast0:input signal cast0_output_wire : std_logic; -- cast0:output -> Delay:sclr signal cast1_output_wire : std_logic; -- cast1:output -> Delay:ena signal logical_bit_operator_result_wire : std_logic; -- Logical_Bit_Operator:result -> cast2:input signal cast2_output_wire : std_logic_vector(0 downto 0); -- cast2:output -> Delay2:input signal cast3_output_wire : std_logic; -- cast3:output -> Logical_Bit_Operator1:data1 signal logical_bit_operator1_result_wire : std_logic; -- Logical_Bit_Operator1:result -> cast4:input signal cast4_output_wire : std_logic_vector(0 downto 0); -- cast4:output -> Delay1:input signal clock_0_clock_output_reset : std_logic; -- Clock_0:aclr_out -> [Barrel_Shifter:aclr, Bus_Concatenation1:aclr, Bus_Concatenation:aclr, Delay1:aclr, Delay2:aclr, Delay:aclr, Multiplexer:aclr, Multiply_Add:aclr] signal clock_0_clock_output_clk : std_logic; -- Clock_0:clock_out -> [Barrel_Shifter:clock, Bus_Concatenation1:clock, Bus_Concatenation:clock, Delay1:clock, Delay2:clock, Delay:clock, Multiplexer:clock, Multiply_Add:clock] begin clock_0 : component alt_dspbuilder_clock_GNQFU4PUDH port map ( clock_out => clock_0_clock_output_clk, -- clock_output.clk aclr_out => clock_0_clock_output_reset, -- .reset clock => Clock, -- clock.clk aclr => aclr -- .reset ); bus_conversion1 : component alt_dspbuilder_cast_GNKXX25S2S generic map ( round => 0, saturate => 0 ) port map ( input => data_in_0_output_wire, -- input.wire output => bus_conversion1_output_wire -- output.wire ); bus_conversion2 : component alt_dspbuilder_cast_GN6OMCQQS7 generic map ( round => 0, saturate => 0 ) port map ( input => data_in_0_output_wire, -- input.wire output => bus_conversion2_output_wire -- output.wire ); bus_conversion3 : component alt_dspbuilder_cast_GN7IAAYCSZ generic map ( round => 0, saturate => 0 ) port map ( input => data_in_0_output_wire, -- input.wire output => bus_conversion3_output_wire -- output.wire ); logical_bit_operator : component alt_dspbuilder_logical_bit_op_GNA5ZFEL7V generic map ( LogicalOp => "AltAND", number_inputs => 2 ) port map ( result => logical_bit_operator_result_wire, -- result.wire data0 => if_statement1_true_wire, -- data0.wire data1 => sop_0_output_wire -- data1.wire ); barrel_shifter : component alt_dspbuilder_barrelshifter_GNV5DVAGHT generic map ( DISTANCE_WIDTH => 4, NDIRECTION => 1, SIGNED => 0, use_dedicated_circuitry => "false", PIPELINE => 0, WIDTH => 18 ) port map ( clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset a => multiply_add_result_wire, -- a.wire r => barrel_shifter_r_wire, -- r.wire distance => constant1_output_wire, -- distance.wire ena => barrel_shifterenavcc_output_wire, -- ena.wire user_aclr => barrel_shifteruser_aclrgnd_output_wire -- user_aclr.wire ); barrel_shifteruser_aclrgnd : component alt_dspbuilder_gnd_GN port map ( output => barrel_shifteruser_aclrgnd_output_wire -- output.wire ); barrel_shifterenavcc : component alt_dspbuilder_vcc_GN port map ( output => barrel_shifterenavcc_output_wire -- output.wire ); multiply_add : component alt_dspbuilder_multiply_add_GNKLXFKAO3 generic map ( family => "Cyclone V", direction => "AddAdd", data3b_const => "00011110", data2b_const => "10010110", representation => "UNSIGNED", dataWidth => 8, data4b_const => "01001100", number_multipliers => 3, pipeline_register => "NoRegister", use_dedicated_circuitry => 1, data1b_const => "01001100", use_b_consts => 1 ) port map ( clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset data1a => bus_conversion3_output_wire, -- data1a.wire data2a => bus_conversion2_output_wire, -- data2a.wire data3a => bus_conversion1_output_wire, -- data3a.wire result => multiply_add_result_wire, -- result.wire user_aclr => multiply_adduser_aclrgnd_output_wire, -- user_aclr.wire ena => multiply_addenavcc_output_wire -- ena.wire ); multiply_adduser_aclrgnd : component alt_dspbuilder_gnd_GN port map ( output => multiply_adduser_aclrgnd_output_wire -- output.wire ); multiply_addenavcc : component alt_dspbuilder_vcc_GN port map ( output => multiply_addenavcc_output_wire -- output.wire ); multiplexer : component alt_dspbuilder_multiplexer_GNCALBUTDR generic map ( HDLTYPE => "STD_LOGIC_VECTOR", use_one_hot_select_bus => 0, width => 24, pipeline => 0, number_inputs => 2 ) port map ( clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset sel => delay_output_wire, -- sel.wire result => multiplexer_result_wire, -- result.wire ena => multiplexerenavcc_output_wire, -- ena.wire user_aclr => multiplexeruser_aclrgnd_output_wire, -- user_aclr.wire in0 => data_in_0_output_wire, -- in0.wire in1 => bus_concatenation1_output_wire -- in1.wire ); multiplexeruser_aclrgnd : component alt_dspbuilder_gnd_GN port map ( output => multiplexeruser_aclrgnd_output_wire -- output.wire ); multiplexerenavcc : component alt_dspbuilder_vcc_GN port map ( output => multiplexerenavcc_output_wire -- output.wire ); bus_conversion : component alt_dspbuilder_cast_GNJGR7GQ2L generic map ( round => 0, saturate => 0 ) port map ( input => barrel_shifter_r_wire, -- input.wire output => bus_conversion_output_wire -- output.wire ); constant4 : component alt_dspbuilder_constant_GNZEH3JAKA generic map ( HDLTYPE => "STD_LOGIC_VECTOR", BitPattern => "000000000000000000001111", width => 24 ) port map ( output => constant4_output_wire -- output.wire ); if_statement1 : component alt_dspbuilder_if_statement_GN7VA7SRUP generic map ( use_else_output => 0, bwr => 0, use_else_input => 0, signed => 0, HDLTYPE => "STD_LOGIC_VECTOR", if_expression => "(a=b) and (a /= c)", number_inputs => 3, width => 24 ) port map ( true => if_statement1_true_wire, -- true.wire a => data_in_0_output_wire, -- a.wire b => constant3_output_wire, -- b.wire c => constant4_output_wire -- c.wire ); sop_0 : component alt_dspbuilder_port_GN37ALZBS4 port map ( input => sop, -- input.wire output => sop_0_output_wire -- output.wire ); bus_concatenation1 : component alt_dspbuilder_bus_concat_GN55ETJ4VI generic map ( widthB => 16, widthA => 8 ) port map ( clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset a => bus_conversion_output_wire, -- a.wire b => bus_concatenation_output_wire, -- b.wire output => bus_concatenation1_output_wire -- output.wire ); delay1 : component alt_dspbuilder_delay_GNHYCSAEGT generic map ( ClockPhase => "1", delay => 1, use_init => 0, BitPattern => "0", width => 1 ) port map ( input => cast4_output_wire, -- input.wire clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset output => delay1_output_wire, -- output.wire sclr => delay1sclrgnd_output_wire, -- sclr.wire ena => delay1enavcc_output_wire -- ena.wire ); delay1sclrgnd : component alt_dspbuilder_gnd_GN port map ( output => delay1sclrgnd_output_wire -- output.wire ); delay1enavcc : component alt_dspbuilder_vcc_GN port map ( output => delay1enavcc_output_wire -- output.wire ); bus_concatenation : component alt_dspbuilder_bus_concat_GNIIOZRPJD generic map ( widthB => 8, widthA => 8 ) port map ( clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset a => bus_conversion_output_wire, -- a.wire b => bus_conversion_output_wire, -- b.wire output => bus_concatenation_output_wire -- output.wire ); constant3 : component alt_dspbuilder_constant_GNNKZSYI73 generic map ( HDLTYPE => "STD_LOGIC_VECTOR", BitPattern => "000000000000000000000000", width => 24 ) port map ( output => constant3_output_wire -- output.wire ); delay2 : component alt_dspbuilder_delay_GNHYCSAEGT generic map ( ClockPhase => "1", delay => 1, use_init => 0, BitPattern => "0", width => 1 ) port map ( input => cast2_output_wire, -- input.wire clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset output => delay2_output_wire, -- output.wire sclr => delay2sclrgnd_output_wire, -- sclr.wire ena => delay2enavcc_output_wire -- ena.wire ); delay2sclrgnd : component alt_dspbuilder_gnd_GN port map ( output => delay2sclrgnd_output_wire -- output.wire ); delay2enavcc : component alt_dspbuilder_vcc_GN port map ( output => delay2enavcc_output_wire -- output.wire ); delay : component alt_dspbuilder_delay_GNUECIBFDH generic map ( ClockPhase => "1", delay => 1, use_init => 1, BitPattern => "0", width => 1 ) port map ( input => delay2_output_wire, -- input.wire clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset output => delay_output_wire, -- output.wire sclr => cast0_output_wire, -- sclr.wire ena => cast1_output_wire -- ena.wire ); constant1 : component alt_dspbuilder_constant_GNPXZ5JSVR generic map ( HDLTYPE => "STD_LOGIC_VECTOR", BitPattern => "1000", width => 4 ) port map ( output => constant1_output_wire -- output.wire ); data_out_0 : component alt_dspbuilder_port_GNOC3SGKQJ port map ( input => multiplexer_result_wire, -- input.wire output => data_out -- output.wire ); data_in_0 : component alt_dspbuilder_port_GNOC3SGKQJ port map ( input => data_in, -- input.wire output => data_in_0_output_wire -- output.wire ); eop_0 : component alt_dspbuilder_port_GN37ALZBS4 port map ( input => eop, -- input.wire output => eop_0_output_wire -- output.wire ); logical_bit_operator1 : component alt_dspbuilder_logical_bit_op_GNA5ZFEL7V generic map ( LogicalOp => "AltAND", number_inputs => 2 ) port map ( result => logical_bit_operator1_result_wire, -- result.wire data0 => eop_0_output_wire, -- data0.wire data1 => cast3_output_wire -- data1.wire ); cast0 : component alt_dspbuilder_cast_GNSB3OXIQS generic map ( round => 0, saturate => 0 ) port map ( input => delay1_output_wire, -- input.wire output => cast0_output_wire -- output.wire ); cast1 : component alt_dspbuilder_cast_GNSB3OXIQS generic map ( round => 0, saturate => 0 ) port map ( input => delay2_output_wire, -- input.wire output => cast1_output_wire -- output.wire ); cast2 : component alt_dspbuilder_cast_GN46N4UJ5S generic map ( round => 0, saturate => 0 ) port map ( input => logical_bit_operator_result_wire, -- input.wire output => cast2_output_wire -- output.wire ); cast3 : component alt_dspbuilder_cast_GNSB3OXIQS generic map ( round => 0, saturate => 0 ) port map ( input => delay_output_wire, -- input.wire output => cast3_output_wire -- output.wire ); cast4 : component alt_dspbuilder_cast_GN46N4UJ5S generic map ( round => 0, saturate => 0 ) port map ( input => logical_bit_operator1_result_wire, -- input.wire output => cast4_output_wire -- output.wire ); end architecture rtl; -- of Gray_Processing_GN_Gray_Processing_Gray_Processing_Module
-- Gray_Processing_GN_Gray_Processing_Gray_Processing_Module.vhd -- Generated using ACDS version 13.1 162 at 2015.02.27.10:14:00 library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity Gray_Processing_GN_Gray_Processing_Gray_Processing_Module is port ( eop : in std_logic := '0'; -- eop.wire Clock : in std_logic := '0'; -- Clock.clk aclr : in std_logic := '0'; -- .reset data_in : in std_logic_vector(23 downto 0) := (others => '0'); -- data_in.wire data_out : out std_logic_vector(23 downto 0); -- data_out.wire sop : in std_logic := '0' -- sop.wire ); end entity Gray_Processing_GN_Gray_Processing_Gray_Processing_Module; architecture rtl of Gray_Processing_GN_Gray_Processing_Gray_Processing_Module is component alt_dspbuilder_clock_GNQFU4PUDH is port ( aclr : in std_logic := 'X'; -- reset aclr_n : in std_logic := 'X'; -- reset_n aclr_out : out std_logic; -- reset clock : in std_logic := 'X'; -- clk clock_out : out std_logic -- clk ); end component alt_dspbuilder_clock_GNQFU4PUDH; component alt_dspbuilder_cast_GNKXX25S2S is generic ( round : natural := 0; saturate : natural := 0 ); port ( input : in std_logic_vector(23 downto 0) := (others => 'X'); -- wire output : out std_logic_vector(7 downto 0) -- wire ); end component alt_dspbuilder_cast_GNKXX25S2S; component alt_dspbuilder_cast_GN6OMCQQS7 is generic ( round : natural := 0; saturate : natural := 0 ); port ( input : in std_logic_vector(23 downto 0) := (others => 'X'); -- wire output : out std_logic_vector(7 downto 0) -- wire ); end component alt_dspbuilder_cast_GN6OMCQQS7; component alt_dspbuilder_cast_GN7IAAYCSZ is generic ( round : natural := 0; saturate : natural := 0 ); port ( input : in std_logic_vector(23 downto 0) := (others => 'X'); -- wire output : out std_logic_vector(7 downto 0) -- wire ); end component alt_dspbuilder_cast_GN7IAAYCSZ; component alt_dspbuilder_logical_bit_op_GNA5ZFEL7V is generic ( LogicalOp : string := "AltAND"; number_inputs : positive := 2 ); port ( result : out std_logic; -- wire data0 : in std_logic := 'X'; -- wire data1 : in std_logic := 'X' -- wire ); end component alt_dspbuilder_logical_bit_op_GNA5ZFEL7V; component alt_dspbuilder_barrelshifter_GNV5DVAGHT is generic ( DISTANCE_WIDTH : natural := 3; NDIRECTION : natural := 0; SIGNED : integer := 1; use_dedicated_circuitry : string := "false"; PIPELINE : natural := 0; WIDTH : natural := 8 ); port ( a : in std_logic_vector(WIDTH-1 downto 0) := (others => 'X'); -- wire aclr : in std_logic := 'X'; -- clk clock : in std_logic := 'X'; -- clk direction : in std_logic := 'X'; -- wire distance : in std_logic_vector(DISTANCE_WIDTH-1 downto 0) := (others => 'X'); -- wire ena : in std_logic := 'X'; -- wire r : out std_logic_vector(WIDTH-1 downto 0); -- wire user_aclr : in std_logic := 'X' -- wire ); end component alt_dspbuilder_barrelshifter_GNV5DVAGHT; component alt_dspbuilder_gnd_GN is port ( output : out std_logic -- wire ); end component alt_dspbuilder_gnd_GN; component alt_dspbuilder_vcc_GN is port ( output : out std_logic -- wire ); end component alt_dspbuilder_vcc_GN; component alt_dspbuilder_multiply_add_GNKLXFKAO3 is generic ( family : string := "Stratix"; direction : string := "AddAdd"; data3b_const : string := "00000000"; data2b_const : string := "00000000"; representation : string := "SIGNED"; dataWidth : integer := 8; data4b_const : string := "00000000"; number_multipliers : integer := 2; pipeline_register : string := "NoRegister"; use_dedicated_circuitry : integer := 0; data1b_const : string := "00000000"; use_b_consts : natural := 0 ); port ( clock : in std_logic := 'X'; -- clk aclr : in std_logic := 'X'; -- reset data1a : in std_logic_vector(7 downto 0) := (others => 'X'); -- wire data2a : in std_logic_vector(7 downto 0) := (others => 'X'); -- wire data3a : in std_logic_vector(7 downto 0) := (others => 'X'); -- wire result : out std_logic_vector(17 downto 0); -- wire user_aclr : in std_logic := 'X'; -- wire ena : in std_logic := 'X' -- wire ); end component alt_dspbuilder_multiply_add_GNKLXFKAO3; component alt_dspbuilder_multiplexer_GNCALBUTDR is generic ( HDLTYPE : string := "STD_LOGIC_VECTOR"; use_one_hot_select_bus : natural := 0; width : positive := 8; pipeline : natural := 0; number_inputs : natural := 4 ); port ( clock : in std_logic := 'X'; -- clk aclr : in std_logic := 'X'; -- reset sel : in std_logic_vector(0 downto 0) := (others => 'X'); -- wire result : out std_logic_vector(23 downto 0); -- wire ena : in std_logic := 'X'; -- wire user_aclr : in std_logic := 'X'; -- wire in0 : in std_logic_vector(23 downto 0) := (others => 'X'); -- wire in1 : in std_logic_vector(23 downto 0) := (others => 'X') -- wire ); end component alt_dspbuilder_multiplexer_GNCALBUTDR; component alt_dspbuilder_cast_GNJGR7GQ2L is generic ( round : natural := 0; saturate : natural := 0 ); port ( input : in std_logic_vector(17 downto 0) := (others => 'X'); -- wire output : out std_logic_vector(7 downto 0) -- wire ); end component alt_dspbuilder_cast_GNJGR7GQ2L; component alt_dspbuilder_constant_GNZEH3JAKA is generic ( HDLTYPE : string := "STD_LOGIC_VECTOR"; BitPattern : string := "0000"; width : natural := 4 ); port ( output : out std_logic_vector(23 downto 0) -- wire ); end component alt_dspbuilder_constant_GNZEH3JAKA; component alt_dspbuilder_if_statement_GN7VA7SRUP is generic ( use_else_output : natural := 0; bwr : natural := 0; use_else_input : natural := 0; signed : natural := 1; HDLTYPE : string := "STD_LOGIC_VECTOR"; if_expression : string := "a"; number_inputs : integer := 1; width : natural := 8 ); port ( true : out std_logic; -- wire a : in std_logic_vector(23 downto 0) := (others => 'X'); -- wire b : in std_logic_vector(23 downto 0) := (others => 'X'); -- wire c : in std_logic_vector(23 downto 0) := (others => 'X') -- wire ); end component alt_dspbuilder_if_statement_GN7VA7SRUP; component alt_dspbuilder_port_GN37ALZBS4 is port ( input : in std_logic := 'X'; -- wire output : out std_logic -- wire ); end component alt_dspbuilder_port_GN37ALZBS4; component alt_dspbuilder_bus_concat_GN55ETJ4VI is generic ( widthB : natural := 8; widthA : natural := 8 ); port ( a : in std_logic_vector(widthA-1 downto 0) := (others => 'X'); -- wire aclr : in std_logic := 'X'; -- clk b : in std_logic_vector(widthB-1 downto 0) := (others => 'X'); -- wire clock : in std_logic := 'X'; -- clk output : out std_logic_vector(widthA+widthB-1 downto 0) -- wire ); end component alt_dspbuilder_bus_concat_GN55ETJ4VI; component alt_dspbuilder_delay_GNHYCSAEGT is generic ( ClockPhase : string := "1"; delay : positive := 1; use_init : natural := 0; BitPattern : string := "00000001"; width : positive := 8 ); port ( aclr : in std_logic := 'X'; -- clk clock : in std_logic := 'X'; -- clk ena : in std_logic := 'X'; -- wire input : in std_logic_vector(width-1 downto 0) := (others => 'X'); -- wire output : out std_logic_vector(width-1 downto 0); -- wire sclr : in std_logic := 'X' -- wire ); end component alt_dspbuilder_delay_GNHYCSAEGT; component alt_dspbuilder_bus_concat_GNIIOZRPJD is generic ( widthB : natural := 8; widthA : natural := 8 ); port ( a : in std_logic_vector(widthA-1 downto 0) := (others => 'X'); -- wire aclr : in std_logic := 'X'; -- clk b : in std_logic_vector(widthB-1 downto 0) := (others => 'X'); -- wire clock : in std_logic := 'X'; -- clk output : out std_logic_vector(widthA+widthB-1 downto 0) -- wire ); end component alt_dspbuilder_bus_concat_GNIIOZRPJD; component alt_dspbuilder_constant_GNNKZSYI73 is generic ( HDLTYPE : string := "STD_LOGIC_VECTOR"; BitPattern : string := "0000"; width : natural := 4 ); port ( output : out std_logic_vector(23 downto 0) -- wire ); end component alt_dspbuilder_constant_GNNKZSYI73; component alt_dspbuilder_delay_GNUECIBFDH is generic ( ClockPhase : string := "1"; delay : positive := 1; use_init : natural := 0; BitPattern : string := "00000001"; width : positive := 8 ); port ( aclr : in std_logic := 'X'; -- clk clock : in std_logic := 'X'; -- clk ena : in std_logic := 'X'; -- wire input : in std_logic_vector(width-1 downto 0) := (others => 'X'); -- wire output : out std_logic_vector(width-1 downto 0); -- wire sclr : in std_logic := 'X' -- wire ); end component alt_dspbuilder_delay_GNUECIBFDH; component alt_dspbuilder_constant_GNPXZ5JSVR is generic ( HDLTYPE : string := "STD_LOGIC_VECTOR"; BitPattern : string := "0000"; width : natural := 4 ); port ( output : out std_logic_vector(3 downto 0) -- wire ); end component alt_dspbuilder_constant_GNPXZ5JSVR; component alt_dspbuilder_port_GNOC3SGKQJ is port ( input : in std_logic_vector(23 downto 0) := (others => 'X'); -- wire output : out std_logic_vector(23 downto 0) -- wire ); end component alt_dspbuilder_port_GNOC3SGKQJ; component alt_dspbuilder_cast_GNSB3OXIQS is generic ( round : natural := 0; saturate : natural := 0 ); port ( input : in std_logic_vector(0 downto 0) := (others => 'X'); -- wire output : out std_logic -- wire ); end component alt_dspbuilder_cast_GNSB3OXIQS; component alt_dspbuilder_cast_GN46N4UJ5S is generic ( round : natural := 0; saturate : natural := 0 ); port ( input : in std_logic := 'X'; -- wire output : out std_logic_vector(0 downto 0) -- wire ); end component alt_dspbuilder_cast_GN46N4UJ5S; signal barrel_shifteruser_aclrgnd_output_wire : std_logic; -- Barrel_Shifteruser_aclrGND:output -> Barrel_Shifter:user_aclr signal barrel_shifterenavcc_output_wire : std_logic; -- Barrel_ShifterenaVCC:output -> Barrel_Shifter:ena signal multiply_adduser_aclrgnd_output_wire : std_logic; -- Multiply_Adduser_aclrGND:output -> Multiply_Add:user_aclr signal multiply_addenavcc_output_wire : std_logic; -- Multiply_AddenaVCC:output -> Multiply_Add:ena signal multiplexeruser_aclrgnd_output_wire : std_logic; -- Multiplexeruser_aclrGND:output -> Multiplexer:user_aclr signal multiplexerenavcc_output_wire : std_logic; -- MultiplexerenaVCC:output -> Multiplexer:ena signal delay1sclrgnd_output_wire : std_logic; -- Delay1sclrGND:output -> Delay1:sclr signal delay1enavcc_output_wire : std_logic; -- Delay1enaVCC:output -> Delay1:ena signal delay2sclrgnd_output_wire : std_logic; -- Delay2sclrGND:output -> Delay2:sclr signal delay2enavcc_output_wire : std_logic; -- Delay2enaVCC:output -> Delay2:ena signal bus_concatenation_output_wire : std_logic_vector(15 downto 0); -- Bus_Concatenation:output -> Bus_Concatenation1:b signal barrel_shifter_r_wire : std_logic_vector(17 downto 0); -- Barrel_Shifter:r -> Bus_Conversion:input signal bus_conversion_output_wire : std_logic_vector(7 downto 0); -- Bus_Conversion:output -> [Bus_Concatenation1:a, Bus_Concatenation:a, Bus_Concatenation:b] signal data_in_0_output_wire : std_logic_vector(23 downto 0); -- data_in_0:output -> [Bus_Conversion1:input, Bus_Conversion2:input, Bus_Conversion3:input, If_Statement1:a, Multiplexer:in0] signal constant1_output_wire : std_logic_vector(3 downto 0); -- Constant1:output -> Barrel_Shifter:distance signal delay2_output_wire : std_logic_vector(0 downto 0); -- Delay2:output -> [Delay:input, cast1:input] signal constant3_output_wire : std_logic_vector(23 downto 0); -- Constant3:output -> If_Statement1:b signal constant4_output_wire : std_logic_vector(23 downto 0); -- Constant4:output -> If_Statement1:c signal if_statement1_true_wire : std_logic; -- If_Statement1:true -> Logical_Bit_Operator:data0 signal sop_0_output_wire : std_logic; -- sop_0:output -> Logical_Bit_Operator:data1 signal eop_0_output_wire : std_logic; -- eop_0:output -> Logical_Bit_Operator1:data0 signal delay_output_wire : std_logic_vector(0 downto 0); -- Delay:output -> [Multiplexer:sel, cast3:input] signal bus_concatenation1_output_wire : std_logic_vector(23 downto 0); -- Bus_Concatenation1:output -> Multiplexer:in1 signal bus_conversion3_output_wire : std_logic_vector(7 downto 0); -- Bus_Conversion3:output -> Multiply_Add:data1a signal bus_conversion2_output_wire : std_logic_vector(7 downto 0); -- Bus_Conversion2:output -> Multiply_Add:data2a signal bus_conversion1_output_wire : std_logic_vector(7 downto 0); -- Bus_Conversion1:output -> Multiply_Add:data3a signal multiply_add_result_wire : std_logic_vector(17 downto 0); -- Multiply_Add:result -> Barrel_Shifter:a signal multiplexer_result_wire : std_logic_vector(23 downto 0); -- Multiplexer:result -> data_out_0:input signal delay1_output_wire : std_logic_vector(0 downto 0); -- Delay1:output -> cast0:input signal cast0_output_wire : std_logic; -- cast0:output -> Delay:sclr signal cast1_output_wire : std_logic; -- cast1:output -> Delay:ena signal logical_bit_operator_result_wire : std_logic; -- Logical_Bit_Operator:result -> cast2:input signal cast2_output_wire : std_logic_vector(0 downto 0); -- cast2:output -> Delay2:input signal cast3_output_wire : std_logic; -- cast3:output -> Logical_Bit_Operator1:data1 signal logical_bit_operator1_result_wire : std_logic; -- Logical_Bit_Operator1:result -> cast4:input signal cast4_output_wire : std_logic_vector(0 downto 0); -- cast4:output -> Delay1:input signal clock_0_clock_output_reset : std_logic; -- Clock_0:aclr_out -> [Barrel_Shifter:aclr, Bus_Concatenation1:aclr, Bus_Concatenation:aclr, Delay1:aclr, Delay2:aclr, Delay:aclr, Multiplexer:aclr, Multiply_Add:aclr] signal clock_0_clock_output_clk : std_logic; -- Clock_0:clock_out -> [Barrel_Shifter:clock, Bus_Concatenation1:clock, Bus_Concatenation:clock, Delay1:clock, Delay2:clock, Delay:clock, Multiplexer:clock, Multiply_Add:clock] begin clock_0 : component alt_dspbuilder_clock_GNQFU4PUDH port map ( clock_out => clock_0_clock_output_clk, -- clock_output.clk aclr_out => clock_0_clock_output_reset, -- .reset clock => Clock, -- clock.clk aclr => aclr -- .reset ); bus_conversion1 : component alt_dspbuilder_cast_GNKXX25S2S generic map ( round => 0, saturate => 0 ) port map ( input => data_in_0_output_wire, -- input.wire output => bus_conversion1_output_wire -- output.wire ); bus_conversion2 : component alt_dspbuilder_cast_GN6OMCQQS7 generic map ( round => 0, saturate => 0 ) port map ( input => data_in_0_output_wire, -- input.wire output => bus_conversion2_output_wire -- output.wire ); bus_conversion3 : component alt_dspbuilder_cast_GN7IAAYCSZ generic map ( round => 0, saturate => 0 ) port map ( input => data_in_0_output_wire, -- input.wire output => bus_conversion3_output_wire -- output.wire ); logical_bit_operator : component alt_dspbuilder_logical_bit_op_GNA5ZFEL7V generic map ( LogicalOp => "AltAND", number_inputs => 2 ) port map ( result => logical_bit_operator_result_wire, -- result.wire data0 => if_statement1_true_wire, -- data0.wire data1 => sop_0_output_wire -- data1.wire ); barrel_shifter : component alt_dspbuilder_barrelshifter_GNV5DVAGHT generic map ( DISTANCE_WIDTH => 4, NDIRECTION => 1, SIGNED => 0, use_dedicated_circuitry => "false", PIPELINE => 0, WIDTH => 18 ) port map ( clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset a => multiply_add_result_wire, -- a.wire r => barrel_shifter_r_wire, -- r.wire distance => constant1_output_wire, -- distance.wire ena => barrel_shifterenavcc_output_wire, -- ena.wire user_aclr => barrel_shifteruser_aclrgnd_output_wire -- user_aclr.wire ); barrel_shifteruser_aclrgnd : component alt_dspbuilder_gnd_GN port map ( output => barrel_shifteruser_aclrgnd_output_wire -- output.wire ); barrel_shifterenavcc : component alt_dspbuilder_vcc_GN port map ( output => barrel_shifterenavcc_output_wire -- output.wire ); multiply_add : component alt_dspbuilder_multiply_add_GNKLXFKAO3 generic map ( family => "Cyclone V", direction => "AddAdd", data3b_const => "00011110", data2b_const => "10010110", representation => "UNSIGNED", dataWidth => 8, data4b_const => "01001100", number_multipliers => 3, pipeline_register => "NoRegister", use_dedicated_circuitry => 1, data1b_const => "01001100", use_b_consts => 1 ) port map ( clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset data1a => bus_conversion3_output_wire, -- data1a.wire data2a => bus_conversion2_output_wire, -- data2a.wire data3a => bus_conversion1_output_wire, -- data3a.wire result => multiply_add_result_wire, -- result.wire user_aclr => multiply_adduser_aclrgnd_output_wire, -- user_aclr.wire ena => multiply_addenavcc_output_wire -- ena.wire ); multiply_adduser_aclrgnd : component alt_dspbuilder_gnd_GN port map ( output => multiply_adduser_aclrgnd_output_wire -- output.wire ); multiply_addenavcc : component alt_dspbuilder_vcc_GN port map ( output => multiply_addenavcc_output_wire -- output.wire ); multiplexer : component alt_dspbuilder_multiplexer_GNCALBUTDR generic map ( HDLTYPE => "STD_LOGIC_VECTOR", use_one_hot_select_bus => 0, width => 24, pipeline => 0, number_inputs => 2 ) port map ( clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset sel => delay_output_wire, -- sel.wire result => multiplexer_result_wire, -- result.wire ena => multiplexerenavcc_output_wire, -- ena.wire user_aclr => multiplexeruser_aclrgnd_output_wire, -- user_aclr.wire in0 => data_in_0_output_wire, -- in0.wire in1 => bus_concatenation1_output_wire -- in1.wire ); multiplexeruser_aclrgnd : component alt_dspbuilder_gnd_GN port map ( output => multiplexeruser_aclrgnd_output_wire -- output.wire ); multiplexerenavcc : component alt_dspbuilder_vcc_GN port map ( output => multiplexerenavcc_output_wire -- output.wire ); bus_conversion : component alt_dspbuilder_cast_GNJGR7GQ2L generic map ( round => 0, saturate => 0 ) port map ( input => barrel_shifter_r_wire, -- input.wire output => bus_conversion_output_wire -- output.wire ); constant4 : component alt_dspbuilder_constant_GNZEH3JAKA generic map ( HDLTYPE => "STD_LOGIC_VECTOR", BitPattern => "000000000000000000001111", width => 24 ) port map ( output => constant4_output_wire -- output.wire ); if_statement1 : component alt_dspbuilder_if_statement_GN7VA7SRUP generic map ( use_else_output => 0, bwr => 0, use_else_input => 0, signed => 0, HDLTYPE => "STD_LOGIC_VECTOR", if_expression => "(a=b) and (a /= c)", number_inputs => 3, width => 24 ) port map ( true => if_statement1_true_wire, -- true.wire a => data_in_0_output_wire, -- a.wire b => constant3_output_wire, -- b.wire c => constant4_output_wire -- c.wire ); sop_0 : component alt_dspbuilder_port_GN37ALZBS4 port map ( input => sop, -- input.wire output => sop_0_output_wire -- output.wire ); bus_concatenation1 : component alt_dspbuilder_bus_concat_GN55ETJ4VI generic map ( widthB => 16, widthA => 8 ) port map ( clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset a => bus_conversion_output_wire, -- a.wire b => bus_concatenation_output_wire, -- b.wire output => bus_concatenation1_output_wire -- output.wire ); delay1 : component alt_dspbuilder_delay_GNHYCSAEGT generic map ( ClockPhase => "1", delay => 1, use_init => 0, BitPattern => "0", width => 1 ) port map ( input => cast4_output_wire, -- input.wire clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset output => delay1_output_wire, -- output.wire sclr => delay1sclrgnd_output_wire, -- sclr.wire ena => delay1enavcc_output_wire -- ena.wire ); delay1sclrgnd : component alt_dspbuilder_gnd_GN port map ( output => delay1sclrgnd_output_wire -- output.wire ); delay1enavcc : component alt_dspbuilder_vcc_GN port map ( output => delay1enavcc_output_wire -- output.wire ); bus_concatenation : component alt_dspbuilder_bus_concat_GNIIOZRPJD generic map ( widthB => 8, widthA => 8 ) port map ( clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset a => bus_conversion_output_wire, -- a.wire b => bus_conversion_output_wire, -- b.wire output => bus_concatenation_output_wire -- output.wire ); constant3 : component alt_dspbuilder_constant_GNNKZSYI73 generic map ( HDLTYPE => "STD_LOGIC_VECTOR", BitPattern => "000000000000000000000000", width => 24 ) port map ( output => constant3_output_wire -- output.wire ); delay2 : component alt_dspbuilder_delay_GNHYCSAEGT generic map ( ClockPhase => "1", delay => 1, use_init => 0, BitPattern => "0", width => 1 ) port map ( input => cast2_output_wire, -- input.wire clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset output => delay2_output_wire, -- output.wire sclr => delay2sclrgnd_output_wire, -- sclr.wire ena => delay2enavcc_output_wire -- ena.wire ); delay2sclrgnd : component alt_dspbuilder_gnd_GN port map ( output => delay2sclrgnd_output_wire -- output.wire ); delay2enavcc : component alt_dspbuilder_vcc_GN port map ( output => delay2enavcc_output_wire -- output.wire ); delay : component alt_dspbuilder_delay_GNUECIBFDH generic map ( ClockPhase => "1", delay => 1, use_init => 1, BitPattern => "0", width => 1 ) port map ( input => delay2_output_wire, -- input.wire clock => clock_0_clock_output_clk, -- clock_aclr.clk aclr => clock_0_clock_output_reset, -- .reset output => delay_output_wire, -- output.wire sclr => cast0_output_wire, -- sclr.wire ena => cast1_output_wire -- ena.wire ); constant1 : component alt_dspbuilder_constant_GNPXZ5JSVR generic map ( HDLTYPE => "STD_LOGIC_VECTOR", BitPattern => "1000", width => 4 ) port map ( output => constant1_output_wire -- output.wire ); data_out_0 : component alt_dspbuilder_port_GNOC3SGKQJ port map ( input => multiplexer_result_wire, -- input.wire output => data_out -- output.wire ); data_in_0 : component alt_dspbuilder_port_GNOC3SGKQJ port map ( input => data_in, -- input.wire output => data_in_0_output_wire -- output.wire ); eop_0 : component alt_dspbuilder_port_GN37ALZBS4 port map ( input => eop, -- input.wire output => eop_0_output_wire -- output.wire ); logical_bit_operator1 : component alt_dspbuilder_logical_bit_op_GNA5ZFEL7V generic map ( LogicalOp => "AltAND", number_inputs => 2 ) port map ( result => logical_bit_operator1_result_wire, -- result.wire data0 => eop_0_output_wire, -- data0.wire data1 => cast3_output_wire -- data1.wire ); cast0 : component alt_dspbuilder_cast_GNSB3OXIQS generic map ( round => 0, saturate => 0 ) port map ( input => delay1_output_wire, -- input.wire output => cast0_output_wire -- output.wire ); cast1 : component alt_dspbuilder_cast_GNSB3OXIQS generic map ( round => 0, saturate => 0 ) port map ( input => delay2_output_wire, -- input.wire output => cast1_output_wire -- output.wire ); cast2 : component alt_dspbuilder_cast_GN46N4UJ5S generic map ( round => 0, saturate => 0 ) port map ( input => logical_bit_operator_result_wire, -- input.wire output => cast2_output_wire -- output.wire ); cast3 : component alt_dspbuilder_cast_GNSB3OXIQS generic map ( round => 0, saturate => 0 ) port map ( input => delay_output_wire, -- input.wire output => cast3_output_wire -- output.wire ); cast4 : component alt_dspbuilder_cast_GN46N4UJ5S generic map ( round => 0, saturate => 0 ) port map ( input => logical_bit_operator1_result_wire, -- input.wire output => cast4_output_wire -- output.wire ); end architecture rtl; -- of Gray_Processing_GN_Gray_Processing_Gray_Processing_Module
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity p_jinfo_comps_info_quant_tbl_no is port ( wa0_data : in std_logic_vector(1 downto 0); wa0_addr : in std_logic_vector(1 downto 0); clk : in std_logic; ra0_addr : in std_logic_vector(1 downto 0); ra0_data : out std_logic_vector(1 downto 0); wa0_en : in std_logic ); end p_jinfo_comps_info_quant_tbl_no; architecture augh of p_jinfo_comps_info_quant_tbl_no is -- Embedded RAM type ram_type is array (0 to 2) of std_logic_vector(1 downto 0); signal ram : ram_type := (others => (others => '0')); -- Little utility functions to make VHDL syntactically correct -- with the syntax to_integer(unsigned(vector)) when 'vector' is a std_logic. -- This happens when accessing arrays with <= 2 cells, for example. function to_integer(B: std_logic) return integer is variable V: std_logic_vector(0 to 0); begin V(0) := B; return to_integer(unsigned(V)); end; function to_integer(V: std_logic_vector) return integer is begin return to_integer(unsigned(V)); end; begin -- Sequential process -- It handles the Writes process (clk) begin if rising_edge(clk) then -- Write to the RAM -- Note: there should be only one port. if wa0_en = '1' then ram( to_integer(wa0_addr) ) <= wa0_data; end if; end if; end process; -- The Read side (the outputs) ra0_data <= ram( to_integer(ra0_addr) ) when to_integer(ra0_addr) < 3 else (others => '-'); end architecture;
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity p_jinfo_comps_info_quant_tbl_no is port ( wa0_data : in std_logic_vector(1 downto 0); wa0_addr : in std_logic_vector(1 downto 0); clk : in std_logic; ra0_addr : in std_logic_vector(1 downto 0); ra0_data : out std_logic_vector(1 downto 0); wa0_en : in std_logic ); end p_jinfo_comps_info_quant_tbl_no; architecture augh of p_jinfo_comps_info_quant_tbl_no is -- Embedded RAM type ram_type is array (0 to 2) of std_logic_vector(1 downto 0); signal ram : ram_type := (others => (others => '0')); -- Little utility functions to make VHDL syntactically correct -- with the syntax to_integer(unsigned(vector)) when 'vector' is a std_logic. -- This happens when accessing arrays with <= 2 cells, for example. function to_integer(B: std_logic) return integer is variable V: std_logic_vector(0 to 0); begin V(0) := B; return to_integer(unsigned(V)); end; function to_integer(V: std_logic_vector) return integer is begin return to_integer(unsigned(V)); end; begin -- Sequential process -- It handles the Writes process (clk) begin if rising_edge(clk) then -- Write to the RAM -- Note: there should be only one port. if wa0_en = '1' then ram( to_integer(wa0_addr) ) <= wa0_data; end if; end if; end process; -- The Read side (the outputs) ra0_data <= ram( to_integer(ra0_addr) ) when to_integer(ra0_addr) < 3 else (others => '-'); end architecture;
-------------------------------------------------------------------------------- -- Company: -- Engineer: -- -- Create Date: 12:35:03 05/28/2011 -- Design Name: -- Module Name: /home/xiadz/prog/fpga/oscilloscope/test_screen_position_gen.vhd -- Project Name: oscilloscope -- Target Device: -- Tool versions: -- Description: -- -- VHDL Test Bench Created by ISE for module: screen_position_gen -- -- Dependencies: -- -- Revision: -- Revision 0.01 - File Created -- Additional Comments: -- -- Notes: -- This testbench has been automatically generated using types std_logic and -- std_logic_vector for the ports of the unit under test. Xilinx recommends -- that these types always be used for the top-level I/O of a design in order -- to guarantee that the testbench will bind correctly to the post-implementation -- simulation model. -------------------------------------------------------------------------------- LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; USE work.types.ALL; ENTITY test_screen_position_gen IS END test_screen_position_gen; ARCHITECTURE behavior OF test_screen_position_gen IS -- Component Declaration for the Unit Under Test (UUT) COMPONENT screen_position_gen PORT( nrst : IN std_logic; clk108 : IN std_logic; vblank : IN std_logic; in_line_change : IN std_logic; in_page_change : IN std_logic; in_column : IN integer range 0 to 1279; in_column_change : IN std_logic; segment : OUT integer range 0 to 15; segment_change : OUT std_logic; subsegment : OUT integer range 0 to 3; subsegment_change : OUT std_logic; line : OUT integer range 0 to 15; out_line_change : OUT std_logic; out_column : OUT integer range 0 to 1279; out_column_change : OUT std_logic; out_page_change : OUT std_logic; active_pixgen_source : OUT PIXGEN_SOURCE_T ); END COMPONENT; --Inputs signal nrst : std_logic := '0'; signal clk108 : std_logic := '0'; signal vblank : std_logic := '0'; signal in_line_change : std_logic := '0'; signal in_page_change : std_logic := '0'; signal in_column : integer range 0 to 1279 := 0; signal in_column_change : std_logic := '0'; --Outputs signal segment : integer range 0 to 15; signal segment_change : std_logic; signal subsegment : integer range 0 to 3; signal subsegment_change : std_logic; signal line : integer range 0 to 15; signal out_line_change : std_logic; signal out_column : integer range 0 to 1279; signal out_column_change : std_logic; signal out_page_change : std_logic; signal active_pixgen_source : PIXGEN_SOURCE_T; -- Clock period definitions constant clk108_period : time := 10 ns; BEGIN -- Instantiate the Unit Under Test (UUT) uut: screen_position_gen PORT MAP ( nrst => nrst, clk108 => clk108, vblank => vblank, in_line_change => in_line_change, in_page_change => in_page_change, in_column => in_column, in_column_change => in_column_change, segment => segment, segment_change => segment_change, subsegment => subsegment, subsegment_change => subsegment_change, line => line, out_line_change => out_line_change, out_column => out_column, out_column_change => out_column_change, out_page_change => out_page_change, active_pixgen_source => active_pixgen_source ); -- Clock process definitions clk108_process :process begin clk108 <= '0'; wait for clk108_period/2; clk108 <= '1'; wait for clk108_period/2; end process; -- Stimulus process stim_proc: process begin -- hold reset state for 100 ns. nrst <= '0'; wait for 100 ns; nrst <= '1'; wait for clk108_period*10; while true loop in_page_change <= '1'; for x_line in 0 to 1279 loop vblank <= '0'; in_line_change <= '1'; in_column_change <= '1'; for x_column in 0 to 1279 loop in_column <= x_column; wait for clk108_period; in_line_change <= '0'; in_page_change <= '0'; end loop; in_column_change <= '0'; vblank <= '1'; wait for clk108_period * 1000; end loop; wait for clk108_period * 10000; end loop; wait; end process; END;
-- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/> -- -- Copyright (C) 2014 Jakub Kicinski <[email protected]> library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.STD_LOGIC_ARITH.all; use IEEE.STD_LOGIC_UNSIGNED.all; -- UART transmission module entity uart_tx is port (Clk : in std_logic; Rst : in std_logic; FreqEn : in std_logic; Byte : in std_logic_vector(7 downto 0); Kick : in std_logic; RsTx : out std_logic; Busy : out std_logic); end uart_tx; -- Operation: -- Wait for @Kick, save values of @Kick and @Byte when it's high. -- Transition between states when @FreqEn is high. architecture Behavioral of uart_tx is type state_t is (IDLE, START, XMIT, STOP); signal state, NEXT_state : state_t; signal cnt, NEXT_cnt : integer range 0 to 7; signal saveByte : std_logic_vector(7 downto 0); signal saveKick : std_logic; begin Busy <= saveKick; NEXT_fsm : process (state, cnt, saveByte, saveKick) begin NEXT_state <= state; NEXT_cnt <= cnt + 1; RsTx <= '1'; -- high is idle case state is when IDLE => if saveKick = '1' then NEXT_state <= START; end if; when START => NEXT_state <= XMIT; NEXT_cnt <= 0; RsTx <= '0'; when XMIT => RsTx <= saveByte(cnt); if cnt = 7 then NEXT_state <= STOP; end if; when STOP => -- UART wants at least two stop bits - STOP, IDLE NEXT_state <= IDLE; end case; end process; fsm : process (Clk) begin if rising_edge(Clk) then if FreqEn = '1' then state <= NEXT_state; cnt <= NEXT_cnt; if state = STOP then saveKick <= '0'; end if; end if; if saveKick = '0' and Kick = '1' then saveKick <= Kick; saveByte <= Byte; end if; if Rst = '1' then state <= IDLE; saveKick <= '0'; end if; end if; end process; end Behavioral;
-- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/> -- -- Copyright (C) 2014 Jakub Kicinski <[email protected]> library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.STD_LOGIC_ARITH.all; use IEEE.STD_LOGIC_UNSIGNED.all; -- UART transmission module entity uart_tx is port (Clk : in std_logic; Rst : in std_logic; FreqEn : in std_logic; Byte : in std_logic_vector(7 downto 0); Kick : in std_logic; RsTx : out std_logic; Busy : out std_logic); end uart_tx; -- Operation: -- Wait for @Kick, save values of @Kick and @Byte when it's high. -- Transition between states when @FreqEn is high. architecture Behavioral of uart_tx is type state_t is (IDLE, START, XMIT, STOP); signal state, NEXT_state : state_t; signal cnt, NEXT_cnt : integer range 0 to 7; signal saveByte : std_logic_vector(7 downto 0); signal saveKick : std_logic; begin Busy <= saveKick; NEXT_fsm : process (state, cnt, saveByte, saveKick) begin NEXT_state <= state; NEXT_cnt <= cnt + 1; RsTx <= '1'; -- high is idle case state is when IDLE => if saveKick = '1' then NEXT_state <= START; end if; when START => NEXT_state <= XMIT; NEXT_cnt <= 0; RsTx <= '0'; when XMIT => RsTx <= saveByte(cnt); if cnt = 7 then NEXT_state <= STOP; end if; when STOP => -- UART wants at least two stop bits - STOP, IDLE NEXT_state <= IDLE; end case; end process; fsm : process (Clk) begin if rising_edge(Clk) then if FreqEn = '1' then state <= NEXT_state; cnt <= NEXT_cnt; if state = STOP then saveKick <= '0'; end if; end if; if saveKick = '0' and Kick = '1' then saveKick <= Kick; saveByte <= Byte; end if; if Rst = '1' then state <= IDLE; saveKick <= '0'; end if; end if; end process; end Behavioral;
-- This is one layer of a neural network -- It contains several neurons that process input frames library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; library work; use work.all; entity nnlayer is generic ( -- Parameters for the neurons WDATA : natural := 16; WWEIGHT : natural := 16; WACCU : natural := 48; -- Parameters for frame and number of neurons FSIZE : natural := 784; NBNEU : natural := 200; -- fifo count CNTW : natural := 16 ); port ( clk : in std_logic; -- reset clear : in std_logic; -- Ports for Write Enable write_mode : in std_logic; write_data : in std_logic_vector(WDATA-1 downto 0) ; write_enable : in std_logic; write_ready : out std_logic; -- The user-specified frame size and number of neurons user_fsize : in std_logic_vector(15 downto 0); user_nbneu : in std_logic_vector(15 downto 0); -- Data input, 2 bits data_in : in std_logic_vector(WDATA-1 downto 0); data_in_valid : in std_logic; data_in_ready : out std_logic; -- Scan chain to extract values data_out : out std_logic_vector(WACCU-1 downto 0); data_out_valid : out std_logic; -- Indicate to the parent component that we are reaching the end of the current frame end_of_frame : out std_logic; -- The output data enters a FIFO. This indicates the available room. out_fifo_room : in std_logic_vector(CNTW - 1 downto 0) ); end nnlayer; architecture synth of nnlayer is -- Max fanout for signals distributed to all BRAM-based blocks constant FANOUT : natural := 4; -- The address to access neuron memory, read and write constant WADDR : natural := 10; -- Arrays of signals to instantiate the neurons signal arr_write_data : std_logic_vector(NBNEU*WDATA-1 downto 0) := (others => '0'); -- Input data signal arr_data_in : std_logic_vector(NBNEU*WDATA-1 downto 0) := (others => '0'); -- Controls signals, go to every neuron through distribuf signal sg_ctrl_we_mode : std_logic_vector(0 downto 0):= (others => '0'); signal sg_ctrl_we_shift : std_logic_vector(0 downto 0):= (others => '0'); signal sg_ctrl_we_valid : std_logic_vector(0 downto 0):= (others => '0'); signal sg_ctrl_accu_clear : std_logic_vector(0 downto 0):= (others => '0'); signal sg_ctrl_accu_add : std_logic_vector(0 downto 0):= (others => '0'); signal sg_ctrl_shift_en : std_logic_vector(0 downto 0):= (others => '0'); signal sg_ctrl_shift_copy : std_logic_vector(0 downto 0):= (others => '0'); -- Address signal signal sg_addr : std_logic_vector(WADDR - 1 downto 0):= (others => '0'); -- Signal to connect the sensor we valid from the good fifo to the fsm inside the nnlayer signal sg_sensor_we_valid : std_logic := '0'; -- Corresponding arrays signal arr_ctrl_we_mode : std_logic_vector(NBNEU - 1 downto 0) := (others => '0'); signal arr_ctrl_we_shift : std_logic_vector(NBNEU - 1 downto 0) := (others => '0'); signal arr_ctrl_we_valid : std_logic_vector(NBNEU - 1 downto 0) := (others => '0'); signal arr_ctrl_accu_clear : std_logic_vector(NBNEU - 1 downto 0) := (others => '0'); signal arr_ctrl_accu_add : std_logic_vector(NBNEU - 1 downto 0) := (others => '0'); signal arr_ctrl_shift_en : std_logic_vector(NBNEU - 1 downto 0) := (others => '0'); signal arr_ctrl_shift_copy : std_logic_vector(NBNEU - 1 downto 0) := (others => '0'); signal arr_addr : std_logic_vector(NBNEU * WADDR - 1 downto 0) := (others => '0'); -- Declaration of signal array to wire we_next and we_prev of every -- neuron -- We need 1 wire between two neurons and 2 more for first and last one. -- Hence NBNEU + 1 values. type match_array is array (0 to NBNEU) of std_logic; signal we_match : match_array := (others => '0'); type match_array_waccu is array (0 to NBNEU) of std_logic_vector(WACCU - 1 downto 0); -- Declaration of sh_data array with NBNEU wires signal sh_data_match : match_array_waccu := (others => (others => '0')); -- Declaration of sensor arrays -- We use only the first one of this array signal sensors_shift_match : match_array:= (others => '0'); signal sensors_copy_match : match_array:= (others => '0'); signal sensors_we_mode_match : match_array:= (others => '0'); signal sensors_we_shift_match : match_array:= (others => '0'); signal sensors_we_valid_match : match_array:= (others => '0'); -- FIFO management signals signal sg_in_fifo_out_ack : std_logic := '0'; --signal sg_out_fifo_in_ack : std_logic; signal sg_out_fifo_in_cnt : std_logic_vector(CNTW - 1 downto 0) := (others => '0'); -- Component declaration: one neuron component neuron is generic ( -- Parameters for the neurons WDATA : natural := 32; WWEIGHT : natural := 16; WACCU : natural := 32; -- Parameters for the frame size FSIZE : natural := 784; WADDR : natural := 10 ); port ( clk : in std_logic; -- Control signals ctrl_we_mode : in std_logic; ctrl_we_shift : in std_logic; ctrl_we_valid : in std_logic; ctrl_accu_clear : in std_logic; ctrl_accu_add : in std_logic; ctrl_shift_en : in std_logic; ctrl_shift_copy : in std_logic; -- Address used for Read and Write addr : in std_logic_vector(WADDR-1 downto 0); -- Ports for Write Enable we_prev : in std_logic; we_next : out std_logic; write_data : in std_logic_vector(WDATA-1 downto 0); -- Data input, 2 bits data_in : in std_logic_vector(WDATA-1 downto 0); -- Scan chain to extract values sh_data_in : in std_logic_vector(WACCU-1 downto 0); sh_data_out : out std_logic_vector(WACCU-1 downto 0); -- Sensors, for synchronization with the controller sensor_shift : out std_logic; sensor_copy : out std_logic; sensor_we_mode : out std_logic; sensor_we_shift : out std_logic; sensor_we_valid : out std_logic ); end component; -- FSM for this layer component fsm is generic ( -- global parameters of layers NB_NEURONS: natural := 200; -- parameters of a neuron WDATA : natural := 16; WWEIGHT : natural := 16; WACCU : natural := 48; -- Parameters for the frame size FSIZE : natural := 784; WADDR : natural := 10 ); port ( reset : in std_logic; clk : in std_logic; -- Control signals -- (go to all neurons) ctrl_we_mode : out std_logic; ctrl_we_shift : out std_logic; ctrl_we_valid : out std_logic; ctrl_accu_clear : out std_logic; ctrl_accu_add : out std_logic; ctrl_shift_en : out std_logic; ctrl_shift_copy : out std_logic; -- Address used for Read and Write -- (go to all neurons) addr : out std_logic_vector(WADDR-1 downto 0); -- Ports for Write Enable -- go to first neuron n0_we_prev : out std_logic; -- come from last neuron nN_we_next : in std_logic; -- Sensors, for synchronization with the controller -- go to first neurons sensor_shift : in std_logic; sensor_copy : in std_logic; sensor_we_mode : in std_logic; sensor_we_shift : in std_logic; sensor_we_valid : in std_logic; -- inputs fsm_mode : in std_logic; -- input FIFO control out_fifo_in_cnt : in std_logic_vector(CNTW-1 downto 0) -- output FIFO control --out_fifo_in_ack : out std_logic ); end component; -- Component declaration: distribution tree to limit fanout component distribuf is generic( WDATA : natural := 32; NBOUT : natural := 32; FANOUT : natural := 32 ); port( clk : in std_logic; -- Input idata : in std_logic_vector(WDATA-1 downto 0); -- Outputs odata : out std_logic_vector(WDATA*NBOUT-1 downto 0) ); end component; begin ------------------------------------------------------------------- -- Instantiate the fanout distribution trees ------------------------------------------------------------------- -- Fanout distribution tree: write_data i_buf_write_data: distribuf generic map ( WDATA => WDATA, NBOUT => NBNEU, FANOUT => FANOUT ) port map ( clk => clk, idata => write_data, odata => arr_write_data ); -- Fanout distribution tree: data_in i_buf_data_in: distribuf generic map ( WDATA => WDATA, NBOUT => NBNEU, FANOUT => FANOUT ) port map ( clk => clk, idata => data_in, odata => arr_data_in ); -- ctrl_we_mode distribution tree i_ctrl_we_mode: distribuf generic map ( WDATA => 1, NBOUT => NBNEU, FANOUT => FANOUT ) port map ( clk => clk, idata => sg_ctrl_we_mode, odata => arr_ctrl_we_mode ); -- ctrl_we_shift distribution tree i_ctrl_we_shift: distribuf generic map ( WDATA => 1, NBOUT => NBNEU, FANOUT => FANOUT ) port map ( clk => clk, idata => sg_ctrl_we_shift, odata => arr_ctrl_we_shift ); -- ctrl_we_valid distribution tree i_ctrl_we_valid: distribuf generic map ( WDATA => 1, NBOUT => NBNEU, FANOUT => FANOUT ) port map ( clk => clk, idata => sg_ctrl_we_valid, odata => arr_ctrl_we_valid ); -- ctrl_accu_clear distribution tree i_ctrl_accu_clear: distribuf generic map ( WDATA => 1, NBOUT => NBNEU, FANOUT => FANOUT ) port map ( clk => clk, idata => sg_ctrl_accu_clear, odata => arr_ctrl_accu_clear ); -- ctrl_accu_add distribution tree i_ctrl_accu_add: distribuf generic map ( WDATA => 1, NBOUT => NBNEU, FANOUT => FANOUT ) port map ( clk => clk, idata => sg_ctrl_accu_add, odata => arr_ctrl_accu_add ); -- ctrl_shift_en distribution tree i_ctrl_shift_en: distribuf generic map ( WDATA => 1, NBOUT => NBNEU, FANOUT => FANOUT ) port map ( clk => clk, idata => sg_ctrl_shift_en, odata => arr_ctrl_shift_en ); -- ctrl_shift_copy distribution tree i_ctrl_shift_copy: distribuf generic map ( WDATA => 1, NBOUT => NBNEU, FANOUT => FANOUT ) port map ( clk => clk, idata => sg_ctrl_shift_copy, odata => arr_ctrl_shift_copy ); -- we_mode distribution tree i_addr: distribuf generic map ( WDATA => WADDR, NBOUT => NBNEU, FANOUT => FANOUT ) port map ( clk => clk, idata => sg_addr, odata => arr_addr ); ------------------------------------------------------------------- -- Instantiate the neurons ------------------------------------------------------------------- gen_neu: for i in 0 to NBNEU-1 generate i_neu_normal: neuron generic map ( -- Parameters for the neurons WDATA => WDATA, WWEIGHT => WWEIGHT, WACCU => WACCU, -- Parameters for the frame size FSIZE => FSIZE, WADDR => WADDR ) port map ( clk => clk, -- Control signals ctrl_we_mode => arr_ctrl_we_mode(i), ctrl_we_shift => arr_ctrl_we_shift(i), ctrl_we_valid => arr_ctrl_we_valid(i), ctrl_accu_clear => arr_ctrl_accu_clear(i), ctrl_accu_add => arr_ctrl_accu_add(i), ctrl_shift_en => arr_ctrl_shift_en(i), ctrl_shift_copy => arr_ctrl_shift_copy(i), -- Address used for Read and Write addr => arr_addr((i+1)*WADDR-1 downto i*WADDR), -- Ports for Write Enable we_prev => we_match(i), we_next => we_match(i + 1), write_data => arr_write_data((i+1)*WDATA-1 downto i*WDATA), -- Data input, 2 bits data_in => arr_data_in((i+1)*WDATA-1 downto i*WDATA), -- Scan chain to extract values -- Inversed from we_prev and we_next sh_data_in => sh_data_match(i+1), sh_data_out => sh_data_match(i), -- Sensors, for synchronization with the controller -- We use only the first (we suppose that synthesis will remove wires) sensor_shift => sensors_shift_match(i), sensor_copy => sensors_copy_match(i), sensor_we_mode => sensors_we_mode_match(i), sensor_we_shift => sensors_we_shift_match(i), -- Not used sensor_we_valid => open ); end generate; ------------------------------------------------------------------- -- Instantiate the FSM ------------------------------------------------------------------- fsm_gen: fsm generic map ( NB_NEURONS => NBNEU, WDATA => WDATA, WWEIGHT => WWEIGHT, WACCU => WACCU, FSIZE => FSIZE, WADDR => WADDR ) port map ( reset => clear, clk => clk, ctrl_we_mode => sg_ctrl_we_mode(0), ctrl_we_shift => sg_ctrl_we_shift(0), ctrl_we_valid => sg_ctrl_we_valid(0), ctrl_accu_clear => sg_ctrl_accu_clear(0), ctrl_accu_add => sg_ctrl_accu_add(0), ctrl_shift_en => sg_ctrl_shift_en(0), ctrl_shift_copy => sg_ctrl_shift_copy(0), addr => sg_addr, n0_we_prev => we_match(0), nN_we_next => we_match(NBNEU), sensor_shift => sensors_shift_match(0), sensor_copy => sensors_copy_match(0), sensor_we_mode => sensors_we_mode_match(0), sensor_we_shift => sensors_we_shift_match(0), sensor_we_valid => sg_sensor_we_valid, fsm_mode => write_mode, out_fifo_in_cnt => sg_out_fifo_in_cnt --out_fifo_in_ack => sg_out_fifo_in_ack ); sg_sensor_we_valid <= (data_in_valid and not(write_mode)) or (write_enable and write_mode); data_in_ready <= sg_ctrl_accu_add(0) and not(write_mode); write_ready <= sg_ctrl_we_valid(0) and write_mode; sg_out_fifo_in_cnt <= out_fifo_room; data_out <= sh_data_match(0); sh_data_match(NBNEU) <= std_logic_vector(to_unsigned(0, sh_data_match(NBNEU)'length)); --data_out_valid <= sg_out_fifo_in_ack; data_out_valid <= sensors_shift_match(0); end_of_frame <= '0'; end architecture;
LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.all; USE IEEE.STD_LOGIC_ARITH.all; USE IEEE.STD_LOGIC_UNSIGNED.all; ENTITY LCD_MOD IS PORT( CLK : IN STD_LOGIC; RST : IN STD_LOGIC; PC : IN STD_LOGIC_VECTOR(15 DOWNTO 0); KEYB : IN STD_LOGIC_VECTOR(7 DOWNTO 0); H_STATE : IN STD_LOGIC; LCD_DATA : OUT STD_LOGIC_VECTOR(7 DOWNTO 0); LCD_ENABLE: OUT STD_LOGIC; LCD_RW : OUT STD_LOGIC; LCD_RS : OUT STD_LOGIC ); END LCD_MOD; ARCHITECTURE main OF LCD_MOD IS CONSTANT RUNNING : STD_LOGIC_VECTOR(55 DOWNTO 0) := x"676E696E6E7552"; CONSTANT HALTED : STD_LOGIC_VECTOR(55 DOWNTO 0) := x"206465746C6148"; CONSTANT PCS : STD_LOGIC_VECTOR(31 DOWNTO 0) := x"203A4350"; CONSTANT KEYBS : STD_LOGIC_VECTOR(47 DOWNTO 0) := x"203A4259454B"; CONSTANT AP9S : STD_LOGIC_VECTOR(23 DOWNTO 0) := x"395041"; SIGNAL MAINSTATE : STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL STATE : STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL STATEA : STD_LOGIC_VECTOR(3 DOWNTO 0); BEGIN PROCESS(CLK, RST) VARIABLE COUNTER : INTEGER RANGE 0 TO 2500000; VARIABLE ITER : INTEGER RANGE 0 TO 256; VARIABLE INPC : STD_LOGIC_VECTOR(15 DOWNTO 0); VARIABLE INKEYB : STD_LOGIC_VECTOR(7 DOWNTO 0); BEGIN IF(RST = '1') THEN ITER := 0; INPC := x"FFFF"; INKEYB := x"FF"; LCD_ENABLE <= '0'; LCD_DATA <= x"00"; MAINSTATE <= x"0"; STATE <= x"F"; STATEA <= x"0"; ELSIF(CLK'EVENT AND CLK = '1') THEN CASE STATE IS --CLEAR SCREEN WHEN x"0" => LCD_DATA <= x"01"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"D"; STATE <= x"E"; --PREPARE TO WRITE RUNNING WHEN x"1" => LCD_DATA <= x"80"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"2"; STATE <= x"E"; --WRITE RUNNING WHEN x"2" => LCD_DATA <= RUNNING(ITER + 7 DOWNTO ITER); LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 56) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"2"; END IF; STATE <= x"F"; --PREPARE TO WRITE PC: XXXX WHEN x"3" => LCD_DATA <= x"88"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"4"; STATE <= x"E"; --WRITE PC: XXXX WHEN x"4" => IF(ITER < 32) THEN LCD_DATA <= PCS(ITER + 7 DOWNTO ITER); ELSE CASE ITER IS WHEN 32 => IF(PC(15 DOWNTO 12) < x"A") THEN LCD_DATA <= PC(15 DOWNTO 12) + x"30"; ELSE LCD_DATA <= PC(15 DOWNTO 12) + x"37"; END IF; WHEN 40 => IF(PC(11 DOWNTO 8) < x"A") THEN LCD_DATA <= PC(11 DOWNTO 8) + x"30"; ELSE LCD_DATA <= PC(11 DOWNTO 8) + x"37"; END IF; WHEN 48 => IF(PC(7 DOWNTO 4) < x"A") THEN LCD_DATA <= PC(7 DOWNTO 4) + x"30"; ELSE LCD_DATA <= PC(7 DOWNTO 4) + x"37"; END IF; WHEN 56 => IF(PC(3 DOWNTO 0) < x"A") THEN LCD_DATA <= PC(3 DOWNTO 0) + x"30"; ELSE LCD_DATA <= PC(3 DOWNTO 0) + x"37"; END IF; WHEN OTHERS => END CASE; END IF; LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 64) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"4"; END IF; STATE <= x"F"; --PREPARE TO WRITE KEYB: XX WHEN x"5" => LCD_DATA <= x"C8"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"6"; STATE <= x"E"; --WRITE KEYB: XX WHEN x"6" => IF(ITER < 48) THEN LCD_DATA <= KEYBS(ITER + 7 DOWNTO ITER); ELSE CASE ITER IS WHEN 48 => IF(KEYB(7 DOWNTO 4) < x"A") THEN LCD_DATA <= KEYB(7 DOWNTO 4) + x"30"; ELSE LCD_DATA <= KEYB(7 DOWNTO 4) + x"37"; END IF; WHEN 56 => IF(KEYB(3 DOWNTO 0) < x"A") THEN LCD_DATA <= KEYB(3 DOWNTO 0) + x"30"; ELSE LCD_DATA <= KEYB(3 DOWNTO 0) + x"37"; END IF; WHEN OTHERS => END CASE; END IF; LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 64) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"6"; END IF; STATE <= x"F"; --PREPARE TO WRITE AP9 WHEN x"7" => LCD_DATA <= x"C0"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"8"; STATE <= x"E"; --WRITE AP9 WHEN x"8" => LCD_DATA <= AP9S(ITER + 7 DOWNTO ITER); LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 24) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"8"; END IF; STATE <= x"F"; --PREPARE TO WRITE HALTED WHEN x"9" => LCD_DATA <= x"80"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"A"; STATE <= x"E"; --WRITE HALTED WHEN x"A" => LCD_DATA <= HALTED(ITER + 7 DOWNTO ITER); LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 56) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"A"; END IF; STATE <= x"F"; --LOOP STATE, ALMOST A MAIN FUNCTION WHEN x"D" => CASE MAINSTATE IS --DRAW AP9 WHEN x"0" => STATE <= x"7"; MAINSTATE <= x"1"; --DRAW STATE RUNNING WHEN x"1" => STATE <= x"1"; MAINSTATE <= x"2"; --DRAW PC (IF NECESSARY) WHEN x"2" => IF(NOT (INPC = PC)) THEN INPC := PC; STATE <= x"3"; END IF; MAINSTATE <= x"3"; --DRAW KEYB (IF NECESSARY) WHEN x"3" => IF(NOT (INKEYB = KEYB)) THEN INKEYB := KEYB; STATE <= x"5"; END IF; MAINSTATE <= x"4"; --DRAW STATE HALTED (IF HALTED) WHEN x"4" => IF(H_STATE = '1') THEN STATE <= x"9"; MAINSTATE <= x"5"; ELSE MAINSTATE <= x"1"; END IF; WHEN OTHERS => END CASE; --WAIT STATE FOR INSTRUCTIONS WHEN x"E" => IF(COUNTER = 250000) THEN COUNTER := 0; LCD_ENABLE <= '0'; STATE <= STATEA; ELSE COUNTER := COUNTER + 1; END IF; --WAIT STATE FOR DATA WHEN x"F" => IF(COUNTER = 25000) THEN COUNTER := 0; LCD_ENABLE <= '0'; STATE <= STATEA; ELSE COUNTER := COUNTER + 1; END IF; WHEN OTHERS => STATE <= x"0"; END CASE; END IF; END PROCESS; END;
LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.all; USE IEEE.STD_LOGIC_ARITH.all; USE IEEE.STD_LOGIC_UNSIGNED.all; ENTITY LCD_MOD IS PORT( CLK : IN STD_LOGIC; RST : IN STD_LOGIC; PC : IN STD_LOGIC_VECTOR(15 DOWNTO 0); KEYB : IN STD_LOGIC_VECTOR(7 DOWNTO 0); H_STATE : IN STD_LOGIC; LCD_DATA : OUT STD_LOGIC_VECTOR(7 DOWNTO 0); LCD_ENABLE: OUT STD_LOGIC; LCD_RW : OUT STD_LOGIC; LCD_RS : OUT STD_LOGIC ); END LCD_MOD; ARCHITECTURE main OF LCD_MOD IS CONSTANT RUNNING : STD_LOGIC_VECTOR(55 DOWNTO 0) := x"676E696E6E7552"; CONSTANT HALTED : STD_LOGIC_VECTOR(55 DOWNTO 0) := x"206465746C6148"; CONSTANT PCS : STD_LOGIC_VECTOR(31 DOWNTO 0) := x"203A4350"; CONSTANT KEYBS : STD_LOGIC_VECTOR(47 DOWNTO 0) := x"203A4259454B"; CONSTANT AP9S : STD_LOGIC_VECTOR(23 DOWNTO 0) := x"395041"; SIGNAL MAINSTATE : STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL STATE : STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL STATEA : STD_LOGIC_VECTOR(3 DOWNTO 0); BEGIN PROCESS(CLK, RST) VARIABLE COUNTER : INTEGER RANGE 0 TO 2500000; VARIABLE ITER : INTEGER RANGE 0 TO 256; VARIABLE INPC : STD_LOGIC_VECTOR(15 DOWNTO 0); VARIABLE INKEYB : STD_LOGIC_VECTOR(7 DOWNTO 0); BEGIN IF(RST = '1') THEN ITER := 0; INPC := x"FFFF"; INKEYB := x"FF"; LCD_ENABLE <= '0'; LCD_DATA <= x"00"; MAINSTATE <= x"0"; STATE <= x"F"; STATEA <= x"0"; ELSIF(CLK'EVENT AND CLK = '1') THEN CASE STATE IS --CLEAR SCREEN WHEN x"0" => LCD_DATA <= x"01"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"D"; STATE <= x"E"; --PREPARE TO WRITE RUNNING WHEN x"1" => LCD_DATA <= x"80"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"2"; STATE <= x"E"; --WRITE RUNNING WHEN x"2" => LCD_DATA <= RUNNING(ITER + 7 DOWNTO ITER); LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 56) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"2"; END IF; STATE <= x"F"; --PREPARE TO WRITE PC: XXXX WHEN x"3" => LCD_DATA <= x"88"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"4"; STATE <= x"E"; --WRITE PC: XXXX WHEN x"4" => IF(ITER < 32) THEN LCD_DATA <= PCS(ITER + 7 DOWNTO ITER); ELSE CASE ITER IS WHEN 32 => IF(PC(15 DOWNTO 12) < x"A") THEN LCD_DATA <= PC(15 DOWNTO 12) + x"30"; ELSE LCD_DATA <= PC(15 DOWNTO 12) + x"37"; END IF; WHEN 40 => IF(PC(11 DOWNTO 8) < x"A") THEN LCD_DATA <= PC(11 DOWNTO 8) + x"30"; ELSE LCD_DATA <= PC(11 DOWNTO 8) + x"37"; END IF; WHEN 48 => IF(PC(7 DOWNTO 4) < x"A") THEN LCD_DATA <= PC(7 DOWNTO 4) + x"30"; ELSE LCD_DATA <= PC(7 DOWNTO 4) + x"37"; END IF; WHEN 56 => IF(PC(3 DOWNTO 0) < x"A") THEN LCD_DATA <= PC(3 DOWNTO 0) + x"30"; ELSE LCD_DATA <= PC(3 DOWNTO 0) + x"37"; END IF; WHEN OTHERS => END CASE; END IF; LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 64) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"4"; END IF; STATE <= x"F"; --PREPARE TO WRITE KEYB: XX WHEN x"5" => LCD_DATA <= x"C8"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"6"; STATE <= x"E"; --WRITE KEYB: XX WHEN x"6" => IF(ITER < 48) THEN LCD_DATA <= KEYBS(ITER + 7 DOWNTO ITER); ELSE CASE ITER IS WHEN 48 => IF(KEYB(7 DOWNTO 4) < x"A") THEN LCD_DATA <= KEYB(7 DOWNTO 4) + x"30"; ELSE LCD_DATA <= KEYB(7 DOWNTO 4) + x"37"; END IF; WHEN 56 => IF(KEYB(3 DOWNTO 0) < x"A") THEN LCD_DATA <= KEYB(3 DOWNTO 0) + x"30"; ELSE LCD_DATA <= KEYB(3 DOWNTO 0) + x"37"; END IF; WHEN OTHERS => END CASE; END IF; LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 64) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"6"; END IF; STATE <= x"F"; --PREPARE TO WRITE AP9 WHEN x"7" => LCD_DATA <= x"C0"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"8"; STATE <= x"E"; --WRITE AP9 WHEN x"8" => LCD_DATA <= AP9S(ITER + 7 DOWNTO ITER); LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 24) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"8"; END IF; STATE <= x"F"; --PREPARE TO WRITE HALTED WHEN x"9" => LCD_DATA <= x"80"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"A"; STATE <= x"E"; --WRITE HALTED WHEN x"A" => LCD_DATA <= HALTED(ITER + 7 DOWNTO ITER); LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 56) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"A"; END IF; STATE <= x"F"; --LOOP STATE, ALMOST A MAIN FUNCTION WHEN x"D" => CASE MAINSTATE IS --DRAW AP9 WHEN x"0" => STATE <= x"7"; MAINSTATE <= x"1"; --DRAW STATE RUNNING WHEN x"1" => STATE <= x"1"; MAINSTATE <= x"2"; --DRAW PC (IF NECESSARY) WHEN x"2" => IF(NOT (INPC = PC)) THEN INPC := PC; STATE <= x"3"; END IF; MAINSTATE <= x"3"; --DRAW KEYB (IF NECESSARY) WHEN x"3" => IF(NOT (INKEYB = KEYB)) THEN INKEYB := KEYB; STATE <= x"5"; END IF; MAINSTATE <= x"4"; --DRAW STATE HALTED (IF HALTED) WHEN x"4" => IF(H_STATE = '1') THEN STATE <= x"9"; MAINSTATE <= x"5"; ELSE MAINSTATE <= x"1"; END IF; WHEN OTHERS => END CASE; --WAIT STATE FOR INSTRUCTIONS WHEN x"E" => IF(COUNTER = 250000) THEN COUNTER := 0; LCD_ENABLE <= '0'; STATE <= STATEA; ELSE COUNTER := COUNTER + 1; END IF; --WAIT STATE FOR DATA WHEN x"F" => IF(COUNTER = 25000) THEN COUNTER := 0; LCD_ENABLE <= '0'; STATE <= STATEA; ELSE COUNTER := COUNTER + 1; END IF; WHEN OTHERS => STATE <= x"0"; END CASE; END IF; END PROCESS; END;
LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.all; USE IEEE.STD_LOGIC_ARITH.all; USE IEEE.STD_LOGIC_UNSIGNED.all; ENTITY LCD_MOD IS PORT( CLK : IN STD_LOGIC; RST : IN STD_LOGIC; PC : IN STD_LOGIC_VECTOR(15 DOWNTO 0); KEYB : IN STD_LOGIC_VECTOR(7 DOWNTO 0); H_STATE : IN STD_LOGIC; LCD_DATA : OUT STD_LOGIC_VECTOR(7 DOWNTO 0); LCD_ENABLE: OUT STD_LOGIC; LCD_RW : OUT STD_LOGIC; LCD_RS : OUT STD_LOGIC ); END LCD_MOD; ARCHITECTURE main OF LCD_MOD IS CONSTANT RUNNING : STD_LOGIC_VECTOR(55 DOWNTO 0) := x"676E696E6E7552"; CONSTANT HALTED : STD_LOGIC_VECTOR(55 DOWNTO 0) := x"206465746C6148"; CONSTANT PCS : STD_LOGIC_VECTOR(31 DOWNTO 0) := x"203A4350"; CONSTANT KEYBS : STD_LOGIC_VECTOR(47 DOWNTO 0) := x"203A4259454B"; CONSTANT AP9S : STD_LOGIC_VECTOR(23 DOWNTO 0) := x"395041"; SIGNAL MAINSTATE : STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL STATE : STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL STATEA : STD_LOGIC_VECTOR(3 DOWNTO 0); BEGIN PROCESS(CLK, RST) VARIABLE COUNTER : INTEGER RANGE 0 TO 2500000; VARIABLE ITER : INTEGER RANGE 0 TO 256; VARIABLE INPC : STD_LOGIC_VECTOR(15 DOWNTO 0); VARIABLE INKEYB : STD_LOGIC_VECTOR(7 DOWNTO 0); BEGIN IF(RST = '1') THEN ITER := 0; INPC := x"FFFF"; INKEYB := x"FF"; LCD_ENABLE <= '0'; LCD_DATA <= x"00"; MAINSTATE <= x"0"; STATE <= x"F"; STATEA <= x"0"; ELSIF(CLK'EVENT AND CLK = '1') THEN CASE STATE IS --CLEAR SCREEN WHEN x"0" => LCD_DATA <= x"01"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"D"; STATE <= x"E"; --PREPARE TO WRITE RUNNING WHEN x"1" => LCD_DATA <= x"80"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"2"; STATE <= x"E"; --WRITE RUNNING WHEN x"2" => LCD_DATA <= RUNNING(ITER + 7 DOWNTO ITER); LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 56) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"2"; END IF; STATE <= x"F"; --PREPARE TO WRITE PC: XXXX WHEN x"3" => LCD_DATA <= x"88"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"4"; STATE <= x"E"; --WRITE PC: XXXX WHEN x"4" => IF(ITER < 32) THEN LCD_DATA <= PCS(ITER + 7 DOWNTO ITER); ELSE CASE ITER IS WHEN 32 => IF(PC(15 DOWNTO 12) < x"A") THEN LCD_DATA <= PC(15 DOWNTO 12) + x"30"; ELSE LCD_DATA <= PC(15 DOWNTO 12) + x"37"; END IF; WHEN 40 => IF(PC(11 DOWNTO 8) < x"A") THEN LCD_DATA <= PC(11 DOWNTO 8) + x"30"; ELSE LCD_DATA <= PC(11 DOWNTO 8) + x"37"; END IF; WHEN 48 => IF(PC(7 DOWNTO 4) < x"A") THEN LCD_DATA <= PC(7 DOWNTO 4) + x"30"; ELSE LCD_DATA <= PC(7 DOWNTO 4) + x"37"; END IF; WHEN 56 => IF(PC(3 DOWNTO 0) < x"A") THEN LCD_DATA <= PC(3 DOWNTO 0) + x"30"; ELSE LCD_DATA <= PC(3 DOWNTO 0) + x"37"; END IF; WHEN OTHERS => END CASE; END IF; LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 64) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"4"; END IF; STATE <= x"F"; --PREPARE TO WRITE KEYB: XX WHEN x"5" => LCD_DATA <= x"C8"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"6"; STATE <= x"E"; --WRITE KEYB: XX WHEN x"6" => IF(ITER < 48) THEN LCD_DATA <= KEYBS(ITER + 7 DOWNTO ITER); ELSE CASE ITER IS WHEN 48 => IF(KEYB(7 DOWNTO 4) < x"A") THEN LCD_DATA <= KEYB(7 DOWNTO 4) + x"30"; ELSE LCD_DATA <= KEYB(7 DOWNTO 4) + x"37"; END IF; WHEN 56 => IF(KEYB(3 DOWNTO 0) < x"A") THEN LCD_DATA <= KEYB(3 DOWNTO 0) + x"30"; ELSE LCD_DATA <= KEYB(3 DOWNTO 0) + x"37"; END IF; WHEN OTHERS => END CASE; END IF; LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 64) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"6"; END IF; STATE <= x"F"; --PREPARE TO WRITE AP9 WHEN x"7" => LCD_DATA <= x"C0"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"8"; STATE <= x"E"; --WRITE AP9 WHEN x"8" => LCD_DATA <= AP9S(ITER + 7 DOWNTO ITER); LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 24) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"8"; END IF; STATE <= x"F"; --PREPARE TO WRITE HALTED WHEN x"9" => LCD_DATA <= x"80"; LCD_RS <= '0'; LCD_RW <= '0'; LCD_ENABLE <= '1'; STATEA <= x"A"; STATE <= x"E"; --WRITE HALTED WHEN x"A" => LCD_DATA <= HALTED(ITER + 7 DOWNTO ITER); LCD_RS <= '1'; LCD_RW <= '0'; LCD_ENABLE <= '1'; ITER := ITER + 8; IF(ITER = 56) THEN ITER := 0; STATEA <= x"D"; ELSE STATEA <= x"A"; END IF; STATE <= x"F"; --LOOP STATE, ALMOST A MAIN FUNCTION WHEN x"D" => CASE MAINSTATE IS --DRAW AP9 WHEN x"0" => STATE <= x"7"; MAINSTATE <= x"1"; --DRAW STATE RUNNING WHEN x"1" => STATE <= x"1"; MAINSTATE <= x"2"; --DRAW PC (IF NECESSARY) WHEN x"2" => IF(NOT (INPC = PC)) THEN INPC := PC; STATE <= x"3"; END IF; MAINSTATE <= x"3"; --DRAW KEYB (IF NECESSARY) WHEN x"3" => IF(NOT (INKEYB = KEYB)) THEN INKEYB := KEYB; STATE <= x"5"; END IF; MAINSTATE <= x"4"; --DRAW STATE HALTED (IF HALTED) WHEN x"4" => IF(H_STATE = '1') THEN STATE <= x"9"; MAINSTATE <= x"5"; ELSE MAINSTATE <= x"1"; END IF; WHEN OTHERS => END CASE; --WAIT STATE FOR INSTRUCTIONS WHEN x"E" => IF(COUNTER = 250000) THEN COUNTER := 0; LCD_ENABLE <= '0'; STATE <= STATEA; ELSE COUNTER := COUNTER + 1; END IF; --WAIT STATE FOR DATA WHEN x"F" => IF(COUNTER = 25000) THEN COUNTER := 0; LCD_ENABLE <= '0'; STATE <= STATEA; ELSE COUNTER := COUNTER + 1; END IF; WHEN OTHERS => STATE <= x"0"; END CASE; END IF; END PROCESS; END;
-------------------------------------------------------------------------------- -- Author: Parham Alvani ([email protected]) -- -- Create Date: 12-02-2016 -- Module Name: sr-latch.vhd -------------------------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; entity sr_latch is port(s, r, clk : in std_logic; q, q_not : buffer std_logic); end entity sr_latch; architecture arch_sr_latch of sr_latch is begin q <= r nor q_not; q_not <= s nor q; end architecture arch_sr_latch;
library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; entity addern is generic( width : integer := 8 ); port( A, B : in std_logic_vector(width - 1 downto 0); Y : out std_logic_vector(width - 1 downto 0) ); end addern; architecture bhv of addern is begin Y <= A + B; end bhv; Library IEEE; use IEEE.std_logic_1164.all; entity generics_1 is port( X, Y, Z : in std_logic_vector(12 downto 0); A, B : in std_logic_vector(4 downto 0); S : out std_logic_vector(17 downto 0)); end generics_1; architecture bhv of generics_1 is component addern generic(width : integer := 8); port( A, B : in std_logic_vector(width - 1 downto 0); Y : out std_logic_vector(width - 1 downto 0)); end component; for all : addern use entity work.addern(bhv); signal C1 : std_logic_vector(12 downto 0); signal C2, C3 : std_logic_vector(17 downto 0); begin U1 : addern generic map(width => 13) port map(X, Y, C1); C2 <= C1 & A; C3 <= Z & B; U2 : addern generic map(width => 18) port map(C2, C3, S); end bhv;
-- Controller implementation for the IS61LV25616-10 memory -- Copyright [email protected] 2014 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use work.Types.all; entity SramController is generic ( AddrW : positive := 18; DataW : positive := 16 ); port ( Clk : in bit1; RstN : in bit1; -- AddrIn : in word(AddrW-1 downto 0); WrData : in word(DataW-1 downto 0); RdData : out word(DataW-1 downto 0); We : in bit1; Re : in bit1; -- D : inout word(DataW-1 downto 0); AddrOut : out word(AddrW-1 downto 0); CeN : out bit1; OeN : out bit1; WeN : out bit1; UbN : out bit1; LbN : out bit1 ); end entity; architecture rtl of SramController is -- The Is61LV25616-10 is asynchronous -- tWC = Write Cycle Time = 10 ns min -- tSA = Address Setup Time = 8 ns min -- tSCE = CeN to Write End = 8 ns min -- tHA = Address Hold from Write End = 0 ns min -- tAW = Address Setup Time to Write End = 8 ns min -- tPWE = WeN Pulse Width = 8 ns min -- tPWB = LbN, UbN valid to end of write = 8 ns -- tHZWE = WeN low to High-Z output = 5 ns max -- tLZWE = WeN high to low-Z output = 3 ns min -- tSD = Data Setup to Write End = 5 ns min -- tHD = Data Hold from Write End = 0 ns min -- tRC = Read Cycle Time = 10 ns min type SramFSM is (IDLE, WR0, WR1, RE0); signal SramFSM_N, SramFSM_D : SramFSM; signal Addr_N, Addr_D : word(AddrW-1 downto 0); signal Data_N, Data_D : word(DataW-1 downto 0); begin FSMSyncRst : process (Clk, RstN) begin if RstN = '0' then SramFSM_D <= IDLE; elsif rising_edge(Clk) then SramFSM_D <= SramFSM_N; end if; end process; FSMSyncNoRst : process (Clk) begin if rising_edge(Clk) then Addr_D <= Addr_N; Data_D <= Data_N; end if; end process; FSMASync : process (SramFSM_D, We, Re, Addr_D, Data_D, AddrIn, WrData, D) begin SramFSM_N <= SramFSM_D; Addr_N <= Addr_D; AddrOut <= Addr_D; Data_N <= Data_D; -- D <= (others => 'Z'); WeN <= '1'; -- FIXME: Tie these to 0 UbN <= '1'; LbN <= '1'; CeN <= '1'; OeN <= '1'; case SramFsm_D is when WR0 => SramFSM_N <= IDLE; -- D <= Data_D; CeN <= '0'; WeN <= '0'; UbN <= '0'; LbN <= '0'; when RE0 => SramFSM_N <= IDLE; -- Data_N <= D; when others => if (We = '1') then SramFSM_N <= WR0; -- Data_N <= WrData; Addr_N <= AddrIn; AddrOut <= AddrIn; elsif Re = '1' then SramFSM_N <= RE0; -- CeN <= '0'; OeN <= '0'; UbN <= '0'; LbN <= '0'; -- Addr_N <= AddrIn; AddrOut <= AddrIn; -- FIXME: Potentially change this to sample the line instead Data_N <= (others => '1'); end if; end case; end process; RdData <= Data_D; end architecture;
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: ap_a_ap_a_10.vhd,v 1.3 2001-10-26 16:29:33 paw Exp $ -- $Revision: 1.3 $ -- -- --------------------------------------------------------------------- entity ap_a_10 is end entity ap_a_10; library ieee; use ieee.std_logic_1164.all; library stimulus; use stimulus.stimulus_generators.all; architecture test of ap_a_10 is signal a, b, c, d : std_ulogic; signal test_vector : std_ulogic_vector(1 to 4); begin b1 : block is signal y : std_ulogic; begin -- code from book y <= a or b or c or d; -- end code from book end block b1; b2 : block is signal y : std_ulogic; begin -- code from book y <= ( a or b ) or ( c or d ); -- end code from book end block b2; b3 : block is signal y : std_ulogic; begin -- code from book (syntax error) -- y <= a or b or c and d; -- end code from book end block b3; b4 : block is signal y : std_ulogic; begin -- code from book y <= ( a or b ) or ( c and d ); -- end code from book end block b4; stimulus : all_possible_values(test_vector, 10 ns); (a, b, c, d) <= test_vector; end architecture test;
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: ap_a_ap_a_10.vhd,v 1.3 2001-10-26 16:29:33 paw Exp $ -- $Revision: 1.3 $ -- -- --------------------------------------------------------------------- entity ap_a_10 is end entity ap_a_10; library ieee; use ieee.std_logic_1164.all; library stimulus; use stimulus.stimulus_generators.all; architecture test of ap_a_10 is signal a, b, c, d : std_ulogic; signal test_vector : std_ulogic_vector(1 to 4); begin b1 : block is signal y : std_ulogic; begin -- code from book y <= a or b or c or d; -- end code from book end block b1; b2 : block is signal y : std_ulogic; begin -- code from book y <= ( a or b ) or ( c or d ); -- end code from book end block b2; b3 : block is signal y : std_ulogic; begin -- code from book (syntax error) -- y <= a or b or c and d; -- end code from book end block b3; b4 : block is signal y : std_ulogic; begin -- code from book y <= ( a or b ) or ( c and d ); -- end code from book end block b4; stimulus : all_possible_values(test_vector, 10 ns); (a, b, c, d) <= test_vector; end architecture test;
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc -- This file is part of VESTs (Vhdl tESTs). -- VESTs is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the -- Free Software Foundation; either version 2 of the License, or (at -- your option) any later version. -- VESTs is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- You should have received a copy of the GNU General Public License -- along with VESTs; if not, write to the Free Software Foundation, -- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --------------------------------------------------------------------- -- -- $Id: ap_a_ap_a_10.vhd,v 1.3 2001-10-26 16:29:33 paw Exp $ -- $Revision: 1.3 $ -- -- --------------------------------------------------------------------- entity ap_a_10 is end entity ap_a_10; library ieee; use ieee.std_logic_1164.all; library stimulus; use stimulus.stimulus_generators.all; architecture test of ap_a_10 is signal a, b, c, d : std_ulogic; signal test_vector : std_ulogic_vector(1 to 4); begin b1 : block is signal y : std_ulogic; begin -- code from book y <= a or b or c or d; -- end code from book end block b1; b2 : block is signal y : std_ulogic; begin -- code from book y <= ( a or b ) or ( c or d ); -- end code from book end block b2; b3 : block is signal y : std_ulogic; begin -- code from book (syntax error) -- y <= a or b or c and d; -- end code from book end block b3; b4 : block is signal y : std_ulogic; begin -- code from book y <= ( a or b ) or ( c and d ); -- end code from book end block b4; stimulus : all_possible_values(test_vector, 10 ns); (a, b, c, d) <= test_vector; end architecture test;
-- Added these lines on rev. 42 in order to remove the commit message saying that -- there is a bug in the implementation, since the bug has been fixed in the same rev. library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity node_port_writermux is Port ( I_portID : in STD_LOGIC_VECTOR (2 downto 0); I_isDataUpValid : in STD_LOGIC; I_isDataDownValid : in STD_LOGIC; I_isDataLeftValid : in STD_LOGIC; I_isDataRightValid : in STD_LOGIC; O_isDataValid : out STD_LOGIC); end node_port_writermux; architecture Behavioral of node_port_writermux is begin with I_portID select O_isDataValid <= I_isDataUpValid when "000", I_isDataDownValid when "001", I_isDataLeftValid when "010", I_isDataRightValid when "011", '0' when others; end Behavioral;
-- NEED RESULT: ARCH00622: Concurrent proc call 1 passed -- NEED RESULT: ARCH00622.P1: Multi transport transactions occurred on concurrent signal asg passed -- NEED RESULT: ARCH00622: Concurrent proc call 2 passed -- NEED RESULT: ARCH00622: One transport transaction occurred on a concurrent signal asg passed -- NEED RESULT: ARCH00622: Old transactions were removed on a concurrent signal asg passed -- NEED RESULT: P1: Transport transactions completed entirely passed ------------------------------------------------------------------------------- -- -- Copyright (c) 1989 by Intermetrics, Inc. -- All rights reserved. -- ------------------------------------------------------------------------------- -- -- TEST NAME: -- -- CT00622 -- -- AUTHOR: -- -- G. Tominovich -- -- TEST OBJECTIVES: -- -- 9.3 (3) -- -- DESIGN UNIT ORDERING: -- -- ENT00622(ARCH00622) -- ENT00622_Test_Bench(ARCH00622_Test_Bench) -- -- REVISION HISTORY: -- -- 24-AUG-1987 - initial revision -- -- NOTES: -- -- self-checking -- automatically generated -- use WORK.STANDARD_TYPES.all ; entity ENT00622 is port ( s_st_arr1_vector : inout st_arr1_vector ) ; subtype chk_sig_type is integer range -1 to 100 ; signal chk_st_arr1_vector : chk_sig_type := -1 ; -- end ENT00622 ; -- -- architecture ARCH00622 of ENT00622 is subtype chk_time_type is Time ; signal s_st_arr1_vector_savt : chk_time_type := 0 ns ; -- subtype chk_cnt_type is Integer ; signal s_st_arr1_vector_cnt : chk_cnt_type := 0 ; -- type select_type is range 1 to 3 ; signal st_arr1_vector_select : select_type := 1 ; -- procedure P1 (signal s_st_arr1_vector : in st_arr1_vector ; signal select_sig : out Select_Type ; signal savtime : out Chk_Time_Type ; signal chk_sig : out Chk_Sig_Type ; signal count : out Integer) is variable correct : boolean ; begin case s_st_arr1_vector_cnt is when 0 => null ; -- s_st_arr1_vector(highb)(lowb to highb-1) <= transport -- c_st_arr1_vector_2(highb)(lowb to highb-1) after 10 ns, -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 20 ns ; -- when 1 => correct := s_st_arr1_vector(highb)(lowb to highb-1) = c_st_arr1_vector_2(highb)(lowb to highb-1) and (s_st_arr1_vector_savt + 10 ns) = Std.Standard.Now ; test_report ( "ARCH00622" , "Concurrent proc call 1", correct ) ; -- when 2 => correct := s_st_arr1_vector(highb)(lowb to highb-1) = c_st_arr1_vector_1(highb)(lowb to highb-1) and (s_st_arr1_vector_savt + 10 ns) = Std.Standard.Now ; test_report ( "ARCH00622.P1" , "Multi transport transactions occurred on " & "concurrent signal asg", correct ) ; -- select_sig <= transport 2 ; -- s_st_arr1_vector(highb)(lowb to highb-1) <= transport -- c_st_arr1_vector_2(highb)(lowb to highb-1) after 10 ns , -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 20 ns , -- c_st_arr1_vector_2(highb)(lowb to highb-1) after 30 ns , -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 40 ns ; -- when 3 => correct := s_st_arr1_vector(highb)(lowb to highb-1) = c_st_arr1_vector_2(highb)(lowb to highb-1) and (s_st_arr1_vector_savt + 10 ns) = Std.Standard.Now ; test_report ( "ARCH00622" , "Concurrent proc call 2", correct ) ; select_sig <= transport 3 ; -- s_st_arr1_vector(highb)(lowb to highb-1) <= transport -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 5 ns ; -- when 4 => correct := s_st_arr1_vector(highb)(lowb to highb-1) = c_st_arr1_vector_1(highb)(lowb to highb-1) and (s_st_arr1_vector_savt + 5 ns) = Std.Standard.Now ; test_report ( "ARCH00622" , "One transport transaction occurred on a " & "concurrent signal asg", correct ) ; test_report ( "ARCH00622" , "Old transactions were removed on a " & "concurrent signal asg", correct ) ; -- when others => -- No more transactions should have occurred test_report ( "ARCH00622" , "Old transactions were removed on a " & "concurrent signal asg", false ) ; -- end case ; -- savtime <= transport Std.Standard.Now ; chk_sig <= transport s_st_arr1_vector_cnt after (1 us - Std.Standard.Now) ; count <= transport s_st_arr1_vector_cnt + 1 ; -- end ; -- begin CHG1 : P1( s_st_arr1_vector , st_arr1_vector_select , s_st_arr1_vector_savt , chk_st_arr1_vector , s_st_arr1_vector_cnt ) ; -- PGEN_CHKP_1 : process ( chk_st_arr1_vector ) begin if Std.Standard.Now > 0 ns then test_report ( "P1" , "Transport transactions completed entirely", chk_st_arr1_vector = 4 ) ; end if ; end process PGEN_CHKP_1 ; -- -- with st_arr1_vector_select select s_st_arr1_vector(highb)(lowb to highb-1) <= transport c_st_arr1_vector_2(highb)(lowb to highb-1) after 10 ns, c_st_arr1_vector_1(highb)(lowb to highb-1) after 20 ns when 1, -- c_st_arr1_vector_2(highb)(lowb to highb-1) after 10 ns , c_st_arr1_vector_1(highb)(lowb to highb-1) after 20 ns , c_st_arr1_vector_2(highb)(lowb to highb-1) after 30 ns , c_st_arr1_vector_1(highb)(lowb to highb-1) after 40 ns when 2, -- c_st_arr1_vector_1(highb)(lowb to highb-1) after 5 ns when 3 ; -- end ARCH00622 ; -- -- use WORK.STANDARD_TYPES.all ; entity ENT00622_Test_Bench is signal s_st_arr1_vector : st_arr1_vector := c_st_arr1_vector_1 ; -- end ENT00622_Test_Bench ; -- -- architecture ARCH00622_Test_Bench of ENT00622_Test_Bench is begin L1: block component UUT port ( s_st_arr1_vector : inout st_arr1_vector ) ; end component ; -- for CIS1 : UUT use entity WORK.ENT00622 ( ARCH00622 ) ; begin CIS1 : UUT port map ( s_st_arr1_vector ) ; end block L1 ; end ARCH00622_Test_Bench ;
-- VHDL Entity lab11_MemoryArbiter_lib.MemoryArbiter.symbol -- -- Created: -- by - Hong.Hong (HSM) -- at - 02:31:01 04/23/14 -- -- Generated by Mentor Graphics' HDL Designer(TM) 2013.1 (Build 6) -- LIBRARY ieee; USE ieee.std_logic_1164.all; USE ieee.std_logic_arith.all; ENTITY MemoryArbiter IS PORT( Addr_fromFetchStage : IN std_logic_vector (15 DOWNTO 0); Addr_fromMemStage : IN std_logic_vector (15 DOWNTO 0); R : IN std_logic; W : IN std_logic; reset : IN std_logic; Addr_toMemory : OUT std_logic_vector (15 DOWNTO 0); Write_Control : OUT std_logic; mdelay_toFetchStage : OUT std_logic; mdelay_toMemStage : OUT std_logic ); -- Declarations END MemoryArbiter ; -- -- VHDL Architecture lab11_MemoryArbiter_lib.MemoryArbiter.struct -- -- Created: -- by - Hong.Hong (HSM) -- at - 02:31:01 04/23/14 -- -- Generated by Mentor Graphics' HDL Designer(TM) 2013.1 (Build 6) -- LIBRARY ieee; USE ieee.std_logic_1164.all; USE ieee.std_logic_arith.all; ARCHITECTURE struct OF MemoryArbiter IS -- Architecture declarations -- Internal signal declarations SIGNAL dout : std_logic; SIGNAL dout1 : std_logic; SIGNAL dout2 : std_logic; -- Implicit buffer signal declarations SIGNAL mdelay_toFetchStage_internal : std_logic; BEGIN -- ModuleWare code(v1.12) for instance 'ZERO' of 'constval' mdelay_toMemStage <= '0'; -- ModuleWare code(v1.12) for instance 'ZERO_a' of 'constval' dout <= '0'; -- ModuleWare code(v1.12) for instance 'ZERO_b' of 'constval' dout2 <= '0'; -- ModuleWare code(v1.12) for instance 'U_0' of 'mux' u_0combo_proc: PROCESS(dout1, dout, reset) BEGIN CASE reset IS WHEN '0' => mdelay_toFetchStage_internal <= dout1; WHEN '1' => mdelay_toFetchStage_internal <= dout; WHEN OTHERS => mdelay_toFetchStage_internal <= 'X'; END CASE; END PROCESS u_0combo_proc; -- ModuleWare code(v1.12) for instance 'WE_MUX' of 'mux' we_muxcombo_proc: PROCESS(W, dout2, reset) BEGIN CASE reset IS WHEN '0' => Write_Control <= W; WHEN '1' => Write_Control <= dout2; WHEN OTHERS => Write_Control <= 'X'; END CASE; END PROCESS we_muxcombo_proc; -- ModuleWare code(v1.12) for instance 'to_MemAddr_MUX' of 'mux' to_memaddr_muxcombo_proc: PROCESS(Addr_fromFetchStage, Addr_fromMemStage, mdelay_toFetchStage_internal) BEGIN CASE mdelay_toFetchStage_internal IS WHEN '0' => Addr_toMemory <= Addr_fromFetchStage; WHEN '1' => Addr_toMemory <= Addr_fromMemStage; WHEN OTHERS => Addr_toMemory <= (OTHERS => 'X'); END CASE; END PROCESS to_memaddr_muxcombo_proc; -- ModuleWare code(v1.12) for instance 'toMemAddr_Control' of 'or' dout1 <= R OR W; -- Instance port mappings. -- Implicit buffered output assignments mdelay_toFetchStage <= mdelay_toFetchStage_internal; END struct;
-------------------------------------------------------------------------- -- uart.vhd -- Simple RS232 like uart tx/rx design -- Does not handle any flow control. -- Does not perform any meaning full buffering. -- -- Peter Fetterer <[email protected]> -------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; entity uart is Port ( i_clk : in std_logic; -- system clock i_srst : in std_logic; -- synchronious reset, 1 - active i_baud_div : in std_logic_vector(15 downto 0); -- clk divider to get to baud rate -- UART Interface o_uart_tx : out std_logic; -- tx bit stream i_uart_rx : in std_logic; -- uart rx bit stream input -- FPGA Side i_tx_send : in std_logic_vector(7 downto 0); -- data byte in i_tx_send_we : in std_logic; -- write enable o_tx_send_busy : out std_logic; -- tx is busy, writes are ignored. o_rx_read : out std_logic_vector(7 downto 0); -- data byte out o_rx_read_valid : out std_logic; -- read data valid this clock cycle i_rx_read_rd : in std_logic -- read request, get next byte.. ); end entity uart; architecture Behavioral of uart is -- holding registers (buffer, 1 byte deep) signal rx_byte_last : std_logic_vector( 7 downto 0 ); -- buffer byte next byte to receive signal rx_byte_last_valid : std_logic; -- if rx_byte_complete is holding a valid byte signal rx_byte_working : std_logic_vector( 7 downto 0 ); -- working space for symbols be received signal tx_byte_next : std_logic_vector(7 downto 0 ); -- next byte to send signal tx_byte_valid : std_logic; -- if tx_byte_next is holding a valid byte signal tx_byte_working : std_logic_vector( 7 downto 0 ); -- working byte being transmitted -- baud divider stuff signal divider_count : unsigned( 15 downto 0); -- symbol period signal divider_count_div2 : unsigned( 15 downto 0); -- 1/2 symbol period signal rx_symbol_count : unsigned( 15 downto 0); -- rx clk count periods signal rx_gen_state : integer; signal tx_symbol_count : unsigned( 15 downto 0); -- tx clk count periods signal tx_gen_state : integer; signal tx_active : std_logic; signal uart_tx : std_logic; signal rx_start_det : std_logic; -- signals that we detected the rising edge of a start bit. (start symbol_ce) signal rx_symbol_ce : std_logic; -- clock enable on rx symbol sample signal rx_symbol_complete : std_logic; -- last bit being received this clock enable signal rx_symbol_complete_d1 : std_logic; -- delayed 1 clock signal tx_symbol_ce : std_logic; -- clock enable on tx symbol sample --signal tx_complete : std_logic; -- finished sending working byte signal uart_rx : std_logic; signal uart_rx_d1 : std_logic; -- rx_uart delayed 1 ( edge detction ) begin -- baud_div is the counts of i_clks per bit period at the baudrate divider_count <= unsigned(i_baud_div); divider_count_div2 <= '0' & divider_count( 15 downto 1 ); -- shift left by 1 (divide by 1) o_uart_tx <= uart_tx; -- register for output.. o_tx_send_busy <= tx_byte_valid; o_rx_read <= rx_byte_last; o_rx_read_valid <= rx_byte_last_valid; ---------------------------------------------------------------------- -- Receive State Machines -- Chain of affectors -- rx_start_dectector -> rx_sample_timing_gen -> rx_byte_builder -- -- with TTL serial interface following the RS232 timing format, -- when there is no data, the line should idle as a '1' -- The start of a byte transmission always starts with a start bit '0' -- which last 1 bit period in length ( 1/baudrate ) -- -- The rx_start_detector detect's when a falling_edge occurs on rx_uart. -- if the rx_sample_timing_gen is in state 0, it will start generating -- the sampling clock enables when rx_start_det = '1'. -- -- The rx_byte_builder receives the sample_ce sigals from the sample -- timing generator and shifts in the value of the rx_uart line on -- each clock enable building a byte. -- -- Note that the rx_sample_timing_gen does not produces a sample_ce -- for the start or stop bits. -- -- In RS232 TTL levels, > 2.5v is a '0' and < 2.5v is a '1'. -- serial data is transmited as LSB first. -- -- ** Top Level interaction Note: -- -- There is no real output buffering going on in this code. -- if we finish receiving a incomming byte and the last working byte -- has not been read yet, we will overwrite it transparently. -- ( On overflow, ew drop the oldest data ) -- -- This shouldn't really be a big issue since the update rate is -- very slow (500+ clock cycles) for each byte. It is assmed -- that upper level components will read the byte as soon as -- it is available and perform there own buffering if needed. -------------------------------------------------------------------------- -- detect start bit rx_start_detector : process( i_clk ) begin if ( rising_edge( i_clk ) ) then if ( i_srst = '1' ) then uart_rx_d1 <= '1'; uart_rx <= i_uart_rx; -- flop to resync to clock domain. else uart_rx <= i_uart_rx; uart_rx_d1 <= uart_rx; -- detect falling edge on uart_rx if ( (uart_rx_d1 = '1') and ( uart_rx = '0' ) ) then rx_start_det <= '1'; -- rising_edge detected -- this will go high on other bits in the byte received, but the -- receive state machine will be active and ignore these pulses. else rx_start_det <= '0'; -- no rising_edge detected end if; end if; end if; end process; -- rx sample ce generator rx_sample_timing_gen : process( i_clk ) begin if ( rising_edge( i_clk ) ) then if ( i_srst = '1' ) then rx_symbol_ce <= '0'; rx_symbol_count <= (others=>'0'); rx_gen_state <= 0; rx_symbol_complete <= '0'; else case rx_gen_state is when 0 => -- waiting for start detect rx_symbol_ce <= '0'; rx_symbol_complete <= '0'; if ( rx_start_det = '1' ) then rx_gen_state <= 1; -- rising_edge detected (ignored for reset of byte receive) end if; when 1 => -- need to wait 1/2 a symbol period if ( rx_symbol_count = divider_count_div2 ) then -- done! rx_symbol_count <= (others=>'0'); -- reset bit period counter rx_gen_state <= 2; else -- increment counter rx_symbol_count <= rx_symbol_count + 1; -- stay in this state.. until symbol count is reached end if; when 2 => -- half way into the start bit... -- test to see if we still see the start bit (rx_uart = 0) if ( uart_rx = '0' ) then rx_gen_state <= 3; else rx_gen_state <= 0; -- fail, go back, look for falling edge again.. end if; when 3 => -- need to wait 1 symbol period ad signal to sample bit0 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 4; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 4 => -- need to wait 1 symbol period and signal to sample bit1 if ( rx_symbol_count = divider_count ) then -- sample bit rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 5; else -- wait rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 5 => -- need to wait 1 symbol period and signal to sample bit2 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 6; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 6 => -- need to wait 1 symbol period and signal to sample bit3 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 7; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 7 => -- need to wait 1 symbol period and signal to sample bit4 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 8; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 8 => -- need to wait 1 symbol period and signal to sample bit5 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 9; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 9 => -- need to wait 1 symbol period and signal to sample bit6 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 10; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 10 => -- need to wait 1 symbol period and signal to sample bit7 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 11; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 11 => -- wait for stop bit, before resetting -- this stops a stuck '1' line from spitting out a bunch of 0xff's -- wait until the line goes idle.. if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '0'; if ( uart_rx = '1' ) then rx_symbol_complete <= '1'; rx_gen_state <= 0; -- ready for next byte end if; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when others => rx_gen_state <= 0; -- should never happen, reset if it does. end case; end if; end if; end process; rx_sym_delay1 : process( i_clk ) begin if ( rising_edge(i_clk) ) then -- delay 1 clock cycle rx_symbol_complete_d1 <= rx_symbol_complete; end if; end process; rx_byte_builder : process ( i_clk ) begin if ( rising_edge( i_clk ) ) then if ( i_srst = '1' ) then -- reset rx_byte_working <= (others=>'0'); rx_byte_last_valid <= '0'; rx_byte_last <= (others=>'0'); else if (rx_symbol_ce = '1' ) then -- shift in new input symbol rx_byte_working <= uart_rx & rx_byte_working(7 downto 1); end if; -- complete_d1 will be 1 clock cycle after rx_symbol_ce for bit 7 if ( rx_symbol_complete_d1 = '1' ) then -- byte complete rx_byte_last <= rx_byte_working; rx_byte_last_valid <= '1'; end if; -- handle rx_byte_last reads if ( rx_byte_last_valid = '1' ) then if ( i_rx_read_rd = '1' ) then rx_byte_last_valid <= '0'; -- reset valid flag for next byte. end if; end if; end if; end if; end process; ------------------------------------------------------------------------- -- ** Transmit State Machine -- * Chain of affectors -- tx_timing_generator -> tx_state_machine -> tx_shift_register -- tx_handler ----^ -- -- The tx_timing_generate just takes the i_clk signal and divides down -- to get the serial bit timing. This is feed to the tx_state_machine -- to control what bit is being transmitted. -- -- tx_state_machine checks to see if tx_byte_valid is a 1. -- This will cause the state machine to load the tx_shift_register -- with the new byte and to shift it own with a start bit prepended. -- -- The tx_handler is reponsible for handling input from a higher level (UI) -- ------------------------------------------------------------------------- -- generater tx bit period clock enable signal tx_symbol_ce -- (clock divider) tx_timing_generator : process( i_clk ) begin if ( rising_edge( i_clk )) then if ( i_srst = '1' ) then tx_symbol_count <= (others=>'0'); else if ( tx_symbol_count = divider_count ) then tx_symbol_ce <= '1'; tx_symbol_count <= (others=>'0'); else tx_symbol_ce <= '0'; tx_symbol_count <= tx_symbol_count + 1; end if; end if; end if; end process; -- transmit state machine tx_state_machine : process( i_clk ) begin if ( rising_edge( i_clk) ) then if ( i_srst = '1' ) then tx_gen_state <= 0; tx_active <= '0'; uart_tx <= '1'; -- idle state --tx_complete <= '0'; else case tx_gen_state is when 0 => -- waiting for a tx byte to be ready to send --tx_complete <= '0'; if ( tx_byte_valid = '1' ) then -- got a byte to send, progress though states tx_gen_state <= 1; tx_byte_working <= tx_byte_next; tx_active <= '1'; -- signal to tx_handler we have latched in the next byte and are going to start sending it. else tx_gen_state <= 0; tx_active <= '0'; uart_tx <= '1'; -- idle end if; when 1 => -- wait for a clock enable if ( tx_symbol_ce = '1' ) then -- send start bit uart_tx <= '0'; tx_gen_state <= 2; else -- wait for clk enable tx_gen_state <= 1; end if; when 2 => -- wait for clock enable then send bit 0 if ( tx_symbol_ce = '1' ) then -- send bit 1 uart_tx <= tx_byte_working(0); tx_gen_state <= 3; else tx_gen_state <= 2; end if; when 3 => -- wait for clock enable then send bit 1 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(1); tx_gen_state <= 4; else tx_gen_state <= 3; end if; when 4 => -- wait for clock enable send bit 2 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(2); tx_gen_state <= 5; else tx_gen_state <= 4; end if; when 5 => -- wait for clock enable send bit 3 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(3); tx_gen_state <= 6; else tx_gen_state <= 5; end if; when 6 => -- wait for clock enable send bit 4 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(4); tx_gen_state <= 7; else tx_gen_state <= 6; end if; when 7 => -- wait for clock enable send bit 5 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(5); tx_gen_state <= 8; else tx_gen_state <= 7; end if; when 8 => -- wait for clock enable send bit 6 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(6); tx_gen_state <= 9; else tx_gen_state <= 8; end if; when 9 => -- wait for clock eanble, send bit 7 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(7); tx_gen_state <= 10; else tx_gen_state <= 9; end if; when 10 => -- send stop bit on next clock enable if ( tx_symbol_ce = '1' ) then uart_tx <= '1'; tx_gen_state <= 11; else tx_gen_state <= 10; end if; when 11 => -- signal complete with transmit -- finish stop bit period if ( tx_symbol_ce = '1' ) then tx_gen_state <= 0; --tx_complete <= '1'; end if; when others => tx_gen_state <= 0; -- should never get here.. end case; end if; end if; end process; -- tx input byte buffer handler -- handle UI to working_byte transfersin tx_handler : process( i_clk ) begin if ( rising_edge( i_clk ) ) then if ( i_srst = '1' ) then tx_byte_valid <= '0'; else -- handle new bytes comming in to transmit if ( i_tx_send_we = '1' ) then if ( tx_byte_valid = '0' ) then -- we can accept a new byte in. tx_byte_next <= i_tx_send; tx_byte_valid <= '1'; -- signal to tx state machine there is data ready to send -- note: o_tx_send_busy <= tx_byte_valid end if; end if; -- clear event to load new incomming bytes. if ( tx_byte_valid = '1' ) then if ( tx_active = '1' ) then -- tx state machine sucked in the byte_next tx_byte_valid <= '0'; -- next byte no longer valid, can accept a new data byte to go next. end if; end if; end if; end if; end process; end architecture Behavioral;
-------------------------------------------------------------------------- -- uart.vhd -- Simple RS232 like uart tx/rx design -- Does not handle any flow control. -- Does not perform any meaning full buffering. -- -- Peter Fetterer <[email protected]> -------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; entity uart is Port ( i_clk : in std_logic; -- system clock i_srst : in std_logic; -- synchronious reset, 1 - active i_baud_div : in std_logic_vector(15 downto 0); -- clk divider to get to baud rate -- UART Interface o_uart_tx : out std_logic; -- tx bit stream i_uart_rx : in std_logic; -- uart rx bit stream input -- FPGA Side i_tx_send : in std_logic_vector(7 downto 0); -- data byte in i_tx_send_we : in std_logic; -- write enable o_tx_send_busy : out std_logic; -- tx is busy, writes are ignored. o_rx_read : out std_logic_vector(7 downto 0); -- data byte out o_rx_read_valid : out std_logic; -- read data valid this clock cycle i_rx_read_rd : in std_logic -- read request, get next byte.. ); end entity uart; architecture Behavioral of uart is -- holding registers (buffer, 1 byte deep) signal rx_byte_last : std_logic_vector( 7 downto 0 ); -- buffer byte next byte to receive signal rx_byte_last_valid : std_logic; -- if rx_byte_complete is holding a valid byte signal rx_byte_working : std_logic_vector( 7 downto 0 ); -- working space for symbols be received signal tx_byte_next : std_logic_vector(7 downto 0 ); -- next byte to send signal tx_byte_valid : std_logic; -- if tx_byte_next is holding a valid byte signal tx_byte_working : std_logic_vector( 7 downto 0 ); -- working byte being transmitted -- baud divider stuff signal divider_count : unsigned( 15 downto 0); -- symbol period signal divider_count_div2 : unsigned( 15 downto 0); -- 1/2 symbol period signal rx_symbol_count : unsigned( 15 downto 0); -- rx clk count periods signal rx_gen_state : integer; signal tx_symbol_count : unsigned( 15 downto 0); -- tx clk count periods signal tx_gen_state : integer; signal tx_active : std_logic; signal uart_tx : std_logic; signal rx_start_det : std_logic; -- signals that we detected the rising edge of a start bit. (start symbol_ce) signal rx_symbol_ce : std_logic; -- clock enable on rx symbol sample signal rx_symbol_complete : std_logic; -- last bit being received this clock enable signal rx_symbol_complete_d1 : std_logic; -- delayed 1 clock signal tx_symbol_ce : std_logic; -- clock enable on tx symbol sample --signal tx_complete : std_logic; -- finished sending working byte signal uart_rx : std_logic; signal uart_rx_d1 : std_logic; -- rx_uart delayed 1 ( edge detction ) begin -- baud_div is the counts of i_clks per bit period at the baudrate divider_count <= unsigned(i_baud_div); divider_count_div2 <= '0' & divider_count( 15 downto 1 ); -- shift left by 1 (divide by 1) o_uart_tx <= uart_tx; -- register for output.. o_tx_send_busy <= tx_byte_valid; o_rx_read <= rx_byte_last; o_rx_read_valid <= rx_byte_last_valid; ---------------------------------------------------------------------- -- Receive State Machines -- Chain of affectors -- rx_start_dectector -> rx_sample_timing_gen -> rx_byte_builder -- -- with TTL serial interface following the RS232 timing format, -- when there is no data, the line should idle as a '1' -- The start of a byte transmission always starts with a start bit '0' -- which last 1 bit period in length ( 1/baudrate ) -- -- The rx_start_detector detect's when a falling_edge occurs on rx_uart. -- if the rx_sample_timing_gen is in state 0, it will start generating -- the sampling clock enables when rx_start_det = '1'. -- -- The rx_byte_builder receives the sample_ce sigals from the sample -- timing generator and shifts in the value of the rx_uart line on -- each clock enable building a byte. -- -- Note that the rx_sample_timing_gen does not produces a sample_ce -- for the start or stop bits. -- -- In RS232 TTL levels, > 2.5v is a '0' and < 2.5v is a '1'. -- serial data is transmited as LSB first. -- -- ** Top Level interaction Note: -- -- There is no real output buffering going on in this code. -- if we finish receiving a incomming byte and the last working byte -- has not been read yet, we will overwrite it transparently. -- ( On overflow, ew drop the oldest data ) -- -- This shouldn't really be a big issue since the update rate is -- very slow (500+ clock cycles) for each byte. It is assmed -- that upper level components will read the byte as soon as -- it is available and perform there own buffering if needed. -------------------------------------------------------------------------- -- detect start bit rx_start_detector : process( i_clk ) begin if ( rising_edge( i_clk ) ) then if ( i_srst = '1' ) then uart_rx_d1 <= '1'; uart_rx <= i_uart_rx; -- flop to resync to clock domain. else uart_rx <= i_uart_rx; uart_rx_d1 <= uart_rx; -- detect falling edge on uart_rx if ( (uart_rx_d1 = '1') and ( uart_rx = '0' ) ) then rx_start_det <= '1'; -- rising_edge detected -- this will go high on other bits in the byte received, but the -- receive state machine will be active and ignore these pulses. else rx_start_det <= '0'; -- no rising_edge detected end if; end if; end if; end process; -- rx sample ce generator rx_sample_timing_gen : process( i_clk ) begin if ( rising_edge( i_clk ) ) then if ( i_srst = '1' ) then rx_symbol_ce <= '0'; rx_symbol_count <= (others=>'0'); rx_gen_state <= 0; rx_symbol_complete <= '0'; else case rx_gen_state is when 0 => -- waiting for start detect rx_symbol_ce <= '0'; rx_symbol_complete <= '0'; if ( rx_start_det = '1' ) then rx_gen_state <= 1; -- rising_edge detected (ignored for reset of byte receive) end if; when 1 => -- need to wait 1/2 a symbol period if ( rx_symbol_count = divider_count_div2 ) then -- done! rx_symbol_count <= (others=>'0'); -- reset bit period counter rx_gen_state <= 2; else -- increment counter rx_symbol_count <= rx_symbol_count + 1; -- stay in this state.. until symbol count is reached end if; when 2 => -- half way into the start bit... -- test to see if we still see the start bit (rx_uart = 0) if ( uart_rx = '0' ) then rx_gen_state <= 3; else rx_gen_state <= 0; -- fail, go back, look for falling edge again.. end if; when 3 => -- need to wait 1 symbol period ad signal to sample bit0 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 4; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 4 => -- need to wait 1 symbol period and signal to sample bit1 if ( rx_symbol_count = divider_count ) then -- sample bit rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 5; else -- wait rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 5 => -- need to wait 1 symbol period and signal to sample bit2 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 6; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 6 => -- need to wait 1 symbol period and signal to sample bit3 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 7; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 7 => -- need to wait 1 symbol period and signal to sample bit4 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 8; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 8 => -- need to wait 1 symbol period and signal to sample bit5 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 9; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 9 => -- need to wait 1 symbol period and signal to sample bit6 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 10; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 10 => -- need to wait 1 symbol period and signal to sample bit7 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 11; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 11 => -- wait for stop bit, before resetting -- this stops a stuck '1' line from spitting out a bunch of 0xff's -- wait until the line goes idle.. if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '0'; if ( uart_rx = '1' ) then rx_symbol_complete <= '1'; rx_gen_state <= 0; -- ready for next byte end if; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when others => rx_gen_state <= 0; -- should never happen, reset if it does. end case; end if; end if; end process; rx_sym_delay1 : process( i_clk ) begin if ( rising_edge(i_clk) ) then -- delay 1 clock cycle rx_symbol_complete_d1 <= rx_symbol_complete; end if; end process; rx_byte_builder : process ( i_clk ) begin if ( rising_edge( i_clk ) ) then if ( i_srst = '1' ) then -- reset rx_byte_working <= (others=>'0'); rx_byte_last_valid <= '0'; rx_byte_last <= (others=>'0'); else if (rx_symbol_ce = '1' ) then -- shift in new input symbol rx_byte_working <= uart_rx & rx_byte_working(7 downto 1); end if; -- complete_d1 will be 1 clock cycle after rx_symbol_ce for bit 7 if ( rx_symbol_complete_d1 = '1' ) then -- byte complete rx_byte_last <= rx_byte_working; rx_byte_last_valid <= '1'; end if; -- handle rx_byte_last reads if ( rx_byte_last_valid = '1' ) then if ( i_rx_read_rd = '1' ) then rx_byte_last_valid <= '0'; -- reset valid flag for next byte. end if; end if; end if; end if; end process; ------------------------------------------------------------------------- -- ** Transmit State Machine -- * Chain of affectors -- tx_timing_generator -> tx_state_machine -> tx_shift_register -- tx_handler ----^ -- -- The tx_timing_generate just takes the i_clk signal and divides down -- to get the serial bit timing. This is feed to the tx_state_machine -- to control what bit is being transmitted. -- -- tx_state_machine checks to see if tx_byte_valid is a 1. -- This will cause the state machine to load the tx_shift_register -- with the new byte and to shift it own with a start bit prepended. -- -- The tx_handler is reponsible for handling input from a higher level (UI) -- ------------------------------------------------------------------------- -- generater tx bit period clock enable signal tx_symbol_ce -- (clock divider) tx_timing_generator : process( i_clk ) begin if ( rising_edge( i_clk )) then if ( i_srst = '1' ) then tx_symbol_count <= (others=>'0'); else if ( tx_symbol_count = divider_count ) then tx_symbol_ce <= '1'; tx_symbol_count <= (others=>'0'); else tx_symbol_ce <= '0'; tx_symbol_count <= tx_symbol_count + 1; end if; end if; end if; end process; -- transmit state machine tx_state_machine : process( i_clk ) begin if ( rising_edge( i_clk) ) then if ( i_srst = '1' ) then tx_gen_state <= 0; tx_active <= '0'; uart_tx <= '1'; -- idle state --tx_complete <= '0'; else case tx_gen_state is when 0 => -- waiting for a tx byte to be ready to send --tx_complete <= '0'; if ( tx_byte_valid = '1' ) then -- got a byte to send, progress though states tx_gen_state <= 1; tx_byte_working <= tx_byte_next; tx_active <= '1'; -- signal to tx_handler we have latched in the next byte and are going to start sending it. else tx_gen_state <= 0; tx_active <= '0'; uart_tx <= '1'; -- idle end if; when 1 => -- wait for a clock enable if ( tx_symbol_ce = '1' ) then -- send start bit uart_tx <= '0'; tx_gen_state <= 2; else -- wait for clk enable tx_gen_state <= 1; end if; when 2 => -- wait for clock enable then send bit 0 if ( tx_symbol_ce = '1' ) then -- send bit 1 uart_tx <= tx_byte_working(0); tx_gen_state <= 3; else tx_gen_state <= 2; end if; when 3 => -- wait for clock enable then send bit 1 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(1); tx_gen_state <= 4; else tx_gen_state <= 3; end if; when 4 => -- wait for clock enable send bit 2 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(2); tx_gen_state <= 5; else tx_gen_state <= 4; end if; when 5 => -- wait for clock enable send bit 3 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(3); tx_gen_state <= 6; else tx_gen_state <= 5; end if; when 6 => -- wait for clock enable send bit 4 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(4); tx_gen_state <= 7; else tx_gen_state <= 6; end if; when 7 => -- wait for clock enable send bit 5 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(5); tx_gen_state <= 8; else tx_gen_state <= 7; end if; when 8 => -- wait for clock enable send bit 6 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(6); tx_gen_state <= 9; else tx_gen_state <= 8; end if; when 9 => -- wait for clock eanble, send bit 7 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(7); tx_gen_state <= 10; else tx_gen_state <= 9; end if; when 10 => -- send stop bit on next clock enable if ( tx_symbol_ce = '1' ) then uart_tx <= '1'; tx_gen_state <= 11; else tx_gen_state <= 10; end if; when 11 => -- signal complete with transmit -- finish stop bit period if ( tx_symbol_ce = '1' ) then tx_gen_state <= 0; --tx_complete <= '1'; end if; when others => tx_gen_state <= 0; -- should never get here.. end case; end if; end if; end process; -- tx input byte buffer handler -- handle UI to working_byte transfersin tx_handler : process( i_clk ) begin if ( rising_edge( i_clk ) ) then if ( i_srst = '1' ) then tx_byte_valid <= '0'; else -- handle new bytes comming in to transmit if ( i_tx_send_we = '1' ) then if ( tx_byte_valid = '0' ) then -- we can accept a new byte in. tx_byte_next <= i_tx_send; tx_byte_valid <= '1'; -- signal to tx state machine there is data ready to send -- note: o_tx_send_busy <= tx_byte_valid end if; end if; -- clear event to load new incomming bytes. if ( tx_byte_valid = '1' ) then if ( tx_active = '1' ) then -- tx state machine sucked in the byte_next tx_byte_valid <= '0'; -- next byte no longer valid, can accept a new data byte to go next. end if; end if; end if; end if; end process; end architecture Behavioral;
-------------------------------------------------------------------------- -- uart.vhd -- Simple RS232 like uart tx/rx design -- Does not handle any flow control. -- Does not perform any meaning full buffering. -- -- Peter Fetterer <[email protected]> -------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; entity uart is Port ( i_clk : in std_logic; -- system clock i_srst : in std_logic; -- synchronious reset, 1 - active i_baud_div : in std_logic_vector(15 downto 0); -- clk divider to get to baud rate -- UART Interface o_uart_tx : out std_logic; -- tx bit stream i_uart_rx : in std_logic; -- uart rx bit stream input -- FPGA Side i_tx_send : in std_logic_vector(7 downto 0); -- data byte in i_tx_send_we : in std_logic; -- write enable o_tx_send_busy : out std_logic; -- tx is busy, writes are ignored. o_rx_read : out std_logic_vector(7 downto 0); -- data byte out o_rx_read_valid : out std_logic; -- read data valid this clock cycle i_rx_read_rd : in std_logic -- read request, get next byte.. ); end entity uart; architecture Behavioral of uart is -- holding registers (buffer, 1 byte deep) signal rx_byte_last : std_logic_vector( 7 downto 0 ); -- buffer byte next byte to receive signal rx_byte_last_valid : std_logic; -- if rx_byte_complete is holding a valid byte signal rx_byte_working : std_logic_vector( 7 downto 0 ); -- working space for symbols be received signal tx_byte_next : std_logic_vector(7 downto 0 ); -- next byte to send signal tx_byte_valid : std_logic; -- if tx_byte_next is holding a valid byte signal tx_byte_working : std_logic_vector( 7 downto 0 ); -- working byte being transmitted -- baud divider stuff signal divider_count : unsigned( 15 downto 0); -- symbol period signal divider_count_div2 : unsigned( 15 downto 0); -- 1/2 symbol period signal rx_symbol_count : unsigned( 15 downto 0); -- rx clk count periods signal rx_gen_state : integer; signal tx_symbol_count : unsigned( 15 downto 0); -- tx clk count periods signal tx_gen_state : integer; signal tx_active : std_logic; signal uart_tx : std_logic; signal rx_start_det : std_logic; -- signals that we detected the rising edge of a start bit. (start symbol_ce) signal rx_symbol_ce : std_logic; -- clock enable on rx symbol sample signal rx_symbol_complete : std_logic; -- last bit being received this clock enable signal rx_symbol_complete_d1 : std_logic; -- delayed 1 clock signal tx_symbol_ce : std_logic; -- clock enable on tx symbol sample --signal tx_complete : std_logic; -- finished sending working byte signal uart_rx : std_logic; signal uart_rx_d1 : std_logic; -- rx_uart delayed 1 ( edge detction ) begin -- baud_div is the counts of i_clks per bit period at the baudrate divider_count <= unsigned(i_baud_div); divider_count_div2 <= '0' & divider_count( 15 downto 1 ); -- shift left by 1 (divide by 1) o_uart_tx <= uart_tx; -- register for output.. o_tx_send_busy <= tx_byte_valid; o_rx_read <= rx_byte_last; o_rx_read_valid <= rx_byte_last_valid; ---------------------------------------------------------------------- -- Receive State Machines -- Chain of affectors -- rx_start_dectector -> rx_sample_timing_gen -> rx_byte_builder -- -- with TTL serial interface following the RS232 timing format, -- when there is no data, the line should idle as a '1' -- The start of a byte transmission always starts with a start bit '0' -- which last 1 bit period in length ( 1/baudrate ) -- -- The rx_start_detector detect's when a falling_edge occurs on rx_uart. -- if the rx_sample_timing_gen is in state 0, it will start generating -- the sampling clock enables when rx_start_det = '1'. -- -- The rx_byte_builder receives the sample_ce sigals from the sample -- timing generator and shifts in the value of the rx_uart line on -- each clock enable building a byte. -- -- Note that the rx_sample_timing_gen does not produces a sample_ce -- for the start or stop bits. -- -- In RS232 TTL levels, > 2.5v is a '0' and < 2.5v is a '1'. -- serial data is transmited as LSB first. -- -- ** Top Level interaction Note: -- -- There is no real output buffering going on in this code. -- if we finish receiving a incomming byte and the last working byte -- has not been read yet, we will overwrite it transparently. -- ( On overflow, ew drop the oldest data ) -- -- This shouldn't really be a big issue since the update rate is -- very slow (500+ clock cycles) for each byte. It is assmed -- that upper level components will read the byte as soon as -- it is available and perform there own buffering if needed. -------------------------------------------------------------------------- -- detect start bit rx_start_detector : process( i_clk ) begin if ( rising_edge( i_clk ) ) then if ( i_srst = '1' ) then uart_rx_d1 <= '1'; uart_rx <= i_uart_rx; -- flop to resync to clock domain. else uart_rx <= i_uart_rx; uart_rx_d1 <= uart_rx; -- detect falling edge on uart_rx if ( (uart_rx_d1 = '1') and ( uart_rx = '0' ) ) then rx_start_det <= '1'; -- rising_edge detected -- this will go high on other bits in the byte received, but the -- receive state machine will be active and ignore these pulses. else rx_start_det <= '0'; -- no rising_edge detected end if; end if; end if; end process; -- rx sample ce generator rx_sample_timing_gen : process( i_clk ) begin if ( rising_edge( i_clk ) ) then if ( i_srst = '1' ) then rx_symbol_ce <= '0'; rx_symbol_count <= (others=>'0'); rx_gen_state <= 0; rx_symbol_complete <= '0'; else case rx_gen_state is when 0 => -- waiting for start detect rx_symbol_ce <= '0'; rx_symbol_complete <= '0'; if ( rx_start_det = '1' ) then rx_gen_state <= 1; -- rising_edge detected (ignored for reset of byte receive) end if; when 1 => -- need to wait 1/2 a symbol period if ( rx_symbol_count = divider_count_div2 ) then -- done! rx_symbol_count <= (others=>'0'); -- reset bit period counter rx_gen_state <= 2; else -- increment counter rx_symbol_count <= rx_symbol_count + 1; -- stay in this state.. until symbol count is reached end if; when 2 => -- half way into the start bit... -- test to see if we still see the start bit (rx_uart = 0) if ( uart_rx = '0' ) then rx_gen_state <= 3; else rx_gen_state <= 0; -- fail, go back, look for falling edge again.. end if; when 3 => -- need to wait 1 symbol period ad signal to sample bit0 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 4; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 4 => -- need to wait 1 symbol period and signal to sample bit1 if ( rx_symbol_count = divider_count ) then -- sample bit rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 5; else -- wait rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 5 => -- need to wait 1 symbol period and signal to sample bit2 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 6; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 6 => -- need to wait 1 symbol period and signal to sample bit3 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 7; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 7 => -- need to wait 1 symbol period and signal to sample bit4 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 8; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 8 => -- need to wait 1 symbol period and signal to sample bit5 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 9; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 9 => -- need to wait 1 symbol period and signal to sample bit6 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 10; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 10 => -- need to wait 1 symbol period and signal to sample bit7 if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '1'; -- sample bit.. rx_gen_state <= 11; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when 11 => -- wait for stop bit, before resetting -- this stops a stuck '1' line from spitting out a bunch of 0xff's -- wait until the line goes idle.. if ( rx_symbol_count = divider_count ) then rx_symbol_count <= (others=>'0'); rx_symbol_ce <= '0'; if ( uart_rx = '1' ) then rx_symbol_complete <= '1'; rx_gen_state <= 0; -- ready for next byte end if; else rx_symbol_count <= rx_symbol_count + 1; rx_symbol_ce <= '0'; end if; when others => rx_gen_state <= 0; -- should never happen, reset if it does. end case; end if; end if; end process; rx_sym_delay1 : process( i_clk ) begin if ( rising_edge(i_clk) ) then -- delay 1 clock cycle rx_symbol_complete_d1 <= rx_symbol_complete; end if; end process; rx_byte_builder : process ( i_clk ) begin if ( rising_edge( i_clk ) ) then if ( i_srst = '1' ) then -- reset rx_byte_working <= (others=>'0'); rx_byte_last_valid <= '0'; rx_byte_last <= (others=>'0'); else if (rx_symbol_ce = '1' ) then -- shift in new input symbol rx_byte_working <= uart_rx & rx_byte_working(7 downto 1); end if; -- complete_d1 will be 1 clock cycle after rx_symbol_ce for bit 7 if ( rx_symbol_complete_d1 = '1' ) then -- byte complete rx_byte_last <= rx_byte_working; rx_byte_last_valid <= '1'; end if; -- handle rx_byte_last reads if ( rx_byte_last_valid = '1' ) then if ( i_rx_read_rd = '1' ) then rx_byte_last_valid <= '0'; -- reset valid flag for next byte. end if; end if; end if; end if; end process; ------------------------------------------------------------------------- -- ** Transmit State Machine -- * Chain of affectors -- tx_timing_generator -> tx_state_machine -> tx_shift_register -- tx_handler ----^ -- -- The tx_timing_generate just takes the i_clk signal and divides down -- to get the serial bit timing. This is feed to the tx_state_machine -- to control what bit is being transmitted. -- -- tx_state_machine checks to see if tx_byte_valid is a 1. -- This will cause the state machine to load the tx_shift_register -- with the new byte and to shift it own with a start bit prepended. -- -- The tx_handler is reponsible for handling input from a higher level (UI) -- ------------------------------------------------------------------------- -- generater tx bit period clock enable signal tx_symbol_ce -- (clock divider) tx_timing_generator : process( i_clk ) begin if ( rising_edge( i_clk )) then if ( i_srst = '1' ) then tx_symbol_count <= (others=>'0'); else if ( tx_symbol_count = divider_count ) then tx_symbol_ce <= '1'; tx_symbol_count <= (others=>'0'); else tx_symbol_ce <= '0'; tx_symbol_count <= tx_symbol_count + 1; end if; end if; end if; end process; -- transmit state machine tx_state_machine : process( i_clk ) begin if ( rising_edge( i_clk) ) then if ( i_srst = '1' ) then tx_gen_state <= 0; tx_active <= '0'; uart_tx <= '1'; -- idle state --tx_complete <= '0'; else case tx_gen_state is when 0 => -- waiting for a tx byte to be ready to send --tx_complete <= '0'; if ( tx_byte_valid = '1' ) then -- got a byte to send, progress though states tx_gen_state <= 1; tx_byte_working <= tx_byte_next; tx_active <= '1'; -- signal to tx_handler we have latched in the next byte and are going to start sending it. else tx_gen_state <= 0; tx_active <= '0'; uart_tx <= '1'; -- idle end if; when 1 => -- wait for a clock enable if ( tx_symbol_ce = '1' ) then -- send start bit uart_tx <= '0'; tx_gen_state <= 2; else -- wait for clk enable tx_gen_state <= 1; end if; when 2 => -- wait for clock enable then send bit 0 if ( tx_symbol_ce = '1' ) then -- send bit 1 uart_tx <= tx_byte_working(0); tx_gen_state <= 3; else tx_gen_state <= 2; end if; when 3 => -- wait for clock enable then send bit 1 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(1); tx_gen_state <= 4; else tx_gen_state <= 3; end if; when 4 => -- wait for clock enable send bit 2 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(2); tx_gen_state <= 5; else tx_gen_state <= 4; end if; when 5 => -- wait for clock enable send bit 3 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(3); tx_gen_state <= 6; else tx_gen_state <= 5; end if; when 6 => -- wait for clock enable send bit 4 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(4); tx_gen_state <= 7; else tx_gen_state <= 6; end if; when 7 => -- wait for clock enable send bit 5 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(5); tx_gen_state <= 8; else tx_gen_state <= 7; end if; when 8 => -- wait for clock enable send bit 6 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(6); tx_gen_state <= 9; else tx_gen_state <= 8; end if; when 9 => -- wait for clock eanble, send bit 7 if ( tx_symbol_ce = '1' ) then uart_tx <= tx_byte_working(7); tx_gen_state <= 10; else tx_gen_state <= 9; end if; when 10 => -- send stop bit on next clock enable if ( tx_symbol_ce = '1' ) then uart_tx <= '1'; tx_gen_state <= 11; else tx_gen_state <= 10; end if; when 11 => -- signal complete with transmit -- finish stop bit period if ( tx_symbol_ce = '1' ) then tx_gen_state <= 0; --tx_complete <= '1'; end if; when others => tx_gen_state <= 0; -- should never get here.. end case; end if; end if; end process; -- tx input byte buffer handler -- handle UI to working_byte transfersin tx_handler : process( i_clk ) begin if ( rising_edge( i_clk ) ) then if ( i_srst = '1' ) then tx_byte_valid <= '0'; else -- handle new bytes comming in to transmit if ( i_tx_send_we = '1' ) then if ( tx_byte_valid = '0' ) then -- we can accept a new byte in. tx_byte_next <= i_tx_send; tx_byte_valid <= '1'; -- signal to tx state machine there is data ready to send -- note: o_tx_send_busy <= tx_byte_valid end if; end if; -- clear event to load new incomming bytes. if ( tx_byte_valid = '1' ) then if ( tx_active = '1' ) then -- tx state machine sucked in the byte_next tx_byte_valid <= '0'; -- next byte no longer valid, can accept a new data byte to go next. end if; end if; end if; end if; end process; end architecture Behavioral;
-- $Id: sys_conf1.vhd 1181 2019-07-08 17:00:50Z mueller $ -- SPDX-License-Identifier: GPL-3.0-or-later -- Copyright 2011- by Walter F.J. Mueller <[email protected]> -- ------------------------------------------------------------------------------ -- Package Name: sys_conf -- Description: Definitions for sys_tst_serloop1_n3 (for synthesis) -- -- Dependencies: - -- Tool versions: xst 13.1-14.7; ghdl 0.29-0.31 -- Revision History: -- Date Rev Version Comment -- 2011-12-09 438 1.0 Initial version ------------------------------------------------------------------------------ library ieee; use ieee.std_logic_1164.all; use work.slvtypes.all; package sys_conf is constant sys_conf_clkdiv_usecdiv : integer := 100; -- default usec constant sys_conf_clkdiv_msecdiv : integer := 1000; -- default msec constant sys_conf_hio_debounce : boolean := true; -- instantiate debouncers constant sys_conf_uart_cdinit : integer := 868-1; -- 100000000/115200 end package sys_conf;
entity sub1 is end entity; architecture a of sub1 is begin end architecture; ------------------------------------------------------------------------------- entity sub2 is end entity; architecture a of sub2 is begin end architecture; ------------------------------------------------------------------------------- entity top is end entity; architecture a of top is component comp is end component; component not_used is end component; for others : not_used use entity work.sub2(a); -- Crash from Billowitch tc3114 begin c1: component comp; end architecture; ------------------------------------------------------------------------------- configuration conf of top is for a for c1 : comp use entity work.sub2(a); end for; end for; end configuration;