content
stringlengths
1
1.04M
architecture RTL of FIFO is procedure PROC1 is begin end procedure proc1; PROCEDURE PROC1 IS BEGIN END PROCEDURE PROC1; begin end architecture RTL;
library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.NUMERIC_STD.all; library std; entity prewitt_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 prewitt_process; architecture rtl of prewitt_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; prod_dv <= '0'; if(matrix_dv = '1' and enable_s = '1') then prod00 <= "11111110" * signed('0' & p00); prod01 <= "11111111" * signed('0' & p01); prod02 <= "00000000" * signed('0' & p02); prod10 <= "11111111" * signed('0' & p10); prod11 <= "00000000" * signed('0' & p11); prod12 <= "00000001" * signed('0' & p12); prod20 <= "00000000" * signed('0' & p20); prod21 <= "00000001" * signed('0' & p21); prod22 <= "00000010" * 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;
-------------------------------------------------------------------------------- -- -- FIFO Generator Core - core top file for implementation -- -------------------------------------------------------------------------------- -- -- (c) Copyright 2009 - 2010 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: system_axi_vdma_0_wrapper_fifo_generator_v9_1_exdes.vhd -- -- Description: -- This is the FIFO core wrapper with BUFG instances for clock connections. -- -------------------------------------------------------------------------------- -- Library Declarations -------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; library unisim; use unisim.vcomponents.all; -------------------------------------------------------------------------------- -- Entity Declaration -------------------------------------------------------------------------------- entity system_axi_vdma_0_wrapper_fifo_generator_v9_1_exdes is PORT ( CLK : IN std_logic; DATA_COUNT : OUT std_logic_vector(8-1 DOWNTO 0); SRST : IN std_logic; WR_EN : IN std_logic; RD_EN : IN std_logic; DIN : IN std_logic_vector(34-1 DOWNTO 0); DOUT : OUT std_logic_vector(34-1 DOWNTO 0); FULL : OUT std_logic; EMPTY : OUT std_logic); end system_axi_vdma_0_wrapper_fifo_generator_v9_1_exdes; architecture xilinx of system_axi_vdma_0_wrapper_fifo_generator_v9_1_exdes is signal clk_i : std_logic; component system_axi_vdma_0_wrapper_fifo_generator_v9_1 is PORT ( CLK : IN std_logic; DATA_COUNT : OUT std_logic_vector(8-1 DOWNTO 0); SRST : IN std_logic; WR_EN : IN std_logic; RD_EN : IN std_logic; DIN : IN std_logic_vector(34-1 DOWNTO 0); DOUT : OUT std_logic_vector(34-1 DOWNTO 0); FULL : OUT std_logic; EMPTY : OUT std_logic); end component; begin clk_buf: bufg PORT map( i => CLK, o => clk_i ); exdes_inst : system_axi_vdma_0_wrapper_fifo_generator_v9_1 PORT MAP ( CLK => clk_i, DATA_COUNT => data_count, SRST => srst, WR_EN => wr_en, RD_EN => rd_en, DIN => din, DOUT => dout, FULL => full, EMPTY => empty); end xilinx;
LIBRARY IEEE; USE IEEE.std_logic_1164.ALL; USE IEEE.numeric_std.ALL; --dynamically generated, for example loaded from file or builded from unit content ENTITY SimpleComentedUnit3 IS PORT( a : IN STD_LOGIC; b : OUT STD_LOGIC ); END ENTITY; ARCHITECTURE rtl OF SimpleComentedUnit3 IS BEGIN b <= a; END ARCHITECTURE;
-- megafunction wizard: %LPM_COUNTER% -- GENERATION: STANDARD -- VERSION: WM1.0 -- MODULE: lpm_counter -- ============================================================ -- File Name: lpm_counter1.vhd -- Megafunction Name(s): -- lpm_counter -- ============================================================ -- ************************************************************ -- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE! -- -- 6.0 Build 202 06/20/2006 SP 1 SJ Full Version -- ************************************************************ --Copyright (C) 1991-2006 Altera Corporation --Your use of Altera Corporation's design tools, logic functions --and other software and tools, and its AMPP partner logic --functions, and any output files any of the foregoing --(including device programming or simulation files), and any --associated documentation or information are expressly subject --to the terms and conditions of the Altera Program License --Subscription Agreement, Altera MegaCore Function License --Agreement, or other applicable license agreement, including, --without limitation, that your use is for the sole purpose of --programming logic devices manufactured by Altera and sold by --Altera or its authorized distributors. Please refer to the --applicable agreement for further details. LIBRARY ieee; USE ieee.std_logic_1164.all; LIBRARY lpm; USE lpm.all; ENTITY lpm_counter1 IS PORT ( aclr : IN STD_LOGIC ; clock : IN STD_LOGIC ; cnt_en : IN STD_LOGIC ; q : OUT STD_LOGIC_VECTOR (9 DOWNTO 0) ); END lpm_counter1; ARCHITECTURE SYN OF lpm_counter1 IS SIGNAL sub_wire0 : STD_LOGIC_VECTOR (9 DOWNTO 0); COMPONENT lpm_counter GENERIC ( lpm_direction : STRING; lpm_port_updown : STRING; lpm_type : STRING; lpm_width : NATURAL ); PORT ( aclr : IN STD_LOGIC ; clock : IN STD_LOGIC ; q : OUT STD_LOGIC_VECTOR (9 DOWNTO 0); cnt_en : IN STD_LOGIC ); END COMPONENT; BEGIN q <= sub_wire0(9 DOWNTO 0); lpm_counter_component : lpm_counter GENERIC MAP ( lpm_direction => "UP", lpm_port_updown => "PORT_UNUSED", lpm_type => "LPM_COUNTER", lpm_width => 10 ) PORT MAP ( aclr => aclr, clock => clock, cnt_en => cnt_en, q => sub_wire0 ); END SYN; -- ============================================================ -- CNX file retrieval info -- ============================================================ -- Retrieval info: PRIVATE: ACLR NUMERIC "1" -- Retrieval info: PRIVATE: ALOAD NUMERIC "0" -- Retrieval info: PRIVATE: ASET NUMERIC "0" -- Retrieval info: PRIVATE: ASETV NUMERIC "0" -- Retrieval info: PRIVATE: ASET_ALL1 NUMERIC "1" -- Retrieval info: PRIVATE: CLK_EN NUMERIC "0" -- Retrieval info: PRIVATE: CNT_EN NUMERIC "1" -- Retrieval info: PRIVATE: CarryIn NUMERIC "0" -- Retrieval info: PRIVATE: CarryOut NUMERIC "0" -- Retrieval info: PRIVATE: Direction NUMERIC "0" -- Retrieval info: PRIVATE: ModulusCounter NUMERIC "0" -- Retrieval info: PRIVATE: ModulusValue NUMERIC "0" -- Retrieval info: PRIVATE: SCLR NUMERIC "0" -- Retrieval info: PRIVATE: SLOAD NUMERIC "0" -- Retrieval info: PRIVATE: SSET NUMERIC "0" -- Retrieval info: PRIVATE: SSETV NUMERIC "0" -- Retrieval info: PRIVATE: SSET_ALL1 NUMERIC "1" -- Retrieval info: PRIVATE: nBit NUMERIC "10" -- Retrieval info: CONSTANT: LPM_DIRECTION STRING "UP" -- Retrieval info: CONSTANT: LPM_PORT_UPDOWN STRING "PORT_UNUSED" -- Retrieval info: CONSTANT: LPM_TYPE STRING "LPM_COUNTER" -- Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "10" -- Retrieval info: USED_PORT: aclr 0 0 0 0 INPUT NODEFVAL aclr -- Retrieval info: USED_PORT: clock 0 0 0 0 INPUT NODEFVAL clock -- Retrieval info: USED_PORT: cnt_en 0 0 0 0 INPUT NODEFVAL cnt_en -- Retrieval info: USED_PORT: q 0 0 10 0 OUTPUT NODEFVAL q[9..0] -- Retrieval info: CONNECT: @clock 0 0 0 0 clock 0 0 0 0 -- Retrieval info: CONNECT: q 0 0 10 0 @q 0 0 10 0 -- Retrieval info: CONNECT: @cnt_en 0 0 0 0 cnt_en 0 0 0 0 -- Retrieval info: CONNECT: @aclr 0 0 0 0 aclr 0 0 0 0 -- Retrieval info: LIBRARY: lpm lpm.lpm_components.all -- Retrieval info: GEN_FILE: TYPE_NORMAL lpm_counter1.vhd TRUE -- Retrieval info: GEN_FILE: TYPE_NORMAL lpm_counter1.inc FALSE -- Retrieval info: GEN_FILE: TYPE_NORMAL lpm_counter1.cmp TRUE -- Retrieval info: GEN_FILE: TYPE_NORMAL lpm_counter1.bsf TRUE FALSE -- Retrieval info: GEN_FILE: TYPE_NORMAL lpm_counter1_inst.vhd TRUE
-- ------------------------------------------------------------- -- -- File Name: hdl_prj/hdlsrc/hdl_ofdm_tx/TWDLMULT_SDNF1_3_block1.vhd -- Created: 2018-02-27 13:25:18 -- -- Generated by MATLAB 9.3 and HDL Coder 3.11 -- -- ------------------------------------------------------------- -- ------------------------------------------------------------- -- -- Module: TWDLMULT_SDNF1_3_block1 -- Source Path: hdl_ofdm_tx/ifft/TWDLMULT_SDNF1_3 -- Hierarchy Level: 2 -- -- ------------------------------------------------------------- LIBRARY IEEE; USE IEEE.std_logic_1164.ALL; USE IEEE.numeric_std.ALL; ENTITY TWDLMULT_SDNF1_3_block1 IS PORT( clk : IN std_logic; reset : IN std_logic; enb_1_16_0 : IN std_logic; dout_5_re : IN std_logic_vector(17 DOWNTO 0); -- sfix18_En13 dout_5_im : IN std_logic_vector(17 DOWNTO 0); -- sfix18_En13 dout_7_re : IN std_logic_vector(17 DOWNTO 0); -- sfix18_En13 dout_7_im : IN std_logic_vector(17 DOWNTO 0); -- sfix18_En13 dout_2_vld : IN std_logic; twdl_3_5_re : IN std_logic_vector(15 DOWNTO 0); -- sfix16_En14 twdl_3_5_im : IN std_logic_vector(15 DOWNTO 0); -- sfix16_En14 twdl_3_6_re : IN std_logic_vector(15 DOWNTO 0); -- sfix16_En14 twdl_3_6_im : IN std_logic_vector(15 DOWNTO 0); -- sfix16_En14 twdl_3_6_vld : IN std_logic; softReset : IN std_logic; twdlXdin_5_re : OUT std_logic_vector(18 DOWNTO 0); -- sfix19_En13 twdlXdin_5_im : OUT std_logic_vector(18 DOWNTO 0); -- sfix19_En13 twdlXdin_6_re : OUT std_logic_vector(18 DOWNTO 0); -- sfix19_En13 twdlXdin_6_im : OUT std_logic_vector(18 DOWNTO 0); -- sfix19_En13 twdlXdin_5_vld : OUT std_logic ); END TWDLMULT_SDNF1_3_block1; ARCHITECTURE rtl OF TWDLMULT_SDNF1_3_block1 IS -- Component Declarations COMPONENT Complex3Multiply_block2 PORT( clk : IN std_logic; reset : IN std_logic; enb_1_16_0 : IN std_logic; din2_re_dly3 : IN std_logic_vector(18 DOWNTO 0); -- sfix19_En13 din2_im_dly3 : IN std_logic_vector(18 DOWNTO 0); -- sfix19_En13 di2_vld_dly3 : IN std_logic; twdl_3_6_re : IN std_logic_vector(15 DOWNTO 0); -- sfix16_En14 twdl_3_6_im : IN std_logic_vector(15 DOWNTO 0); -- sfix16_En14 softReset : IN std_logic; twdlXdin_6_re : OUT std_logic_vector(18 DOWNTO 0); -- sfix19_En13 twdlXdin_6_im : OUT std_logic_vector(18 DOWNTO 0); -- sfix19_En13 twdlXdin2_vld : OUT std_logic ); END COMPONENT; -- Component Configuration Statements FOR ALL : Complex3Multiply_block2 USE ENTITY work.Complex3Multiply_block2(rtl); -- Signals SIGNAL dout_5_re_signed : signed(17 DOWNTO 0); -- sfix18_En13 SIGNAL din_re : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_re_dly1 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_re_dly2 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_re_dly3 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_re_dly4 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_re_dly5 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_re_dly6 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_re_dly7 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_re_dly8 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_re_dly9 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL dout_5_im_signed : signed(17 DOWNTO 0); -- sfix18_En13 SIGNAL din_im : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_im_dly1 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_im_dly2 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_im_dly3 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_im_dly4 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_im_dly5 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_im_dly6 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_im_dly7 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_im_dly8 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din1_im_dly9 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL dout_7_re_signed : signed(17 DOWNTO 0); -- sfix18_En13 SIGNAL din_re_1 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din2_re_dly1 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din2_re_dly2 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL dout_7_im_signed : signed(17 DOWNTO 0); -- sfix18_En13 SIGNAL din_im_1 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din2_im_dly1 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din2_im_dly2 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din2_re_dly3 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL din2_im_dly3 : signed(18 DOWNTO 0); -- sfix19_En13 SIGNAL di2_vld_dly1 : std_logic; SIGNAL di2_vld_dly2 : std_logic; SIGNAL di2_vld_dly3 : std_logic; SIGNAL twdlXdin_6_re_tmp : std_logic_vector(18 DOWNTO 0); -- ufix19 SIGNAL twdlXdin_6_im_tmp : std_logic_vector(18 DOWNTO 0); -- ufix19 BEGIN u_MUL3_2 : Complex3Multiply_block2 PORT MAP( clk => clk, reset => reset, enb_1_16_0 => enb_1_16_0, din2_re_dly3 => std_logic_vector(din2_re_dly3), -- sfix19_En13 din2_im_dly3 => std_logic_vector(din2_im_dly3), -- sfix19_En13 di2_vld_dly3 => di2_vld_dly3, twdl_3_6_re => twdl_3_6_re, -- sfix16_En14 twdl_3_6_im => twdl_3_6_im, -- sfix16_En14 softReset => softReset, twdlXdin_6_re => twdlXdin_6_re_tmp, -- sfix19_En13 twdlXdin_6_im => twdlXdin_6_im_tmp, -- sfix19_En13 twdlXdin2_vld => twdlXdin_5_vld ); dout_5_re_signed <= signed(dout_5_re); din_re <= resize(dout_5_re_signed, 19); intdelay_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_re_dly1 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_re_dly1 <= din_re; END IF; END IF; END PROCESS intdelay_process; intdelay_1_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_re_dly2 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_re_dly2 <= din1_re_dly1; END IF; END IF; END PROCESS intdelay_1_process; intdelay_2_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_re_dly3 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_re_dly3 <= din1_re_dly2; END IF; END IF; END PROCESS intdelay_2_process; intdelay_3_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_re_dly4 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_re_dly4 <= din1_re_dly3; END IF; END IF; END PROCESS intdelay_3_process; intdelay_4_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_re_dly5 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_re_dly5 <= din1_re_dly4; END IF; END IF; END PROCESS intdelay_4_process; intdelay_5_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_re_dly6 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_re_dly6 <= din1_re_dly5; END IF; END IF; END PROCESS intdelay_5_process; intdelay_6_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_re_dly7 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_re_dly7 <= din1_re_dly6; END IF; END IF; END PROCESS intdelay_6_process; intdelay_7_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_re_dly8 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_re_dly8 <= din1_re_dly7; END IF; END IF; END PROCESS intdelay_7_process; intdelay_8_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_re_dly9 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_re_dly9 <= din1_re_dly8; END IF; END IF; END PROCESS intdelay_8_process; twdlXdin_5_re <= std_logic_vector(din1_re_dly9); dout_5_im_signed <= signed(dout_5_im); din_im <= resize(dout_5_im_signed, 19); intdelay_9_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_im_dly1 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_im_dly1 <= din_im; END IF; END IF; END PROCESS intdelay_9_process; intdelay_10_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_im_dly2 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_im_dly2 <= din1_im_dly1; END IF; END IF; END PROCESS intdelay_10_process; intdelay_11_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_im_dly3 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_im_dly3 <= din1_im_dly2; END IF; END IF; END PROCESS intdelay_11_process; intdelay_12_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_im_dly4 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_im_dly4 <= din1_im_dly3; END IF; END IF; END PROCESS intdelay_12_process; intdelay_13_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_im_dly5 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_im_dly5 <= din1_im_dly4; END IF; END IF; END PROCESS intdelay_13_process; intdelay_14_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_im_dly6 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_im_dly6 <= din1_im_dly5; END IF; END IF; END PROCESS intdelay_14_process; intdelay_15_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_im_dly7 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_im_dly7 <= din1_im_dly6; END IF; END IF; END PROCESS intdelay_15_process; intdelay_16_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_im_dly8 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_im_dly8 <= din1_im_dly7; END IF; END IF; END PROCESS intdelay_16_process; intdelay_17_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din1_im_dly9 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din1_im_dly9 <= din1_im_dly8; END IF; END IF; END PROCESS intdelay_17_process; twdlXdin_5_im <= std_logic_vector(din1_im_dly9); dout_7_re_signed <= signed(dout_7_re); din_re_1 <= resize(dout_7_re_signed, 19); intdelay_18_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din2_re_dly1 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din2_re_dly1 <= din_re_1; END IF; END IF; END PROCESS intdelay_18_process; intdelay_19_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din2_re_dly2 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din2_re_dly2 <= din2_re_dly1; END IF; END IF; END PROCESS intdelay_19_process; dout_7_im_signed <= signed(dout_7_im); din_im_1 <= resize(dout_7_im_signed, 19); intdelay_20_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din2_im_dly1 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din2_im_dly1 <= din_im_1; END IF; END IF; END PROCESS intdelay_20_process; intdelay_21_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din2_im_dly2 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din2_im_dly2 <= din2_im_dly1; END IF; END IF; END PROCESS intdelay_21_process; intdelay_22_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din2_re_dly3 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din2_re_dly3 <= din2_re_dly2; END IF; END IF; END PROCESS intdelay_22_process; intdelay_23_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN din2_im_dly3 <= to_signed(16#00000#, 19); ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN din2_im_dly3 <= din2_im_dly2; END IF; END IF; END PROCESS intdelay_23_process; intdelay_24_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN di2_vld_dly1 <= '0'; ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN di2_vld_dly1 <= dout_2_vld; END IF; END IF; END PROCESS intdelay_24_process; intdelay_25_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN di2_vld_dly2 <= '0'; ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN di2_vld_dly2 <= di2_vld_dly1; END IF; END IF; END PROCESS intdelay_25_process; intdelay_26_process : PROCESS (clk, reset) BEGIN IF reset = '1' THEN di2_vld_dly3 <= '0'; ELSIF clk'EVENT AND clk = '1' THEN IF enb_1_16_0 = '1' THEN di2_vld_dly3 <= di2_vld_dly2; END IF; END IF; END PROCESS intdelay_26_process; twdlXdin_6_re <= twdlXdin_6_re_tmp; twdlXdin_6_im <= twdlXdin_6_im_tmp; END rtl;
library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; -- -- LES DONNEES ARRIVENT SOUS LA FORME (0x00 & B & G & R) -- ET ELLES RESSORTENT SOUS LA FORME (0x00 & V & U & Y) -- entity RGB_2_Y is port( rst : in STD_LOGIC; clk : in STD_LOGIC; start : in STD_LOGIC; flush : in std_logic; holdn : in std_ulogic; INPUT_1 : in STD_LOGIC_VECTOR(31 downto 0); ready : out std_logic; nready : out std_logic; icc : out std_logic_vector(3 downto 0); OUTPUT_1 : out STD_LOGIC_VECTOR(31 downto 0) ); end RGB_2_Y; architecture rtl of RGB_2_YUV is constant s_rgb_30 : UNSIGNED(11 downto 0) := "001001100100"; constant s_rgb_59 : UNSIGNED(11 downto 0) := "010010110010"; constant s_rgb_11 : UNSIGNED(11 downto 0) := "000011101001"; SIGNAL INPUT_R : STD_LOGIC_VECTOR(7 downto 0); SIGNAL INPUT_G : STD_LOGIC_VECTOR(7 downto 0); SIGNAL INPUT_B : STD_LOGIC_VECTOR(7 downto 0); SIGNAL INPUT_Y : STD_LOGIC_VECTOR(7 downto 0); SIGNAL s_rgb_out_y : UNSIGNED(19 downto 0) := (others => '0'); SIGNAL rgb_in_r_reg_Y : UNSIGNED(19 downto 0):= (others => '0'); SIGNAL rgb_in_g_reg_Y : UNSIGNED(19 downto 0):= (others => '0'); SIGNAL rgb_in_b_reg_Y : UNSIGNED(19 downto 0):= (others => '0'); begin INPUT_R <= INPUT_1( 7 downto 0); INPUT_G <= INPUT_1(15 downto 8); INPUT_B <= INPUT_1(23 downto 16); OUTPUT_1 <= "000000000000000000000000" & INPUT_Y; process(INPUT_R, INPUT_G, INPUT_B) begin rgb_in_r_reg_Y <= s_rgb_30 * UNSIGNED(INPUT_R); rgb_in_g_reg_Y <= s_rgb_59 * UNSIGNED(INPUT_G); rgb_in_b_reg_Y <= s_rgb_11 * UNSIGNED(INPUT_B); s_rgb_out_y <= rgb_in_r_reg_Y + (rgb_in_g_reg_Y + rgb_in_b_reg_Y); INPUT_Y <= STD_LOGIC_VECTOR(s_rgb_out_y(19 downto 12)); end process; end rtl;
library IEEE; use IEEE.std_logic_1164.all; entity reg16b is port(clk, load, reset : in STD_LOGIC; input : in STD_LOGIC_VECTOR (15 downto 0); output : out STD_LOGIC_VECTOR (15 downto 0) := "0000000000000000" ); end entity; architecture reg16b_ARCH of reg16b is begin process(clk) begin if(clk = '1') then if(reset = '1') then output <= "0000000000000000"; elsif(load = '1') then output <= input; end if; end if; end process; end architecture;
------------------------------------------------------------------------------ -- LEON3 Demonstration design test bench -- Copyright (C) 2012 Aeroflex Gaisler ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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 gaisler; use gaisler.libdcom.all; use gaisler.sim.all; use work.debug.all; library techmap; use techmap.gencomp.all; library micron; use micron.components.all; library grlib; use grlib.stdlib.all; use work.config.all; -- configuration entity testbench is generic ( fabtech : integer := CFG_FABTECH; memtech : integer := CFG_MEMTECH; padtech : integer := CFG_PADTECH; clktech : integer := CFG_CLKTECH; disas : integer := CFG_DISAS; -- Enable disassembly to console dbguart : integer := CFG_DUART; -- Print UART on console pclow : integer := CFG_PCLOW; romdepth : integer := 22 -- rom address depth (flash 4 MB) ); end; architecture behav of testbench is constant promfile : string := "prom.srec"; constant sdramfile : string := "ram.srec"; signal clock_50 : std_logic := '0'; signal led : std_logic_vector(7 downto 0); signal key : std_logic_vector(1 downto 0); signal sw : std_logic_vector(3 downto 0); signal dram_ba : std_logic_vector(1 downto 0); signal dram_dqm : std_logic_vector(1 downto 0); signal dram_ras_n : std_ulogic; signal dram_cas_n : std_ulogic; signal dram_cke : std_ulogic; signal dram_clk : std_ulogic; signal dram_we_n : std_ulogic; signal dram_cs_n : std_ulogic; signal dram_dq : std_logic_vector(15 downto 0); signal dram_addr : std_logic_vector(12 downto 0); signal epcs_data0 : std_logic; signal epcs_dclk : std_logic; signal epcs_ncso : std_logic; signal epcs_asdo : std_logic; signal i2c_sclk : std_logic; signal i2c_sdat : std_logic; signal g_sensor_cs_n : std_ulogic; signal g_sensor_int : std_ulogic; signal adc_cs_n : std_ulogic; signal adc_saddr : std_ulogic; signal adc_sclk : std_ulogic; signal adc_sdat : std_ulogic; signal gpio_2 : std_logic_vector(12 downto 0); signal gpio_2_in : std_logic_vector(2 downto 0); signal gpio_1_in : std_logic_vector(1 downto 0); signal gpio_1 : std_logic_vector(33 downto 0); signal gpio_0_in : std_logic_vector(1 downto 0); signal gpio_0 : std_logic_vector(33 downto 0); begin clock_50 <= not clock_50 after 10 ns; --50 MHz clk key(0) <= '0', '1' after 300 ns; key(1) <= '1'; -- DSU break, disabled sw <= (others => 'H'); gpio_0 <= (others => 'H'); gpio_0_in <= (others => 'H'); gpio_1 <= (others => 'H'); gpio_1_in <= (others => 'H'); gpio_2 <= (others => 'H'); gpio_2_in <= (others => 'H'); led(5 downto 0) <= (others => 'H'); d3 : entity work.leon3mp generic map ( fabtech, memtech, padtech, clktech, disas, dbguart, pclow ) port map ( clock_50 => clock_50, led => led, key => key, sw => sw, dram_ba => dram_ba, dram_dqm => dram_dqm, dram_ras_n => dram_ras_n, dram_cas_n => dram_cas_n, dram_cke => dram_cke, dram_clk => dram_clk, dram_we_n => dram_we_n, dram_cs_n => dram_cs_n, dram_dq => dram_dq, dram_addr => dram_addr, epcs_data0 => epcs_data0, epcs_dclk => epcs_dclk, epcs_ncso => epcs_ncso, epcs_asdo => epcs_asdo, i2c_sclk => i2c_sclk, i2c_sdat => i2c_sdat, g_sensor_cs_n => g_sensor_cs_n, g_sensor_int => g_sensor_int, adc_cs_n => adc_cs_n, adc_saddr => adc_saddr, adc_sclk => adc_sclk, adc_sdat => adc_sdat, gpio_2 => gpio_2, gpio_2_in => gpio_2_in, gpio_1_in => gpio_1_in, gpio_1 => gpio_1, gpio_0_in => gpio_0_in, gpio_0 => gpio_0); sd1 : if (CFG_SDCTRL /= 0) generate u1: entity work.mt48lc16m16a2 generic map (addr_bits => 13, col_bits => 8, index => 1024, fname => sdramfile) PORT MAP( Dq => dram_dq, Addr => dram_addr, Ba => dram_ba, Clk => dram_clk, Cke => dram_cke, Cs_n => dram_cs_n, Ras_n => dram_ras_n, Cas_n => dram_cas_n, We_n => dram_we_n, Dqm => dram_dqm); end generate; dram_dq <= buskeep(dram_dq) after 5 ns; spif : if CFG_SPIMCTRL /= 0 generate spi0: spi_flash generic map ( ftype => 4, debug => 0, fname => promfile, readcmd => CFG_SPIMCTRL_READCMD, dummybyte => CFG_SPIMCTRL_DUMMYBYTE, dualoutput => CFG_SPIMCTRL_DUALOUTPUT, memoffset => CFG_SPIMCTRL_OFFSET) port map ( sck => epcs_dclk, di => epcs_asdo, do => epcs_data0, csn => epcs_ncso, sd_cmd_timeout => open, sd_data_timeout => open); end generate; iuerr : process begin wait for 2500 ns; if to_x01(led(6)) = '1' then wait on led(6); end if; assert (to_x01(led(6)) = '1') report "*** IU in error mode, simulation halted ***" severity failure ; end process; end ;
-- ------------------------------------------------------------- -- -- Generated Architecture Declaration for rtl of ent_a -- -- Generated -- by: wig -- on: Mon Jul 18 16:07:02 2005 -- cmd: h:/work/eclipse/mix/mix_0.pl -sheet HIER=HIER_VHDL -strip -nodelta ../../verilog.xls -- -- !!! Do not edit this file! Autogenerated by MIX !!! -- $Author: wig $ -- $Id: ent_a-rtl-a.vhd,v 1.4 2005/10/13 09:09:43 wig Exp $ -- $Date: 2005/10/13 09:09:43 $ -- $Log: ent_a-rtl-a.vhd,v $ -- Revision 1.4 2005/10/13 09:09:43 wig -- Added intermediate CONN sheet split -- -- -- Based on Mix Architecture Template built into RCSfile: MixWriter.pm,v -- Id: MixWriter.pm,v 1.57 2005/07/18 08:58:22 wig Exp -- -- Generator: mix_0.pl Revision: 1.36 , [email protected] -- (C) 2003 Micronas GmbH -- -- -------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; -- No project specific VHDL libraries/arch -- -- -- Start of Generated Architecture rtl of ent_a -- architecture rtl of ent_a is -- Generated Constant Declarations -- -- Components -- -- Generated Components component ent_aa -- -- No Generated Generics port ( -- Generated Port for Entity ent_aa port_aa_1 : out std_ulogic; port_aa_2 : out std_ulogic; -- __I_AUTO_REDUCED_BUS2SIGNAL port_aa_3 : out std_ulogic; port_aa_4 : in std_ulogic; port_aa_5 : out std_ulogic_vector(3 downto 0); port_aa_6 : out std_ulogic_vector(3 downto 0); sig_07 : out std_ulogic_vector(5 downto 0); sig_08 : out std_ulogic_vector(8 downto 2); sig_13 : out std_ulogic_vector(4 downto 0); sig_14 : out std_ulogic_vector(6 downto 0) -- End of Generated Port for Entity ent_aa ); end component; -- --------- component ent_ab -- -- No Generated Generics port ( -- Generated Port for Entity ent_ab port_ab_1 : in std_ulogic; port_ab_2 : out std_ulogic; -- __I_AUTO_REDUCED_BUS2SIGNAL sig_13 : in std_ulogic_vector(4 downto 0); sig_14 : in std_ulogic_vector(6 downto 0) -- End of Generated Port for Entity ent_ab ); end component; -- --------- component ent_ac -- -- No Generated Generics port ( -- Generated Port for Entity ent_ac port_ac_2 : out std_ulogic -- __I_AUTO_REDUCED_BUS2SIGNAL -- End of Generated Port for Entity ent_ac ); end component; -- --------- component ent_ad -- -- No Generated Generics port ( -- Generated Port for Entity ent_ad port_ad_2 : out std_ulogic -- __I_AUTO_REDUCED_BUS2SIGNAL -- End of Generated Port for Entity ent_ad ); end component; -- --------- component ent_ae -- -- No Generated Generics port ( -- Generated Port for Entity ent_ae port_ae_2 : in std_ulogic_vector(4 downto 0); port_ae_5 : in std_ulogic_vector(3 downto 0); port_ae_6 : in std_ulogic_vector(3 downto 0); sig_07 : in std_ulogic_vector(5 downto 0); sig_08 : in std_ulogic_vector(8 downto 2); sig_i_ae : in std_ulogic_vector(6 downto 0); sig_o_ae : out std_ulogic_vector(7 downto 0) -- End of Generated Port for Entity ent_ae ); end component; -- --------- -- -- Nets -- -- -- Generated Signal List -- signal sig_01 : std_ulogic; -- __W_PORT_SIGNAL_MAP_REQ signal sig_02 : std_ulogic_vector(4 downto 0); signal sig_03 : std_ulogic; -- __W_PORT_SIGNAL_MAP_REQ signal sig_04 : std_ulogic; -- __W_PORT_SIGNAL_MAP_REQ signal sig_05 : std_ulogic_vector(3 downto 0); -- __W_PORT_SIGNAL_MAP_REQ signal sig_06 : std_ulogic_vector(3 downto 0); -- __W_PORT_SIGNAL_MAP_REQ signal s_int_sig_07 : std_ulogic_vector(5 downto 0); -- __W_PORT_SIGNAL_MAP_REQ signal s_int_sig_08 : std_ulogic_vector(8 downto 2); -- __W_PORT_SIGNAL_MAP_REQ signal s_int_sig_13 : std_ulogic_vector(4 downto 0); -- __W_PORT_SIGNAL_MAP_REQ signal sig_14 : std_ulogic_vector(6 downto 0); signal sig_i_ae : std_ulogic_vector(6 downto 0); -- __W_PORT_SIGNAL_MAP_REQ signal sig_o_ae : std_ulogic_vector(7 downto 0); -- __W_PORT_SIGNAL_MAP_REQ -- -- End of Generated Signal List -- begin -- -- Generated Concurrent Statements -- -- Generated Signal Assignments p_mix_sig_01_go <= sig_01; -- __I_O_BIT_PORT p_mix_sig_03_go <= sig_03; -- __I_O_BIT_PORT sig_04 <= p_mix_sig_04_gi; -- __I_I_BIT_PORT p_mix_sig_05_2_1_go(1 downto 0) <= sig_05(2 downto 1); -- __I_O_SLICE_PORT sig_06 <= p_mix_sig_06_gi; -- __I_I_BUS_PORT s_int_sig_07 <= sig_07; -- __I_I_BUS_PORT sig_08 <= s_int_sig_08; -- __I_O_BUS_PORT sig_13 <= s_int_sig_13; -- __I_O_BUS_PORT sig_i_ae <= p_mix_sig_i_ae_gi; -- __I_I_BUS_PORT p_mix_sig_o_ae_go <= sig_o_ae; -- __I_O_BUS_PORT -- -- Generated Instances -- -- Generated Instances and Port Mappings -- Generated Instance Port Map for inst_aa inst_aa: ent_aa port map ( port_aa_1 => sig_01, -- Use internally test1Will create p_mix_sig_1_go port port_aa_2 => sig_02(0), -- Use internally test2, no port generated port_aa_3 => sig_03, -- Interhierachy link, will create p_mix_sig_3_go port_aa_4 => sig_04, -- Interhierachy link, will create p_mix_sig_4_gi port_aa_5 => sig_05, -- Bus, single bits go to outsideBus, single bits go to outside, will create p_mix_sig_5_2_2_goBus,... port_aa_6 => sig_06, -- Conflicting definition (X2) sig_07 => s_int_sig_07, -- Conflicting definition, IN false! sig_08 => s_int_sig_08, -- VHDL intermediate needed (port name) sig_13 => s_int_sig_13, -- Create internal signal name sig_14 => sig_14 -- Multiline comment 1 -- Multiline comment 2 -- Multiline comment 3 ); -- End of Generated Instance Port Map for inst_aa -- Generated Instance Port Map for inst_ab inst_ab: ent_ab port map ( port_ab_1 => sig_01, -- Use internally test1Will create p_mix_sig_1_go port port_ab_2 => sig_02(1), -- Use internally test2, no port generated sig_13 => s_int_sig_13, -- Create internal signal name sig_14 => sig_14 -- Mulitline comment 1 -- Multiline comment 2 -- Multiline comment 3 ); -- End of Generated Instance Port Map for inst_ab -- Generated Instance Port Map for inst_ac inst_ac: ent_ac port map ( port_ac_2 => sig_02(3) -- Use internally test2, no port generated ); -- End of Generated Instance Port Map for inst_ac -- Generated Instance Port Map for inst_ad inst_ad: ent_ad port map ( port_ad_2 => sig_02(4) -- Use internally test2, no port generated ); -- End of Generated Instance Port Map for inst_ad -- Generated Instance Port Map for inst_ae inst_ae: ent_ae port map ( port_ae_2(1 downto 0) => sig_02(1 downto 0), -- Use internally test2, no port generated port_ae_2(4 downto 3) => sig_02(4 downto 3), -- Use internally test2, no port generated port_ae_5 => sig_05, -- Bus, single bits go to outsideBus, single bits go to outside, will create p_mix_sig_5_2_2_goBus,... port_ae_6 => sig_06, -- Conflicting definition (X2) sig_07 => s_int_sig_07, -- Conflicting definition, IN false! sig_08 => s_int_sig_08, -- VHDL intermediate needed (port name) sig_i_ae => sig_i_ae, -- Input Bus sig_o_ae => sig_o_ae -- Output Bus ); -- End of Generated Instance Port Map for inst_ae end rtl; -- --!End of Architecture/s -- --------------------------------------------------------------
------------------------------------------------------------------------------- -- -- (C) COPYRIGHT 2004, Gideon's Logic Architectures -- ------------------------------------------------------------------------------- -- Title : token_crc.vhd ------------------------------------------------------------------------------- -- File : token_crc.vhd -- Author : Gideon Zweijtzer <[email protected]> ------------------------------------------------------------------------------- -- Description: This file is used to calculate the CRC over a USB token ------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; entity token_crc is port ( clock : in std_logic; sync : in std_logic; token_in : in std_logic_vector(10 downto 0); crc : out std_logic_vector(4 downto 0) ); end token_crc; architecture Gideon of token_crc is -- signal crc_reg : std_logic_vector(4 downto 0) := (others => '0'); constant polynom : std_logic_vector(4 downto 0) := "00100"; -- CRC-5 = x5 + x2 + 1 begin process(clock) variable tmp : std_logic_vector(crc'range); variable d : std_logic; begin if rising_edge(clock) then tmp := (others => '1'); for i in token_in'reverse_range loop -- LSB first! d := token_in(i) xor tmp(tmp'high); tmp := tmp(tmp'high-1 downto 0) & d; --'0'; if d = '1' then tmp := tmp xor polynom; end if; end loop; for i in tmp'range loop -- reverse and invert crc(crc'high-i) <= not(tmp(i)); end loop; end if; end process; end Gideon;
------------------------------------------------------------------------------- -- -- (C) COPYRIGHT 2004, Gideon's Logic Architectures -- ------------------------------------------------------------------------------- -- Title : token_crc.vhd ------------------------------------------------------------------------------- -- File : token_crc.vhd -- Author : Gideon Zweijtzer <[email protected]> ------------------------------------------------------------------------------- -- Description: This file is used to calculate the CRC over a USB token ------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; entity token_crc is port ( clock : in std_logic; sync : in std_logic; token_in : in std_logic_vector(10 downto 0); crc : out std_logic_vector(4 downto 0) ); end token_crc; architecture Gideon of token_crc is -- signal crc_reg : std_logic_vector(4 downto 0) := (others => '0'); constant polynom : std_logic_vector(4 downto 0) := "00100"; -- CRC-5 = x5 + x2 + 1 begin process(clock) variable tmp : std_logic_vector(crc'range); variable d : std_logic; begin if rising_edge(clock) then tmp := (others => '1'); for i in token_in'reverse_range loop -- LSB first! d := token_in(i) xor tmp(tmp'high); tmp := tmp(tmp'high-1 downto 0) & d; --'0'; if d = '1' then tmp := tmp xor polynom; end if; end loop; for i in tmp'range loop -- reverse and invert crc(crc'high-i) <= not(tmp(i)); end loop; end if; end process; end Gideon;
------------------------------------------------------------------------------- -- -- (C) COPYRIGHT 2004, Gideon's Logic Architectures -- ------------------------------------------------------------------------------- -- Title : token_crc.vhd ------------------------------------------------------------------------------- -- File : token_crc.vhd -- Author : Gideon Zweijtzer <[email protected]> ------------------------------------------------------------------------------- -- Description: This file is used to calculate the CRC over a USB token ------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; entity token_crc is port ( clock : in std_logic; sync : in std_logic; token_in : in std_logic_vector(10 downto 0); crc : out std_logic_vector(4 downto 0) ); end token_crc; architecture Gideon of token_crc is -- signal crc_reg : std_logic_vector(4 downto 0) := (others => '0'); constant polynom : std_logic_vector(4 downto 0) := "00100"; -- CRC-5 = x5 + x2 + 1 begin process(clock) variable tmp : std_logic_vector(crc'range); variable d : std_logic; begin if rising_edge(clock) then tmp := (others => '1'); for i in token_in'reverse_range loop -- LSB first! d := token_in(i) xor tmp(tmp'high); tmp := tmp(tmp'high-1 downto 0) & d; --'0'; if d = '1' then tmp := tmp xor polynom; end if; end loop; for i in tmp'range loop -- reverse and invert crc(crc'high-i) <= not(tmp(i)); end loop; end if; end process; end Gideon;
library verilog; use verilog.vl_types.all; entity receive_data_gen is port( clk_50M : in vl_logic; clk_100M : in vl_logic; reset_n : in vl_logic; Data_A : out vl_logic_vector(11 downto 0); Data_B : out vl_logic_vector(11 downto 0); Data_C : out vl_logic_vector(11 downto 0); Data_D : out vl_logic_vector(11 downto 0); Data_E : out vl_logic_vector(11 downto 0); Data_F : out vl_logic_vector(11 downto 0); Data_G : out vl_logic_vector(11 downto 0); Data_H : out vl_logic_vector(11 downto 0); Line_Num : out vl_logic_vector(7 downto 0); Focus_Num : out vl_logic_vector(1 downto 0); Pr_Gate : out vl_logic; RX_Gate : out vl_logic; Sample_Gate : out vl_logic; End_Gate : out vl_logic ); end receive_data_gen;
---------------------------------------------------------------------------------- -- Company: ITESM CQ -- Engineer: Miguel Gonzalez A01203712 -- -- Create Date: 10:29:20 11/10/2015 -- Design Name: -- Module Name: Top - Behavioral -- Project Name: -- Target Devices: -- Tool versions: -- Description: Top module for robot sumo -- -- Dependencies: -- -- Revision: -- Revision 0.0.1 - File Created -- Revision 1.0.0 - Motor Implementation -- 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_line_top : in STD_LOGIC; in_Rx : in STD_LOGIC; out_Tx : out STD_LOGIC; out_motor_1 : out STD_LOGIC; out_motor_2 : out STD_LOGIC ); end Top; architecture Behavioral of Top is -- Declarar componentes -- Comp : U1 Motor module component Motor Port ( in_Rst : in STD_LOGIC; in_Clk : in STD_LOGIC; in_Action_m : in STD_LOGIC_VECTOR(1 downto 0); out_motor : out STD_LOGIC); end component; -- Comp : U2 Robot Module component Robot Port ( in_sonic_1 : in STD_LOGIC; in_color_1 : in STD_LOGIC; in_clk : in STD_LOGIC; in_rst : in STD_LOGIC; out_action_1_r : out STD_LOGIC_VECTOR(1 downto 0); out_action_2_r : out STD_LOGIC_VECTOR(1 downto 0)); end component; --Comp: U3 Line Detector Component Detector_Linea Port( in_Rst_dl : in STD_LOGIC; in_Clk : in STD_LOGIC; in_line_dl : in STD_LOGIC; out_Line: out STD_LOGIC); end component; --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; -- signals -- no use constant aux_sonic : STD_LOGIC := '0'; constant aux_color : STD_LOGIC := '0'; -- 1 bit signal out_Line : STD_LOGIC := '0'; signal out_ultrasonic_1 : STD_LOGIC := '0'; -- 2 or more bit -- integer signal motor_1_action : STD_LOGIC_VECTOR(1 downto 0); signal motor_2_action : STD_LOGIC_VECTOR(1 downto 0); begin -- instanciar componentes U4: Ultrasonic Port map (in_Clk100MHz,in_Rst, in_Rx,out_Tx,out_ultrasonic_1); U3: Detector_Linea port map( in_Rst, in_Clk100MHz, in_line_top, out_Line); U2: Robot port map ( out_ultrasonic_1, out_Line, in_Clk100MHz, in_rst, motor_1_action, motor_2_action); U1_1 : Motor port map ( in_Rst, in_Clk100MHz, motor_1_action, out_motor_1); U1_2 : Motor port map ( in_Rst, in_Clk100MHz, motor_2_action, out_motor_2); end Behavioral;
------------------------------------------------------------------------------ -- This file is a part of the GRLIB VHDL IP LIBRARY -- Copyright (C) 2003 - 2008, Gaisler Research -- Copyright (C) 2008 - 2013, 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: syncram128 -- File: syncram128.vhd -- Author: Jiri Gaisler - Gaisler Research -- Description: 128-bit syncronous 1-port ram with 32-bit write strobes -- and tech selection ------------------------------------------------------------------------------ library ieee; library techmap; use ieee.std_logic_1164.all; use techmap.gencomp.all; use techmap.allmem.all; library grlib; use grlib.config.all; use grlib.config_types.all; use grlib.stdlib.all; entity syncram128 is generic (tech : integer := 0; abits : integer := 6; testen : integer := 0; paren : integer := 0; custombits : integer := 1); port ( clk : in std_ulogic; address : in std_logic_vector (abits -1 downto 0); datain : in std_logic_vector (127+16*paren downto 0); dataout : out std_logic_vector (127+16*paren downto 0); enable : in std_logic_vector (3 downto 0); write : in std_logic_vector (3 downto 0); testin : in std_logic_vector (TESTIN_WIDTH-1 downto 0) := testin_none; customclk: in std_ulogic := '0'; customin : in std_logic_vector(4*custombits-1 downto 0) := (others => '0'); customout:out std_logic_vector(4*custombits-1 downto 0)); end; architecture rtl of syncram128 is component unisim_syncram128 generic ( abits : integer := 9); port ( clk : in std_ulogic; address : in std_logic_vector (abits -1 downto 0); datain : in std_logic_vector (127 downto 0); dataout : out std_logic_vector (127 downto 0); enable : in std_logic_vector (3 downto 0); write : in std_logic_vector (3 downto 0) ); end component; signal dinp, doutp : std_logic_vector(143 downto 0); signal xenable,xwrite : std_logic_vector(3 downto 0); signal custominx,customoutx: std_logic_vector(syncram_customif_maxwidth downto 0); begin xenable <= enable when testen=0 or testin(TESTIN_WIDTH-2)='0' else "0000"; xwrite <= write when testen=0 or testin(TESTIN_WIDTH-2)='0' else "0000"; custominx(custominx'high downto custombits) <= (others => '0'); custominx(custombits-1 downto 0) <= customin(custombits-1 downto 0); nocust: if syncram_has_customif(tech)=0 or has_sram128(tech)=0 or paren=1 generate customoutx <= (others => '0'); end generate; nopar : if paren = 0 generate s128 : if has_sram128(tech) = 1 generate uni : if (is_unisim(tech) = 1) generate x0 : unisim_syncram128 generic map (abits) port map (clk, address, datain, dataout, xenable, xwrite); end generate; n2x : if (tech = easic45) generate x0 : n2x_syncram_we generic map (abits => abits, dbits => 128) port map(clk, address, datain, dataout, xenable, xwrite); end generate; customout(4*custombits-1 downto custombits) <= (others => '0'); customout(custombits-1 downto 0) <= customoutx(custombits-1 downto 0); -- pragma translate_off dmsg : if GRLIB_CONFIG_ARRAY(grlib_debug_level) >= 2 generate x : process begin assert false report "syncram128: " & tost(2**abits) & "x128" & " (" & tech_table(tech) & ")" severity note; wait; end process; end generate; -- pragma translate_on end generate; nos128 : if has_sram128(tech) = 0 generate x0 : syncram64 generic map (tech, abits, testen, 0, custombits) port map (clk, address, datain(127 downto 64), dataout(127 downto 64), enable(3 downto 2), write(3 downto 2), testin, customclk, customin(4*custombits-1 downto 2*custombits), customout(4*custombits-1 downto 2*custombits)); x1 : syncram64 generic map (tech, abits, testen, 0, custombits) port map (clk, address, datain(63 downto 0), dataout(63 downto 0), enable(1 downto 0), write(1 downto 0), testin, customclk, customin(2*custombits-1 downto 0), customout(2*custombits-1 downto 0)); end generate; end generate; par : if paren = 1 generate dinp <= datain(127+16*paren downto 120+16*paren) & datain(127 downto 64) & datain(127+8*paren downto 120+8*paren) & datain(63 downto 0); dataout <= doutp(143 downto 136) & doutp(71 downto 64) & doutp(135 downto 72) & doutp(63-16+16*paren downto 0); x0 : syncram64 generic map (tech, abits, testen, 1, custombits) port map (clk, address, dinp(143 downto 72), doutp(143 downto 72), enable(3 downto 2), write(3 downto 2), testin, customclk, customin(4*custombits-1 downto 2*custombits), customout(4*custombits-1 downto 2*custombits)); x1 : syncram64 generic map (tech, abits, testen, 1, custombits) port map (clk, address, dinp(71 downto 0), doutp(71 downto 0), enable(1 downto 0), write(1 downto 0), testin, customclk, customin(2*custombits-1 downto 0), customout(2*custombits-1 downto 0)); end generate; end;
library ieee; use ieee.std_logic_1164.all; package status_t_pkg is type status_t is array (natural range <>) of std_logic_vector(2 downto 0); end package;
--------------------------------------------------------------------- ---- ---- ---- WISHBONE revB2 compl. I2C Master Core; top level ---- ---- ---- ---- ---- ---- Author: Richard Herveille ---- ---- [email protected] ---- ---- www.asics.ws ---- ---- ---- ---- Downloaded from: http://www.opencores.org/projects/i2c/ ---- ---- ---- --------------------------------------------------------------------- ---- ---- ---- Copyright (C) 2000 Richard Herveille ---- ---- [email protected] ---- ---- ---- ---- This source file may be used and distributed without ---- ---- restriction provided that this copyright statement is not ---- ---- removed from the file and that any derivative work contains ---- ---- the original copyright notice and the associated disclaimer.---- ---- ---- ---- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ---- ---- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---- ---- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ---- ---- FOR A PARTICULAR PURPOSE. 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. ---- ---- ---- --------------------------------------------------------------------- -- CVS Log -- -- $Id: i2c_master_top.vhd,v 1.8 2009-01-20 10:38:45 rherveille Exp $ -- -- $Date: 2009-01-20 10:38:45 $ -- $Revision: 1.8 $ -- $Author: rherveille $ -- $Locker: $ -- $State: Exp $ -- -- Change History: -- Revision 1.7 2004/03/14 10:17:03 rherveille -- Fixed simulation issue when writing to CR register -- -- Revision 1.6 2003/08/09 07:01:13 rherveille -- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line. -- Fixed a potential bug in the byte controller's host-acknowledge generation. -- -- Revision 1.5 2003/02/01 02:03:06 rherveille -- Fixed a few 'arbitration lost' bugs. VHDL version only. -- -- Revision 1.4 2002/12/26 16:05:47 rherveille -- Core is now a Multimaster I2C controller. -- -- Revision 1.3 2002/11/30 22:24:37 rherveille -- Cleaned up code -- -- Revision 1.2 2001/11/10 10:52:44 rherveille -- Changed PRER reset value from 0x0000 to 0xffff, conform specs. -- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity COMM_zpuino_wb_i2c is generic( ARST_LVL : std_logic := '0' -- asynchronous reset level ); port ( -- wishbone signals wishbone_in : in std_logic_vector(61 downto 0); wishbone_out : out std_logic_vector(33 downto 0); -- i2c lines scl_pad_i : in std_logic; -- i2c clock line input scl_pad_o : out std_logic; -- i2c clock line output scl_padoen_o : out std_logic; -- i2c clock line output enable, active low sda_pad_i : in std_logic; -- i2c data line input sda_pad_o : out std_logic; -- i2c data line output sda_padoen_o : out std_logic -- i2c data line output enable, active low ); end entity COMM_zpuino_wb_i2c; architecture structural of COMM_zpuino_wb_i2c is component i2c_master_byte_ctrl is port ( clk : in std_logic; rst : in std_logic; -- synchronous active high reset (WISHBONE compatible) nReset : in std_logic; -- asynchornous active low reset (FPGA compatible) ena : in std_logic; -- core enable signal clk_cnt : in unsigned(15 downto 0); -- 4x SCL -- input signals start, stop, read, write, ack_in : std_logic; din : in std_logic_vector(7 downto 0); -- output signals cmd_ack : out std_logic; ack_out : out std_logic; i2c_busy : out std_logic; i2c_al : out std_logic; dout : out std_logic_vector(7 downto 0); -- i2c lines scl_i : in std_logic; -- i2c clock line input scl_o : out std_logic; -- i2c clock line output scl_oen : out std_logic; -- i2c clock line output enable, active low sda_i : in std_logic; -- i2c data line input sda_o : out std_logic; -- i2c data line output sda_oen : out std_logic -- i2c data line output enable, active low ); end component i2c_master_byte_ctrl; -- registers signal prer : unsigned(15 downto 0); -- clock prescale register signal ctr : std_logic_vector(7 downto 0); -- control register signal txr : std_logic_vector(7 downto 0); -- transmit register signal rxr : std_logic_vector(7 downto 0); -- receive register signal cr : std_logic_vector(7 downto 0); -- command register signal sr : std_logic_vector(7 downto 0); -- status register -- internal reset signal signal rst_i : std_logic; -- wishbone write access signal wb_wacc : std_logic; -- internal acknowledge signal signal iack_o : std_logic; -- done signal: command completed, clear command register signal done : std_logic; -- command register signals signal sta, sto, rd, wr, ack, iack : std_logic; signal core_en : std_logic; -- core enable signal signal ien : std_logic; -- interrupt enable signal -- status register signals signal irxack, rxack : std_logic; -- received aknowledge from slave signal tip : std_logic; -- transfer in progress signal irq_flag : std_logic; -- interrupt pending flag signal i2c_busy : std_logic; -- i2c bus busy (start signal detected) signal i2c_al, al : std_logic; -- arbitration lost signal wb_clk_i: std_logic; -- Wishbone clock signal wb_rst_i: std_logic; -- Wishbone reset (synchronous) signal wb_dat_i: std_logic_vector(31 downto 0); -- Wishbone data input (32 bits) signal wb_adr_i: std_logic_vector(26 downto 2); -- Wishbone address input (32 bits) signal wb_we_i: std_logic; -- Wishbone write enable signal signal wb_cyc_i: std_logic; -- Wishbone cycle signal signal wb_stb_i: std_logic; -- Wishbone strobe signal signal wb_dat_o: std_logic_vector(31 downto 0); -- Wishbone data output (32 bits) signal wb_ack_o: std_logic; -- Wishbone acknowledge out signal signal wb_inta_o: std_logic; begin -- Unpack the wishbone array into signals so the modules code is not confusing. wb_clk_i <= wishbone_in(61); wb_rst_i <= wishbone_in(60); wb_dat_i <= wishbone_in(59 downto 28); wb_adr_i <= wishbone_in(27 downto 3); wb_we_i <= wishbone_in(2); wb_cyc_i <= wishbone_in(1); wb_stb_i <= wishbone_in(0); wishbone_out(33 downto 2) <= wb_dat_o; wishbone_out(1) <= wb_ack_o; wishbone_out(0) <= wb_inta_o; -- generate internal reset signal rst_i <= arst_i xor ARST_LVL; -- generate acknowledge output signal gen_ack_o : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then iack_o <= wb_cyc_i and wb_stb_i and not iack_o; -- because timing is always honored end if; end process gen_ack_o; wb_ack_o <= iack_o; -- generate wishbone write access signal wb_wacc <= wb_we_i and iack_o; -- assign wb_dat_o assign_dato : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then case wb_adr_i is when "000" => wb_dat_o <= std_logic_vector(prer( 7 downto 0)); when "001" => wb_dat_o <= std_logic_vector(prer(15 downto 8)); when "010" => wb_dat_o <= ctr; when "011" => wb_dat_o <= rxr; -- write is transmit register TxR when "100" => wb_dat_o <= sr; -- write is command register CR -- Debugging registers: -- These registers are not documented. -- Functionality could change in future releases when "101" => wb_dat_o <= txr; when "110" => wb_dat_o <= cr; when "111" => wb_dat_o <= (others => '0'); when others => wb_dat_o <= (others => 'X'); -- for simulation only end case; end if; end process assign_dato; -- generate registers (CR, SR see below) gen_regs: process(rst_i, wb_clk_i) begin if (rst_i = '0') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_wacc = '1') then case wb_adr_i is when "000" => prer( 7 downto 0) <= unsigned(wb_dat_i); when "001" => prer(15 downto 8) <= unsigned(wb_dat_i); when "010" => ctr <= wb_dat_i; when "011" => txr <= wb_dat_i; when "100" => null; --write to CR, avoid executing the others clause -- illegal cases, for simulation only when others => report ("Illegal write address, setting all registers to unknown."); prer <= (others => 'X'); ctr <= (others => 'X'); txr <= (others => 'X'); end case; end if; end if; end process gen_regs; -- generate command register gen_cr: process(rst_i, wb_clk_i) begin if (rst_i = '0') then cr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then cr <= (others => '0'); elsif (wb_wacc = '1') then if ( (core_en = '1') and (wb_adr_i = "100") ) then -- only take new commands when i2c core enabled -- pending commands are finished cr <= wb_dat_i; end if; else if (done = '1' or i2c_al = '1') then cr(7 downto 4) <= (others => '0'); -- clear command bits when command done or arbitration lost end if; cr(2 downto 1) <= (others => '0'); -- reserved bits, always '0' cr(0) <= '0'; -- clear IRQ_ACK bit end if; end if; end process gen_cr; -- decode command register sta <= cr(7); sto <= cr(6); rd <= cr(5); wr <= cr(4); ack <= cr(3); iack <= cr(0); -- decode control register core_en <= ctr(7); ien <= ctr(6); -- hookup byte controller block byte_ctrl: i2c_master_byte_ctrl port map ( clk => wb_clk_i, rst => wb_rst_i, nReset => rst_i, ena => core_en, clk_cnt => prer, start => sta, stop => sto, read => rd, write => wr, ack_in => ack, i2c_busy => i2c_busy, i2c_al => i2c_al, din => txr, cmd_ack => done, ack_out => irxack, dout => rxr, scl_i => scl_pad_i, scl_o => scl_pad_o, scl_oen => scl_padoen_o, sda_i => sda_pad_i, sda_o => sda_pad_o, sda_oen => sda_padoen_o ); -- status register block + interrupt request signal st_irq_block : block begin -- generate status register bits gen_sr_bits: process (wb_clk_i, rst_i) begin if (rst_i = '0') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; else al <= i2c_al or (al and not sta); rxack <= irxack; tip <= (rd or wr); -- interrupt request flag is always generated irq_flag <= (done or i2c_al or irq_flag) and not iack; end if; end if; end process gen_sr_bits; -- generate interrupt request signals gen_irq: process (wb_clk_i, rst_i) begin if (rst_i = '0') then wb_inta_o <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then wb_inta_o <= '0'; else -- interrupt signal is only generated when IEN (interrupt enable bit) is set wb_inta_o <= irq_flag and ien; end if; end if; end process gen_irq; -- assign status register bits sr(7) <= rxack; sr(6) <= i2c_busy; sr(5) <= al; sr(4 downto 2) <= (others => '0'); -- reserved sr(1) <= tip; sr(0) <= irq_flag; end block; end architecture structural;
--------------------------------------------------------------------- ---- ---- ---- WISHBONE revB2 compl. I2C Master Core; top level ---- ---- ---- ---- ---- ---- Author: Richard Herveille ---- ---- [email protected] ---- ---- www.asics.ws ---- ---- ---- ---- Downloaded from: http://www.opencores.org/projects/i2c/ ---- ---- ---- --------------------------------------------------------------------- ---- ---- ---- Copyright (C) 2000 Richard Herveille ---- ---- [email protected] ---- ---- ---- ---- This source file may be used and distributed without ---- ---- restriction provided that this copyright statement is not ---- ---- removed from the file and that any derivative work contains ---- ---- the original copyright notice and the associated disclaimer.---- ---- ---- ---- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ---- ---- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---- ---- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ---- ---- FOR A PARTICULAR PURPOSE. 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. ---- ---- ---- --------------------------------------------------------------------- -- CVS Log -- -- $Id: i2c_master_top.vhd,v 1.8 2009-01-20 10:38:45 rherveille Exp $ -- -- $Date: 2009-01-20 10:38:45 $ -- $Revision: 1.8 $ -- $Author: rherveille $ -- $Locker: $ -- $State: Exp $ -- -- Change History: -- Revision 1.7 2004/03/14 10:17:03 rherveille -- Fixed simulation issue when writing to CR register -- -- Revision 1.6 2003/08/09 07:01:13 rherveille -- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line. -- Fixed a potential bug in the byte controller's host-acknowledge generation. -- -- Revision 1.5 2003/02/01 02:03:06 rherveille -- Fixed a few 'arbitration lost' bugs. VHDL version only. -- -- Revision 1.4 2002/12/26 16:05:47 rherveille -- Core is now a Multimaster I2C controller. -- -- Revision 1.3 2002/11/30 22:24:37 rherveille -- Cleaned up code -- -- Revision 1.2 2001/11/10 10:52:44 rherveille -- Changed PRER reset value from 0x0000 to 0xffff, conform specs. -- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity COMM_zpuino_wb_i2c is generic( ARST_LVL : std_logic := '0' -- asynchronous reset level ); port ( -- wishbone signals wishbone_in : in std_logic_vector(61 downto 0); wishbone_out : out std_logic_vector(33 downto 0); -- i2c lines scl_pad_i : in std_logic; -- i2c clock line input scl_pad_o : out std_logic; -- i2c clock line output scl_padoen_o : out std_logic; -- i2c clock line output enable, active low sda_pad_i : in std_logic; -- i2c data line input sda_pad_o : out std_logic; -- i2c data line output sda_padoen_o : out std_logic -- i2c data line output enable, active low ); end entity COMM_zpuino_wb_i2c; architecture structural of COMM_zpuino_wb_i2c is component i2c_master_byte_ctrl is port ( clk : in std_logic; rst : in std_logic; -- synchronous active high reset (WISHBONE compatible) nReset : in std_logic; -- asynchornous active low reset (FPGA compatible) ena : in std_logic; -- core enable signal clk_cnt : in unsigned(15 downto 0); -- 4x SCL -- input signals start, stop, read, write, ack_in : std_logic; din : in std_logic_vector(7 downto 0); -- output signals cmd_ack : out std_logic; ack_out : out std_logic; i2c_busy : out std_logic; i2c_al : out std_logic; dout : out std_logic_vector(7 downto 0); -- i2c lines scl_i : in std_logic; -- i2c clock line input scl_o : out std_logic; -- i2c clock line output scl_oen : out std_logic; -- i2c clock line output enable, active low sda_i : in std_logic; -- i2c data line input sda_o : out std_logic; -- i2c data line output sda_oen : out std_logic -- i2c data line output enable, active low ); end component i2c_master_byte_ctrl; -- registers signal prer : unsigned(15 downto 0); -- clock prescale register signal ctr : std_logic_vector(7 downto 0); -- control register signal txr : std_logic_vector(7 downto 0); -- transmit register signal rxr : std_logic_vector(7 downto 0); -- receive register signal cr : std_logic_vector(7 downto 0); -- command register signal sr : std_logic_vector(7 downto 0); -- status register -- internal reset signal signal rst_i : std_logic; -- wishbone write access signal wb_wacc : std_logic; -- internal acknowledge signal signal iack_o : std_logic; -- done signal: command completed, clear command register signal done : std_logic; -- command register signals signal sta, sto, rd, wr, ack, iack : std_logic; signal core_en : std_logic; -- core enable signal signal ien : std_logic; -- interrupt enable signal -- status register signals signal irxack, rxack : std_logic; -- received aknowledge from slave signal tip : std_logic; -- transfer in progress signal irq_flag : std_logic; -- interrupt pending flag signal i2c_busy : std_logic; -- i2c bus busy (start signal detected) signal i2c_al, al : std_logic; -- arbitration lost signal wb_clk_i: std_logic; -- Wishbone clock signal wb_rst_i: std_logic; -- Wishbone reset (synchronous) signal wb_dat_i: std_logic_vector(31 downto 0); -- Wishbone data input (32 bits) signal wb_adr_i: std_logic_vector(26 downto 2); -- Wishbone address input (32 bits) signal wb_we_i: std_logic; -- Wishbone write enable signal signal wb_cyc_i: std_logic; -- Wishbone cycle signal signal wb_stb_i: std_logic; -- Wishbone strobe signal signal wb_dat_o: std_logic_vector(31 downto 0); -- Wishbone data output (32 bits) signal wb_ack_o: std_logic; -- Wishbone acknowledge out signal signal wb_inta_o: std_logic; begin -- Unpack the wishbone array into signals so the modules code is not confusing. wb_clk_i <= wishbone_in(61); wb_rst_i <= wishbone_in(60); wb_dat_i <= wishbone_in(59 downto 28); wb_adr_i <= wishbone_in(27 downto 3); wb_we_i <= wishbone_in(2); wb_cyc_i <= wishbone_in(1); wb_stb_i <= wishbone_in(0); wishbone_out(33 downto 2) <= wb_dat_o; wishbone_out(1) <= wb_ack_o; wishbone_out(0) <= wb_inta_o; -- generate internal reset signal rst_i <= arst_i xor ARST_LVL; -- generate acknowledge output signal gen_ack_o : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then iack_o <= wb_cyc_i and wb_stb_i and not iack_o; -- because timing is always honored end if; end process gen_ack_o; wb_ack_o <= iack_o; -- generate wishbone write access signal wb_wacc <= wb_we_i and iack_o; -- assign wb_dat_o assign_dato : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then case wb_adr_i is when "000" => wb_dat_o <= std_logic_vector(prer( 7 downto 0)); when "001" => wb_dat_o <= std_logic_vector(prer(15 downto 8)); when "010" => wb_dat_o <= ctr; when "011" => wb_dat_o <= rxr; -- write is transmit register TxR when "100" => wb_dat_o <= sr; -- write is command register CR -- Debugging registers: -- These registers are not documented. -- Functionality could change in future releases when "101" => wb_dat_o <= txr; when "110" => wb_dat_o <= cr; when "111" => wb_dat_o <= (others => '0'); when others => wb_dat_o <= (others => 'X'); -- for simulation only end case; end if; end process assign_dato; -- generate registers (CR, SR see below) gen_regs: process(rst_i, wb_clk_i) begin if (rst_i = '0') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_wacc = '1') then case wb_adr_i is when "000" => prer( 7 downto 0) <= unsigned(wb_dat_i); when "001" => prer(15 downto 8) <= unsigned(wb_dat_i); when "010" => ctr <= wb_dat_i; when "011" => txr <= wb_dat_i; when "100" => null; --write to CR, avoid executing the others clause -- illegal cases, for simulation only when others => report ("Illegal write address, setting all registers to unknown."); prer <= (others => 'X'); ctr <= (others => 'X'); txr <= (others => 'X'); end case; end if; end if; end process gen_regs; -- generate command register gen_cr: process(rst_i, wb_clk_i) begin if (rst_i = '0') then cr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then cr <= (others => '0'); elsif (wb_wacc = '1') then if ( (core_en = '1') and (wb_adr_i = "100") ) then -- only take new commands when i2c core enabled -- pending commands are finished cr <= wb_dat_i; end if; else if (done = '1' or i2c_al = '1') then cr(7 downto 4) <= (others => '0'); -- clear command bits when command done or arbitration lost end if; cr(2 downto 1) <= (others => '0'); -- reserved bits, always '0' cr(0) <= '0'; -- clear IRQ_ACK bit end if; end if; end process gen_cr; -- decode command register sta <= cr(7); sto <= cr(6); rd <= cr(5); wr <= cr(4); ack <= cr(3); iack <= cr(0); -- decode control register core_en <= ctr(7); ien <= ctr(6); -- hookup byte controller block byte_ctrl: i2c_master_byte_ctrl port map ( clk => wb_clk_i, rst => wb_rst_i, nReset => rst_i, ena => core_en, clk_cnt => prer, start => sta, stop => sto, read => rd, write => wr, ack_in => ack, i2c_busy => i2c_busy, i2c_al => i2c_al, din => txr, cmd_ack => done, ack_out => irxack, dout => rxr, scl_i => scl_pad_i, scl_o => scl_pad_o, scl_oen => scl_padoen_o, sda_i => sda_pad_i, sda_o => sda_pad_o, sda_oen => sda_padoen_o ); -- status register block + interrupt request signal st_irq_block : block begin -- generate status register bits gen_sr_bits: process (wb_clk_i, rst_i) begin if (rst_i = '0') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; else al <= i2c_al or (al and not sta); rxack <= irxack; tip <= (rd or wr); -- interrupt request flag is always generated irq_flag <= (done or i2c_al or irq_flag) and not iack; end if; end if; end process gen_sr_bits; -- generate interrupt request signals gen_irq: process (wb_clk_i, rst_i) begin if (rst_i = '0') then wb_inta_o <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then wb_inta_o <= '0'; else -- interrupt signal is only generated when IEN (interrupt enable bit) is set wb_inta_o <= irq_flag and ien; end if; end if; end process gen_irq; -- assign status register bits sr(7) <= rxack; sr(6) <= i2c_busy; sr(5) <= al; sr(4 downto 2) <= (others => '0'); -- reserved sr(1) <= tip; sr(0) <= irq_flag; end block; end architecture structural;
--------------------------------------------------------------------- ---- ---- ---- WISHBONE revB2 compl. I2C Master Core; top level ---- ---- ---- ---- ---- ---- Author: Richard Herveille ---- ---- [email protected] ---- ---- www.asics.ws ---- ---- ---- ---- Downloaded from: http://www.opencores.org/projects/i2c/ ---- ---- ---- --------------------------------------------------------------------- ---- ---- ---- Copyright (C) 2000 Richard Herveille ---- ---- [email protected] ---- ---- ---- ---- This source file may be used and distributed without ---- ---- restriction provided that this copyright statement is not ---- ---- removed from the file and that any derivative work contains ---- ---- the original copyright notice and the associated disclaimer.---- ---- ---- ---- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ---- ---- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---- ---- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ---- ---- FOR A PARTICULAR PURPOSE. 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. ---- ---- ---- --------------------------------------------------------------------- -- CVS Log -- -- $Id: i2c_master_top.vhd,v 1.8 2009-01-20 10:38:45 rherveille Exp $ -- -- $Date: 2009-01-20 10:38:45 $ -- $Revision: 1.8 $ -- $Author: rherveille $ -- $Locker: $ -- $State: Exp $ -- -- Change History: -- Revision 1.7 2004/03/14 10:17:03 rherveille -- Fixed simulation issue when writing to CR register -- -- Revision 1.6 2003/08/09 07:01:13 rherveille -- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line. -- Fixed a potential bug in the byte controller's host-acknowledge generation. -- -- Revision 1.5 2003/02/01 02:03:06 rherveille -- Fixed a few 'arbitration lost' bugs. VHDL version only. -- -- Revision 1.4 2002/12/26 16:05:47 rherveille -- Core is now a Multimaster I2C controller. -- -- Revision 1.3 2002/11/30 22:24:37 rherveille -- Cleaned up code -- -- Revision 1.2 2001/11/10 10:52:44 rherveille -- Changed PRER reset value from 0x0000 to 0xffff, conform specs. -- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity COMM_zpuino_wb_i2c is generic( ARST_LVL : std_logic := '0' -- asynchronous reset level ); port ( -- wishbone signals wishbone_in : in std_logic_vector(61 downto 0); wishbone_out : out std_logic_vector(33 downto 0); -- i2c lines scl_pad_i : in std_logic; -- i2c clock line input scl_pad_o : out std_logic; -- i2c clock line output scl_padoen_o : out std_logic; -- i2c clock line output enable, active low sda_pad_i : in std_logic; -- i2c data line input sda_pad_o : out std_logic; -- i2c data line output sda_padoen_o : out std_logic -- i2c data line output enable, active low ); end entity COMM_zpuino_wb_i2c; architecture structural of COMM_zpuino_wb_i2c is component i2c_master_byte_ctrl is port ( clk : in std_logic; rst : in std_logic; -- synchronous active high reset (WISHBONE compatible) nReset : in std_logic; -- asynchornous active low reset (FPGA compatible) ena : in std_logic; -- core enable signal clk_cnt : in unsigned(15 downto 0); -- 4x SCL -- input signals start, stop, read, write, ack_in : std_logic; din : in std_logic_vector(7 downto 0); -- output signals cmd_ack : out std_logic; ack_out : out std_logic; i2c_busy : out std_logic; i2c_al : out std_logic; dout : out std_logic_vector(7 downto 0); -- i2c lines scl_i : in std_logic; -- i2c clock line input scl_o : out std_logic; -- i2c clock line output scl_oen : out std_logic; -- i2c clock line output enable, active low sda_i : in std_logic; -- i2c data line input sda_o : out std_logic; -- i2c data line output sda_oen : out std_logic -- i2c data line output enable, active low ); end component i2c_master_byte_ctrl; -- registers signal prer : unsigned(15 downto 0); -- clock prescale register signal ctr : std_logic_vector(7 downto 0); -- control register signal txr : std_logic_vector(7 downto 0); -- transmit register signal rxr : std_logic_vector(7 downto 0); -- receive register signal cr : std_logic_vector(7 downto 0); -- command register signal sr : std_logic_vector(7 downto 0); -- status register -- internal reset signal signal rst_i : std_logic; -- wishbone write access signal wb_wacc : std_logic; -- internal acknowledge signal signal iack_o : std_logic; -- done signal: command completed, clear command register signal done : std_logic; -- command register signals signal sta, sto, rd, wr, ack, iack : std_logic; signal core_en : std_logic; -- core enable signal signal ien : std_logic; -- interrupt enable signal -- status register signals signal irxack, rxack : std_logic; -- received aknowledge from slave signal tip : std_logic; -- transfer in progress signal irq_flag : std_logic; -- interrupt pending flag signal i2c_busy : std_logic; -- i2c bus busy (start signal detected) signal i2c_al, al : std_logic; -- arbitration lost signal wb_clk_i: std_logic; -- Wishbone clock signal wb_rst_i: std_logic; -- Wishbone reset (synchronous) signal wb_dat_i: std_logic_vector(31 downto 0); -- Wishbone data input (32 bits) signal wb_adr_i: std_logic_vector(26 downto 2); -- Wishbone address input (32 bits) signal wb_we_i: std_logic; -- Wishbone write enable signal signal wb_cyc_i: std_logic; -- Wishbone cycle signal signal wb_stb_i: std_logic; -- Wishbone strobe signal signal wb_dat_o: std_logic_vector(31 downto 0); -- Wishbone data output (32 bits) signal wb_ack_o: std_logic; -- Wishbone acknowledge out signal signal wb_inta_o: std_logic; begin -- Unpack the wishbone array into signals so the modules code is not confusing. wb_clk_i <= wishbone_in(61); wb_rst_i <= wishbone_in(60); wb_dat_i <= wishbone_in(59 downto 28); wb_adr_i <= wishbone_in(27 downto 3); wb_we_i <= wishbone_in(2); wb_cyc_i <= wishbone_in(1); wb_stb_i <= wishbone_in(0); wishbone_out(33 downto 2) <= wb_dat_o; wishbone_out(1) <= wb_ack_o; wishbone_out(0) <= wb_inta_o; -- generate internal reset signal rst_i <= arst_i xor ARST_LVL; -- generate acknowledge output signal gen_ack_o : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then iack_o <= wb_cyc_i and wb_stb_i and not iack_o; -- because timing is always honored end if; end process gen_ack_o; wb_ack_o <= iack_o; -- generate wishbone write access signal wb_wacc <= wb_we_i and iack_o; -- assign wb_dat_o assign_dato : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then case wb_adr_i is when "000" => wb_dat_o <= std_logic_vector(prer( 7 downto 0)); when "001" => wb_dat_o <= std_logic_vector(prer(15 downto 8)); when "010" => wb_dat_o <= ctr; when "011" => wb_dat_o <= rxr; -- write is transmit register TxR when "100" => wb_dat_o <= sr; -- write is command register CR -- Debugging registers: -- These registers are not documented. -- Functionality could change in future releases when "101" => wb_dat_o <= txr; when "110" => wb_dat_o <= cr; when "111" => wb_dat_o <= (others => '0'); when others => wb_dat_o <= (others => 'X'); -- for simulation only end case; end if; end process assign_dato; -- generate registers (CR, SR see below) gen_regs: process(rst_i, wb_clk_i) begin if (rst_i = '0') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_wacc = '1') then case wb_adr_i is when "000" => prer( 7 downto 0) <= unsigned(wb_dat_i); when "001" => prer(15 downto 8) <= unsigned(wb_dat_i); when "010" => ctr <= wb_dat_i; when "011" => txr <= wb_dat_i; when "100" => null; --write to CR, avoid executing the others clause -- illegal cases, for simulation only when others => report ("Illegal write address, setting all registers to unknown."); prer <= (others => 'X'); ctr <= (others => 'X'); txr <= (others => 'X'); end case; end if; end if; end process gen_regs; -- generate command register gen_cr: process(rst_i, wb_clk_i) begin if (rst_i = '0') then cr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then cr <= (others => '0'); elsif (wb_wacc = '1') then if ( (core_en = '1') and (wb_adr_i = "100") ) then -- only take new commands when i2c core enabled -- pending commands are finished cr <= wb_dat_i; end if; else if (done = '1' or i2c_al = '1') then cr(7 downto 4) <= (others => '0'); -- clear command bits when command done or arbitration lost end if; cr(2 downto 1) <= (others => '0'); -- reserved bits, always '0' cr(0) <= '0'; -- clear IRQ_ACK bit end if; end if; end process gen_cr; -- decode command register sta <= cr(7); sto <= cr(6); rd <= cr(5); wr <= cr(4); ack <= cr(3); iack <= cr(0); -- decode control register core_en <= ctr(7); ien <= ctr(6); -- hookup byte controller block byte_ctrl: i2c_master_byte_ctrl port map ( clk => wb_clk_i, rst => wb_rst_i, nReset => rst_i, ena => core_en, clk_cnt => prer, start => sta, stop => sto, read => rd, write => wr, ack_in => ack, i2c_busy => i2c_busy, i2c_al => i2c_al, din => txr, cmd_ack => done, ack_out => irxack, dout => rxr, scl_i => scl_pad_i, scl_o => scl_pad_o, scl_oen => scl_padoen_o, sda_i => sda_pad_i, sda_o => sda_pad_o, sda_oen => sda_padoen_o ); -- status register block + interrupt request signal st_irq_block : block begin -- generate status register bits gen_sr_bits: process (wb_clk_i, rst_i) begin if (rst_i = '0') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; else al <= i2c_al or (al and not sta); rxack <= irxack; tip <= (rd or wr); -- interrupt request flag is always generated irq_flag <= (done or i2c_al or irq_flag) and not iack; end if; end if; end process gen_sr_bits; -- generate interrupt request signals gen_irq: process (wb_clk_i, rst_i) begin if (rst_i = '0') then wb_inta_o <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then wb_inta_o <= '0'; else -- interrupt signal is only generated when IEN (interrupt enable bit) is set wb_inta_o <= irq_flag and ien; end if; end if; end process gen_irq; -- assign status register bits sr(7) <= rxack; sr(6) <= i2c_busy; sr(5) <= al; sr(4 downto 2) <= (others => '0'); -- reserved sr(1) <= tip; sr(0) <= irq_flag; end block; end architecture structural;
--------------------------------------------------------------------- ---- ---- ---- WISHBONE revB2 compl. I2C Master Core; top level ---- ---- ---- ---- ---- ---- Author: Richard Herveille ---- ---- [email protected] ---- ---- www.asics.ws ---- ---- ---- ---- Downloaded from: http://www.opencores.org/projects/i2c/ ---- ---- ---- --------------------------------------------------------------------- ---- ---- ---- Copyright (C) 2000 Richard Herveille ---- ---- [email protected] ---- ---- ---- ---- This source file may be used and distributed without ---- ---- restriction provided that this copyright statement is not ---- ---- removed from the file and that any derivative work contains ---- ---- the original copyright notice and the associated disclaimer.---- ---- ---- ---- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ---- ---- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---- ---- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ---- ---- FOR A PARTICULAR PURPOSE. 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. ---- ---- ---- --------------------------------------------------------------------- -- CVS Log -- -- $Id: i2c_master_top.vhd,v 1.8 2009-01-20 10:38:45 rherveille Exp $ -- -- $Date: 2009-01-20 10:38:45 $ -- $Revision: 1.8 $ -- $Author: rherveille $ -- $Locker: $ -- $State: Exp $ -- -- Change History: -- Revision 1.7 2004/03/14 10:17:03 rherveille -- Fixed simulation issue when writing to CR register -- -- Revision 1.6 2003/08/09 07:01:13 rherveille -- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line. -- Fixed a potential bug in the byte controller's host-acknowledge generation. -- -- Revision 1.5 2003/02/01 02:03:06 rherveille -- Fixed a few 'arbitration lost' bugs. VHDL version only. -- -- Revision 1.4 2002/12/26 16:05:47 rherveille -- Core is now a Multimaster I2C controller. -- -- Revision 1.3 2002/11/30 22:24:37 rherveille -- Cleaned up code -- -- Revision 1.2 2001/11/10 10:52:44 rherveille -- Changed PRER reset value from 0x0000 to 0xffff, conform specs. -- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity COMM_zpuino_wb_i2c is generic( ARST_LVL : std_logic := '0' -- asynchronous reset level ); port ( -- wishbone signals wishbone_in : in std_logic_vector(61 downto 0); wishbone_out : out std_logic_vector(33 downto 0); -- i2c lines scl_pad_i : in std_logic; -- i2c clock line input scl_pad_o : out std_logic; -- i2c clock line output scl_padoen_o : out std_logic; -- i2c clock line output enable, active low sda_pad_i : in std_logic; -- i2c data line input sda_pad_o : out std_logic; -- i2c data line output sda_padoen_o : out std_logic -- i2c data line output enable, active low ); end entity COMM_zpuino_wb_i2c; architecture structural of COMM_zpuino_wb_i2c is component i2c_master_byte_ctrl is port ( clk : in std_logic; rst : in std_logic; -- synchronous active high reset (WISHBONE compatible) nReset : in std_logic; -- asynchornous active low reset (FPGA compatible) ena : in std_logic; -- core enable signal clk_cnt : in unsigned(15 downto 0); -- 4x SCL -- input signals start, stop, read, write, ack_in : std_logic; din : in std_logic_vector(7 downto 0); -- output signals cmd_ack : out std_logic; ack_out : out std_logic; i2c_busy : out std_logic; i2c_al : out std_logic; dout : out std_logic_vector(7 downto 0); -- i2c lines scl_i : in std_logic; -- i2c clock line input scl_o : out std_logic; -- i2c clock line output scl_oen : out std_logic; -- i2c clock line output enable, active low sda_i : in std_logic; -- i2c data line input sda_o : out std_logic; -- i2c data line output sda_oen : out std_logic -- i2c data line output enable, active low ); end component i2c_master_byte_ctrl; -- registers signal prer : unsigned(15 downto 0); -- clock prescale register signal ctr : std_logic_vector(7 downto 0); -- control register signal txr : std_logic_vector(7 downto 0); -- transmit register signal rxr : std_logic_vector(7 downto 0); -- receive register signal cr : std_logic_vector(7 downto 0); -- command register signal sr : std_logic_vector(7 downto 0); -- status register -- internal reset signal signal rst_i : std_logic; -- wishbone write access signal wb_wacc : std_logic; -- internal acknowledge signal signal iack_o : std_logic; -- done signal: command completed, clear command register signal done : std_logic; -- command register signals signal sta, sto, rd, wr, ack, iack : std_logic; signal core_en : std_logic; -- core enable signal signal ien : std_logic; -- interrupt enable signal -- status register signals signal irxack, rxack : std_logic; -- received aknowledge from slave signal tip : std_logic; -- transfer in progress signal irq_flag : std_logic; -- interrupt pending flag signal i2c_busy : std_logic; -- i2c bus busy (start signal detected) signal i2c_al, al : std_logic; -- arbitration lost signal wb_clk_i: std_logic; -- Wishbone clock signal wb_rst_i: std_logic; -- Wishbone reset (synchronous) signal wb_dat_i: std_logic_vector(31 downto 0); -- Wishbone data input (32 bits) signal wb_adr_i: std_logic_vector(26 downto 2); -- Wishbone address input (32 bits) signal wb_we_i: std_logic; -- Wishbone write enable signal signal wb_cyc_i: std_logic; -- Wishbone cycle signal signal wb_stb_i: std_logic; -- Wishbone strobe signal signal wb_dat_o: std_logic_vector(31 downto 0); -- Wishbone data output (32 bits) signal wb_ack_o: std_logic; -- Wishbone acknowledge out signal signal wb_inta_o: std_logic; begin -- Unpack the wishbone array into signals so the modules code is not confusing. wb_clk_i <= wishbone_in(61); wb_rst_i <= wishbone_in(60); wb_dat_i <= wishbone_in(59 downto 28); wb_adr_i <= wishbone_in(27 downto 3); wb_we_i <= wishbone_in(2); wb_cyc_i <= wishbone_in(1); wb_stb_i <= wishbone_in(0); wishbone_out(33 downto 2) <= wb_dat_o; wishbone_out(1) <= wb_ack_o; wishbone_out(0) <= wb_inta_o; -- generate internal reset signal rst_i <= arst_i xor ARST_LVL; -- generate acknowledge output signal gen_ack_o : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then iack_o <= wb_cyc_i and wb_stb_i and not iack_o; -- because timing is always honored end if; end process gen_ack_o; wb_ack_o <= iack_o; -- generate wishbone write access signal wb_wacc <= wb_we_i and iack_o; -- assign wb_dat_o assign_dato : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then case wb_adr_i is when "000" => wb_dat_o <= std_logic_vector(prer( 7 downto 0)); when "001" => wb_dat_o <= std_logic_vector(prer(15 downto 8)); when "010" => wb_dat_o <= ctr; when "011" => wb_dat_o <= rxr; -- write is transmit register TxR when "100" => wb_dat_o <= sr; -- write is command register CR -- Debugging registers: -- These registers are not documented. -- Functionality could change in future releases when "101" => wb_dat_o <= txr; when "110" => wb_dat_o <= cr; when "111" => wb_dat_o <= (others => '0'); when others => wb_dat_o <= (others => 'X'); -- for simulation only end case; end if; end process assign_dato; -- generate registers (CR, SR see below) gen_regs: process(rst_i, wb_clk_i) begin if (rst_i = '0') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_wacc = '1') then case wb_adr_i is when "000" => prer( 7 downto 0) <= unsigned(wb_dat_i); when "001" => prer(15 downto 8) <= unsigned(wb_dat_i); when "010" => ctr <= wb_dat_i; when "011" => txr <= wb_dat_i; when "100" => null; --write to CR, avoid executing the others clause -- illegal cases, for simulation only when others => report ("Illegal write address, setting all registers to unknown."); prer <= (others => 'X'); ctr <= (others => 'X'); txr <= (others => 'X'); end case; end if; end if; end process gen_regs; -- generate command register gen_cr: process(rst_i, wb_clk_i) begin if (rst_i = '0') then cr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then cr <= (others => '0'); elsif (wb_wacc = '1') then if ( (core_en = '1') and (wb_adr_i = "100") ) then -- only take new commands when i2c core enabled -- pending commands are finished cr <= wb_dat_i; end if; else if (done = '1' or i2c_al = '1') then cr(7 downto 4) <= (others => '0'); -- clear command bits when command done or arbitration lost end if; cr(2 downto 1) <= (others => '0'); -- reserved bits, always '0' cr(0) <= '0'; -- clear IRQ_ACK bit end if; end if; end process gen_cr; -- decode command register sta <= cr(7); sto <= cr(6); rd <= cr(5); wr <= cr(4); ack <= cr(3); iack <= cr(0); -- decode control register core_en <= ctr(7); ien <= ctr(6); -- hookup byte controller block byte_ctrl: i2c_master_byte_ctrl port map ( clk => wb_clk_i, rst => wb_rst_i, nReset => rst_i, ena => core_en, clk_cnt => prer, start => sta, stop => sto, read => rd, write => wr, ack_in => ack, i2c_busy => i2c_busy, i2c_al => i2c_al, din => txr, cmd_ack => done, ack_out => irxack, dout => rxr, scl_i => scl_pad_i, scl_o => scl_pad_o, scl_oen => scl_padoen_o, sda_i => sda_pad_i, sda_o => sda_pad_o, sda_oen => sda_padoen_o ); -- status register block + interrupt request signal st_irq_block : block begin -- generate status register bits gen_sr_bits: process (wb_clk_i, rst_i) begin if (rst_i = '0') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; else al <= i2c_al or (al and not sta); rxack <= irxack; tip <= (rd or wr); -- interrupt request flag is always generated irq_flag <= (done or i2c_al or irq_flag) and not iack; end if; end if; end process gen_sr_bits; -- generate interrupt request signals gen_irq: process (wb_clk_i, rst_i) begin if (rst_i = '0') then wb_inta_o <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then wb_inta_o <= '0'; else -- interrupt signal is only generated when IEN (interrupt enable bit) is set wb_inta_o <= irq_flag and ien; end if; end if; end process gen_irq; -- assign status register bits sr(7) <= rxack; sr(6) <= i2c_busy; sr(5) <= al; sr(4 downto 2) <= (others => '0'); -- reserved sr(1) <= tip; sr(0) <= irq_flag; end block; end architecture structural;
--------------------------------------------------------------------- ---- ---- ---- WISHBONE revB2 compl. I2C Master Core; top level ---- ---- ---- ---- ---- ---- Author: Richard Herveille ---- ---- [email protected] ---- ---- www.asics.ws ---- ---- ---- ---- Downloaded from: http://www.opencores.org/projects/i2c/ ---- ---- ---- --------------------------------------------------------------------- ---- ---- ---- Copyright (C) 2000 Richard Herveille ---- ---- [email protected] ---- ---- ---- ---- This source file may be used and distributed without ---- ---- restriction provided that this copyright statement is not ---- ---- removed from the file and that any derivative work contains ---- ---- the original copyright notice and the associated disclaimer.---- ---- ---- ---- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ---- ---- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---- ---- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ---- ---- FOR A PARTICULAR PURPOSE. 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. ---- ---- ---- --------------------------------------------------------------------- -- CVS Log -- -- $Id: i2c_master_top.vhd,v 1.8 2009-01-20 10:38:45 rherveille Exp $ -- -- $Date: 2009-01-20 10:38:45 $ -- $Revision: 1.8 $ -- $Author: rherveille $ -- $Locker: $ -- $State: Exp $ -- -- Change History: -- Revision 1.7 2004/03/14 10:17:03 rherveille -- Fixed simulation issue when writing to CR register -- -- Revision 1.6 2003/08/09 07:01:13 rherveille -- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line. -- Fixed a potential bug in the byte controller's host-acknowledge generation. -- -- Revision 1.5 2003/02/01 02:03:06 rherveille -- Fixed a few 'arbitration lost' bugs. VHDL version only. -- -- Revision 1.4 2002/12/26 16:05:47 rherveille -- Core is now a Multimaster I2C controller. -- -- Revision 1.3 2002/11/30 22:24:37 rherveille -- Cleaned up code -- -- Revision 1.2 2001/11/10 10:52:44 rherveille -- Changed PRER reset value from 0x0000 to 0xffff, conform specs. -- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity COMM_zpuino_wb_i2c is generic( ARST_LVL : std_logic := '0' -- asynchronous reset level ); port ( -- wishbone signals wishbone_in : in std_logic_vector(61 downto 0); wishbone_out : out std_logic_vector(33 downto 0); -- i2c lines scl_pad_i : in std_logic; -- i2c clock line input scl_pad_o : out std_logic; -- i2c clock line output scl_padoen_o : out std_logic; -- i2c clock line output enable, active low sda_pad_i : in std_logic; -- i2c data line input sda_pad_o : out std_logic; -- i2c data line output sda_padoen_o : out std_logic -- i2c data line output enable, active low ); end entity COMM_zpuino_wb_i2c; architecture structural of COMM_zpuino_wb_i2c is component i2c_master_byte_ctrl is port ( clk : in std_logic; rst : in std_logic; -- synchronous active high reset (WISHBONE compatible) nReset : in std_logic; -- asynchornous active low reset (FPGA compatible) ena : in std_logic; -- core enable signal clk_cnt : in unsigned(15 downto 0); -- 4x SCL -- input signals start, stop, read, write, ack_in : std_logic; din : in std_logic_vector(7 downto 0); -- output signals cmd_ack : out std_logic; ack_out : out std_logic; i2c_busy : out std_logic; i2c_al : out std_logic; dout : out std_logic_vector(7 downto 0); -- i2c lines scl_i : in std_logic; -- i2c clock line input scl_o : out std_logic; -- i2c clock line output scl_oen : out std_logic; -- i2c clock line output enable, active low sda_i : in std_logic; -- i2c data line input sda_o : out std_logic; -- i2c data line output sda_oen : out std_logic -- i2c data line output enable, active low ); end component i2c_master_byte_ctrl; -- registers signal prer : unsigned(15 downto 0); -- clock prescale register signal ctr : std_logic_vector(7 downto 0); -- control register signal txr : std_logic_vector(7 downto 0); -- transmit register signal rxr : std_logic_vector(7 downto 0); -- receive register signal cr : std_logic_vector(7 downto 0); -- command register signal sr : std_logic_vector(7 downto 0); -- status register -- internal reset signal signal rst_i : std_logic; -- wishbone write access signal wb_wacc : std_logic; -- internal acknowledge signal signal iack_o : std_logic; -- done signal: command completed, clear command register signal done : std_logic; -- command register signals signal sta, sto, rd, wr, ack, iack : std_logic; signal core_en : std_logic; -- core enable signal signal ien : std_logic; -- interrupt enable signal -- status register signals signal irxack, rxack : std_logic; -- received aknowledge from slave signal tip : std_logic; -- transfer in progress signal irq_flag : std_logic; -- interrupt pending flag signal i2c_busy : std_logic; -- i2c bus busy (start signal detected) signal i2c_al, al : std_logic; -- arbitration lost signal wb_clk_i: std_logic; -- Wishbone clock signal wb_rst_i: std_logic; -- Wishbone reset (synchronous) signal wb_dat_i: std_logic_vector(31 downto 0); -- Wishbone data input (32 bits) signal wb_adr_i: std_logic_vector(26 downto 2); -- Wishbone address input (32 bits) signal wb_we_i: std_logic; -- Wishbone write enable signal signal wb_cyc_i: std_logic; -- Wishbone cycle signal signal wb_stb_i: std_logic; -- Wishbone strobe signal signal wb_dat_o: std_logic_vector(31 downto 0); -- Wishbone data output (32 bits) signal wb_ack_o: std_logic; -- Wishbone acknowledge out signal signal wb_inta_o: std_logic; begin -- Unpack the wishbone array into signals so the modules code is not confusing. wb_clk_i <= wishbone_in(61); wb_rst_i <= wishbone_in(60); wb_dat_i <= wishbone_in(59 downto 28); wb_adr_i <= wishbone_in(27 downto 3); wb_we_i <= wishbone_in(2); wb_cyc_i <= wishbone_in(1); wb_stb_i <= wishbone_in(0); wishbone_out(33 downto 2) <= wb_dat_o; wishbone_out(1) <= wb_ack_o; wishbone_out(0) <= wb_inta_o; -- generate internal reset signal rst_i <= arst_i xor ARST_LVL; -- generate acknowledge output signal gen_ack_o : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then iack_o <= wb_cyc_i and wb_stb_i and not iack_o; -- because timing is always honored end if; end process gen_ack_o; wb_ack_o <= iack_o; -- generate wishbone write access signal wb_wacc <= wb_we_i and iack_o; -- assign wb_dat_o assign_dato : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then case wb_adr_i is when "000" => wb_dat_o <= std_logic_vector(prer( 7 downto 0)); when "001" => wb_dat_o <= std_logic_vector(prer(15 downto 8)); when "010" => wb_dat_o <= ctr; when "011" => wb_dat_o <= rxr; -- write is transmit register TxR when "100" => wb_dat_o <= sr; -- write is command register CR -- Debugging registers: -- These registers are not documented. -- Functionality could change in future releases when "101" => wb_dat_o <= txr; when "110" => wb_dat_o <= cr; when "111" => wb_dat_o <= (others => '0'); when others => wb_dat_o <= (others => 'X'); -- for simulation only end case; end if; end process assign_dato; -- generate registers (CR, SR see below) gen_regs: process(rst_i, wb_clk_i) begin if (rst_i = '0') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_wacc = '1') then case wb_adr_i is when "000" => prer( 7 downto 0) <= unsigned(wb_dat_i); when "001" => prer(15 downto 8) <= unsigned(wb_dat_i); when "010" => ctr <= wb_dat_i; when "011" => txr <= wb_dat_i; when "100" => null; --write to CR, avoid executing the others clause -- illegal cases, for simulation only when others => report ("Illegal write address, setting all registers to unknown."); prer <= (others => 'X'); ctr <= (others => 'X'); txr <= (others => 'X'); end case; end if; end if; end process gen_regs; -- generate command register gen_cr: process(rst_i, wb_clk_i) begin if (rst_i = '0') then cr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then cr <= (others => '0'); elsif (wb_wacc = '1') then if ( (core_en = '1') and (wb_adr_i = "100") ) then -- only take new commands when i2c core enabled -- pending commands are finished cr <= wb_dat_i; end if; else if (done = '1' or i2c_al = '1') then cr(7 downto 4) <= (others => '0'); -- clear command bits when command done or arbitration lost end if; cr(2 downto 1) <= (others => '0'); -- reserved bits, always '0' cr(0) <= '0'; -- clear IRQ_ACK bit end if; end if; end process gen_cr; -- decode command register sta <= cr(7); sto <= cr(6); rd <= cr(5); wr <= cr(4); ack <= cr(3); iack <= cr(0); -- decode control register core_en <= ctr(7); ien <= ctr(6); -- hookup byte controller block byte_ctrl: i2c_master_byte_ctrl port map ( clk => wb_clk_i, rst => wb_rst_i, nReset => rst_i, ena => core_en, clk_cnt => prer, start => sta, stop => sto, read => rd, write => wr, ack_in => ack, i2c_busy => i2c_busy, i2c_al => i2c_al, din => txr, cmd_ack => done, ack_out => irxack, dout => rxr, scl_i => scl_pad_i, scl_o => scl_pad_o, scl_oen => scl_padoen_o, sda_i => sda_pad_i, sda_o => sda_pad_o, sda_oen => sda_padoen_o ); -- status register block + interrupt request signal st_irq_block : block begin -- generate status register bits gen_sr_bits: process (wb_clk_i, rst_i) begin if (rst_i = '0') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; else al <= i2c_al or (al and not sta); rxack <= irxack; tip <= (rd or wr); -- interrupt request flag is always generated irq_flag <= (done or i2c_al or irq_flag) and not iack; end if; end if; end process gen_sr_bits; -- generate interrupt request signals gen_irq: process (wb_clk_i, rst_i) begin if (rst_i = '0') then wb_inta_o <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then wb_inta_o <= '0'; else -- interrupt signal is only generated when IEN (interrupt enable bit) is set wb_inta_o <= irq_flag and ien; end if; end if; end process gen_irq; -- assign status register bits sr(7) <= rxack; sr(6) <= i2c_busy; sr(5) <= al; sr(4 downto 2) <= (others => '0'); -- reserved sr(1) <= tip; sr(0) <= irq_flag; end block; end architecture structural;
--------------------------------------------------------------------- ---- ---- ---- WISHBONE revB2 compl. I2C Master Core; top level ---- ---- ---- ---- ---- ---- Author: Richard Herveille ---- ---- [email protected] ---- ---- www.asics.ws ---- ---- ---- ---- Downloaded from: http://www.opencores.org/projects/i2c/ ---- ---- ---- --------------------------------------------------------------------- ---- ---- ---- Copyright (C) 2000 Richard Herveille ---- ---- [email protected] ---- ---- ---- ---- This source file may be used and distributed without ---- ---- restriction provided that this copyright statement is not ---- ---- removed from the file and that any derivative work contains ---- ---- the original copyright notice and the associated disclaimer.---- ---- ---- ---- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ---- ---- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---- ---- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ---- ---- FOR A PARTICULAR PURPOSE. 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. ---- ---- ---- --------------------------------------------------------------------- -- CVS Log -- -- $Id: i2c_master_top.vhd,v 1.8 2009-01-20 10:38:45 rherveille Exp $ -- -- $Date: 2009-01-20 10:38:45 $ -- $Revision: 1.8 $ -- $Author: rherveille $ -- $Locker: $ -- $State: Exp $ -- -- Change History: -- Revision 1.7 2004/03/14 10:17:03 rherveille -- Fixed simulation issue when writing to CR register -- -- Revision 1.6 2003/08/09 07:01:13 rherveille -- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line. -- Fixed a potential bug in the byte controller's host-acknowledge generation. -- -- Revision 1.5 2003/02/01 02:03:06 rherveille -- Fixed a few 'arbitration lost' bugs. VHDL version only. -- -- Revision 1.4 2002/12/26 16:05:47 rherveille -- Core is now a Multimaster I2C controller. -- -- Revision 1.3 2002/11/30 22:24:37 rherveille -- Cleaned up code -- -- Revision 1.2 2001/11/10 10:52:44 rherveille -- Changed PRER reset value from 0x0000 to 0xffff, conform specs. -- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity COMM_zpuino_wb_i2c is generic( ARST_LVL : std_logic := '0' -- asynchronous reset level ); port ( -- wishbone signals wishbone_in : in std_logic_vector(61 downto 0); wishbone_out : out std_logic_vector(33 downto 0); -- i2c lines scl_pad_i : in std_logic; -- i2c clock line input scl_pad_o : out std_logic; -- i2c clock line output scl_padoen_o : out std_logic; -- i2c clock line output enable, active low sda_pad_i : in std_logic; -- i2c data line input sda_pad_o : out std_logic; -- i2c data line output sda_padoen_o : out std_logic -- i2c data line output enable, active low ); end entity COMM_zpuino_wb_i2c; architecture structural of COMM_zpuino_wb_i2c is component i2c_master_byte_ctrl is port ( clk : in std_logic; rst : in std_logic; -- synchronous active high reset (WISHBONE compatible) nReset : in std_logic; -- asynchornous active low reset (FPGA compatible) ena : in std_logic; -- core enable signal clk_cnt : in unsigned(15 downto 0); -- 4x SCL -- input signals start, stop, read, write, ack_in : std_logic; din : in std_logic_vector(7 downto 0); -- output signals cmd_ack : out std_logic; ack_out : out std_logic; i2c_busy : out std_logic; i2c_al : out std_logic; dout : out std_logic_vector(7 downto 0); -- i2c lines scl_i : in std_logic; -- i2c clock line input scl_o : out std_logic; -- i2c clock line output scl_oen : out std_logic; -- i2c clock line output enable, active low sda_i : in std_logic; -- i2c data line input sda_o : out std_logic; -- i2c data line output sda_oen : out std_logic -- i2c data line output enable, active low ); end component i2c_master_byte_ctrl; -- registers signal prer : unsigned(15 downto 0); -- clock prescale register signal ctr : std_logic_vector(7 downto 0); -- control register signal txr : std_logic_vector(7 downto 0); -- transmit register signal rxr : std_logic_vector(7 downto 0); -- receive register signal cr : std_logic_vector(7 downto 0); -- command register signal sr : std_logic_vector(7 downto 0); -- status register -- internal reset signal signal rst_i : std_logic; -- wishbone write access signal wb_wacc : std_logic; -- internal acknowledge signal signal iack_o : std_logic; -- done signal: command completed, clear command register signal done : std_logic; -- command register signals signal sta, sto, rd, wr, ack, iack : std_logic; signal core_en : std_logic; -- core enable signal signal ien : std_logic; -- interrupt enable signal -- status register signals signal irxack, rxack : std_logic; -- received aknowledge from slave signal tip : std_logic; -- transfer in progress signal irq_flag : std_logic; -- interrupt pending flag signal i2c_busy : std_logic; -- i2c bus busy (start signal detected) signal i2c_al, al : std_logic; -- arbitration lost signal wb_clk_i: std_logic; -- Wishbone clock signal wb_rst_i: std_logic; -- Wishbone reset (synchronous) signal wb_dat_i: std_logic_vector(31 downto 0); -- Wishbone data input (32 bits) signal wb_adr_i: std_logic_vector(26 downto 2); -- Wishbone address input (32 bits) signal wb_we_i: std_logic; -- Wishbone write enable signal signal wb_cyc_i: std_logic; -- Wishbone cycle signal signal wb_stb_i: std_logic; -- Wishbone strobe signal signal wb_dat_o: std_logic_vector(31 downto 0); -- Wishbone data output (32 bits) signal wb_ack_o: std_logic; -- Wishbone acknowledge out signal signal wb_inta_o: std_logic; begin -- Unpack the wishbone array into signals so the modules code is not confusing. wb_clk_i <= wishbone_in(61); wb_rst_i <= wishbone_in(60); wb_dat_i <= wishbone_in(59 downto 28); wb_adr_i <= wishbone_in(27 downto 3); wb_we_i <= wishbone_in(2); wb_cyc_i <= wishbone_in(1); wb_stb_i <= wishbone_in(0); wishbone_out(33 downto 2) <= wb_dat_o; wishbone_out(1) <= wb_ack_o; wishbone_out(0) <= wb_inta_o; -- generate internal reset signal rst_i <= arst_i xor ARST_LVL; -- generate acknowledge output signal gen_ack_o : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then iack_o <= wb_cyc_i and wb_stb_i and not iack_o; -- because timing is always honored end if; end process gen_ack_o; wb_ack_o <= iack_o; -- generate wishbone write access signal wb_wacc <= wb_we_i and iack_o; -- assign wb_dat_o assign_dato : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then case wb_adr_i is when "000" => wb_dat_o <= std_logic_vector(prer( 7 downto 0)); when "001" => wb_dat_o <= std_logic_vector(prer(15 downto 8)); when "010" => wb_dat_o <= ctr; when "011" => wb_dat_o <= rxr; -- write is transmit register TxR when "100" => wb_dat_o <= sr; -- write is command register CR -- Debugging registers: -- These registers are not documented. -- Functionality could change in future releases when "101" => wb_dat_o <= txr; when "110" => wb_dat_o <= cr; when "111" => wb_dat_o <= (others => '0'); when others => wb_dat_o <= (others => 'X'); -- for simulation only end case; end if; end process assign_dato; -- generate registers (CR, SR see below) gen_regs: process(rst_i, wb_clk_i) begin if (rst_i = '0') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_wacc = '1') then case wb_adr_i is when "000" => prer( 7 downto 0) <= unsigned(wb_dat_i); when "001" => prer(15 downto 8) <= unsigned(wb_dat_i); when "010" => ctr <= wb_dat_i; when "011" => txr <= wb_dat_i; when "100" => null; --write to CR, avoid executing the others clause -- illegal cases, for simulation only when others => report ("Illegal write address, setting all registers to unknown."); prer <= (others => 'X'); ctr <= (others => 'X'); txr <= (others => 'X'); end case; end if; end if; end process gen_regs; -- generate command register gen_cr: process(rst_i, wb_clk_i) begin if (rst_i = '0') then cr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then cr <= (others => '0'); elsif (wb_wacc = '1') then if ( (core_en = '1') and (wb_adr_i = "100") ) then -- only take new commands when i2c core enabled -- pending commands are finished cr <= wb_dat_i; end if; else if (done = '1' or i2c_al = '1') then cr(7 downto 4) <= (others => '0'); -- clear command bits when command done or arbitration lost end if; cr(2 downto 1) <= (others => '0'); -- reserved bits, always '0' cr(0) <= '0'; -- clear IRQ_ACK bit end if; end if; end process gen_cr; -- decode command register sta <= cr(7); sto <= cr(6); rd <= cr(5); wr <= cr(4); ack <= cr(3); iack <= cr(0); -- decode control register core_en <= ctr(7); ien <= ctr(6); -- hookup byte controller block byte_ctrl: i2c_master_byte_ctrl port map ( clk => wb_clk_i, rst => wb_rst_i, nReset => rst_i, ena => core_en, clk_cnt => prer, start => sta, stop => sto, read => rd, write => wr, ack_in => ack, i2c_busy => i2c_busy, i2c_al => i2c_al, din => txr, cmd_ack => done, ack_out => irxack, dout => rxr, scl_i => scl_pad_i, scl_o => scl_pad_o, scl_oen => scl_padoen_o, sda_i => sda_pad_i, sda_o => sda_pad_o, sda_oen => sda_padoen_o ); -- status register block + interrupt request signal st_irq_block : block begin -- generate status register bits gen_sr_bits: process (wb_clk_i, rst_i) begin if (rst_i = '0') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; else al <= i2c_al or (al and not sta); rxack <= irxack; tip <= (rd or wr); -- interrupt request flag is always generated irq_flag <= (done or i2c_al or irq_flag) and not iack; end if; end if; end process gen_sr_bits; -- generate interrupt request signals gen_irq: process (wb_clk_i, rst_i) begin if (rst_i = '0') then wb_inta_o <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then wb_inta_o <= '0'; else -- interrupt signal is only generated when IEN (interrupt enable bit) is set wb_inta_o <= irq_flag and ien; end if; end if; end process gen_irq; -- assign status register bits sr(7) <= rxack; sr(6) <= i2c_busy; sr(5) <= al; sr(4 downto 2) <= (others => '0'); -- reserved sr(1) <= tip; sr(0) <= irq_flag; end block; end architecture structural;
--------------------------------------------------------------------- ---- ---- ---- WISHBONE revB2 compl. I2C Master Core; top level ---- ---- ---- ---- ---- ---- Author: Richard Herveille ---- ---- [email protected] ---- ---- www.asics.ws ---- ---- ---- ---- Downloaded from: http://www.opencores.org/projects/i2c/ ---- ---- ---- --------------------------------------------------------------------- ---- ---- ---- Copyright (C) 2000 Richard Herveille ---- ---- [email protected] ---- ---- ---- ---- This source file may be used and distributed without ---- ---- restriction provided that this copyright statement is not ---- ---- removed from the file and that any derivative work contains ---- ---- the original copyright notice and the associated disclaimer.---- ---- ---- ---- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ---- ---- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---- ---- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ---- ---- FOR A PARTICULAR PURPOSE. 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. ---- ---- ---- --------------------------------------------------------------------- -- CVS Log -- -- $Id: i2c_master_top.vhd,v 1.8 2009-01-20 10:38:45 rherveille Exp $ -- -- $Date: 2009-01-20 10:38:45 $ -- $Revision: 1.8 $ -- $Author: rherveille $ -- $Locker: $ -- $State: Exp $ -- -- Change History: -- Revision 1.7 2004/03/14 10:17:03 rherveille -- Fixed simulation issue when writing to CR register -- -- Revision 1.6 2003/08/09 07:01:13 rherveille -- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line. -- Fixed a potential bug in the byte controller's host-acknowledge generation. -- -- Revision 1.5 2003/02/01 02:03:06 rherveille -- Fixed a few 'arbitration lost' bugs. VHDL version only. -- -- Revision 1.4 2002/12/26 16:05:47 rherveille -- Core is now a Multimaster I2C controller. -- -- Revision 1.3 2002/11/30 22:24:37 rherveille -- Cleaned up code -- -- Revision 1.2 2001/11/10 10:52:44 rherveille -- Changed PRER reset value from 0x0000 to 0xffff, conform specs. -- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity COMM_zpuino_wb_i2c is generic( ARST_LVL : std_logic := '0' -- asynchronous reset level ); port ( -- wishbone signals wishbone_in : in std_logic_vector(61 downto 0); wishbone_out : out std_logic_vector(33 downto 0); -- i2c lines scl_pad_i : in std_logic; -- i2c clock line input scl_pad_o : out std_logic; -- i2c clock line output scl_padoen_o : out std_logic; -- i2c clock line output enable, active low sda_pad_i : in std_logic; -- i2c data line input sda_pad_o : out std_logic; -- i2c data line output sda_padoen_o : out std_logic -- i2c data line output enable, active low ); end entity COMM_zpuino_wb_i2c; architecture structural of COMM_zpuino_wb_i2c is component i2c_master_byte_ctrl is port ( clk : in std_logic; rst : in std_logic; -- synchronous active high reset (WISHBONE compatible) nReset : in std_logic; -- asynchornous active low reset (FPGA compatible) ena : in std_logic; -- core enable signal clk_cnt : in unsigned(15 downto 0); -- 4x SCL -- input signals start, stop, read, write, ack_in : std_logic; din : in std_logic_vector(7 downto 0); -- output signals cmd_ack : out std_logic; ack_out : out std_logic; i2c_busy : out std_logic; i2c_al : out std_logic; dout : out std_logic_vector(7 downto 0); -- i2c lines scl_i : in std_logic; -- i2c clock line input scl_o : out std_logic; -- i2c clock line output scl_oen : out std_logic; -- i2c clock line output enable, active low sda_i : in std_logic; -- i2c data line input sda_o : out std_logic; -- i2c data line output sda_oen : out std_logic -- i2c data line output enable, active low ); end component i2c_master_byte_ctrl; -- registers signal prer : unsigned(15 downto 0); -- clock prescale register signal ctr : std_logic_vector(7 downto 0); -- control register signal txr : std_logic_vector(7 downto 0); -- transmit register signal rxr : std_logic_vector(7 downto 0); -- receive register signal cr : std_logic_vector(7 downto 0); -- command register signal sr : std_logic_vector(7 downto 0); -- status register -- internal reset signal signal rst_i : std_logic; -- wishbone write access signal wb_wacc : std_logic; -- internal acknowledge signal signal iack_o : std_logic; -- done signal: command completed, clear command register signal done : std_logic; -- command register signals signal sta, sto, rd, wr, ack, iack : std_logic; signal core_en : std_logic; -- core enable signal signal ien : std_logic; -- interrupt enable signal -- status register signals signal irxack, rxack : std_logic; -- received aknowledge from slave signal tip : std_logic; -- transfer in progress signal irq_flag : std_logic; -- interrupt pending flag signal i2c_busy : std_logic; -- i2c bus busy (start signal detected) signal i2c_al, al : std_logic; -- arbitration lost signal wb_clk_i: std_logic; -- Wishbone clock signal wb_rst_i: std_logic; -- Wishbone reset (synchronous) signal wb_dat_i: std_logic_vector(31 downto 0); -- Wishbone data input (32 bits) signal wb_adr_i: std_logic_vector(26 downto 2); -- Wishbone address input (32 bits) signal wb_we_i: std_logic; -- Wishbone write enable signal signal wb_cyc_i: std_logic; -- Wishbone cycle signal signal wb_stb_i: std_logic; -- Wishbone strobe signal signal wb_dat_o: std_logic_vector(31 downto 0); -- Wishbone data output (32 bits) signal wb_ack_o: std_logic; -- Wishbone acknowledge out signal signal wb_inta_o: std_logic; begin -- Unpack the wishbone array into signals so the modules code is not confusing. wb_clk_i <= wishbone_in(61); wb_rst_i <= wishbone_in(60); wb_dat_i <= wishbone_in(59 downto 28); wb_adr_i <= wishbone_in(27 downto 3); wb_we_i <= wishbone_in(2); wb_cyc_i <= wishbone_in(1); wb_stb_i <= wishbone_in(0); wishbone_out(33 downto 2) <= wb_dat_o; wishbone_out(1) <= wb_ack_o; wishbone_out(0) <= wb_inta_o; -- generate internal reset signal rst_i <= arst_i xor ARST_LVL; -- generate acknowledge output signal gen_ack_o : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then iack_o <= wb_cyc_i and wb_stb_i and not iack_o; -- because timing is always honored end if; end process gen_ack_o; wb_ack_o <= iack_o; -- generate wishbone write access signal wb_wacc <= wb_we_i and iack_o; -- assign wb_dat_o assign_dato : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then case wb_adr_i is when "000" => wb_dat_o <= std_logic_vector(prer( 7 downto 0)); when "001" => wb_dat_o <= std_logic_vector(prer(15 downto 8)); when "010" => wb_dat_o <= ctr; when "011" => wb_dat_o <= rxr; -- write is transmit register TxR when "100" => wb_dat_o <= sr; -- write is command register CR -- Debugging registers: -- These registers are not documented. -- Functionality could change in future releases when "101" => wb_dat_o <= txr; when "110" => wb_dat_o <= cr; when "111" => wb_dat_o <= (others => '0'); when others => wb_dat_o <= (others => 'X'); -- for simulation only end case; end if; end process assign_dato; -- generate registers (CR, SR see below) gen_regs: process(rst_i, wb_clk_i) begin if (rst_i = '0') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_wacc = '1') then case wb_adr_i is when "000" => prer( 7 downto 0) <= unsigned(wb_dat_i); when "001" => prer(15 downto 8) <= unsigned(wb_dat_i); when "010" => ctr <= wb_dat_i; when "011" => txr <= wb_dat_i; when "100" => null; --write to CR, avoid executing the others clause -- illegal cases, for simulation only when others => report ("Illegal write address, setting all registers to unknown."); prer <= (others => 'X'); ctr <= (others => 'X'); txr <= (others => 'X'); end case; end if; end if; end process gen_regs; -- generate command register gen_cr: process(rst_i, wb_clk_i) begin if (rst_i = '0') then cr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then cr <= (others => '0'); elsif (wb_wacc = '1') then if ( (core_en = '1') and (wb_adr_i = "100") ) then -- only take new commands when i2c core enabled -- pending commands are finished cr <= wb_dat_i; end if; else if (done = '1' or i2c_al = '1') then cr(7 downto 4) <= (others => '0'); -- clear command bits when command done or arbitration lost end if; cr(2 downto 1) <= (others => '0'); -- reserved bits, always '0' cr(0) <= '0'; -- clear IRQ_ACK bit end if; end if; end process gen_cr; -- decode command register sta <= cr(7); sto <= cr(6); rd <= cr(5); wr <= cr(4); ack <= cr(3); iack <= cr(0); -- decode control register core_en <= ctr(7); ien <= ctr(6); -- hookup byte controller block byte_ctrl: i2c_master_byte_ctrl port map ( clk => wb_clk_i, rst => wb_rst_i, nReset => rst_i, ena => core_en, clk_cnt => prer, start => sta, stop => sto, read => rd, write => wr, ack_in => ack, i2c_busy => i2c_busy, i2c_al => i2c_al, din => txr, cmd_ack => done, ack_out => irxack, dout => rxr, scl_i => scl_pad_i, scl_o => scl_pad_o, scl_oen => scl_padoen_o, sda_i => sda_pad_i, sda_o => sda_pad_o, sda_oen => sda_padoen_o ); -- status register block + interrupt request signal st_irq_block : block begin -- generate status register bits gen_sr_bits: process (wb_clk_i, rst_i) begin if (rst_i = '0') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; else al <= i2c_al or (al and not sta); rxack <= irxack; tip <= (rd or wr); -- interrupt request flag is always generated irq_flag <= (done or i2c_al or irq_flag) and not iack; end if; end if; end process gen_sr_bits; -- generate interrupt request signals gen_irq: process (wb_clk_i, rst_i) begin if (rst_i = '0') then wb_inta_o <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then wb_inta_o <= '0'; else -- interrupt signal is only generated when IEN (interrupt enable bit) is set wb_inta_o <= irq_flag and ien; end if; end if; end process gen_irq; -- assign status register bits sr(7) <= rxack; sr(6) <= i2c_busy; sr(5) <= al; sr(4 downto 2) <= (others => '0'); -- reserved sr(1) <= tip; sr(0) <= irq_flag; end block; end architecture structural;
--------------------------------------------------------------------- ---- ---- ---- WISHBONE revB2 compl. I2C Master Core; top level ---- ---- ---- ---- ---- ---- Author: Richard Herveille ---- ---- [email protected] ---- ---- www.asics.ws ---- ---- ---- ---- Downloaded from: http://www.opencores.org/projects/i2c/ ---- ---- ---- --------------------------------------------------------------------- ---- ---- ---- Copyright (C) 2000 Richard Herveille ---- ---- [email protected] ---- ---- ---- ---- This source file may be used and distributed without ---- ---- restriction provided that this copyright statement is not ---- ---- removed from the file and that any derivative work contains ---- ---- the original copyright notice and the associated disclaimer.---- ---- ---- ---- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ---- ---- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---- ---- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ---- ---- FOR A PARTICULAR PURPOSE. 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. ---- ---- ---- --------------------------------------------------------------------- -- CVS Log -- -- $Id: i2c_master_top.vhd,v 1.8 2009-01-20 10:38:45 rherveille Exp $ -- -- $Date: 2009-01-20 10:38:45 $ -- $Revision: 1.8 $ -- $Author: rherveille $ -- $Locker: $ -- $State: Exp $ -- -- Change History: -- Revision 1.7 2004/03/14 10:17:03 rherveille -- Fixed simulation issue when writing to CR register -- -- Revision 1.6 2003/08/09 07:01:13 rherveille -- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line. -- Fixed a potential bug in the byte controller's host-acknowledge generation. -- -- Revision 1.5 2003/02/01 02:03:06 rherveille -- Fixed a few 'arbitration lost' bugs. VHDL version only. -- -- Revision 1.4 2002/12/26 16:05:47 rherveille -- Core is now a Multimaster I2C controller. -- -- Revision 1.3 2002/11/30 22:24:37 rherveille -- Cleaned up code -- -- Revision 1.2 2001/11/10 10:52:44 rherveille -- Changed PRER reset value from 0x0000 to 0xffff, conform specs. -- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity COMM_zpuino_wb_i2c is generic( ARST_LVL : std_logic := '0' -- asynchronous reset level ); port ( -- wishbone signals wishbone_in : in std_logic_vector(61 downto 0); wishbone_out : out std_logic_vector(33 downto 0); -- i2c lines scl_pad_i : in std_logic; -- i2c clock line input scl_pad_o : out std_logic; -- i2c clock line output scl_padoen_o : out std_logic; -- i2c clock line output enable, active low sda_pad_i : in std_logic; -- i2c data line input sda_pad_o : out std_logic; -- i2c data line output sda_padoen_o : out std_logic -- i2c data line output enable, active low ); end entity COMM_zpuino_wb_i2c; architecture structural of COMM_zpuino_wb_i2c is component i2c_master_byte_ctrl is port ( clk : in std_logic; rst : in std_logic; -- synchronous active high reset (WISHBONE compatible) nReset : in std_logic; -- asynchornous active low reset (FPGA compatible) ena : in std_logic; -- core enable signal clk_cnt : in unsigned(15 downto 0); -- 4x SCL -- input signals start, stop, read, write, ack_in : std_logic; din : in std_logic_vector(7 downto 0); -- output signals cmd_ack : out std_logic; ack_out : out std_logic; i2c_busy : out std_logic; i2c_al : out std_logic; dout : out std_logic_vector(7 downto 0); -- i2c lines scl_i : in std_logic; -- i2c clock line input scl_o : out std_logic; -- i2c clock line output scl_oen : out std_logic; -- i2c clock line output enable, active low sda_i : in std_logic; -- i2c data line input sda_o : out std_logic; -- i2c data line output sda_oen : out std_logic -- i2c data line output enable, active low ); end component i2c_master_byte_ctrl; -- registers signal prer : unsigned(15 downto 0); -- clock prescale register signal ctr : std_logic_vector(7 downto 0); -- control register signal txr : std_logic_vector(7 downto 0); -- transmit register signal rxr : std_logic_vector(7 downto 0); -- receive register signal cr : std_logic_vector(7 downto 0); -- command register signal sr : std_logic_vector(7 downto 0); -- status register -- internal reset signal signal rst_i : std_logic; -- wishbone write access signal wb_wacc : std_logic; -- internal acknowledge signal signal iack_o : std_logic; -- done signal: command completed, clear command register signal done : std_logic; -- command register signals signal sta, sto, rd, wr, ack, iack : std_logic; signal core_en : std_logic; -- core enable signal signal ien : std_logic; -- interrupt enable signal -- status register signals signal irxack, rxack : std_logic; -- received aknowledge from slave signal tip : std_logic; -- transfer in progress signal irq_flag : std_logic; -- interrupt pending flag signal i2c_busy : std_logic; -- i2c bus busy (start signal detected) signal i2c_al, al : std_logic; -- arbitration lost signal wb_clk_i: std_logic; -- Wishbone clock signal wb_rst_i: std_logic; -- Wishbone reset (synchronous) signal wb_dat_i: std_logic_vector(31 downto 0); -- Wishbone data input (32 bits) signal wb_adr_i: std_logic_vector(26 downto 2); -- Wishbone address input (32 bits) signal wb_we_i: std_logic; -- Wishbone write enable signal signal wb_cyc_i: std_logic; -- Wishbone cycle signal signal wb_stb_i: std_logic; -- Wishbone strobe signal signal wb_dat_o: std_logic_vector(31 downto 0); -- Wishbone data output (32 bits) signal wb_ack_o: std_logic; -- Wishbone acknowledge out signal signal wb_inta_o: std_logic; begin -- Unpack the wishbone array into signals so the modules code is not confusing. wb_clk_i <= wishbone_in(61); wb_rst_i <= wishbone_in(60); wb_dat_i <= wishbone_in(59 downto 28); wb_adr_i <= wishbone_in(27 downto 3); wb_we_i <= wishbone_in(2); wb_cyc_i <= wishbone_in(1); wb_stb_i <= wishbone_in(0); wishbone_out(33 downto 2) <= wb_dat_o; wishbone_out(1) <= wb_ack_o; wishbone_out(0) <= wb_inta_o; -- generate internal reset signal rst_i <= arst_i xor ARST_LVL; -- generate acknowledge output signal gen_ack_o : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then iack_o <= wb_cyc_i and wb_stb_i and not iack_o; -- because timing is always honored end if; end process gen_ack_o; wb_ack_o <= iack_o; -- generate wishbone write access signal wb_wacc <= wb_we_i and iack_o; -- assign wb_dat_o assign_dato : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then case wb_adr_i is when "000" => wb_dat_o <= std_logic_vector(prer( 7 downto 0)); when "001" => wb_dat_o <= std_logic_vector(prer(15 downto 8)); when "010" => wb_dat_o <= ctr; when "011" => wb_dat_o <= rxr; -- write is transmit register TxR when "100" => wb_dat_o <= sr; -- write is command register CR -- Debugging registers: -- These registers are not documented. -- Functionality could change in future releases when "101" => wb_dat_o <= txr; when "110" => wb_dat_o <= cr; when "111" => wb_dat_o <= (others => '0'); when others => wb_dat_o <= (others => 'X'); -- for simulation only end case; end if; end process assign_dato; -- generate registers (CR, SR see below) gen_regs: process(rst_i, wb_clk_i) begin if (rst_i = '0') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_wacc = '1') then case wb_adr_i is when "000" => prer( 7 downto 0) <= unsigned(wb_dat_i); when "001" => prer(15 downto 8) <= unsigned(wb_dat_i); when "010" => ctr <= wb_dat_i; when "011" => txr <= wb_dat_i; when "100" => null; --write to CR, avoid executing the others clause -- illegal cases, for simulation only when others => report ("Illegal write address, setting all registers to unknown."); prer <= (others => 'X'); ctr <= (others => 'X'); txr <= (others => 'X'); end case; end if; end if; end process gen_regs; -- generate command register gen_cr: process(rst_i, wb_clk_i) begin if (rst_i = '0') then cr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then cr <= (others => '0'); elsif (wb_wacc = '1') then if ( (core_en = '1') and (wb_adr_i = "100") ) then -- only take new commands when i2c core enabled -- pending commands are finished cr <= wb_dat_i; end if; else if (done = '1' or i2c_al = '1') then cr(7 downto 4) <= (others => '0'); -- clear command bits when command done or arbitration lost end if; cr(2 downto 1) <= (others => '0'); -- reserved bits, always '0' cr(0) <= '0'; -- clear IRQ_ACK bit end if; end if; end process gen_cr; -- decode command register sta <= cr(7); sto <= cr(6); rd <= cr(5); wr <= cr(4); ack <= cr(3); iack <= cr(0); -- decode control register core_en <= ctr(7); ien <= ctr(6); -- hookup byte controller block byte_ctrl: i2c_master_byte_ctrl port map ( clk => wb_clk_i, rst => wb_rst_i, nReset => rst_i, ena => core_en, clk_cnt => prer, start => sta, stop => sto, read => rd, write => wr, ack_in => ack, i2c_busy => i2c_busy, i2c_al => i2c_al, din => txr, cmd_ack => done, ack_out => irxack, dout => rxr, scl_i => scl_pad_i, scl_o => scl_pad_o, scl_oen => scl_padoen_o, sda_i => sda_pad_i, sda_o => sda_pad_o, sda_oen => sda_padoen_o ); -- status register block + interrupt request signal st_irq_block : block begin -- generate status register bits gen_sr_bits: process (wb_clk_i, rst_i) begin if (rst_i = '0') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; else al <= i2c_al or (al and not sta); rxack <= irxack; tip <= (rd or wr); -- interrupt request flag is always generated irq_flag <= (done or i2c_al or irq_flag) and not iack; end if; end if; end process gen_sr_bits; -- generate interrupt request signals gen_irq: process (wb_clk_i, rst_i) begin if (rst_i = '0') then wb_inta_o <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then wb_inta_o <= '0'; else -- interrupt signal is only generated when IEN (interrupt enable bit) is set wb_inta_o <= irq_flag and ien; end if; end if; end process gen_irq; -- assign status register bits sr(7) <= rxack; sr(6) <= i2c_busy; sr(5) <= al; sr(4 downto 2) <= (others => '0'); -- reserved sr(1) <= tip; sr(0) <= irq_flag; end block; end architecture structural;
--------------------------------------------------------------------- ---- ---- ---- WISHBONE revB2 compl. I2C Master Core; top level ---- ---- ---- ---- ---- ---- Author: Richard Herveille ---- ---- [email protected] ---- ---- www.asics.ws ---- ---- ---- ---- Downloaded from: http://www.opencores.org/projects/i2c/ ---- ---- ---- --------------------------------------------------------------------- ---- ---- ---- Copyright (C) 2000 Richard Herveille ---- ---- [email protected] ---- ---- ---- ---- This source file may be used and distributed without ---- ---- restriction provided that this copyright statement is not ---- ---- removed from the file and that any derivative work contains ---- ---- the original copyright notice and the associated disclaimer.---- ---- ---- ---- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ---- ---- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---- ---- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ---- ---- FOR A PARTICULAR PURPOSE. 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. ---- ---- ---- --------------------------------------------------------------------- -- CVS Log -- -- $Id: i2c_master_top.vhd,v 1.8 2009-01-20 10:38:45 rherveille Exp $ -- -- $Date: 2009-01-20 10:38:45 $ -- $Revision: 1.8 $ -- $Author: rherveille $ -- $Locker: $ -- $State: Exp $ -- -- Change History: -- Revision 1.7 2004/03/14 10:17:03 rherveille -- Fixed simulation issue when writing to CR register -- -- Revision 1.6 2003/08/09 07:01:13 rherveille -- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line. -- Fixed a potential bug in the byte controller's host-acknowledge generation. -- -- Revision 1.5 2003/02/01 02:03:06 rherveille -- Fixed a few 'arbitration lost' bugs. VHDL version only. -- -- Revision 1.4 2002/12/26 16:05:47 rherveille -- Core is now a Multimaster I2C controller. -- -- Revision 1.3 2002/11/30 22:24:37 rherveille -- Cleaned up code -- -- Revision 1.2 2001/11/10 10:52:44 rherveille -- Changed PRER reset value from 0x0000 to 0xffff, conform specs. -- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity COMM_zpuino_wb_i2c is generic( ARST_LVL : std_logic := '0' -- asynchronous reset level ); port ( -- wishbone signals wishbone_in : in std_logic_vector(61 downto 0); wishbone_out : out std_logic_vector(33 downto 0); -- i2c lines scl_pad_i : in std_logic; -- i2c clock line input scl_pad_o : out std_logic; -- i2c clock line output scl_padoen_o : out std_logic; -- i2c clock line output enable, active low sda_pad_i : in std_logic; -- i2c data line input sda_pad_o : out std_logic; -- i2c data line output sda_padoen_o : out std_logic -- i2c data line output enable, active low ); end entity COMM_zpuino_wb_i2c; architecture structural of COMM_zpuino_wb_i2c is component i2c_master_byte_ctrl is port ( clk : in std_logic; rst : in std_logic; -- synchronous active high reset (WISHBONE compatible) nReset : in std_logic; -- asynchornous active low reset (FPGA compatible) ena : in std_logic; -- core enable signal clk_cnt : in unsigned(15 downto 0); -- 4x SCL -- input signals start, stop, read, write, ack_in : std_logic; din : in std_logic_vector(7 downto 0); -- output signals cmd_ack : out std_logic; ack_out : out std_logic; i2c_busy : out std_logic; i2c_al : out std_logic; dout : out std_logic_vector(7 downto 0); -- i2c lines scl_i : in std_logic; -- i2c clock line input scl_o : out std_logic; -- i2c clock line output scl_oen : out std_logic; -- i2c clock line output enable, active low sda_i : in std_logic; -- i2c data line input sda_o : out std_logic; -- i2c data line output sda_oen : out std_logic -- i2c data line output enable, active low ); end component i2c_master_byte_ctrl; -- registers signal prer : unsigned(15 downto 0); -- clock prescale register signal ctr : std_logic_vector(7 downto 0); -- control register signal txr : std_logic_vector(7 downto 0); -- transmit register signal rxr : std_logic_vector(7 downto 0); -- receive register signal cr : std_logic_vector(7 downto 0); -- command register signal sr : std_logic_vector(7 downto 0); -- status register -- internal reset signal signal rst_i : std_logic; -- wishbone write access signal wb_wacc : std_logic; -- internal acknowledge signal signal iack_o : std_logic; -- done signal: command completed, clear command register signal done : std_logic; -- command register signals signal sta, sto, rd, wr, ack, iack : std_logic; signal core_en : std_logic; -- core enable signal signal ien : std_logic; -- interrupt enable signal -- status register signals signal irxack, rxack : std_logic; -- received aknowledge from slave signal tip : std_logic; -- transfer in progress signal irq_flag : std_logic; -- interrupt pending flag signal i2c_busy : std_logic; -- i2c bus busy (start signal detected) signal i2c_al, al : std_logic; -- arbitration lost signal wb_clk_i: std_logic; -- Wishbone clock signal wb_rst_i: std_logic; -- Wishbone reset (synchronous) signal wb_dat_i: std_logic_vector(31 downto 0); -- Wishbone data input (32 bits) signal wb_adr_i: std_logic_vector(26 downto 2); -- Wishbone address input (32 bits) signal wb_we_i: std_logic; -- Wishbone write enable signal signal wb_cyc_i: std_logic; -- Wishbone cycle signal signal wb_stb_i: std_logic; -- Wishbone strobe signal signal wb_dat_o: std_logic_vector(31 downto 0); -- Wishbone data output (32 bits) signal wb_ack_o: std_logic; -- Wishbone acknowledge out signal signal wb_inta_o: std_logic; begin -- Unpack the wishbone array into signals so the modules code is not confusing. wb_clk_i <= wishbone_in(61); wb_rst_i <= wishbone_in(60); wb_dat_i <= wishbone_in(59 downto 28); wb_adr_i <= wishbone_in(27 downto 3); wb_we_i <= wishbone_in(2); wb_cyc_i <= wishbone_in(1); wb_stb_i <= wishbone_in(0); wishbone_out(33 downto 2) <= wb_dat_o; wishbone_out(1) <= wb_ack_o; wishbone_out(0) <= wb_inta_o; -- generate internal reset signal rst_i <= arst_i xor ARST_LVL; -- generate acknowledge output signal gen_ack_o : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then iack_o <= wb_cyc_i and wb_stb_i and not iack_o; -- because timing is always honored end if; end process gen_ack_o; wb_ack_o <= iack_o; -- generate wishbone write access signal wb_wacc <= wb_we_i and iack_o; -- assign wb_dat_o assign_dato : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then case wb_adr_i is when "000" => wb_dat_o <= std_logic_vector(prer( 7 downto 0)); when "001" => wb_dat_o <= std_logic_vector(prer(15 downto 8)); when "010" => wb_dat_o <= ctr; when "011" => wb_dat_o <= rxr; -- write is transmit register TxR when "100" => wb_dat_o <= sr; -- write is command register CR -- Debugging registers: -- These registers are not documented. -- Functionality could change in future releases when "101" => wb_dat_o <= txr; when "110" => wb_dat_o <= cr; when "111" => wb_dat_o <= (others => '0'); when others => wb_dat_o <= (others => 'X'); -- for simulation only end case; end if; end process assign_dato; -- generate registers (CR, SR see below) gen_regs: process(rst_i, wb_clk_i) begin if (rst_i = '0') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_wacc = '1') then case wb_adr_i is when "000" => prer( 7 downto 0) <= unsigned(wb_dat_i); when "001" => prer(15 downto 8) <= unsigned(wb_dat_i); when "010" => ctr <= wb_dat_i; when "011" => txr <= wb_dat_i; when "100" => null; --write to CR, avoid executing the others clause -- illegal cases, for simulation only when others => report ("Illegal write address, setting all registers to unknown."); prer <= (others => 'X'); ctr <= (others => 'X'); txr <= (others => 'X'); end case; end if; end if; end process gen_regs; -- generate command register gen_cr: process(rst_i, wb_clk_i) begin if (rst_i = '0') then cr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then cr <= (others => '0'); elsif (wb_wacc = '1') then if ( (core_en = '1') and (wb_adr_i = "100") ) then -- only take new commands when i2c core enabled -- pending commands are finished cr <= wb_dat_i; end if; else if (done = '1' or i2c_al = '1') then cr(7 downto 4) <= (others => '0'); -- clear command bits when command done or arbitration lost end if; cr(2 downto 1) <= (others => '0'); -- reserved bits, always '0' cr(0) <= '0'; -- clear IRQ_ACK bit end if; end if; end process gen_cr; -- decode command register sta <= cr(7); sto <= cr(6); rd <= cr(5); wr <= cr(4); ack <= cr(3); iack <= cr(0); -- decode control register core_en <= ctr(7); ien <= ctr(6); -- hookup byte controller block byte_ctrl: i2c_master_byte_ctrl port map ( clk => wb_clk_i, rst => wb_rst_i, nReset => rst_i, ena => core_en, clk_cnt => prer, start => sta, stop => sto, read => rd, write => wr, ack_in => ack, i2c_busy => i2c_busy, i2c_al => i2c_al, din => txr, cmd_ack => done, ack_out => irxack, dout => rxr, scl_i => scl_pad_i, scl_o => scl_pad_o, scl_oen => scl_padoen_o, sda_i => sda_pad_i, sda_o => sda_pad_o, sda_oen => sda_padoen_o ); -- status register block + interrupt request signal st_irq_block : block begin -- generate status register bits gen_sr_bits: process (wb_clk_i, rst_i) begin if (rst_i = '0') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; else al <= i2c_al or (al and not sta); rxack <= irxack; tip <= (rd or wr); -- interrupt request flag is always generated irq_flag <= (done or i2c_al or irq_flag) and not iack; end if; end if; end process gen_sr_bits; -- generate interrupt request signals gen_irq: process (wb_clk_i, rst_i) begin if (rst_i = '0') then wb_inta_o <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then wb_inta_o <= '0'; else -- interrupt signal is only generated when IEN (interrupt enable bit) is set wb_inta_o <= irq_flag and ien; end if; end if; end process gen_irq; -- assign status register bits sr(7) <= rxack; sr(6) <= i2c_busy; sr(5) <= al; sr(4 downto 2) <= (others => '0'); -- reserved sr(1) <= tip; sr(0) <= irq_flag; end block; end architecture structural;
--------------------------------------------------------------------- ---- ---- ---- WISHBONE revB2 compl. I2C Master Core; top level ---- ---- ---- ---- ---- ---- Author: Richard Herveille ---- ---- [email protected] ---- ---- www.asics.ws ---- ---- ---- ---- Downloaded from: http://www.opencores.org/projects/i2c/ ---- ---- ---- --------------------------------------------------------------------- ---- ---- ---- Copyright (C) 2000 Richard Herveille ---- ---- [email protected] ---- ---- ---- ---- This source file may be used and distributed without ---- ---- restriction provided that this copyright statement is not ---- ---- removed from the file and that any derivative work contains ---- ---- the original copyright notice and the associated disclaimer.---- ---- ---- ---- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ---- ---- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---- ---- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ---- ---- FOR A PARTICULAR PURPOSE. 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. ---- ---- ---- --------------------------------------------------------------------- -- CVS Log -- -- $Id: i2c_master_top.vhd,v 1.8 2009-01-20 10:38:45 rherveille Exp $ -- -- $Date: 2009-01-20 10:38:45 $ -- $Revision: 1.8 $ -- $Author: rherveille $ -- $Locker: $ -- $State: Exp $ -- -- Change History: -- Revision 1.7 2004/03/14 10:17:03 rherveille -- Fixed simulation issue when writing to CR register -- -- Revision 1.6 2003/08/09 07:01:13 rherveille -- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line. -- Fixed a potential bug in the byte controller's host-acknowledge generation. -- -- Revision 1.5 2003/02/01 02:03:06 rherveille -- Fixed a few 'arbitration lost' bugs. VHDL version only. -- -- Revision 1.4 2002/12/26 16:05:47 rherveille -- Core is now a Multimaster I2C controller. -- -- Revision 1.3 2002/11/30 22:24:37 rherveille -- Cleaned up code -- -- Revision 1.2 2001/11/10 10:52:44 rherveille -- Changed PRER reset value from 0x0000 to 0xffff, conform specs. -- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity COMM_zpuino_wb_i2c is generic( ARST_LVL : std_logic := '0' -- asynchronous reset level ); port ( -- wishbone signals wishbone_in : in std_logic_vector(61 downto 0); wishbone_out : out std_logic_vector(33 downto 0); -- i2c lines scl_pad_i : in std_logic; -- i2c clock line input scl_pad_o : out std_logic; -- i2c clock line output scl_padoen_o : out std_logic; -- i2c clock line output enable, active low sda_pad_i : in std_logic; -- i2c data line input sda_pad_o : out std_logic; -- i2c data line output sda_padoen_o : out std_logic -- i2c data line output enable, active low ); end entity COMM_zpuino_wb_i2c; architecture structural of COMM_zpuino_wb_i2c is component i2c_master_byte_ctrl is port ( clk : in std_logic; rst : in std_logic; -- synchronous active high reset (WISHBONE compatible) nReset : in std_logic; -- asynchornous active low reset (FPGA compatible) ena : in std_logic; -- core enable signal clk_cnt : in unsigned(15 downto 0); -- 4x SCL -- input signals start, stop, read, write, ack_in : std_logic; din : in std_logic_vector(7 downto 0); -- output signals cmd_ack : out std_logic; ack_out : out std_logic; i2c_busy : out std_logic; i2c_al : out std_logic; dout : out std_logic_vector(7 downto 0); -- i2c lines scl_i : in std_logic; -- i2c clock line input scl_o : out std_logic; -- i2c clock line output scl_oen : out std_logic; -- i2c clock line output enable, active low sda_i : in std_logic; -- i2c data line input sda_o : out std_logic; -- i2c data line output sda_oen : out std_logic -- i2c data line output enable, active low ); end component i2c_master_byte_ctrl; -- registers signal prer : unsigned(15 downto 0); -- clock prescale register signal ctr : std_logic_vector(7 downto 0); -- control register signal txr : std_logic_vector(7 downto 0); -- transmit register signal rxr : std_logic_vector(7 downto 0); -- receive register signal cr : std_logic_vector(7 downto 0); -- command register signal sr : std_logic_vector(7 downto 0); -- status register -- internal reset signal signal rst_i : std_logic; -- wishbone write access signal wb_wacc : std_logic; -- internal acknowledge signal signal iack_o : std_logic; -- done signal: command completed, clear command register signal done : std_logic; -- command register signals signal sta, sto, rd, wr, ack, iack : std_logic; signal core_en : std_logic; -- core enable signal signal ien : std_logic; -- interrupt enable signal -- status register signals signal irxack, rxack : std_logic; -- received aknowledge from slave signal tip : std_logic; -- transfer in progress signal irq_flag : std_logic; -- interrupt pending flag signal i2c_busy : std_logic; -- i2c bus busy (start signal detected) signal i2c_al, al : std_logic; -- arbitration lost signal wb_clk_i: std_logic; -- Wishbone clock signal wb_rst_i: std_logic; -- Wishbone reset (synchronous) signal wb_dat_i: std_logic_vector(31 downto 0); -- Wishbone data input (32 bits) signal wb_adr_i: std_logic_vector(26 downto 2); -- Wishbone address input (32 bits) signal wb_we_i: std_logic; -- Wishbone write enable signal signal wb_cyc_i: std_logic; -- Wishbone cycle signal signal wb_stb_i: std_logic; -- Wishbone strobe signal signal wb_dat_o: std_logic_vector(31 downto 0); -- Wishbone data output (32 bits) signal wb_ack_o: std_logic; -- Wishbone acknowledge out signal signal wb_inta_o: std_logic; begin -- Unpack the wishbone array into signals so the modules code is not confusing. wb_clk_i <= wishbone_in(61); wb_rst_i <= wishbone_in(60); wb_dat_i <= wishbone_in(59 downto 28); wb_adr_i <= wishbone_in(27 downto 3); wb_we_i <= wishbone_in(2); wb_cyc_i <= wishbone_in(1); wb_stb_i <= wishbone_in(0); wishbone_out(33 downto 2) <= wb_dat_o; wishbone_out(1) <= wb_ack_o; wishbone_out(0) <= wb_inta_o; -- generate internal reset signal rst_i <= arst_i xor ARST_LVL; -- generate acknowledge output signal gen_ack_o : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then iack_o <= wb_cyc_i and wb_stb_i and not iack_o; -- because timing is always honored end if; end process gen_ack_o; wb_ack_o <= iack_o; -- generate wishbone write access signal wb_wacc <= wb_we_i and iack_o; -- assign wb_dat_o assign_dato : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then case wb_adr_i is when "000" => wb_dat_o <= std_logic_vector(prer( 7 downto 0)); when "001" => wb_dat_o <= std_logic_vector(prer(15 downto 8)); when "010" => wb_dat_o <= ctr; when "011" => wb_dat_o <= rxr; -- write is transmit register TxR when "100" => wb_dat_o <= sr; -- write is command register CR -- Debugging registers: -- These registers are not documented. -- Functionality could change in future releases when "101" => wb_dat_o <= txr; when "110" => wb_dat_o <= cr; when "111" => wb_dat_o <= (others => '0'); when others => wb_dat_o <= (others => 'X'); -- for simulation only end case; end if; end process assign_dato; -- generate registers (CR, SR see below) gen_regs: process(rst_i, wb_clk_i) begin if (rst_i = '0') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_wacc = '1') then case wb_adr_i is when "000" => prer( 7 downto 0) <= unsigned(wb_dat_i); when "001" => prer(15 downto 8) <= unsigned(wb_dat_i); when "010" => ctr <= wb_dat_i; when "011" => txr <= wb_dat_i; when "100" => null; --write to CR, avoid executing the others clause -- illegal cases, for simulation only when others => report ("Illegal write address, setting all registers to unknown."); prer <= (others => 'X'); ctr <= (others => 'X'); txr <= (others => 'X'); end case; end if; end if; end process gen_regs; -- generate command register gen_cr: process(rst_i, wb_clk_i) begin if (rst_i = '0') then cr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then cr <= (others => '0'); elsif (wb_wacc = '1') then if ( (core_en = '1') and (wb_adr_i = "100") ) then -- only take new commands when i2c core enabled -- pending commands are finished cr <= wb_dat_i; end if; else if (done = '1' or i2c_al = '1') then cr(7 downto 4) <= (others => '0'); -- clear command bits when command done or arbitration lost end if; cr(2 downto 1) <= (others => '0'); -- reserved bits, always '0' cr(0) <= '0'; -- clear IRQ_ACK bit end if; end if; end process gen_cr; -- decode command register sta <= cr(7); sto <= cr(6); rd <= cr(5); wr <= cr(4); ack <= cr(3); iack <= cr(0); -- decode control register core_en <= ctr(7); ien <= ctr(6); -- hookup byte controller block byte_ctrl: i2c_master_byte_ctrl port map ( clk => wb_clk_i, rst => wb_rst_i, nReset => rst_i, ena => core_en, clk_cnt => prer, start => sta, stop => sto, read => rd, write => wr, ack_in => ack, i2c_busy => i2c_busy, i2c_al => i2c_al, din => txr, cmd_ack => done, ack_out => irxack, dout => rxr, scl_i => scl_pad_i, scl_o => scl_pad_o, scl_oen => scl_padoen_o, sda_i => sda_pad_i, sda_o => sda_pad_o, sda_oen => sda_padoen_o ); -- status register block + interrupt request signal st_irq_block : block begin -- generate status register bits gen_sr_bits: process (wb_clk_i, rst_i) begin if (rst_i = '0') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; else al <= i2c_al or (al and not sta); rxack <= irxack; tip <= (rd or wr); -- interrupt request flag is always generated irq_flag <= (done or i2c_al or irq_flag) and not iack; end if; end if; end process gen_sr_bits; -- generate interrupt request signals gen_irq: process (wb_clk_i, rst_i) begin if (rst_i = '0') then wb_inta_o <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then wb_inta_o <= '0'; else -- interrupt signal is only generated when IEN (interrupt enable bit) is set wb_inta_o <= irq_flag and ien; end if; end if; end process gen_irq; -- assign status register bits sr(7) <= rxack; sr(6) <= i2c_busy; sr(5) <= al; sr(4 downto 2) <= (others => '0'); -- reserved sr(1) <= tip; sr(0) <= irq_flag; end block; end architecture structural;
--------------------------------------------------------------------- ---- ---- ---- WISHBONE revB2 compl. I2C Master Core; top level ---- ---- ---- ---- ---- ---- Author: Richard Herveille ---- ---- [email protected] ---- ---- www.asics.ws ---- ---- ---- ---- Downloaded from: http://www.opencores.org/projects/i2c/ ---- ---- ---- --------------------------------------------------------------------- ---- ---- ---- Copyright (C) 2000 Richard Herveille ---- ---- [email protected] ---- ---- ---- ---- This source file may be used and distributed without ---- ---- restriction provided that this copyright statement is not ---- ---- removed from the file and that any derivative work contains ---- ---- the original copyright notice and the associated disclaimer.---- ---- ---- ---- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ---- ---- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---- ---- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ---- ---- FOR A PARTICULAR PURPOSE. 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. ---- ---- ---- --------------------------------------------------------------------- -- CVS Log -- -- $Id: i2c_master_top.vhd,v 1.8 2009-01-20 10:38:45 rherveille Exp $ -- -- $Date: 2009-01-20 10:38:45 $ -- $Revision: 1.8 $ -- $Author: rherveille $ -- $Locker: $ -- $State: Exp $ -- -- Change History: -- Revision 1.7 2004/03/14 10:17:03 rherveille -- Fixed simulation issue when writing to CR register -- -- Revision 1.6 2003/08/09 07:01:13 rherveille -- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line. -- Fixed a potential bug in the byte controller's host-acknowledge generation. -- -- Revision 1.5 2003/02/01 02:03:06 rherveille -- Fixed a few 'arbitration lost' bugs. VHDL version only. -- -- Revision 1.4 2002/12/26 16:05:47 rherveille -- Core is now a Multimaster I2C controller. -- -- Revision 1.3 2002/11/30 22:24:37 rherveille -- Cleaned up code -- -- Revision 1.2 2001/11/10 10:52:44 rherveille -- Changed PRER reset value from 0x0000 to 0xffff, conform specs. -- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity COMM_zpuino_wb_i2c is generic( ARST_LVL : std_logic := '0' -- asynchronous reset level ); port ( -- wishbone signals wishbone_in : in std_logic_vector(61 downto 0); wishbone_out : out std_logic_vector(33 downto 0); -- i2c lines scl_pad_i : in std_logic; -- i2c clock line input scl_pad_o : out std_logic; -- i2c clock line output scl_padoen_o : out std_logic; -- i2c clock line output enable, active low sda_pad_i : in std_logic; -- i2c data line input sda_pad_o : out std_logic; -- i2c data line output sda_padoen_o : out std_logic -- i2c data line output enable, active low ); end entity COMM_zpuino_wb_i2c; architecture structural of COMM_zpuino_wb_i2c is component i2c_master_byte_ctrl is port ( clk : in std_logic; rst : in std_logic; -- synchronous active high reset (WISHBONE compatible) nReset : in std_logic; -- asynchornous active low reset (FPGA compatible) ena : in std_logic; -- core enable signal clk_cnt : in unsigned(15 downto 0); -- 4x SCL -- input signals start, stop, read, write, ack_in : std_logic; din : in std_logic_vector(7 downto 0); -- output signals cmd_ack : out std_logic; ack_out : out std_logic; i2c_busy : out std_logic; i2c_al : out std_logic; dout : out std_logic_vector(7 downto 0); -- i2c lines scl_i : in std_logic; -- i2c clock line input scl_o : out std_logic; -- i2c clock line output scl_oen : out std_logic; -- i2c clock line output enable, active low sda_i : in std_logic; -- i2c data line input sda_o : out std_logic; -- i2c data line output sda_oen : out std_logic -- i2c data line output enable, active low ); end component i2c_master_byte_ctrl; -- registers signal prer : unsigned(15 downto 0); -- clock prescale register signal ctr : std_logic_vector(7 downto 0); -- control register signal txr : std_logic_vector(7 downto 0); -- transmit register signal rxr : std_logic_vector(7 downto 0); -- receive register signal cr : std_logic_vector(7 downto 0); -- command register signal sr : std_logic_vector(7 downto 0); -- status register -- internal reset signal signal rst_i : std_logic; -- wishbone write access signal wb_wacc : std_logic; -- internal acknowledge signal signal iack_o : std_logic; -- done signal: command completed, clear command register signal done : std_logic; -- command register signals signal sta, sto, rd, wr, ack, iack : std_logic; signal core_en : std_logic; -- core enable signal signal ien : std_logic; -- interrupt enable signal -- status register signals signal irxack, rxack : std_logic; -- received aknowledge from slave signal tip : std_logic; -- transfer in progress signal irq_flag : std_logic; -- interrupt pending flag signal i2c_busy : std_logic; -- i2c bus busy (start signal detected) signal i2c_al, al : std_logic; -- arbitration lost signal wb_clk_i: std_logic; -- Wishbone clock signal wb_rst_i: std_logic; -- Wishbone reset (synchronous) signal wb_dat_i: std_logic_vector(31 downto 0); -- Wishbone data input (32 bits) signal wb_adr_i: std_logic_vector(26 downto 2); -- Wishbone address input (32 bits) signal wb_we_i: std_logic; -- Wishbone write enable signal signal wb_cyc_i: std_logic; -- Wishbone cycle signal signal wb_stb_i: std_logic; -- Wishbone strobe signal signal wb_dat_o: std_logic_vector(31 downto 0); -- Wishbone data output (32 bits) signal wb_ack_o: std_logic; -- Wishbone acknowledge out signal signal wb_inta_o: std_logic; begin -- Unpack the wishbone array into signals so the modules code is not confusing. wb_clk_i <= wishbone_in(61); wb_rst_i <= wishbone_in(60); wb_dat_i <= wishbone_in(59 downto 28); wb_adr_i <= wishbone_in(27 downto 3); wb_we_i <= wishbone_in(2); wb_cyc_i <= wishbone_in(1); wb_stb_i <= wishbone_in(0); wishbone_out(33 downto 2) <= wb_dat_o; wishbone_out(1) <= wb_ack_o; wishbone_out(0) <= wb_inta_o; -- generate internal reset signal rst_i <= arst_i xor ARST_LVL; -- generate acknowledge output signal gen_ack_o : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then iack_o <= wb_cyc_i and wb_stb_i and not iack_o; -- because timing is always honored end if; end process gen_ack_o; wb_ack_o <= iack_o; -- generate wishbone write access signal wb_wacc <= wb_we_i and iack_o; -- assign wb_dat_o assign_dato : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then case wb_adr_i is when "000" => wb_dat_o <= std_logic_vector(prer( 7 downto 0)); when "001" => wb_dat_o <= std_logic_vector(prer(15 downto 8)); when "010" => wb_dat_o <= ctr; when "011" => wb_dat_o <= rxr; -- write is transmit register TxR when "100" => wb_dat_o <= sr; -- write is command register CR -- Debugging registers: -- These registers are not documented. -- Functionality could change in future releases when "101" => wb_dat_o <= txr; when "110" => wb_dat_o <= cr; when "111" => wb_dat_o <= (others => '0'); when others => wb_dat_o <= (others => 'X'); -- for simulation only end case; end if; end process assign_dato; -- generate registers (CR, SR see below) gen_regs: process(rst_i, wb_clk_i) begin if (rst_i = '0') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_wacc = '1') then case wb_adr_i is when "000" => prer( 7 downto 0) <= unsigned(wb_dat_i); when "001" => prer(15 downto 8) <= unsigned(wb_dat_i); when "010" => ctr <= wb_dat_i; when "011" => txr <= wb_dat_i; when "100" => null; --write to CR, avoid executing the others clause -- illegal cases, for simulation only when others => report ("Illegal write address, setting all registers to unknown."); prer <= (others => 'X'); ctr <= (others => 'X'); txr <= (others => 'X'); end case; end if; end if; end process gen_regs; -- generate command register gen_cr: process(rst_i, wb_clk_i) begin if (rst_i = '0') then cr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then cr <= (others => '0'); elsif (wb_wacc = '1') then if ( (core_en = '1') and (wb_adr_i = "100") ) then -- only take new commands when i2c core enabled -- pending commands are finished cr <= wb_dat_i; end if; else if (done = '1' or i2c_al = '1') then cr(7 downto 4) <= (others => '0'); -- clear command bits when command done or arbitration lost end if; cr(2 downto 1) <= (others => '0'); -- reserved bits, always '0' cr(0) <= '0'; -- clear IRQ_ACK bit end if; end if; end process gen_cr; -- decode command register sta <= cr(7); sto <= cr(6); rd <= cr(5); wr <= cr(4); ack <= cr(3); iack <= cr(0); -- decode control register core_en <= ctr(7); ien <= ctr(6); -- hookup byte controller block byte_ctrl: i2c_master_byte_ctrl port map ( clk => wb_clk_i, rst => wb_rst_i, nReset => rst_i, ena => core_en, clk_cnt => prer, start => sta, stop => sto, read => rd, write => wr, ack_in => ack, i2c_busy => i2c_busy, i2c_al => i2c_al, din => txr, cmd_ack => done, ack_out => irxack, dout => rxr, scl_i => scl_pad_i, scl_o => scl_pad_o, scl_oen => scl_padoen_o, sda_i => sda_pad_i, sda_o => sda_pad_o, sda_oen => sda_padoen_o ); -- status register block + interrupt request signal st_irq_block : block begin -- generate status register bits gen_sr_bits: process (wb_clk_i, rst_i) begin if (rst_i = '0') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; else al <= i2c_al or (al and not sta); rxack <= irxack; tip <= (rd or wr); -- interrupt request flag is always generated irq_flag <= (done or i2c_al or irq_flag) and not iack; end if; end if; end process gen_sr_bits; -- generate interrupt request signals gen_irq: process (wb_clk_i, rst_i) begin if (rst_i = '0') then wb_inta_o <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then wb_inta_o <= '0'; else -- interrupt signal is only generated when IEN (interrupt enable bit) is set wb_inta_o <= irq_flag and ien; end if; end if; end process gen_irq; -- assign status register bits sr(7) <= rxack; sr(6) <= i2c_busy; sr(5) <= al; sr(4 downto 2) <= (others => '0'); -- reserved sr(1) <= tip; sr(0) <= irq_flag; end block; end architecture structural;
--------------------------------------------------------------------- ---- ---- ---- WISHBONE revB2 compl. I2C Master Core; top level ---- ---- ---- ---- ---- ---- Author: Richard Herveille ---- ---- [email protected] ---- ---- www.asics.ws ---- ---- ---- ---- Downloaded from: http://www.opencores.org/projects/i2c/ ---- ---- ---- --------------------------------------------------------------------- ---- ---- ---- Copyright (C) 2000 Richard Herveille ---- ---- [email protected] ---- ---- ---- ---- This source file may be used and distributed without ---- ---- restriction provided that this copyright statement is not ---- ---- removed from the file and that any derivative work contains ---- ---- the original copyright notice and the associated disclaimer.---- ---- ---- ---- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ---- ---- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---- ---- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ---- ---- FOR A PARTICULAR PURPOSE. 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. ---- ---- ---- --------------------------------------------------------------------- -- CVS Log -- -- $Id: i2c_master_top.vhd,v 1.8 2009-01-20 10:38:45 rherveille Exp $ -- -- $Date: 2009-01-20 10:38:45 $ -- $Revision: 1.8 $ -- $Author: rherveille $ -- $Locker: $ -- $State: Exp $ -- -- Change History: -- Revision 1.7 2004/03/14 10:17:03 rherveille -- Fixed simulation issue when writing to CR register -- -- Revision 1.6 2003/08/09 07:01:13 rherveille -- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line. -- Fixed a potential bug in the byte controller's host-acknowledge generation. -- -- Revision 1.5 2003/02/01 02:03:06 rherveille -- Fixed a few 'arbitration lost' bugs. VHDL version only. -- -- Revision 1.4 2002/12/26 16:05:47 rherveille -- Core is now a Multimaster I2C controller. -- -- Revision 1.3 2002/11/30 22:24:37 rherveille -- Cleaned up code -- -- Revision 1.2 2001/11/10 10:52:44 rherveille -- Changed PRER reset value from 0x0000 to 0xffff, conform specs. -- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity COMM_zpuino_wb_i2c is generic( ARST_LVL : std_logic := '0' -- asynchronous reset level ); port ( -- wishbone signals wishbone_in : in std_logic_vector(61 downto 0); wishbone_out : out std_logic_vector(33 downto 0); -- i2c lines scl_pad_i : in std_logic; -- i2c clock line input scl_pad_o : out std_logic; -- i2c clock line output scl_padoen_o : out std_logic; -- i2c clock line output enable, active low sda_pad_i : in std_logic; -- i2c data line input sda_pad_o : out std_logic; -- i2c data line output sda_padoen_o : out std_logic -- i2c data line output enable, active low ); end entity COMM_zpuino_wb_i2c; architecture structural of COMM_zpuino_wb_i2c is component i2c_master_byte_ctrl is port ( clk : in std_logic; rst : in std_logic; -- synchronous active high reset (WISHBONE compatible) nReset : in std_logic; -- asynchornous active low reset (FPGA compatible) ena : in std_logic; -- core enable signal clk_cnt : in unsigned(15 downto 0); -- 4x SCL -- input signals start, stop, read, write, ack_in : std_logic; din : in std_logic_vector(7 downto 0); -- output signals cmd_ack : out std_logic; ack_out : out std_logic; i2c_busy : out std_logic; i2c_al : out std_logic; dout : out std_logic_vector(7 downto 0); -- i2c lines scl_i : in std_logic; -- i2c clock line input scl_o : out std_logic; -- i2c clock line output scl_oen : out std_logic; -- i2c clock line output enable, active low sda_i : in std_logic; -- i2c data line input sda_o : out std_logic; -- i2c data line output sda_oen : out std_logic -- i2c data line output enable, active low ); end component i2c_master_byte_ctrl; -- registers signal prer : unsigned(15 downto 0); -- clock prescale register signal ctr : std_logic_vector(7 downto 0); -- control register signal txr : std_logic_vector(7 downto 0); -- transmit register signal rxr : std_logic_vector(7 downto 0); -- receive register signal cr : std_logic_vector(7 downto 0); -- command register signal sr : std_logic_vector(7 downto 0); -- status register -- internal reset signal signal rst_i : std_logic; -- wishbone write access signal wb_wacc : std_logic; -- internal acknowledge signal signal iack_o : std_logic; -- done signal: command completed, clear command register signal done : std_logic; -- command register signals signal sta, sto, rd, wr, ack, iack : std_logic; signal core_en : std_logic; -- core enable signal signal ien : std_logic; -- interrupt enable signal -- status register signals signal irxack, rxack : std_logic; -- received aknowledge from slave signal tip : std_logic; -- transfer in progress signal irq_flag : std_logic; -- interrupt pending flag signal i2c_busy : std_logic; -- i2c bus busy (start signal detected) signal i2c_al, al : std_logic; -- arbitration lost signal wb_clk_i: std_logic; -- Wishbone clock signal wb_rst_i: std_logic; -- Wishbone reset (synchronous) signal wb_dat_i: std_logic_vector(31 downto 0); -- Wishbone data input (32 bits) signal wb_adr_i: std_logic_vector(26 downto 2); -- Wishbone address input (32 bits) signal wb_we_i: std_logic; -- Wishbone write enable signal signal wb_cyc_i: std_logic; -- Wishbone cycle signal signal wb_stb_i: std_logic; -- Wishbone strobe signal signal wb_dat_o: std_logic_vector(31 downto 0); -- Wishbone data output (32 bits) signal wb_ack_o: std_logic; -- Wishbone acknowledge out signal signal wb_inta_o: std_logic; begin -- Unpack the wishbone array into signals so the modules code is not confusing. wb_clk_i <= wishbone_in(61); wb_rst_i <= wishbone_in(60); wb_dat_i <= wishbone_in(59 downto 28); wb_adr_i <= wishbone_in(27 downto 3); wb_we_i <= wishbone_in(2); wb_cyc_i <= wishbone_in(1); wb_stb_i <= wishbone_in(0); wishbone_out(33 downto 2) <= wb_dat_o; wishbone_out(1) <= wb_ack_o; wishbone_out(0) <= wb_inta_o; -- generate internal reset signal rst_i <= arst_i xor ARST_LVL; -- generate acknowledge output signal gen_ack_o : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then iack_o <= wb_cyc_i and wb_stb_i and not iack_o; -- because timing is always honored end if; end process gen_ack_o; wb_ack_o <= iack_o; -- generate wishbone write access signal wb_wacc <= wb_we_i and iack_o; -- assign wb_dat_o assign_dato : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then case wb_adr_i is when "000" => wb_dat_o <= std_logic_vector(prer( 7 downto 0)); when "001" => wb_dat_o <= std_logic_vector(prer(15 downto 8)); when "010" => wb_dat_o <= ctr; when "011" => wb_dat_o <= rxr; -- write is transmit register TxR when "100" => wb_dat_o <= sr; -- write is command register CR -- Debugging registers: -- These registers are not documented. -- Functionality could change in future releases when "101" => wb_dat_o <= txr; when "110" => wb_dat_o <= cr; when "111" => wb_dat_o <= (others => '0'); when others => wb_dat_o <= (others => 'X'); -- for simulation only end case; end if; end process assign_dato; -- generate registers (CR, SR see below) gen_regs: process(rst_i, wb_clk_i) begin if (rst_i = '0') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_wacc = '1') then case wb_adr_i is when "000" => prer( 7 downto 0) <= unsigned(wb_dat_i); when "001" => prer(15 downto 8) <= unsigned(wb_dat_i); when "010" => ctr <= wb_dat_i; when "011" => txr <= wb_dat_i; when "100" => null; --write to CR, avoid executing the others clause -- illegal cases, for simulation only when others => report ("Illegal write address, setting all registers to unknown."); prer <= (others => 'X'); ctr <= (others => 'X'); txr <= (others => 'X'); end case; end if; end if; end process gen_regs; -- generate command register gen_cr: process(rst_i, wb_clk_i) begin if (rst_i = '0') then cr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then cr <= (others => '0'); elsif (wb_wacc = '1') then if ( (core_en = '1') and (wb_adr_i = "100") ) then -- only take new commands when i2c core enabled -- pending commands are finished cr <= wb_dat_i; end if; else if (done = '1' or i2c_al = '1') then cr(7 downto 4) <= (others => '0'); -- clear command bits when command done or arbitration lost end if; cr(2 downto 1) <= (others => '0'); -- reserved bits, always '0' cr(0) <= '0'; -- clear IRQ_ACK bit end if; end if; end process gen_cr; -- decode command register sta <= cr(7); sto <= cr(6); rd <= cr(5); wr <= cr(4); ack <= cr(3); iack <= cr(0); -- decode control register core_en <= ctr(7); ien <= ctr(6); -- hookup byte controller block byte_ctrl: i2c_master_byte_ctrl port map ( clk => wb_clk_i, rst => wb_rst_i, nReset => rst_i, ena => core_en, clk_cnt => prer, start => sta, stop => sto, read => rd, write => wr, ack_in => ack, i2c_busy => i2c_busy, i2c_al => i2c_al, din => txr, cmd_ack => done, ack_out => irxack, dout => rxr, scl_i => scl_pad_i, scl_o => scl_pad_o, scl_oen => scl_padoen_o, sda_i => sda_pad_i, sda_o => sda_pad_o, sda_oen => sda_padoen_o ); -- status register block + interrupt request signal st_irq_block : block begin -- generate status register bits gen_sr_bits: process (wb_clk_i, rst_i) begin if (rst_i = '0') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; else al <= i2c_al or (al and not sta); rxack <= irxack; tip <= (rd or wr); -- interrupt request flag is always generated irq_flag <= (done or i2c_al or irq_flag) and not iack; end if; end if; end process gen_sr_bits; -- generate interrupt request signals gen_irq: process (wb_clk_i, rst_i) begin if (rst_i = '0') then wb_inta_o <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then wb_inta_o <= '0'; else -- interrupt signal is only generated when IEN (interrupt enable bit) is set wb_inta_o <= irq_flag and ien; end if; end if; end process gen_irq; -- assign status register bits sr(7) <= rxack; sr(6) <= i2c_busy; sr(5) <= al; sr(4 downto 2) <= (others => '0'); -- reserved sr(1) <= tip; sr(0) <= irq_flag; end block; end architecture structural;
--------------------------------------------------------------------- ---- ---- ---- WISHBONE revB2 compl. I2C Master Core; top level ---- ---- ---- ---- ---- ---- Author: Richard Herveille ---- ---- [email protected] ---- ---- www.asics.ws ---- ---- ---- ---- Downloaded from: http://www.opencores.org/projects/i2c/ ---- ---- ---- --------------------------------------------------------------------- ---- ---- ---- Copyright (C) 2000 Richard Herveille ---- ---- [email protected] ---- ---- ---- ---- This source file may be used and distributed without ---- ---- restriction provided that this copyright statement is not ---- ---- removed from the file and that any derivative work contains ---- ---- the original copyright notice and the associated disclaimer.---- ---- ---- ---- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY ---- ---- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ---- ---- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ---- ---- FOR A PARTICULAR PURPOSE. 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. ---- ---- ---- --------------------------------------------------------------------- -- CVS Log -- -- $Id: i2c_master_top.vhd,v 1.8 2009-01-20 10:38:45 rherveille Exp $ -- -- $Date: 2009-01-20 10:38:45 $ -- $Revision: 1.8 $ -- $Author: rherveille $ -- $Locker: $ -- $State: Exp $ -- -- Change History: -- Revision 1.7 2004/03/14 10:17:03 rherveille -- Fixed simulation issue when writing to CR register -- -- Revision 1.6 2003/08/09 07:01:13 rherveille -- Fixed a bug in the Arbitration Lost generation caused by delay on the (external) sda line. -- Fixed a potential bug in the byte controller's host-acknowledge generation. -- -- Revision 1.5 2003/02/01 02:03:06 rherveille -- Fixed a few 'arbitration lost' bugs. VHDL version only. -- -- Revision 1.4 2002/12/26 16:05:47 rherveille -- Core is now a Multimaster I2C controller. -- -- Revision 1.3 2002/11/30 22:24:37 rherveille -- Cleaned up code -- -- Revision 1.2 2001/11/10 10:52:44 rherveille -- Changed PRER reset value from 0x0000 to 0xffff, conform specs. -- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity COMM_zpuino_wb_i2c is generic( ARST_LVL : std_logic := '0' -- asynchronous reset level ); port ( -- wishbone signals wishbone_in : in std_logic_vector(61 downto 0); wishbone_out : out std_logic_vector(33 downto 0); -- i2c lines scl_pad_i : in std_logic; -- i2c clock line input scl_pad_o : out std_logic; -- i2c clock line output scl_padoen_o : out std_logic; -- i2c clock line output enable, active low sda_pad_i : in std_logic; -- i2c data line input sda_pad_o : out std_logic; -- i2c data line output sda_padoen_o : out std_logic -- i2c data line output enable, active low ); end entity COMM_zpuino_wb_i2c; architecture structural of COMM_zpuino_wb_i2c is component i2c_master_byte_ctrl is port ( clk : in std_logic; rst : in std_logic; -- synchronous active high reset (WISHBONE compatible) nReset : in std_logic; -- asynchornous active low reset (FPGA compatible) ena : in std_logic; -- core enable signal clk_cnt : in unsigned(15 downto 0); -- 4x SCL -- input signals start, stop, read, write, ack_in : std_logic; din : in std_logic_vector(7 downto 0); -- output signals cmd_ack : out std_logic; ack_out : out std_logic; i2c_busy : out std_logic; i2c_al : out std_logic; dout : out std_logic_vector(7 downto 0); -- i2c lines scl_i : in std_logic; -- i2c clock line input scl_o : out std_logic; -- i2c clock line output scl_oen : out std_logic; -- i2c clock line output enable, active low sda_i : in std_logic; -- i2c data line input sda_o : out std_logic; -- i2c data line output sda_oen : out std_logic -- i2c data line output enable, active low ); end component i2c_master_byte_ctrl; -- registers signal prer : unsigned(15 downto 0); -- clock prescale register signal ctr : std_logic_vector(7 downto 0); -- control register signal txr : std_logic_vector(7 downto 0); -- transmit register signal rxr : std_logic_vector(7 downto 0); -- receive register signal cr : std_logic_vector(7 downto 0); -- command register signal sr : std_logic_vector(7 downto 0); -- status register -- internal reset signal signal rst_i : std_logic; -- wishbone write access signal wb_wacc : std_logic; -- internal acknowledge signal signal iack_o : std_logic; -- done signal: command completed, clear command register signal done : std_logic; -- command register signals signal sta, sto, rd, wr, ack, iack : std_logic; signal core_en : std_logic; -- core enable signal signal ien : std_logic; -- interrupt enable signal -- status register signals signal irxack, rxack : std_logic; -- received aknowledge from slave signal tip : std_logic; -- transfer in progress signal irq_flag : std_logic; -- interrupt pending flag signal i2c_busy : std_logic; -- i2c bus busy (start signal detected) signal i2c_al, al : std_logic; -- arbitration lost signal wb_clk_i: std_logic; -- Wishbone clock signal wb_rst_i: std_logic; -- Wishbone reset (synchronous) signal wb_dat_i: std_logic_vector(31 downto 0); -- Wishbone data input (32 bits) signal wb_adr_i: std_logic_vector(26 downto 2); -- Wishbone address input (32 bits) signal wb_we_i: std_logic; -- Wishbone write enable signal signal wb_cyc_i: std_logic; -- Wishbone cycle signal signal wb_stb_i: std_logic; -- Wishbone strobe signal signal wb_dat_o: std_logic_vector(31 downto 0); -- Wishbone data output (32 bits) signal wb_ack_o: std_logic; -- Wishbone acknowledge out signal signal wb_inta_o: std_logic; begin -- Unpack the wishbone array into signals so the modules code is not confusing. wb_clk_i <= wishbone_in(61); wb_rst_i <= wishbone_in(60); wb_dat_i <= wishbone_in(59 downto 28); wb_adr_i <= wishbone_in(27 downto 3); wb_we_i <= wishbone_in(2); wb_cyc_i <= wishbone_in(1); wb_stb_i <= wishbone_in(0); wishbone_out(33 downto 2) <= wb_dat_o; wishbone_out(1) <= wb_ack_o; wishbone_out(0) <= wb_inta_o; -- generate internal reset signal rst_i <= arst_i xor ARST_LVL; -- generate acknowledge output signal gen_ack_o : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then iack_o <= wb_cyc_i and wb_stb_i and not iack_o; -- because timing is always honored end if; end process gen_ack_o; wb_ack_o <= iack_o; -- generate wishbone write access signal wb_wacc <= wb_we_i and iack_o; -- assign wb_dat_o assign_dato : process(wb_clk_i) begin if (wb_clk_i'event and wb_clk_i = '1') then case wb_adr_i is when "000" => wb_dat_o <= std_logic_vector(prer( 7 downto 0)); when "001" => wb_dat_o <= std_logic_vector(prer(15 downto 8)); when "010" => wb_dat_o <= ctr; when "011" => wb_dat_o <= rxr; -- write is transmit register TxR when "100" => wb_dat_o <= sr; -- write is command register CR -- Debugging registers: -- These registers are not documented. -- Functionality could change in future releases when "101" => wb_dat_o <= txr; when "110" => wb_dat_o <= cr; when "111" => wb_dat_o <= (others => '0'); when others => wb_dat_o <= (others => 'X'); -- for simulation only end case; end if; end process assign_dato; -- generate registers (CR, SR see below) gen_regs: process(rst_i, wb_clk_i) begin if (rst_i = '0') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then prer <= (others => '1'); ctr <= (others => '0'); txr <= (others => '0'); elsif (wb_wacc = '1') then case wb_adr_i is when "000" => prer( 7 downto 0) <= unsigned(wb_dat_i); when "001" => prer(15 downto 8) <= unsigned(wb_dat_i); when "010" => ctr <= wb_dat_i; when "011" => txr <= wb_dat_i; when "100" => null; --write to CR, avoid executing the others clause -- illegal cases, for simulation only when others => report ("Illegal write address, setting all registers to unknown."); prer <= (others => 'X'); ctr <= (others => 'X'); txr <= (others => 'X'); end case; end if; end if; end process gen_regs; -- generate command register gen_cr: process(rst_i, wb_clk_i) begin if (rst_i = '0') then cr <= (others => '0'); elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then cr <= (others => '0'); elsif (wb_wacc = '1') then if ( (core_en = '1') and (wb_adr_i = "100") ) then -- only take new commands when i2c core enabled -- pending commands are finished cr <= wb_dat_i; end if; else if (done = '1' or i2c_al = '1') then cr(7 downto 4) <= (others => '0'); -- clear command bits when command done or arbitration lost end if; cr(2 downto 1) <= (others => '0'); -- reserved bits, always '0' cr(0) <= '0'; -- clear IRQ_ACK bit end if; end if; end process gen_cr; -- decode command register sta <= cr(7); sto <= cr(6); rd <= cr(5); wr <= cr(4); ack <= cr(3); iack <= cr(0); -- decode control register core_en <= ctr(7); ien <= ctr(6); -- hookup byte controller block byte_ctrl: i2c_master_byte_ctrl port map ( clk => wb_clk_i, rst => wb_rst_i, nReset => rst_i, ena => core_en, clk_cnt => prer, start => sta, stop => sto, read => rd, write => wr, ack_in => ack, i2c_busy => i2c_busy, i2c_al => i2c_al, din => txr, cmd_ack => done, ack_out => irxack, dout => rxr, scl_i => scl_pad_i, scl_o => scl_pad_o, scl_oen => scl_padoen_o, sda_i => sda_pad_i, sda_o => sda_pad_o, sda_oen => sda_padoen_o ); -- status register block + interrupt request signal st_irq_block : block begin -- generate status register bits gen_sr_bits: process (wb_clk_i, rst_i) begin if (rst_i = '0') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then al <= '0'; rxack <= '0'; tip <= '0'; irq_flag <= '0'; else al <= i2c_al or (al and not sta); rxack <= irxack; tip <= (rd or wr); -- interrupt request flag is always generated irq_flag <= (done or i2c_al or irq_flag) and not iack; end if; end if; end process gen_sr_bits; -- generate interrupt request signals gen_irq: process (wb_clk_i, rst_i) begin if (rst_i = '0') then wb_inta_o <= '0'; elsif (wb_clk_i'event and wb_clk_i = '1') then if (wb_rst_i = '1') then wb_inta_o <= '0'; else -- interrupt signal is only generated when IEN (interrupt enable bit) is set wb_inta_o <= irq_flag and ien; end if; end if; end process gen_irq; -- assign status register bits sr(7) <= rxack; sr(6) <= i2c_busy; sr(5) <= al; sr(4 downto 2) <= (others => '0'); -- reserved sr(1) <= tip; sr(0) <= irq_flag; end block; end architecture structural;
-------------------------------------------------------------------------------- -- This file is owned and controlled by Xilinx and must be used -- -- solely for design, simulation, implementation and creation of -- -- design files limited to Xilinx devices or technologies. Use -- -- with non-Xilinx devices or technologies is expressly prohibited -- -- and immediately terminates your license. -- -- -- -- XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" -- -- SOLELY FOR USE IN DEVELOPING PROGRAMS AND SOLUTIONS FOR -- -- XILINX DEVICES. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION -- -- AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION -- -- OR STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS -- -- IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT, -- -- AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE -- -- FOR YOUR IMPLEMENTATION. XILINX EXPRESSLY DISCLAIMS ANY -- -- WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE -- -- IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR -- -- REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF -- -- INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -- -- FOR A PARTICULAR PURPOSE. -- -- -- -- Xilinx products are not intended for use in life support -- -- appliances, devices, or systems. Use in such applications are -- -- expressly prohibited. -- -- -- -- (c) Copyright 1995-2012 Xilinx, Inc. -- -- All rights reserved. -- -------------------------------------------------------------------------------- -- You must compile the wrapper file dpram_4_1_xc6.vhd when simulating -- the core, dpram_4_1_xc6. When compiling the wrapper file, be sure to -- reference the XilinxCoreLib VHDL simulation library. For detailed -- instructions, please refer to the "CORE Generator Help". -- The synthesis directives "translate_off/translate_on" specified -- below are supported by Xilinx, Mentor Graphics and Synplicity -- synthesis tools. Ensure they are correct for your synthesis tool(s). LIBRARY ieee; USE ieee.std_logic_1164.ALL; -- synthesis translate_off LIBRARY XilinxCoreLib; -- synthesis translate_on ENTITY dpram_4_1_xc6 IS PORT ( clka : IN STD_LOGIC; wea : IN STD_LOGIC_VECTOR(3 DOWNTO 0); addra : IN STD_LOGIC_VECTOR(7 DOWNTO 0); dina : IN STD_LOGIC_VECTOR(31 DOWNTO 0); douta : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); clkb : IN STD_LOGIC; web : IN STD_LOGIC_VECTOR(0 DOWNTO 0); addrb : IN STD_LOGIC_VECTOR(9 DOWNTO 0); dinb : IN STD_LOGIC_VECTOR(7 DOWNTO 0); doutb : OUT STD_LOGIC_VECTOR(7 DOWNTO 0) ); END dpram_4_1_xc6; ARCHITECTURE dpram_4_1_xc6_a OF dpram_4_1_xc6 IS -- synthesis translate_off COMPONENT wrapped_dpram_4_1_xc6 PORT ( clka : IN STD_LOGIC; wea : IN STD_LOGIC_VECTOR(3 DOWNTO 0); addra : IN STD_LOGIC_VECTOR(7 DOWNTO 0); dina : IN STD_LOGIC_VECTOR(31 DOWNTO 0); douta : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); clkb : IN STD_LOGIC; web : IN STD_LOGIC_VECTOR(0 DOWNTO 0); addrb : IN STD_LOGIC_VECTOR(9 DOWNTO 0); dinb : IN STD_LOGIC_VECTOR(7 DOWNTO 0); doutb : OUT STD_LOGIC_VECTOR(7 DOWNTO 0) ); END COMPONENT; -- Configuration specification FOR ALL : wrapped_dpram_4_1_xc6 USE ENTITY XilinxCoreLib.blk_mem_gen_v6_1(behavioral) GENERIC MAP ( c_addra_width => 8, c_addrb_width => 10, c_algorithm => 1, c_axi_id_width => 4, c_axi_slave_type => 0, c_axi_type => 1, c_byte_size => 8, c_common_clk => 0, c_default_data => "0", c_disable_warn_bhv_coll => 0, c_disable_warn_bhv_range => 0, c_family => "spartan6", c_has_axi_id => 0, c_has_ena => 0, c_has_enb => 0, c_has_injecterr => 0, c_has_mem_output_regs_a => 0, c_has_mem_output_regs_b => 0, c_has_mux_output_regs_a => 0, c_has_mux_output_regs_b => 0, c_has_regcea => 0, c_has_regceb => 0, c_has_rsta => 0, c_has_rstb => 0, c_has_softecc_input_regs_a => 0, c_has_softecc_output_regs_b => 0, c_init_file_name => "no_coe_file_loaded", c_inita_val => "0", c_initb_val => "0", c_interface_type => 0, c_load_init_file => 0, c_mem_type => 2, c_mux_pipeline_stages => 0, c_prim_type => 1, c_read_depth_a => 256, c_read_depth_b => 1024, c_read_width_a => 32, c_read_width_b => 8, c_rst_priority_a => "CE", c_rst_priority_b => "CE", c_rst_type => "SYNC", c_rstram_a => 0, c_rstram_b => 0, c_sim_collision_check => "ALL", c_use_byte_wea => 1, c_use_byte_web => 1, c_use_default_data => 0, c_use_ecc => 0, c_use_softecc => 0, c_wea_width => 4, c_web_width => 1, c_write_depth_a => 256, c_write_depth_b => 1024, c_write_mode_a => "WRITE_FIRST", c_write_mode_b => "WRITE_FIRST", c_write_width_a => 32, c_write_width_b => 8, c_xdevicefamily => "spartan6" ); -- synthesis translate_on BEGIN -- synthesis translate_off U0 : wrapped_dpram_4_1_xc6 PORT MAP ( clka => clka, wea => wea, addra => addra, dina => dina, douta => douta, clkb => clkb, web => web, addrb => addrb, dinb => dinb, doutb => doutb ); -- synthesis translate_on END dpram_4_1_xc6_a;
-- VHDL do Sistema Digital library ieee; use ieee.std_logic_1164.all; entity recepcao_serial is port( clock: in std_logic; reset: in std_logic; entrada: in std_logic; recebe_dado: in std_logic; dado_rec: out std_logic_vector(11 downto 0); tem_dado_rec: out std_logic; dep_paridade_ok: out std_logic; dep_tick_rx: out std_logic; dep_estados: out std_logic_vector(5 downto 0); dep_habilita_recepcao: out std_logic ); end recepcao_serial; architecture estrutural of recepcao_serial is component circuito_recepcao is port( dado_serial : in std_logic; reset : in std_logic; clock : in std_logic; tick : in std_logic; dados_ascii : out std_logic_vector(11 downto 0); saidas_estado : out std_logic_vector(5 downto 0); pronto : out std_logic; paridade_ok : out std_logic; dep_habilita_recepcao : out std_logic ); end component; component interface_recepcao is port( clock: in std_logic; reset: in std_logic; pronto: in std_logic; paridade_ok: in std_logic; recebe_dado: in std_logic; dado_entrada: in std_logic_vector(11 downto 0); tem_dado_rec: out std_logic; dado_rec: out std_logic_vector(11 downto 0) ); end component; component gerador_tick is generic( M: integer := 454545 -- para transmissao de 110 bauds ); port( clock, reset: in std_logic; tick: out std_logic ); end component; signal sinal_tick: std_logic; signal sinal_dados_ascii: std_logic_vector(11 downto 0); signal sinal_pronto: std_logic; signal sinal_paridade_ok: std_logic; begin circuito : circuito_recepcao port map (entrada, reset, clock, sinal_tick, sinal_dados_ascii, dep_estados, sinal_pronto, sinal_paridade_ok, dep_habilita_recepcao); gera_tick: gerador_tick generic map (M => 28409) port map(clock, reset, sinal_tick); --para teste usar a linha abaixo de comentar a de cima --gera_tick: gerador_tick generic map (M => 2) port map(clock, reset, sinal_tick); interface: interface_recepcao port map (clock, reset, sinal_pronto, sinal_paridade_ok, recebe_dado, sinal_dados_ascii, tem_dado_rec, dado_rec); dep_paridade_ok <= sinal_paridade_ok; dep_tick_rx <= sinal_tick; end estrutural;
------------------------------------------------------------------------------- --! @file edgedetectorRtl.vhd -- --! @brief Edge detector -- --! @details This is an edge detector circuit providing any, rising and falling --! edge outputs. ------------------------------------------------------------------------------- -- -- (c) B&R, 2013 -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: -- -- 1. Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary 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. -- -- 3. Neither the name of B&R nor the names of its -- contributors may be used to endorse or promote products derived -- from this software without prior written permission. For written -- permission, please contact [email protected] -- -- 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 -- COPYRIGHT HOLDERS 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. -- ------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use work.global.all; entity edgedetector is port ( --! Asynchronous reset iArst : in std_logic; --! Clock iClk : in std_logic; --! Enable detection iEnable : in std_logic; --! Data to be sampled iData : in std_logic; --! Rising edge detected (unregistered) oRising : out std_logic; --! Falling edge detected (unregistered) oFalling : out std_logic; --! Any edge detected (unregistered) oAny : out std_logic ); end edgedetector; architecture rtl of edgedetector is --! Register to delay input by one clock cycle signal reg : std_logic; --! Register next signal reg_next : std_logic; --! Second register signal reg_l : std_logic; --! Second register next signal reg_l_next : std_logic; begin -- assign input data to register reg_next <= iData; --! Detection comb : process ( iEnable, reg, reg_l ) begin -- default oRising <= cInactivated; oFalling <= cInactivated; oAny <= cInactivated; if iEnable = cActivated then -- rising edge if reg_l = cInactivated and reg = cActivated then oRising <= cActivated; oAny <= cActivated; end if; -- falling edge if reg_l = cActivated and reg = cInactivated then oFalling <= cActivated; oAny <= cActivated; end if; end if; end process; reg_l_next <= reg; --! Clock process regClk : process(iArst, iClk) begin if iArst = cActivated then reg <= cInactivated; reg_l <= cInactivated; elsif rising_edge(iClk) then reg <= reg_next; reg_l <= reg_l_next; end if; end process; end rtl;
------------------------------------------------------------------------------ -- LEON3 Demonstration design test bench -- Copyright (C) 2013 Aeroflex Gaisler ------------------------------------------------------------------------------ -- This file is a part of the GRLIB VHDL IP LIBRARY -- Copyright (C) 2003 - 2008, Gaisler Research -- Copyright (C) 2008 - 2013, 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 ------------------------------------------------------------------------------ library ieee; use ieee.std_logic_1164.all; library gaisler; use gaisler.libdcom.all; use gaisler.sim.all; use work.debug.all; library techmap; use techmap.gencomp.all; library micron; use micron.components.all; library grlib; use grlib.stdlib.all; use work.config.all; -- configuration entity testbench is generic ( fabtech : integer := CFG_FABTECH; memtech : integer := CFG_MEMTECH; padtech : integer := CFG_PADTECH; clktech : integer := CFG_CLKTECH; disas : integer := CFG_DISAS; -- Enable disassembly to console dbguart : integer := CFG_DUART; -- Print UART on console pclow : integer := CFG_PCLOW; clkperiod : integer := 10; -- system clock period romdepth : integer := 25; -- rom address depth sramwidth : integer := 32; -- ram data width (8/16/32) sramdepth : integer := 20; -- ram address depth srambanks : integer := 2 -- number of ram banks ); end; architecture behav of testbench is constant promfile : string := "prom.srec"; -- rom contents constant sramfile : string := "ram.srec"; -- ram contents constant sdramfile : string := "ram.srec"; -- sdram contents constant ct : integer := clkperiod/2; -- clocks signal OSC_50_BANK2 : std_logic := '0'; signal OSC_50_BANK3 : std_logic := '0'; signal OSC_50_BANK4 : std_logic := '0'; signal OSC_50_BANK5 : std_logic := '0'; signal OSC_50_BANK6 : std_logic := '0'; signal OSC_50_BANK7 : std_logic := '0'; signal PLL_CLKIN_p : std_logic := '0'; signal SMA_CLKIN_p : std_logic := '0'; --signal SMA_GXBCLK_p : std_logic; signal GCLKIN : std_logic := '0'; signal GCLKOUT_FPGA : std_logic := '0'; signal SMA_CLKOUT_p : std_logic := '0'; -- cpu reset signal CPU_RESET_n : std_ulogic := '0'; -- max i/o signal MAX_CONF_D : std_logic_vector(3 downto 0); signal MAX_I2C_SCLK : std_logic; signal MAX_I2C_SDAT : std_logic; -- LEDs signal LED : std_logic_vector(7 downto 0); -- buttons signal BUTTON : std_logic_vector(3 downto 0); -- switches signal SW : std_logic_vector(3 downto 0); -- slide switches signal SLIDE_SW : std_logic_vector(3 downto 0); -- temperature signal TEMP_SMCLK : std_logic; signal TEMP_SMDAT : std_logic; signal TEMP_INT_n : std_logic; -- current signal CSENSE_ADC_FO : std_logic; signal CSENSE_SCK : std_logic; signal CSENSE_SDI : std_logic; signal CSENSE_SDO : std_logic; signal CSENSE_CS_n : std_logic_vector(1 downto 0); -- fan signal FAN_CTRL : std_logic; -- eeprom signal EEP_SCL : std_logic; signal EEP_SDA : std_logic; -- sdcard signal SD_CLK : std_logic; signal SD_CMD : std_logic; signal SD_DAT : std_logic_vector(3 downto 0); signal SD_WP_n : std_logic; -- Ethernet interfaces signal ETH_INT_n : std_logic_vector(3 downto 0); signal ETH_MDC : std_logic_vector(3 downto 0); signal ETH_MDIO : std_logic_vector(3 downto 0); signal ETH_RST_n : std_ulogic; signal ETH_RX_p : std_logic_vector(3 downto 0); signal ETH_TX_p : std_logic_vector(3 downto 0); -- PCIe interfaces --signal PCIE_PREST_n : std_ulogic; --signal PCIE_REFCLK_p : std_ulogic; --signal PCIE_RX_p : std_logic_vector(7 downto 0); --signal PCIE_SMBCLK : std_logic; --signal PCIE_SMBDAT : std_logic; --signal PCIE_TX_p : std_logic_vector(7 downto 0); --signal PCIE_WAKE_n : std_logic; -- Flash and SRAM, shared signals signal FSM_A : std_logic_vector(25 downto 1); signal FSM_D : std_logic_vector(15 downto 0); -- Flash control signal FLASH_ADV_n : std_ulogic; signal FLASH_CE_n : std_ulogic; signal FLASH_CLK : std_ulogic; signal FLASH_OE_n : std_ulogic; signal FLASH_RESET_n : std_ulogic; signal FLASH_RYBY_n : std_ulogic; signal FLASH_WE_n : std_ulogic; -- SSRAM control signal SSRAM_ADV : std_ulogic; signal SSRAM_BWA_n : std_ulogic; signal SSRAM_BWB_n : std_ulogic; signal SSRAM_CE_n : std_ulogic; signal SSRAM_CKE_n : std_ulogic; signal SSRAM_CLK : std_ulogic; signal SSRAM_OE_n : std_ulogic; signal SSRAM_WE_n : std_ulogic; -- USB OTG --signal OTG_A : std_logic_vector(17 downto 1); --signal OTG_CS_n : std_ulogic; --signal OTG_D : std_logic_vector(31 downto 0); --signal OTG_DC_DACK : std_ulogic; --signal OTG_DC_DREQ : std_ulogic; --signal OTG_DC_IRQ : std_ulogic; --signal OTG_HC_DACK : std_ulogic; --signal OTG_HC_DREQ : std_ulogic; --signal OTG_HC_IRQ : std_ulogic; --signal OTG_OE_n : std_ulogic; --signal OTG_RESET_n : std_ulogic; --signal OTG_WE_n : std_ulogic; -- SATA --signal SATA_REFCLK_p : std_logic; --signal SATA_HOST_RX_p : std_logic_vector(1 downto 0); --signal SATA_HOST_TX_p : std_logic_vector(1 downto 0); --signal SATA_DEVICE_RX_p : std_logic_vector(1 downto 0); --signal SATA_DEVICE_TX_p : std_logic_vector(1 downto 0); -- DDR2 SODIMM signal M1_DDR2_addr : std_logic_vector(15 downto 0); signal M1_DDR2_ba : std_logic_vector(2 downto 0); signal M1_DDR2_cas_n : std_logic; signal M1_DDR2_cke : std_logic_vector(1 downto 0); signal M1_DDR2_clk : std_logic_vector(1 downto 0); signal M1_DDR2_clk_n : std_logic_vector(1 downto 0); signal M1_DDR2_cs_n : std_logic_vector(1 downto 0); signal M1_DDR2_dm : std_logic_vector(7 downto 0); signal M1_DDR2_dq : std_logic_vector(63 downto 0); signal M1_DDR2_dqs : std_logic_vector(7 downto 0); signal M1_DDR2_dqsn : std_logic_vector(7 downto 0); signal M1_DDR2_odt : std_logic_vector(1 downto 0); signal M1_DDR2_ras_n : std_logic; -- signal M1_DDR2_SA : std_logic_vector(1 downto 0); -- signal M1_DDR2_SCL : std_logic; -- signal M1_DDR2_SDA : std_logic; signal M1_DDR2_we_n : std_logic; signal M1_DDR2_oct_rdn : std_logic; signal M1_DDR2_oct_rup : std_logic; -- DDR2 SODIMM --signal M2_DDR2_addr : std_logic_vector(15 downto 0); --signal M2_DDR2_ba : std_logic_vector(2 downto 0); --signal M2_DDR2_cas_n : std_logic; --signal M2_DDR2_cke : std_logic_vector(1 downto 0); --signal M2_DDR2_clk : std_logic_vector(1 downto 0); --signal M2_DDR2_clk_n : std_logic_vector(1 downto 0); --signal M2_DDR2_cs_n : std_logic_vector(1 downto 0); --signal M2_DDR2_dm : std_logic_vector(7 downto 0); --signal M2_DDR2_dq : std_logic_vector(63 downto 0); --signal M2_DDR2_dqs : std_logic_vector(7 downto 0); --signal M2_DDR2_dqsn : std_logic_vector(7 downto 0); --signal M2_DDR2_odt : std_logic_vector(1 downto 0); --signal M2_DDR2_ras_n : std_logic; --signal M2_DDR2_SA : std_logic_vector(1 downto 0); --signal M2_DDR2_SCL : std_logic; --signal M2_DDR2_SDA : std_logic; --signal M2_DDR2_we_n : std_logic; -- GPIO signal GPIO0_D : std_logic_vector(35 downto 0); signal GPIO1_D : std_logic_vector(35 downto 0); -- Ext I/O signal EXT_IO : std_logic; -- HSMC A -- signal HSMA_CLKIN_n1 : std_logic; -- signal HSMA_CLKIN_n2 : std_logic; -- signal HSMA_CLKIN_p1 : std_logic; -- signal HSMA_CLKIN_p2 : std_logic; -- signal HSMA_CLKIN0 : std_logic; -- signal HSMA_CLKOUT_n2 : std_logic; -- signal HSMA_CLKOUT_p2 : std_logic; -- signal HSMA_D : std_logic_vector(3 downto 0); -- HSMA_GXB_RX_p : std_logic_vector(3 downto 0); -- HSMA_GXB_TX_p : std_logic_vector(3 downto 0); -- signal HSMA_OUT_n1 : std_logic; -- signal HSMA_OUT_p1 : std_logic; -- signal HSMA_OUT0 : std_logic; -- HSMA_REFCLK_p : in std_logic; -- signal HSMA_RX_n : std_logic_vector(16 downto 0); -- signal HSMA_RX_p : std_logic_vector(16 downto 0); -- signal HSMA_TX_n : std_logic_vector(16 downto 0); -- signal HSMA_TX_p : std_logic_vector(16 downto 0); -- HSMC_B -- signal HSMB_CLKIN_n1 : std_logic; -- signal HSMB_CLKIN_n2 : std_logic; -- signal HSMB_CLKIN_p1 : std_logic; -- signal HSMB_CLKIN_p2 : std_logic; -- signal HSMB_CLKIN0 : std_logic; -- signal HSMB_CLKOUT_n2 : std_logic; -- signal HSMB_CLKOUT_p2 : std_logic; -- signal HSMB_D : std_logic_vector(3 downto 0); -- signal HSMB_GXB_RX_p : in std_logic_vector(3 downto 0); -- signal HSMB_GXB_TX_p : out std_logic_vector(3 downto 0); -- signal HSMB_OUT_n1 : std_logic; -- signal HSMB_OUT_p1 : std_logic; -- signal HSMB_OUT0 : std_logic; -- signal HSMB_REFCLK_p : in std_logic; -- signal HSMB_RX_n : std_logic_vector(16 downto 0); -- signal HSMB_RX_p : std_logic_vector(16 downto 0); -- signal HSMB_TX_n : std_logic_vector(16 downto 0); -- signal HSMB_TX_p : std_logic_vector(16 downto 0); -- HSMC i2c -- signal HSMC_SCL : std_logic; -- signal HSMC_SDA : std_logic; -- Display -- signal SEG0_D : std_logic_vector(6 downto 0); -- signal SEG1_D : std_logic_vector(6 downto 0); -- signal SEG0_DP : std_ulogic; -- signal SEG1_DP : std_ulogic; -- UART signal UART_CTS : std_ulogic; signal UART_RTS : std_ulogic; signal UART_RXD : std_logic; signal UART_TXD : std_logic; signal dsuen, dsubren, dsuact : std_ulogic; signal dsurst : std_ulogic; constant lresp : boolean := false; begin -- clock and reset -- 50 MHz clocks OSC_50_BANK2 <= not OSC_50_BANK2 after 10 ns; OSC_50_BANK3 <= not OSC_50_BANK3 after 10 ns; OSC_50_BANK4 <= not OSC_50_BANK4 after 10 ns; OSC_50_BANK5 <= not OSC_50_BANK5 after 10 ns; OSC_50_BANK6 <= not OSC_50_BANK6 after 10 ns; OSC_50_BANK7 <= not OSC_50_BANK7 after 10 ns; -- 100 MHz PLL_CLKIN_p <= not PLL_CLKIN_p after 5 ns; SMA_CLKIN_p <= not SMA_CLKIN_p after 10 ns; GCLKIN <= not GCLKIN after 10 ns; CPU_RESET_n <= '0', '1' after 200 ns; -- various interfaces MAX_CONF_D <= (others => 'H'); MAX_I2C_SDAT <= 'H'; BUTTON <= "HHHH"; SW <= (others => 'H'); SLIDE_SW <= (others => 'L'); TEMP_SMDAT <= 'H'; TEMP_INT_n <= 'H'; CSENSE_SCK <= 'H'; CSENSE_SDO <= 'H'; EEP_SDA <= 'H'; SD_CMD <= 'H'; SD_DAT <= (others => 'H'); SD_WP_n <= 'H'; GPIO0_D <= (others => 'H'); GPIO1_D <= (others => 'H'); EXT_IO <= 'H'; LED(0) <= 'H'; -- HSMC_SDA <= 'H'; UART_RTS <= '1'; UART_RXD <= 'H'; -- LEON3 SoC d3 : entity work.leon3mp generic map ( fabtech, memtech, padtech, clktech, disas, dbguart, pclow) port map ( OSC_50_BANK2, OSC_50_BANK3, OSC_50_BANK4, OSC_50_BANK5, OSC_50_BANK6, OSC_50_BANK7, PLL_CLKIN_p, SMA_CLKIN_p, -- SMA_GXBCLK_p GCLKIN, GCLKOUT_FPGA, SMA_CLKOUT_p, -- cpu reset CPU_RESET_n, -- max i/o MAX_CONF_D, MAX_I2C_SCLK, MAX_I2C_SDAT, -- LEDs LED, -- buttons BUTTON, -- switches SW, -- slide switches SLIDE_SW, -- temperature TEMP_SMCLK, TEMP_SMDAT, TEMP_INT_n, -- current CSENSE_ADC_FO, CSENSE_SCK, CSENSE_SDI, CSENSE_SDO, CSENSE_CS_n, -- fan FAN_CTRL, -- eeprom EEP_SCL, EEP_SDA, -- sdcard SD_CLK, SD_CMD, SD_DAT, SD_WP_n, -- Ethernet interfaces ETH_INT_n, ETH_MDC, ETH_MDIO, ETH_RST_n, ETH_RX_p, ETH_TX_p, -- PCIe interfaces -- PCIE_PREST_n, PCIE_REFCLK_p, PCIE_RX_p, PCIE_SMBCLK, -- PCIE_SMBDAT, PCIE_TX_p PCIE_WAKE_n -- Flash and SRAM, shared signals FSM_A, FSM_D, -- Flash control FLASH_ADV_n, FLASH_CE_n, FLASH_CLK, FLASH_OE_n, FLASH_RESET_n, FLASH_RYBY_n, FLASH_WE_n, -- SSRAM control SSRAM_ADV, SSRAM_BWA_n, SSRAM_BWB_n, SSRAM_CE_n, SSRAM_CKE_n, SSRAM_CLK, SSRAM_OE_n, SSRAM_WE_n, -- USB OTG -- OTG_A, OTG_CS_n, OTG_D, OTG_DC_DACK, OTG_DC_DRE, OTG_DC_IRQ, -- OTG_HC_DACK, OTG_HC_DREQ, OTG_HC_IRQ, OTG_OE_n, OTG_RESET_n, -- OTG_WE_n, -- SATA -- SATA_REFCLK_p, SATA_HOST_RX_p, SATA_HOST_TX_p, SATA_DEVICE_RX_p, SATA_DEVICE_TX_p, -- DDR2 SODIMM M1_DDR2_addr, M1_DDR2_ba, M1_DDR2_cas_n, M1_DDR2_cke, M1_DDR2_clk, M1_DDR2_clk_n, M1_DDR2_cs_n, M1_DDR2_dm, M1_DDR2_dq, M1_DDR2_dqs, M1_DDR2_dqsn, M1_DDR2_odt, M1_DDR2_ras_n, -- M1_DDR2_SA, M1_DDR2_SCL, M1_DDR2_SDA, M1_DDR2_we_n, M1_DDR2_oct_rdn, M1_DDR2_oct_rup, -- DDR2 SODIMM -- M2_DDR2_addr, M2_DDR2_ba, M2_DDR2_cas_n, M2_DDR2_cke, M2_DDR2_clk, M2_DDR2_clk_n -- M2_DDR2_cs_n, M2_DDR2_dm, M2_DDR2_dq, M2_DDR2_dqs, M2_DDR2_dqsn, M2_DDR2_odt, -- M2_DDR2_ras_n, M2_DDR2_SA, M2_DDR2_SCL, M2_DDR2_SDA M2_DDR2_we_n -- GPIO GPIO0_D, GPIO1_D, -- Ext I/O -- EXT_IO, -- HSMC A -- HSMA_CLKIN_n1, HSMA_CLKIN_n2, HSMA_CLKIN_p1, HSMA_CLKIN_p2, HSMA_CLKIN0, -- HSMA_CLKOUT_n2, HSMA_CLKOUT_p2, HSMA_D, -- HSMA_GXB_RX_p, HSMA_GXB_TX_p, -- HSMA_OUT_n1, HSMA_OUT_p1, HSMA_OUT0, -- HSMA_REFCLK_p, -- HSMA_RX_n, HSMA_RX_p, HSMA_TX_n, HSMA_TX_p, -- HSMC_B -- HSMB_CLKIN_n1, HSMB_CLKIN_n2, HSMB_CLKIN_p1, HSMB_CLKIN_p2, HSMB_CLKIN0, -- HSMB_CLKOUT_n2, HSMB_CLKOUT_p2, HSMB_D, -- HSMB_GXB_RX_p, HSMB_GXB_TX_p, -- HSMB_OUT_n1, HSMB_OUT_p1, HSMB_OUT0, -- HSMB_REFCLK_p, -- HSMB_RX_n, HSMB_RX_p, HSMB_TX_n, HSMB_TX_p, -- HSMC i2c -- HSMC_SCL, HSMC_SDA, -- Display -- SEG0_D, SEG1_D, SEG0_DP, SEG1_DP, -- UART UART_CTS, UART_RTS, UART_RXD, UART_TXD ); prom0 : sram16 generic map (index => 4, abits => romdepth, fname => promfile) port map (FSM_A(romdepth downto 1), FSM_D, FLASH_CE_n, FLASH_CE_n, FLASH_CE_n, FLASH_WE_n, FLASH_OE_n); FLASH_RYBY_n <= 'H'; test0 : grtestmod generic map ( width => 16 ) port map ( CPU_RESET_n, OSC_50_BANK3, LED(0), FSM_A(20 downto 1), FSM_D, '0', FLASH_OE_n, FLASH_WE_n); iuerr : process begin wait for 2500 ns; if to_x01(LED(0)) = '1' then wait on LED(0); end if; assert (to_x01(LED(0)) = '1') report "*** IU in error mode, simulation halted ***" severity failure ; end process; FSM_D <= buskeep(FSM_D) after 5 ns; dsucom : process procedure dsucfg(signal dsurx : in std_ulogic; signal dsutx : out std_ulogic) is variable w32 : std_logic_vector(31 downto 0); variable c8 : std_logic_vector(7 downto 0); constant txp : time := 320 * 1 ns; begin dsutx <= '1'; dsurst <= '0'; wait for 2500 ns; dsurst <= '1'; wait; wait for 5000 ns; txc(dsutx, 16#55#, txp); -- sync uart-- txc(dsutx, 16#c0#, txp); txa(dsutx, 16#90#, 16#00#, 16#00#, 16#00#, txp); txa(dsutx, 16#00#, 16#00#, 16#20#, 16#2e#, txp);-- wait for 25000 ns; txc(dsutx, 16#c0#, txp); txa(dsutx, 16#90#, 16#00#, 16#00#, 16#20#, txp); txa(dsutx, 16#00#, 16#00#, 16#00#, 16#01#, txp);-- txc(dsutx, 16#c0#, txp); txa(dsutx, 16#90#, 16#40#, 16#00#, 16#24#, txp); txa(dsutx, 16#00#, 16#00#, 16#00#, 16#0D#, txp);-- txc(dsutx, 16#c0#, txp); txa(dsutx, 16#90#, 16#70#, 16#11#, 16#78#, txp); txa(dsutx, 16#91#, 16#00#, 16#00#, 16#0D#, txp);-- txa(dsutx, 16#90#, 16#40#, 16#00#, 16#44#, txp); txa(dsutx, 16#00#, 16#00#, 16#20#, 16#00#, txp);-- txc(dsutx, 16#80#, txp); txa(dsutx, 16#90#, 16#40#, 16#00#, 16#44#, txp);-- wait; txc(dsutx, 16#c0#, txp); txa(dsutx, 16#00#, 16#00#, 16#0a#, 16#aa#, txp); txa(dsutx, 16#00#, 16#55#, 16#00#, 16#55#, txp); txc(dsutx, 16#c0#, txp); txa(dsutx, 16#00#, 16#00#, 16#0a#, 16#a0#, txp); txa(dsutx, 16#01#, 16#02#, 16#09#, 16#33#, txp);-- txc(dsutx, 16#c0#, txp); txa(dsutx, 16#90#, 16#00#, 16#00#, 16#00#, txp); txa(dsutx, 16#00#, 16#00#, 16#00#, 16#2e#, txp); txc(dsutx, 16#c0#, txp); txa(dsutx, 16#91#, 16#00#, 16#00#, 16#00#, txp); txa(dsutx, 16#00#, 16#00#, 16#00#, 16#2e#, txp); txc(dsutx, 16#c0#, txp); txa(dsutx, 16#90#, 16#00#, 16#00#, 16#20#, txp); txa(dsutx, 16#00#, 16#00#, 16#00#, 16#0f#, txp); txc(dsutx, 16#c0#, txp); txa(dsutx, 16#90#, 16#00#, 16#00#, 16#20#, txp); txa(dsutx, 16#00#, 16#00#, 16#00#, 16#00#, txp); txc(dsutx, 16#c0#, txp); txa(dsutx, 16#80#, 16#00#, 16#02#, 16#10#, txp); txa(dsutx, 16#00#, 16#00#, 16#00#, 16#0f#, txp);-- txc(dsutx, 16#c0#, txp); txa(dsutx, 16#91#, 16#40#, 16#00#, 16#24#, txp); txa(dsutx, 16#00#, 16#00#, 16#00#, 16#24#, txp); txc(dsutx, 16#c0#, txp); txa(dsutx, 16#91#, 16#70#, 16#00#, 16#00#, txp); txa(dsutx, 16#00#, 16#00#, 16#00#, 16#03#, txp);-- txc(dsutx, 16#c0#, txp); txa(dsutx, 16#90#, 16#00#, 16#00#, 16#20#, txp); txa(dsutx, 16#00#, 16#00#, 16#ff#, 16#ff#, txp);-- txc(dsutx, 16#c0#, txp); txa(dsutx, 16#90#, 16#40#, 16#00#, 16#48#, txp); txa(dsutx, 16#00#, 16#00#, 16#00#, 16#12#, txp);-- txc(dsutx, 16#c0#, txp); txa(dsutx, 16#90#, 16#40#, 16#00#, 16#60#, txp); txa(dsutx, 16#00#, 16#00#, 16#12#, 16#10#, txp);-- txc(dsutx, 16#80#, txp); txa(dsutx, 16#90#, 16#00#, 16#00#, 16#00#, txp); rxi(dsurx, w32, txp, lresp);-- txc(dsutx, 16#a0#, txp); txa(dsutx, 16#40#, 16#00#, 16#00#, 16#00#, txp); rxi(dsurx, w32, txp, lresp);-- end;-- begin-- dsucfg(UART_TXD, UART_RXD);-- wait; end process; end ;
entity ret1 is end; architecture behav of ret1 is procedure p (n : natural) is variable i : natural := 0; begin loop report "hello 1"; wait for 1 ns; if i = n then return; end if; i := i + 1; end loop; end p; begin process begin p (5); report "SUCCESS: hello3"; wait; end process; end behav;
entity ret1 is end; architecture behav of ret1 is procedure p (n : natural) is variable i : natural := 0; begin loop report "hello 1"; wait for 1 ns; if i = n then return; end if; i := i + 1; end loop; end p; begin process begin p (5); report "SUCCESS: hello3"; wait; end process; end behav;
-- (c) Copyright 1995-2017 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. -- -- DO NOT MODIFY THIS FILE. -- IP VLNV: xilinx.com:user:ieee754_fp_multiplier:1.0 -- IP Revision: 5 LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; ENTITY affine_block_ieee754_fp_multiplier_1_1 IS PORT ( x : IN STD_LOGIC_VECTOR(31 DOWNTO 0); y : IN STD_LOGIC_VECTOR(31 DOWNTO 0); z : OUT STD_LOGIC_VECTOR(31 DOWNTO 0) ); END affine_block_ieee754_fp_multiplier_1_1; ARCHITECTURE affine_block_ieee754_fp_multiplier_1_1_arch OF affine_block_ieee754_fp_multiplier_1_1 IS ATTRIBUTE DowngradeIPIdentifiedWarnings : STRING; ATTRIBUTE DowngradeIPIdentifiedWarnings OF affine_block_ieee754_fp_multiplier_1_1_arch: ARCHITECTURE IS "yes"; COMPONENT ieee754_fp_multiplier IS PORT ( x : IN STD_LOGIC_VECTOR(31 DOWNTO 0); y : IN STD_LOGIC_VECTOR(31 DOWNTO 0); z : OUT STD_LOGIC_VECTOR(31 DOWNTO 0) ); END COMPONENT ieee754_fp_multiplier; ATTRIBUTE X_CORE_INFO : STRING; ATTRIBUTE X_CORE_INFO OF affine_block_ieee754_fp_multiplier_1_1_arch: ARCHITECTURE IS "ieee754_fp_multiplier,Vivado 2016.4"; ATTRIBUTE CHECK_LICENSE_TYPE : STRING; ATTRIBUTE CHECK_LICENSE_TYPE OF affine_block_ieee754_fp_multiplier_1_1_arch : ARCHITECTURE IS "affine_block_ieee754_fp_multiplier_1_1,ieee754_fp_multiplier,{}"; ATTRIBUTE CORE_GENERATION_INFO : STRING; ATTRIBUTE CORE_GENERATION_INFO OF affine_block_ieee754_fp_multiplier_1_1_arch: ARCHITECTURE IS "affine_block_ieee754_fp_multiplier_1_1,ieee754_fp_multiplier,{x_ipProduct=Vivado 2016.4,x_ipVendor=xilinx.com,x_ipLibrary=user,x_ipName=ieee754_fp_multiplier,x_ipVersion=1.0,x_ipCoreRevision=5,x_ipLanguage=VHDL,x_ipSimLanguage=MIXED}"; BEGIN U0 : ieee754_fp_multiplier PORT MAP ( x => x, y => y, z => z ); END affine_block_ieee754_fp_multiplier_1_1_arch;
-- (c) Copyright 1995-2017 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. -- -- DO NOT MODIFY THIS FILE. -- IP VLNV: xilinx.com:user:ieee754_fp_multiplier:1.0 -- IP Revision: 5 LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; ENTITY affine_block_ieee754_fp_multiplier_1_1 IS PORT ( x : IN STD_LOGIC_VECTOR(31 DOWNTO 0); y : IN STD_LOGIC_VECTOR(31 DOWNTO 0); z : OUT STD_LOGIC_VECTOR(31 DOWNTO 0) ); END affine_block_ieee754_fp_multiplier_1_1; ARCHITECTURE affine_block_ieee754_fp_multiplier_1_1_arch OF affine_block_ieee754_fp_multiplier_1_1 IS ATTRIBUTE DowngradeIPIdentifiedWarnings : STRING; ATTRIBUTE DowngradeIPIdentifiedWarnings OF affine_block_ieee754_fp_multiplier_1_1_arch: ARCHITECTURE IS "yes"; COMPONENT ieee754_fp_multiplier IS PORT ( x : IN STD_LOGIC_VECTOR(31 DOWNTO 0); y : IN STD_LOGIC_VECTOR(31 DOWNTO 0); z : OUT STD_LOGIC_VECTOR(31 DOWNTO 0) ); END COMPONENT ieee754_fp_multiplier; ATTRIBUTE X_CORE_INFO : STRING; ATTRIBUTE X_CORE_INFO OF affine_block_ieee754_fp_multiplier_1_1_arch: ARCHITECTURE IS "ieee754_fp_multiplier,Vivado 2016.4"; ATTRIBUTE CHECK_LICENSE_TYPE : STRING; ATTRIBUTE CHECK_LICENSE_TYPE OF affine_block_ieee754_fp_multiplier_1_1_arch : ARCHITECTURE IS "affine_block_ieee754_fp_multiplier_1_1,ieee754_fp_multiplier,{}"; ATTRIBUTE CORE_GENERATION_INFO : STRING; ATTRIBUTE CORE_GENERATION_INFO OF affine_block_ieee754_fp_multiplier_1_1_arch: ARCHITECTURE IS "affine_block_ieee754_fp_multiplier_1_1,ieee754_fp_multiplier,{x_ipProduct=Vivado 2016.4,x_ipVendor=xilinx.com,x_ipLibrary=user,x_ipName=ieee754_fp_multiplier,x_ipVersion=1.0,x_ipCoreRevision=5,x_ipLanguage=VHDL,x_ipSimLanguage=MIXED}"; BEGIN U0 : ieee754_fp_multiplier PORT MAP ( x => x, y => y, z => z ); END affine_block_ieee754_fp_multiplier_1_1_arch;
-- niosii_system_switches_s1_translator.vhd -- Generated using ACDS version 13.0sp1 232 at 2016.04.06.21:13:31 library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity niosii_system_switches_s1_translator is generic ( AV_ADDRESS_W : integer := 2; AV_DATA_W : integer := 32; UAV_DATA_W : integer := 32; AV_BURSTCOUNT_W : integer := 1; AV_BYTEENABLE_W : integer := 1; UAV_BYTEENABLE_W : integer := 4; UAV_ADDRESS_W : integer := 25; UAV_BURSTCOUNT_W : integer := 3; AV_READLATENCY : integer := 0; USE_READDATAVALID : integer := 0; USE_WAITREQUEST : integer := 0; USE_UAV_CLKEN : integer := 0; USE_READRESPONSE : integer := 0; USE_WRITERESPONSE : integer := 0; AV_SYMBOLS_PER_WORD : integer := 4; AV_ADDRESS_SYMBOLS : integer := 0; AV_BURSTCOUNT_SYMBOLS : integer := 0; AV_CONSTANT_BURST_BEHAVIOR : integer := 0; UAV_CONSTANT_BURST_BEHAVIOR : integer := 0; AV_REQUIRE_UNALIGNED_ADDRESSES : integer := 0; CHIPSELECT_THROUGH_READLATENCY : integer := 0; AV_READ_WAIT_CYCLES : integer := 1; AV_WRITE_WAIT_CYCLES : integer := 0; AV_SETUP_WAIT_CYCLES : integer := 0; AV_DATA_HOLD_CYCLES : integer := 0 ); port ( clk : in std_logic := '0'; -- clk.clk reset : in std_logic := '0'; -- reset.reset uav_address : in std_logic_vector(24 downto 0) := (others => '0'); -- avalon_universal_slave_0.address uav_burstcount : in std_logic_vector(2 downto 0) := (others => '0'); -- .burstcount uav_read : in std_logic := '0'; -- .read uav_write : in std_logic := '0'; -- .write uav_waitrequest : out std_logic; -- .waitrequest uav_readdatavalid : out std_logic; -- .readdatavalid uav_byteenable : in std_logic_vector(3 downto 0) := (others => '0'); -- .byteenable uav_readdata : out std_logic_vector(31 downto 0); -- .readdata uav_writedata : in std_logic_vector(31 downto 0) := (others => '0'); -- .writedata uav_lock : in std_logic := '0'; -- .lock uav_debugaccess : in std_logic := '0'; -- .debugaccess av_address : out std_logic_vector(1 downto 0); -- avalon_anti_slave_0.address av_readdata : in std_logic_vector(31 downto 0) := (others => '0'); -- .readdata av_beginbursttransfer : out std_logic; av_begintransfer : out std_logic; av_burstcount : out std_logic_vector(0 downto 0); av_byteenable : out std_logic_vector(0 downto 0); av_chipselect : out std_logic; av_clken : out std_logic; av_debugaccess : out std_logic; av_lock : out std_logic; av_outputenable : out std_logic; av_read : out std_logic; av_readdatavalid : in std_logic := '0'; av_response : in std_logic_vector(1 downto 0) := (others => '0'); av_waitrequest : in std_logic := '0'; av_write : out std_logic; av_writebyteenable : out std_logic_vector(0 downto 0); av_writedata : out std_logic_vector(31 downto 0); av_writeresponserequest : out std_logic; av_writeresponsevalid : in std_logic := '0'; uav_clken : in std_logic := '0'; uav_response : out std_logic_vector(1 downto 0); uav_writeresponserequest : in std_logic := '0'; uav_writeresponsevalid : out std_logic ); end entity niosii_system_switches_s1_translator; architecture rtl of niosii_system_switches_s1_translator is component altera_merlin_slave_translator is generic ( AV_ADDRESS_W : integer := 30; AV_DATA_W : integer := 32; UAV_DATA_W : integer := 32; AV_BURSTCOUNT_W : integer := 4; AV_BYTEENABLE_W : integer := 4; UAV_BYTEENABLE_W : integer := 4; UAV_ADDRESS_W : integer := 32; UAV_BURSTCOUNT_W : integer := 4; AV_READLATENCY : integer := 0; USE_READDATAVALID : integer := 1; USE_WAITREQUEST : integer := 1; USE_UAV_CLKEN : integer := 0; USE_READRESPONSE : integer := 0; USE_WRITERESPONSE : integer := 0; AV_SYMBOLS_PER_WORD : integer := 4; AV_ADDRESS_SYMBOLS : integer := 0; AV_BURSTCOUNT_SYMBOLS : integer := 0; AV_CONSTANT_BURST_BEHAVIOR : integer := 0; UAV_CONSTANT_BURST_BEHAVIOR : integer := 0; AV_REQUIRE_UNALIGNED_ADDRESSES : integer := 0; CHIPSELECT_THROUGH_READLATENCY : integer := 0; AV_READ_WAIT_CYCLES : integer := 0; AV_WRITE_WAIT_CYCLES : integer := 0; AV_SETUP_WAIT_CYCLES : integer := 0; AV_DATA_HOLD_CYCLES : integer := 0 ); port ( clk : in std_logic := 'X'; -- clk reset : in std_logic := 'X'; -- reset uav_address : in std_logic_vector(24 downto 0) := (others => 'X'); -- address uav_burstcount : in std_logic_vector(2 downto 0) := (others => 'X'); -- burstcount uav_read : in std_logic := 'X'; -- read uav_write : in std_logic := 'X'; -- write uav_waitrequest : out std_logic; -- waitrequest uav_readdatavalid : out std_logic; -- readdatavalid uav_byteenable : in std_logic_vector(3 downto 0) := (others => 'X'); -- byteenable uav_readdata : out std_logic_vector(31 downto 0); -- readdata uav_writedata : in std_logic_vector(31 downto 0) := (others => 'X'); -- writedata uav_lock : in std_logic := 'X'; -- lock uav_debugaccess : in std_logic := 'X'; -- debugaccess av_address : out std_logic_vector(1 downto 0); -- address av_readdata : in std_logic_vector(31 downto 0) := (others => 'X'); -- readdata av_write : out std_logic; -- write av_read : out std_logic; -- read av_writedata : out std_logic_vector(31 downto 0); -- writedata av_begintransfer : out std_logic; -- begintransfer av_beginbursttransfer : out std_logic; -- beginbursttransfer av_burstcount : out std_logic_vector(0 downto 0); -- burstcount av_byteenable : out std_logic_vector(0 downto 0); -- byteenable av_readdatavalid : in std_logic := 'X'; -- readdatavalid av_waitrequest : in std_logic := 'X'; -- waitrequest av_writebyteenable : out std_logic_vector(0 downto 0); -- writebyteenable av_lock : out std_logic; -- lock av_chipselect : out std_logic; -- chipselect av_clken : out std_logic; -- clken uav_clken : in std_logic := 'X'; -- clken av_debugaccess : out std_logic; -- debugaccess av_outputenable : out std_logic; -- outputenable uav_response : out std_logic_vector(1 downto 0); -- response av_response : in std_logic_vector(1 downto 0) := (others => 'X'); -- response uav_writeresponserequest : in std_logic := 'X'; -- writeresponserequest uav_writeresponsevalid : out std_logic; -- writeresponsevalid av_writeresponserequest : out std_logic; -- writeresponserequest av_writeresponsevalid : in std_logic := 'X' -- writeresponsevalid ); end component altera_merlin_slave_translator; begin switches_s1_translator : component altera_merlin_slave_translator generic map ( AV_ADDRESS_W => AV_ADDRESS_W, AV_DATA_W => AV_DATA_W, UAV_DATA_W => UAV_DATA_W, AV_BURSTCOUNT_W => AV_BURSTCOUNT_W, AV_BYTEENABLE_W => AV_BYTEENABLE_W, UAV_BYTEENABLE_W => UAV_BYTEENABLE_W, UAV_ADDRESS_W => UAV_ADDRESS_W, UAV_BURSTCOUNT_W => UAV_BURSTCOUNT_W, AV_READLATENCY => AV_READLATENCY, USE_READDATAVALID => USE_READDATAVALID, USE_WAITREQUEST => USE_WAITREQUEST, USE_UAV_CLKEN => USE_UAV_CLKEN, USE_READRESPONSE => USE_READRESPONSE, USE_WRITERESPONSE => USE_WRITERESPONSE, AV_SYMBOLS_PER_WORD => AV_SYMBOLS_PER_WORD, AV_ADDRESS_SYMBOLS => AV_ADDRESS_SYMBOLS, AV_BURSTCOUNT_SYMBOLS => AV_BURSTCOUNT_SYMBOLS, AV_CONSTANT_BURST_BEHAVIOR => AV_CONSTANT_BURST_BEHAVIOR, UAV_CONSTANT_BURST_BEHAVIOR => UAV_CONSTANT_BURST_BEHAVIOR, AV_REQUIRE_UNALIGNED_ADDRESSES => AV_REQUIRE_UNALIGNED_ADDRESSES, CHIPSELECT_THROUGH_READLATENCY => CHIPSELECT_THROUGH_READLATENCY, AV_READ_WAIT_CYCLES => AV_READ_WAIT_CYCLES, AV_WRITE_WAIT_CYCLES => AV_WRITE_WAIT_CYCLES, AV_SETUP_WAIT_CYCLES => AV_SETUP_WAIT_CYCLES, AV_DATA_HOLD_CYCLES => AV_DATA_HOLD_CYCLES ) port map ( clk => clk, -- clk.clk reset => reset, -- reset.reset uav_address => uav_address, -- avalon_universal_slave_0.address uav_burstcount => uav_burstcount, -- .burstcount uav_read => uav_read, -- .read uav_write => uav_write, -- .write uav_waitrequest => uav_waitrequest, -- .waitrequest uav_readdatavalid => uav_readdatavalid, -- .readdatavalid uav_byteenable => uav_byteenable, -- .byteenable uav_readdata => uav_readdata, -- .readdata uav_writedata => uav_writedata, -- .writedata uav_lock => uav_lock, -- .lock uav_debugaccess => uav_debugaccess, -- .debugaccess av_address => av_address, -- avalon_anti_slave_0.address av_readdata => av_readdata, -- .readdata av_write => open, -- (terminated) av_read => open, -- (terminated) av_writedata => open, -- (terminated) av_begintransfer => open, -- (terminated) av_beginbursttransfer => open, -- (terminated) av_burstcount => open, -- (terminated) av_byteenable => open, -- (terminated) av_readdatavalid => '0', -- (terminated) av_waitrequest => '0', -- (terminated) av_writebyteenable => open, -- (terminated) av_lock => open, -- (terminated) av_chipselect => open, -- (terminated) av_clken => open, -- (terminated) uav_clken => '0', -- (terminated) av_debugaccess => open, -- (terminated) av_outputenable => open, -- (terminated) uav_response => open, -- (terminated) av_response => "00", -- (terminated) uav_writeresponserequest => '0', -- (terminated) uav_writeresponsevalid => open, -- (terminated) av_writeresponserequest => open, -- (terminated) av_writeresponsevalid => '0' -- (terminated) ); end architecture rtl; -- of niosii_system_switches_s1_translator
-- 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: tc1082.vhd,v 1.2 2001-10-26 16:30:06 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c06s05b00x00p02n01i01082ent IS END c06s05b00x00p02n01i01082ent; ARCHITECTURE c06s05b00x00p02n01i01082arch OF c06s05b00x00p02n01i01082ent IS BEGIN TESTING: PROCESS type FIVE is range 1 to 5; type A51 is array (FIVE) of BOOLEAN; type A53 is array (FIVE) of A51; variable V51: A51 ; variable V53: A53 ; BEGIN V51(2 to 2, 3 to 3) := V51(2 to 2, 3 to 3); -- SYNTAX ERROR: NO MULTIPLE DISCRETE RANGES IN SLICE NAMES assert FALSE report "***FAILED TEST: c06s05b00x00p02n01i01082 - Slice name consists of a single discrete range enclosed within parentheses." severity ERROR; wait; END PROCESS TESTING; END c06s05b00x00p02n01i01082arch;
-- 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: tc1082.vhd,v 1.2 2001-10-26 16:30:06 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c06s05b00x00p02n01i01082ent IS END c06s05b00x00p02n01i01082ent; ARCHITECTURE c06s05b00x00p02n01i01082arch OF c06s05b00x00p02n01i01082ent IS BEGIN TESTING: PROCESS type FIVE is range 1 to 5; type A51 is array (FIVE) of BOOLEAN; type A53 is array (FIVE) of A51; variable V51: A51 ; variable V53: A53 ; BEGIN V51(2 to 2, 3 to 3) := V51(2 to 2, 3 to 3); -- SYNTAX ERROR: NO MULTIPLE DISCRETE RANGES IN SLICE NAMES assert FALSE report "***FAILED TEST: c06s05b00x00p02n01i01082 - Slice name consists of a single discrete range enclosed within parentheses." severity ERROR; wait; END PROCESS TESTING; END c06s05b00x00p02n01i01082arch;
-- 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: tc1082.vhd,v 1.2 2001-10-26 16:30:06 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c06s05b00x00p02n01i01082ent IS END c06s05b00x00p02n01i01082ent; ARCHITECTURE c06s05b00x00p02n01i01082arch OF c06s05b00x00p02n01i01082ent IS BEGIN TESTING: PROCESS type FIVE is range 1 to 5; type A51 is array (FIVE) of BOOLEAN; type A53 is array (FIVE) of A51; variable V51: A51 ; variable V53: A53 ; BEGIN V51(2 to 2, 3 to 3) := V51(2 to 2, 3 to 3); -- SYNTAX ERROR: NO MULTIPLE DISCRETE RANGES IN SLICE NAMES assert FALSE report "***FAILED TEST: c06s05b00x00p02n01i01082 - Slice name consists of a single discrete range enclosed within parentheses." severity ERROR; wait; END PROCESS TESTING; END c06s05b00x00p02n01i01082arch;
-------------------------------------------------------------------------------- -- PROJECT: PIPE MANIA - GAME FOR FPGA -------------------------------------------------------------------------------- -- NAME: RESET_SYNC -- AUTHORS: Jakub Cabal <[email protected]> -- LICENSE: The MIT License, please read LICENSE file -- WEBSITE: https://github.com/jakubcabal/pipemania-fpga-game -------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity RESET_SYNC is Port ( CLK : in std_logic; -- Clock ASYNC_RST : in std_logic; -- High active async reset input OUT_RST : out std_logic -- High active sync async reset output ); end RESET_SYNC; architecture FULL of RESET_SYNC is signal meta_reg : std_logic; signal reset_reg : std_logic; begin process (CLK, ASYNC_RST) begin if (ASYNC_RST = '1') then meta_reg <= '1'; reset_reg <= '1'; elsif (rising_edge(CLK)) then meta_reg <= '0'; reset_reg <= meta_reg; end if; end process; OUT_RST <= reset_reg; end FULL;
----------------------------------------------------------------------------- ---- ---- ---- gmzpu timer component testbench ---- ---- ---- ---- http://github.com/sonologic/gmzpu ---- ---- ---- ---- Description: ---- ---- This is the testbench for the gmZPU core ---- ---- ---- ---- To Do: ---- ---- - ---- ---- ---- ---- Author: ---- ---- - Salvador E. Tropea, salvador inti.gob.ar ---- ---- - "Koen Martens" <gmc sonologic.nl> ---- ---- ---- ------------------------------------------------------------------------------ ---- ---- ---- Copyright (c) 2008 Salvador E. Tropea <salvador inti.gob.ar> ---- ---- Copyright (c) 2008 Instituto Nacional de Tecnología Industrial ---- ---- Copyright (c) 2014 Koen Martens ---- ---- ---- ---- Distributed under the BSD license ---- ---- ---- ------------------------------------------------------------------------------ ---- ---- ---- Design unit: zwishbone_TB ---- ---- File name: gmzpu_tb.vhdl ---- ---- Note: None ---- ---- Limitations: None known ---- ---- Errors: None known ---- ---- Library: zpu ---- ---- Dependencies: IEEE.std_logic_1164 ---- ---- IEEE.numeric_std ---- ---- Target FPGA: n/a ---- ---- Language: VHDL ---- ---- Wishbone: No ---- ---- Synthesis tools: Modelsim ---- ---- Simulation tools: Modelsim ---- ---- Text editor: vim ---- ---- ---- ------------------------------------------------------------------------------ library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library gmzpu; use gmzpu.timer; entity timer_TB is end entity timer_TB; architecture Behave of timer_TB is constant CLK_FREQ : positive:=50; -- 50 MHz clock constant CLK_S_PER : time:=1 us/(2.0*real(CLK_FREQ)); -- Clock semi period constant ADR_WIDTH : natural:=3; constant DATA_WIDTH : natural:=32; component timer is generic ( ADR_WIDTH : natural:=3; DATA_WIDTH : natural:=32 ); port ( clk_i : in std_logic; rst_i : in std_logic; inc_i : in std_logic; addr_i : in unsigned(ADR_WIDTH-1 downto 0); dat_o : out unsigned(DATA_WIDTH-1 downto 0); dat_i : in unsigned(DATA_WIDTH-1 downto 0); we_i : in std_logic; en_i : in std_logic; thresh_o: out std_logic ); end component timer; type sample is record -- inputs rst_i : std_logic; inc_i : std_logic; addr_i : unsigned(ADR_WIDTH-1 downto 0); dat_i : unsigned(DATA_WIDTH-1 downto 0); we_i : std_logic; en_i : std_logic; -- outputs dat_o : unsigned(DATA_WIDTH-1 downto 0); thresh_o : std_logic; end record; type sample_array is array(natural range <>) of sample; constant test_data : sample_array := ( -- rst inc addr dat_i we en dat_o thr -- reset ('1','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('1','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- 0 ('0','1',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- 0 ('0','1',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- 0, write threshold ('0','1',"001", X"00000004", '1', '1', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- 0, write config 0001 1110 ('0','1',"010", X"0000001E", '1', '1', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- 1, reset CNT ('0','1',"000", X"00000000", '1', '1', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- 0 ('0','1',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- 1 ('0','1',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- rst inc addr dat_i we en dat_o thr -- 2 ('0','1',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- 3, check threshold asserted ('0','1',"000", X"00000000", '0', '0', X"00000000", '1'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '1'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '1'), -- 0, check threshold asserted ('0','1',"000", X"00000000", '0', '0', X"00000000", '1'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '1'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '1'), -- 1, reset threshold ('0','1',"011", X"00000000", '1', '1', X"00000000", '1'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '1'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '1'), -- 2, write config, deassert ien ('0','1',"010", X"00000016", '1', '1', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- 3 ('0','1',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- 0, check no threshold ('0','1',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- 1, write config, deassert ('0','1',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- 2 ('0','1',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- rst inc addr dat_i we en dat_o thr -- 3 ('0','1',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- 0 ('0','1',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- 1 ('0','1',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), ('0','0',"000", X"00000000", '0', '0', X"00000000", '0'), -- ('0','1',"000", X"00000000", '0', '0', X"00000000", '0') ); signal clk : std_logic; signal rst_i : std_logic; signal inc_i : std_logic; signal addr_i : unsigned(ADR_WIDTH-1 downto 0); signal dat_o : unsigned(DATA_WIDTH-1 downto 0); signal dat_i : unsigned(DATA_WIDTH-1 downto 0); signal we_i : std_logic; signal en_i : std_logic; signal thresh_o: std_logic; begin dut : timer generic map(ADR_WIDTH => ADR_WIDTH, DATA_WIDTH => DATA_WIDTH) port map(clk_i => clk, inc_i => inc_i, rst_i => rst_i, addr_i => addr_i, dat_o => dat_o, dat_i => dat_i, we_i => we_i, en_i => en_i, thresh_o => thresh_o); process variable cycle_count : integer:=0; begin for i in test_data'range loop rst_i <= test_data(i).rst_i; inc_i <= test_data(i).inc_i; addr_i <= test_data(i).addr_i; dat_i <= test_data(i).dat_i; we_i <= test_data(i).we_i; en_i <= test_data(i).en_i; clk <= '1'; wait for CLK_S_PER; clk <= '0'; wait for CLK_S_PER; assert (thresh_o = test_data(i).thresh_o) report "thresh_o output mismatch" severity error; -- assert (icr_o = test_data(i).icr_o) report "icr_o output mismatch" severity failure; end loop; clk <= '0'; wait; end process; end architecture Behave;
------------------------------------------------------------------------------- -- -- The BUS unit. -- Implements the BUS port logic. -- -- $Id: db_bus-c.vhd,v 1.2 2005-06-11 10:08:43 arniml Exp $ -- -- Copyright (c) 2004, Arnim Laeuger ([email protected]) -- -- All rights reserved -- ------------------------------------------------------------------------------- configuration t48_db_bus_rtl_c0 of t48_db_bus is for rtl end for; end t48_db_bus_rtl_c0;
----------------------------------------------------------------------------- -- LEON3 Demonstration design test bench configuration -- Copyright (C) 2009 Aeroflex Gaisler ------------------------------------------------------------------------------ library techmap; use techmap.gencomp.all; package config is -- Technology and synthesis options constant CFG_FABTECH : integer := virtex7; constant CFG_MEMTECH : integer := virtex7; constant CFG_PADTECH : integer := virtex7; constant CFG_TRANSTECH : integer := GTP0; constant CFG_NOASYNC : integer := 0; constant CFG_SCAN : integer := 0; -- Clock generator constant CFG_CLKTECH : integer := virtex7; constant CFG_CLKMUL : integer := (4); constant CFG_CLKDIV : integer := (8); constant CFG_OCLKDIV : integer := 1; constant CFG_OCLKBDIV : integer := 0; constant CFG_OCLKCDIV : integer := 0; constant CFG_PCIDLL : integer := 0; constant CFG_PCISYSCLK: integer := 0; constant CFG_CLK_NOFB : integer := 0; -- LEON processor core constant CFG_LEON : integer := 3; constant CFG_NCPU : integer := (4); constant CFG_NWIN : integer := (8); constant CFG_V8 : integer := 16#32# + 4*0; constant CFG_MAC : integer := 0; constant CFG_SVT : integer := 1; constant CFG_RSTADDR : integer := 16#00000#; constant CFG_LDDEL : integer := (1); constant CFG_NWP : integer := (2); constant CFG_PWD : integer := 1*2; constant CFG_FPU : integer := 0 + 16*0 + 32*0; constant CFG_GRFPUSH : integer := 0; constant CFG_ICEN : integer := 1; constant CFG_ISETS : integer := 4; constant CFG_ISETSZ : integer := 4; constant CFG_ILINE : integer := 8; constant CFG_IREPL : integer := 0; constant CFG_ILOCK : integer := 0; constant CFG_ILRAMEN : integer := 0; constant CFG_ILRAMADDR: integer := 16#8E#; constant CFG_ILRAMSZ : integer := 1; constant CFG_DCEN : integer := 1; constant CFG_DSETS : integer := 4; constant CFG_DSETSZ : integer := 4; constant CFG_DLINE : integer := 8; constant CFG_DREPL : integer := 0; constant CFG_DLOCK : integer := 0; constant CFG_DSNOOP : integer := 1*2 + 4*1; constant CFG_DFIXED : integer := 16#0#; constant CFG_BWMASK : integer := 16#0#; constant CFG_CACHEBW : integer := 128; constant CFG_DLRAMEN : integer := 0; constant CFG_DLRAMADDR: integer := 16#8F#; constant CFG_DLRAMSZ : integer := 1; constant CFG_MMUEN : integer := 1; constant CFG_ITLBNUM : integer := 8; constant CFG_DTLBNUM : integer := 8; constant CFG_TLB_TYPE : integer := 0 + 1*2; constant CFG_TLB_REP : integer := 0; constant CFG_DSU : integer := 1; constant CFG_ITBSZ : integer := 4 + 64*1; constant CFG_ATBSZ : integer := 4; constant CFG_AHBPF : integer := 2; constant CFG_AHBWP : integer := 2; constant CFG_LEONFT_EN : integer := 0 + 0*8; constant CFG_LEON_NETLIST : integer := 0; constant CFG_DISAS : integer := 0 + 0; constant CFG_PCLOW : integer := 2; constant CFG_STAT_ENABLE : integer := 1; constant CFG_STAT_CNT : integer := (4); constant CFG_STAT_NMAX : integer := (0); constant CFG_STAT_DSUEN : integer := 1; constant CFG_NP_ASI : integer := 1; constant CFG_WRPSR : integer := 1; constant CFG_ALTWIN : integer := 0; constant CFG_REX : integer := 0; -- L2 Cache constant CFG_L2_EN : integer := 0; constant CFG_L2_SIZE : integer := 64; constant CFG_L2_WAYS : integer := 1; constant CFG_L2_HPROT : integer := 0; constant CFG_L2_PEN : integer := 0; constant CFG_L2_WT : integer := 0; constant CFG_L2_RAN : integer := 0; constant CFG_L2_SHARE : integer := 0; constant CFG_L2_LSZ : integer := 32; constant CFG_L2_MAP : integer := 16#00F0#; constant CFG_L2_MTRR : integer := (0); constant CFG_L2_EDAC : integer := 0; -- AMBA settings constant CFG_DEFMST : integer := (0); constant CFG_RROBIN : integer := 1; constant CFG_SPLIT : integer := 0; constant CFG_FPNPEN : integer := 1; constant CFG_AHBIO : integer := 16#FFF#; constant CFG_APBADDR : integer := 16#800#; constant CFG_AHB_MON : integer := 0; constant CFG_AHB_MONERR : integer := 0; constant CFG_AHB_MONWAR : integer := 0; constant CFG_AHB_DTRACE : integer := 0; -- DSU UART constant CFG_AHB_UART : integer := 1; -- JTAG based DSU interface constant CFG_AHB_JTAG : integer := 1; -- USB DSU constant CFG_GRUSB_DCL : integer := 0; constant CFG_GRUSB_DCL_UIFACE : integer := 1; constant CFG_GRUSB_DCL_DW : integer := 8; -- Ethernet DSU constant CFG_DSU_ETH : integer := 1 + 0 + 0; constant CFG_ETH_BUF : integer := 16; constant CFG_ETH_IPM : integer := 16#C0A8#; constant CFG_ETH_IPL : integer := 16#0033#; constant CFG_ETH_ENM : integer := 16#020000#; constant CFG_ETH_ENL : integer := 16#000000#; -- LEON2 memory controller constant CFG_MCTRL_LEON2 : integer := 1; constant CFG_MCTRL_RAM8BIT : integer := 1; constant CFG_MCTRL_RAM16BIT : integer := 1; constant CFG_MCTRL_5CS : integer := 0; constant CFG_MCTRL_SDEN : integer := 0; constant CFG_MCTRL_SEPBUS : integer := 0; constant CFG_MCTRL_INVCLK : integer := 0; constant CFG_MCTRL_SD64 : integer := 0; constant CFG_MCTRL_PAGE : integer := 0 + 0; -- Xilinx MIG 7-Series constant CFG_MIG_7SERIES : integer := 1; constant CFG_MIG_7SERIES_MODEL : integer := 0; -- AHB status register constant CFG_AHBSTAT : integer := 0; constant CFG_AHBSTATN : integer := (1); -- AHB ROM constant CFG_AHBROMEN : integer := 0; constant CFG_AHBROPIP : integer := 0; constant CFG_AHBRODDR : integer := 16#000#; constant CFG_ROMADDR : integer := 16#000#; constant CFG_ROMMASK : integer := 16#E00# + 16#000#; -- AHB RAM constant CFG_AHBRAMEN : integer := 1; constant CFG_AHBRSZ : integer := 4; constant CFG_AHBRADDR : integer := 16#A00#; constant CFG_AHBRPIPE : integer := 0; -- Gaisler Ethernet core constant CFG_GRETH : integer := 1; constant CFG_GRETH1G : integer := 0; constant CFG_ETH_FIFO : integer := 8; constant CFG_GRETH_FT : integer := 0; constant CFG_GRETH_EDCLFT : integer := 0; -- USB Host Controller constant CFG_GRUSBHC : integer := 0; constant CFG_GRUSBHC_NPORTS : integer := (1); constant CFG_GRUSBHC_EHC : integer := 0; constant CFG_GRUSBHC_UHC : integer := 0; constant CFG_GRUSBHC_NCC : integer := 1; constant CFG_GRUSBHC_NPCC : integer := (1); constant CFG_GRUSBHC_PRR : integer := 0; constant CFG_GRUSBHC_PR1 : integer := 0*2**26 + 0*2**22 + 0*2**18 + 0*2**14 + 0*2**10 + 0*2**6 + 0*2**2 + (1/4); constant CFG_GRUSBHC_PR2 : integer := 0*2**26 + 0*2**22 + 0*2**18 + 0*2**14 + 0*2**10 + 0*2**6 + 0*2**2 + (1 mod 4); constant CFG_GRUSBHC_ENDIAN : integer := 1; constant CFG_GRUSBHC_BEREGS : integer := 0; constant CFG_GRUSBHC_BEDESC : integer := 0; constant CFG_GRUSBHC_BLO : integer := 3; constant CFG_GRUSBHC_BWRD : integer := (16); constant CFG_GRUSBHC_UTM : integer := 2; constant CFG_GRUSBHC_VBUSCONF : integer := 3; -- GR USB 2.0 Device Controller constant CFG_GRUSBDC : integer := 0; constant CFG_GRUSBDC_AIFACE : integer := 0; constant CFG_GRUSBDC_UIFACE : integer := 1; constant CFG_GRUSBDC_DW : integer := 8; constant CFG_GRUSBDC_NEPI : integer := (1); constant CFG_GRUSBDC_NEPO : integer := (1); constant CFG_GRUSBDC_I0 : integer := (1024); constant CFG_GRUSBDC_I1 : integer := (1024); constant CFG_GRUSBDC_I2 : integer := (1024); constant CFG_GRUSBDC_I3 : integer := (1024); constant CFG_GRUSBDC_I4 : integer := (1024); constant CFG_GRUSBDC_I5 : integer := (1024); constant CFG_GRUSBDC_I6 : integer := (1024); constant CFG_GRUSBDC_I7 : integer := (1024); constant CFG_GRUSBDC_I8 : integer := (1024); constant CFG_GRUSBDC_I9 : integer := (1024); constant CFG_GRUSBDC_I10 : integer := (1024); constant CFG_GRUSBDC_I11 : integer := (1024); constant CFG_GRUSBDC_I12 : integer := (1024); constant CFG_GRUSBDC_I13 : integer := (1024); constant CFG_GRUSBDC_I14 : integer := (1024); constant CFG_GRUSBDC_I15 : integer := (1024); constant CFG_GRUSBDC_O0 : integer := (1024); constant CFG_GRUSBDC_O1 : integer := (1024); constant CFG_GRUSBDC_O2 : integer := (1024); constant CFG_GRUSBDC_O3 : integer := (1024); constant CFG_GRUSBDC_O4 : integer := (1024); constant CFG_GRUSBDC_O5 : integer := (1024); constant CFG_GRUSBDC_O6 : integer := (1024); constant CFG_GRUSBDC_O7 : integer := (1024); constant CFG_GRUSBDC_O8 : integer := (1024); constant CFG_GRUSBDC_O9 : integer := (1024); constant CFG_GRUSBDC_O10 : integer := (1024); constant CFG_GRUSBDC_O11 : integer := (1024); constant CFG_GRUSBDC_O12 : integer := (1024); constant CFG_GRUSBDC_O13 : integer := (1024); constant CFG_GRUSBDC_O14 : integer := (1024); constant CFG_GRUSBDC_O15 : integer := (1024); -- CAN 2.0 interface constant CFG_CAN : integer := 0; constant CFG_CAN_NUM : integer := (1); constant CFG_CANIO : integer := 16#C00#; constant CFG_CANIRQ : integer := (13); constant CFG_CANSEPIRQ: integer := 0; constant CFG_CAN_SYNCRST : integer := 0; constant CFG_CANFT : integer := 0; -- Spacewire interface constant CFG_SPW_EN : integer := 0; constant CFG_SPW_NUM : integer := (1); constant CFG_SPW_AHBFIFO : integer := 16; constant CFG_SPW_RXFIFO : integer := 16; constant CFG_SPW_RMAP : integer := 0; constant CFG_SPW_RMAPBUF : integer := 4; constant CFG_SPW_RMAPCRC : integer := 0; constant CFG_SPW_NETLIST : integer := 0; constant CFG_SPW_FT : integer := 0; constant CFG_SPW_GRSPW : integer := 2; constant CFG_SPW_RXUNAL : integer := 0; constant CFG_SPW_DMACHAN : integer := (1); constant CFG_SPW_PORTS : integer := (1); constant CFG_SPW_INPUT : integer := 3; constant CFG_SPW_OUTPUT : integer := 0; constant CFG_SPW_RTSAME : integer := 0; -- UART 1 constant CFG_UART1_ENABLE : integer := 1; constant CFG_UART1_FIFO : integer := 32; -- LEON3 interrupt controller constant CFG_IRQ3_ENABLE : integer := 1; constant CFG_IRQ3_NSEC : integer := 0; -- Modular timer constant CFG_GPT_ENABLE : integer := 1; constant CFG_GPT_NTIM : integer := (2); constant CFG_GPT_SW : integer := (8); constant CFG_GPT_TW : integer := (32); constant CFG_GPT_IRQ : integer := (8); constant CFG_GPT_SEPIRQ : integer := 1; constant CFG_GPT_WDOGEN : integer := 0; constant CFG_GPT_WDOG : integer := 16#0#; -- GPIO port constant CFG_GRGPIO_ENABLE : integer := 1; constant CFG_GRGPIO_IMASK : integer := 16#0000#; constant CFG_GRGPIO_WIDTH : integer := (8); -- I2C master constant CFG_I2C_ENABLE : integer := 1; -- VGA and PS2/ interface constant CFG_KBD_ENABLE : integer := 0; constant CFG_VGA_ENABLE : integer := 0; constant CFG_SVGA_ENABLE : integer := 0; -- SPI memory controller constant CFG_SPIMCTRL : integer := 0; constant CFG_SPIMCTRL_SDCARD : integer := 0; constant CFG_SPIMCTRL_READCMD : integer := 16#0B#; constant CFG_SPIMCTRL_DUMMYBYTE : integer := 0; constant CFG_SPIMCTRL_DUALOUTPUT : integer := 0; constant CFG_SPIMCTRL_SCALER : integer := (1); constant CFG_SPIMCTRL_ASCALER : integer := (8); constant CFG_SPIMCTRL_PWRUPCNT : integer := (0); constant CFG_SPIMCTRL_OFFSET : integer := 16#0#; -- SPI controller constant CFG_SPICTRL_ENABLE : integer := 1; constant CFG_SPICTRL_NUM : integer := (1); constant CFG_SPICTRL_SLVS : integer := (1); constant CFG_SPICTRL_FIFO : integer := (1); constant CFG_SPICTRL_SLVREG : integer := 0; constant CFG_SPICTRL_ODMODE : integer := 0; constant CFG_SPICTRL_AM : integer := 0; constant CFG_SPICTRL_ASEL : integer := 0; constant CFG_SPICTRL_TWEN : integer := 0; constant CFG_SPICTRL_MAXWLEN : integer := (0); constant CFG_SPICTRL_SYNCRAM : integer := 0; constant CFG_SPICTRL_FT : integer := 0; -- Dynamic Partial Reconfiguration constant CFG_PRC : integer := 0; constant CFG_CRC_EN : integer := 0; constant CFG_EDAC_EN : integer := 0; constant CFG_WORDS_BLOCK : integer := 100; constant CFG_DCM_FIFO : integer := 0; constant CFG_DPR_FIFO : integer := 9; -- GRLIB debugging constant CFG_DUART : integer := 0; end;
-- 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: tc1746.vhd,v 1.2 2001-10-26 16:30:12 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c09s05b00x00p06n03i01746ent IS END c09s05b00x00p06n03i01746ent; ARCHITECTURE c09s05b00x00p06n03i01746arch OF c09s05b00x00p06n03i01746ent IS type a is array (1 to 4) of boolean; type arrbool is array (positive range <>) of boolean; function F (BB: arrbool) return boolean is begin return false; end; signal i, j : F boolean bus := true; signal k, l : boolean := true; signal m : a := (true, false, true, false); BEGIN (i, j, k, l) <= transport a'(m(1), m(2), m(3), m(4)) after 10 ns; -- Failure_here -- i and j are guarded signals and k and l are unguarded signals. TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c09s05b00x00p06n03i01746 - Guarded signal and Ungarded signal is mixed used." severity ERROR; wait; END PROCESS TESTING; END c09s05b00x00p06n03i01746arch;
-- 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: tc1746.vhd,v 1.2 2001-10-26 16:30:12 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c09s05b00x00p06n03i01746ent IS END c09s05b00x00p06n03i01746ent; ARCHITECTURE c09s05b00x00p06n03i01746arch OF c09s05b00x00p06n03i01746ent IS type a is array (1 to 4) of boolean; type arrbool is array (positive range <>) of boolean; function F (BB: arrbool) return boolean is begin return false; end; signal i, j : F boolean bus := true; signal k, l : boolean := true; signal m : a := (true, false, true, false); BEGIN (i, j, k, l) <= transport a'(m(1), m(2), m(3), m(4)) after 10 ns; -- Failure_here -- i and j are guarded signals and k and l are unguarded signals. TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c09s05b00x00p06n03i01746 - Guarded signal and Ungarded signal is mixed used." severity ERROR; wait; END PROCESS TESTING; END c09s05b00x00p06n03i01746arch;
-- 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: tc1746.vhd,v 1.2 2001-10-26 16:30:12 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- ENTITY c09s05b00x00p06n03i01746ent IS END c09s05b00x00p06n03i01746ent; ARCHITECTURE c09s05b00x00p06n03i01746arch OF c09s05b00x00p06n03i01746ent IS type a is array (1 to 4) of boolean; type arrbool is array (positive range <>) of boolean; function F (BB: arrbool) return boolean is begin return false; end; signal i, j : F boolean bus := true; signal k, l : boolean := true; signal m : a := (true, false, true, false); BEGIN (i, j, k, l) <= transport a'(m(1), m(2), m(3), m(4)) after 10 ns; -- Failure_here -- i and j are guarded signals and k and l are unguarded signals. TESTING: PROCESS BEGIN assert FALSE report "***FAILED TEST: c09s05b00x00p06n03i01746 - Guarded signal and Ungarded signal is mixed used." severity ERROR; wait; END PROCESS TESTING; END c09s05b00x00p06n03i01746arch;
-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- Complete implementation of Patterson and Hennessy single cycle MIPS processor -- Copyright (C) 2015 Darci Luiz Tomasi Junior -- -- 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, version 3. -- -- 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/>. -- -- Engineer: Darci Luiz Tomasi Junior -- E-mail: [email protected] -- Date : 09/07/2015 - 22:07 -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.NUMERIC_STD.ALL; ENTITY SL_1 IS PORT( IN_A : IN STD_LOGIC_VECTOR (31 DOWNTO 0); OUT_A : OUT STD_LOGIC_VECTOR (31 DOWNTO 0) ); END SL_1; ARCHITECTURE ARC_SL_1 OF SL_1 IS BEGIN OUT_A <= STD_LOGIC_VECTOR(UNSIGNED(IN_A) SLL 2); END ARC_SL_1;
-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- Complete implementation of Patterson and Hennessy single cycle MIPS processor -- Copyright (C) 2015 Darci Luiz Tomasi Junior -- -- 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, version 3. -- -- 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/>. -- -- Engineer: Darci Luiz Tomasi Junior -- E-mail: [email protected] -- Date : 09/07/2015 - 22:07 -- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.NUMERIC_STD.ALL; ENTITY SL_1 IS PORT( IN_A : IN STD_LOGIC_VECTOR (31 DOWNTO 0); OUT_A : OUT STD_LOGIC_VECTOR (31 DOWNTO 0) ); END SL_1; ARCHITECTURE ARC_SL_1 OF SL_1 IS BEGIN OUT_A <= STD_LOGIC_VECTOR(UNSIGNED(IN_A) SLL 2); END ARC_SL_1;
---------------------------------------------------------------------------------- -- Company: -- Engineer: -- -- Create Date: 07:16:12 11/02/2011 -- Design Name: -- Module Name: control - 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; use IEEE.std_logic_unsigned.all; use ieee.std_logic_arith.all; -- Uncomment the following library declaration if using -- arithmetic functions with Signed or Unsigned values --use IEEE.NUMERIC_STD.ALL; -- Uncomment the following library declaration if instantiating -- any Xilinx primitives in this code. --library UNISIM; --use UNISIM.VComponents.all; entity control is Port( clk : in STD_LOGIC; reset : in STD_LOGIC; inicioIn : in STD_LOGIC; filasBolita : in STD_LOGIC_VECTOR (7 downto 0); columnasJugador: in STD_LOGIC_VECTOR (7 downto 0); columnasBolita : in STD_LOGIC_VECTOR (7 downto 0); visible : out STD_LOGIC; inicioOut : out STD_LOGIC; puntajeOut : out STD_LOGIC_VECTOR (3 downto 0); filas : out STD_LOGIC_VECTOR (7 downto 0); columnas : out STD_LOGIC_VECTOR (7 downto 0) ); end control; architecture Behavioral of control is type estados is (inicio, jugando, victoria, derrota); signal estado : estados; signal puntaje : STD_LOGIC_VECTOR (3 downto 0); begin process(clk, reset, inicioIn, filasBolita, columnasJugador, columnasBolita, estado, puntaje) begin if reset = '1' then estado <= inicio; puntaje <= "0000"; visible <= '0'; inicioOut <= '1'; puntajeOut <= "0000"; filas <= "00000000"; columnas <= "00000000"; elsif clk'event and clk = '1' then case estado is when inicio => inicioOut<= '1'; visible <= '0'; puntaje <= "0000"; if (inicioIn = '1') then estado <= jugando; end if; when jugando => inicioOut<= '0'; visible <= '0'; if filasBolita = "10000000" then if columnasJugador = columnasBolita then if (puntaje = 9) then estado <= victoria; else puntaje <= puntaje + 1; puntajeOut <= puntaje + 1; end if; else estado <= derrota; end if; end if; when victoria => inicioOut <= '1'; visible <= '1'; filas <= "10000001"; columnas <= "11111111"; if inicioIn = '1' then estado <= inicio; end if; when derrota => inicioOut <= '1'; visible <= '1'; filas <= "11111111"; columnas <= "11111111"; if inicioIn = '1' then estado <= inicio; end if; end case; end if; end process; end Behavioral;
---------------------------------------------------------------------------------- --! Company: EDAQ WIS. --! Engineer: juna --! --! Create Date: 06/19/2014 --! Module Name: KcharTest --! Project Name: FELIX ---------------------------------------------------------------------------------- --! Use standard library library IEEE; use IEEE.STD_LOGIC_1164.ALL; use work.centralRouter_package.all; --! KcharTest entity KcharTest is Port ( clk : in std_logic; encoded10in : in std_logic_vector (9 downto 0); KcharCode : out std_logic_vector (1 downto 0) ); end KcharTest; architecture Behavioral of KcharTest is signal KcharCode_comma,KcharCode_soc,KcharCode_eoc,KcharCode_sob,KcharCode_eob : std_logic; signal KcharCode_s : std_logic_vector (1 downto 0) := (others=>'0'); begin ------------------------------------------------------------------------------------------------------ KcharCode_comma <= '1' when (encoded10in = COMMAp or encoded10in = COMMAn) else '0'; KcharCode_soc <= '1' when (encoded10in = SOCp or encoded10in = SOCn) else '0'; KcharCode_eoc <= '1' when (encoded10in = EOCp or encoded10in = EOCn) else '0'; KcharCode_sob <= '1' when (encoded10in = SOBp or encoded10in = SOBn) else '0'; KcharCode_eob <= '1' when (encoded10in = EOBp or encoded10in = EOBn) else '0'; ------------------------------------------------------------------------------------------------------ process(clk) begin if clk'event and clk = '1' then KcharCode_s(0) <= ((not KcharCode_soc) and (KcharCode_eoc xor KcharCode_comma)) or KcharCode_sob or KcharCode_eob; KcharCode_s(1) <= ((not KcharCode_eoc) and (KcharCode_soc xor KcharCode_comma)) or KcharCode_sob or KcharCode_eob; end if; end process; -- KcharCode <= KcharCode_s; end Behavioral;
---------------------------------------------------------------------------------- --! Company: EDAQ WIS. --! Engineer: juna --! --! Create Date: 06/19/2014 --! Module Name: KcharTest --! Project Name: FELIX ---------------------------------------------------------------------------------- --! Use standard library library IEEE; use IEEE.STD_LOGIC_1164.ALL; use work.centralRouter_package.all; --! KcharTest entity KcharTest is Port ( clk : in std_logic; encoded10in : in std_logic_vector (9 downto 0); KcharCode : out std_logic_vector (1 downto 0) ); end KcharTest; architecture Behavioral of KcharTest is signal KcharCode_comma,KcharCode_soc,KcharCode_eoc,KcharCode_sob,KcharCode_eob : std_logic; signal KcharCode_s : std_logic_vector (1 downto 0) := (others=>'0'); begin ------------------------------------------------------------------------------------------------------ KcharCode_comma <= '1' when (encoded10in = COMMAp or encoded10in = COMMAn) else '0'; KcharCode_soc <= '1' when (encoded10in = SOCp or encoded10in = SOCn) else '0'; KcharCode_eoc <= '1' when (encoded10in = EOCp or encoded10in = EOCn) else '0'; KcharCode_sob <= '1' when (encoded10in = SOBp or encoded10in = SOBn) else '0'; KcharCode_eob <= '1' when (encoded10in = EOBp or encoded10in = EOBn) else '0'; ------------------------------------------------------------------------------------------------------ process(clk) begin if clk'event and clk = '1' then KcharCode_s(0) <= ((not KcharCode_soc) and (KcharCode_eoc xor KcharCode_comma)) or KcharCode_sob or KcharCode_eob; KcharCode_s(1) <= ((not KcharCode_eoc) and (KcharCode_soc xor KcharCode_comma)) or KcharCode_sob or KcharCode_eob; end if; end process; -- KcharCode <= KcharCode_s; end Behavioral;
---------------------------------------------------------------------------------- --! Company: EDAQ WIS. --! Engineer: juna --! --! Create Date: 06/19/2014 --! Module Name: KcharTest --! Project Name: FELIX ---------------------------------------------------------------------------------- --! Use standard library library IEEE; use IEEE.STD_LOGIC_1164.ALL; use work.centralRouter_package.all; --! KcharTest entity KcharTest is Port ( clk : in std_logic; encoded10in : in std_logic_vector (9 downto 0); KcharCode : out std_logic_vector (1 downto 0) ); end KcharTest; architecture Behavioral of KcharTest is signal KcharCode_comma,KcharCode_soc,KcharCode_eoc,KcharCode_sob,KcharCode_eob : std_logic; signal KcharCode_s : std_logic_vector (1 downto 0) := (others=>'0'); begin ------------------------------------------------------------------------------------------------------ KcharCode_comma <= '1' when (encoded10in = COMMAp or encoded10in = COMMAn) else '0'; KcharCode_soc <= '1' when (encoded10in = SOCp or encoded10in = SOCn) else '0'; KcharCode_eoc <= '1' when (encoded10in = EOCp or encoded10in = EOCn) else '0'; KcharCode_sob <= '1' when (encoded10in = SOBp or encoded10in = SOBn) else '0'; KcharCode_eob <= '1' when (encoded10in = EOBp or encoded10in = EOBn) else '0'; ------------------------------------------------------------------------------------------------------ process(clk) begin if clk'event and clk = '1' then KcharCode_s(0) <= ((not KcharCode_soc) and (KcharCode_eoc xor KcharCode_comma)) or KcharCode_sob or KcharCode_eob; KcharCode_s(1) <= ((not KcharCode_eoc) and (KcharCode_soc xor KcharCode_comma)) or KcharCode_sob or KcharCode_eob; end if; end process; -- KcharCode <= KcharCode_s; end Behavioral;
---------------------------------------------------------------------------------- --! Company: EDAQ WIS. --! Engineer: juna --! --! Create Date: 06/19/2014 --! Module Name: KcharTest --! Project Name: FELIX ---------------------------------------------------------------------------------- --! Use standard library library IEEE; use IEEE.STD_LOGIC_1164.ALL; use work.centralRouter_package.all; --! KcharTest entity KcharTest is Port ( clk : in std_logic; encoded10in : in std_logic_vector (9 downto 0); KcharCode : out std_logic_vector (1 downto 0) ); end KcharTest; architecture Behavioral of KcharTest is signal KcharCode_comma,KcharCode_soc,KcharCode_eoc,KcharCode_sob,KcharCode_eob : std_logic; signal KcharCode_s : std_logic_vector (1 downto 0) := (others=>'0'); begin ------------------------------------------------------------------------------------------------------ KcharCode_comma <= '1' when (encoded10in = COMMAp or encoded10in = COMMAn) else '0'; KcharCode_soc <= '1' when (encoded10in = SOCp or encoded10in = SOCn) else '0'; KcharCode_eoc <= '1' when (encoded10in = EOCp or encoded10in = EOCn) else '0'; KcharCode_sob <= '1' when (encoded10in = SOBp or encoded10in = SOBn) else '0'; KcharCode_eob <= '1' when (encoded10in = EOBp or encoded10in = EOBn) else '0'; ------------------------------------------------------------------------------------------------------ process(clk) begin if clk'event and clk = '1' then KcharCode_s(0) <= ((not KcharCode_soc) and (KcharCode_eoc xor KcharCode_comma)) or KcharCode_sob or KcharCode_eob; KcharCode_s(1) <= ((not KcharCode_eoc) and (KcharCode_soc xor KcharCode_comma)) or KcharCode_sob or KcharCode_eob; end if; end process; -- KcharCode <= KcharCode_s; end Behavioral;
-- ------------------------------------------------------------- -- -- Entity Declaration for inst_A_e -- -- Generated -- by: wig -- on: Mon Mar 5 07:51:26 2007 -- cmd: /cygdrive/c/Documents and Settings/wig/My Documents/work/MIX/mix_0.pl -nodelta ../../case.xls -- -- !!! Do not edit this file! Autogenerated by MIX !!! -- $Author: wig $ -- $Id: inst_a_e-e.vhd,v 1.1 2007/03/05 08:59:00 wig Exp $ -- $Date: 2007/03/05 08:59:00 $ -- $Log: inst_a_e-e.vhd,v $ -- Revision 1.1 2007/03/05 08:59:00 wig -- Upgraded testcases -- case/force still not fully operational (internal names keep case). -- -- -- Based on Mix Entity Template built into RCSfile: MixWriter.pm,v -- Id: MixWriter.pm,v 1.104 2007/03/03 17:24:06 wig Exp -- -- Generator: mix_0.pl Version: Revision: 1.47 , [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_A_e -- entity inst_A_e is -- Generics: -- No Generated Generics for Entity inst_A_e -- Generated Port Declaration: port( -- Generated Port for Entity inst_A_e case_a_p : out std_ulogic -- End of Generated Port for Entity inst_A_e ); end inst_A_e; -- -- End of Generated Entity inst_A_e -- -- --!End of Entity/ies -- --------------------------------------------------------------
------------------------------------------------------------------------------ -- Testbench for zunit.vhd -- configures a 4-tap FIR (coefficients are shifts) -- -- Project : -- File : tb_zunit-fir4sh.vhd -- Author : Rolf Enzler <[email protected]> -- Company : Swiss Federal Institute of Technology (ETH) Zurich -- Created : 2002/06/28 -- Last changed: $LastChangedDate: 2004-10-05 17:10:36 +0200 (Tue, 05 Oct 2004) $ ------------------------------------------------------------------------------ library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use std.textio.all; use work.AuxPkg.all; use work.ZArchPkg.all; use work.ComponentsPkg.all; use work.ConfigPkg.all; use work.CfgLib_FIR.all; architecture fir4sh of tb_ZUnit is -- simulation stuff constant CLK_PERIOD : time := 100 ns; signal ccount : integer := 1; type tbstatusType is (tbstart, idle, done, rst, wr_cfg, set_cmptr, push_data, inlevel, wr_ncycl, rd_ncycl, running, outlevel, pop_data); signal tbStatus : tbstatusType := idle; -- general control signals signal ClkxC : std_logic := '1'; signal RstxRB : std_logic; -- data/control signals signal WExE : std_logic; signal RExE : std_logic; signal AddrxD : std_logic_vector(IFWIDTH-1 downto 0); signal DataInxD : std_logic_vector(IFWIDTH-1 downto 0); signal DataOutxD : std_logic_vector(IFWIDTH-1 downto 0); -- configuration stuff signal Cfg : engineConfigRec := fir4shift; signal CfgxD : std_logic_vector(ENGN_CFGLEN-1 downto 0) := to_engineConfig_vec(Cfg); signal CfgPrt : cfgPartArray := partition_config(CfgxD); file HFILE : text open write_mode is "fir4sh.h"; begin -- fir4sh ---------------------------------------------------------------------------- -- device under test ---------------------------------------------------------------------------- dut : ZUnit generic map ( IFWIDTH => IFWIDTH, DATAWIDTH => DATAWIDTH, CCNTWIDTH => CCNTWIDTH, FIFODEPTH => FIFODEPTH) port map ( ClkxC => ClkxC, RstxRB => RstxRB, WExEI => WExE, RExEI => RExE, AddrxDI => AddrxD, DataxDI => DataInxD, DataxDO => DataOutxD); ---------------------------------------------------------------------------- -- generate .h file for coupled simulation ---------------------------------------------------------------------------- hFileGen : process begin -- process hFileGen gen_cfghfile(HFILE, CfgPrt); wait; end process hFileGen; ---------------------------------------------------------------------------- -- stimuli ---------------------------------------------------------------------------- stimuliTb : process constant NDATA : integer := 12; -- nr. of data elements constant NRUNCYCLES : integer := 12; -- nr. of run cycles begin -- process stimuliTb tbStatus <= tbstart; WExE <= '0'; RExE <= '0'; AddrxD <= (others => '0'); DataInxD <= (others => '0'); wait until (ClkxC'event and ClkxC = '1' and RstxRB = '0'); wait until (ClkxC'event and ClkxC = '1' and RstxRB = '1'); tbStatus <= idle; wait for CLK_PERIOD*0.25; tbStatus <= idle; -- idle WExE <= '0'; RExE <= '0'; AddrxD <= (others => '0'); DataInxD <= (others => '0'); wait for CLK_PERIOD; -- ----------------------------------------------- -- reset (ZREG_RST:W) -- ----------------------------------------------- tbStatus <= rst; WExE <= '1'; RExE <= '0'; AddrxD <= std_logic_vector(to_unsigned(ZREG_RST, IFWIDTH)); DataInxD <= std_logic_vector(to_signed(0, IFWIDTH)); wait for CLK_PERIOD; tbStatus <= idle; -- idle WExE <= '0'; RExE <= '0'; AddrxD <= (others => '0'); DataInxD <= (others => '0'); wait for CLK_PERIOD; wait for CLK_PERIOD; -- ----------------------------------------------- -- write configuration slices (ZREG_CFGMEM0:W) -- ----------------------------------------------- tbStatus <= wr_cfg; WExE <= '1'; RExE <= '0'; AddrxD <= std_logic_vector(to_unsigned(ZREG_CFGMEM0, IFWIDTH)); for i in CfgPrt'low to CfgPrt'high loop DataInxD <= CfgPrt(i); wait for CLK_PERIOD; end loop; -- i tbStatus <= idle; -- idle WExE <= '0'; RExE <= '0'; AddrxD <= (others => '0'); DataInxD <= (others => '0'); wait for CLK_PERIOD; wait for CLK_PERIOD; -- ----------------------------------------------- -- push data into in buffer (ZREG_FIFO0:W) -- ----------------------------------------------- tbStatus <= push_data; WExE <= '1'; RExE <= '0'; AddrxD <= std_logic_vector(to_unsigned(ZREG_FIFO0, IFWIDTH)); DataInxD <= std_logic_vector(to_signed(80, IFWIDTH)); wait for CLK_PERIOD; -- DataInxD <= std_logic_vector(to_signed(80, IFWIDTH)); -- wait for CLK_PERIOD; -- DataInxD <= std_logic_vector(to_signed(80, IFWIDTH)); -- wait for CLK_PERIOD; -- DataInxD <= std_logic_vector(to_signed(80, IFWIDTH)); -- wait for CLK_PERIOD; -- DataInxD <= std_logic_vector(to_signed(80, IFWIDTH)); -- wait for CLK_PERIOD; -- DataInxD <= std_logic_vector(to_signed(80, IFWIDTH)); -- wait for CLK_PERIOD; -- DataInxD <= std_logic_vector(to_signed(80, IFWIDTH)); -- wait for CLK_PERIOD; -- DataInxD <= std_logic_vector(to_signed(80, IFWIDTH)); -- wait for CLK_PERIOD; -- DataInxD <= std_logic_vector(to_signed(80, IFWIDTH)); -- wait for CLK_PERIOD; -- DataInxD <= std_logic_vector(to_signed(80, IFWIDTH)); -- wait for CLK_PERIOD; -- DataInxD <= std_logic_vector(to_signed(80, IFWIDTH)); -- wait for CLK_PERIOD; -- DataInxD <= std_logic_vector(to_signed(80, IFWIDTH)); -- wait for CLK_PERIOD; -- for i in 12 to NDATA loop for i in 1 to NDATA loop DataInxD <= std_logic_vector(to_signed(0, IFWIDTH)); wait for CLK_PERIOD; end loop; -- i tbStatus <= idle; -- idle WExE <= '0'; RExE <= '0'; AddrxD <= (others => '0'); DataInxD <= (others => '0'); wait for CLK_PERIOD; wait for CLK_PERIOD; -- ----------------------------------------------- -- write cycle count register (ZREG_CYCLECNT:W) -- ----------------------------------------------- tbStatus <= wr_ncycl; WExE <= '1'; RExE <= '0'; AddrxD <= std_logic_vector(to_unsigned(ZREG_CYCLECNT, IFWIDTH)); DataInxD <= std_logic_vector(to_signed(NRUNCYCLES, IFWIDTH)); wait for CLK_PERIOD; -- ----------------------------------------------- -- computation running -- ----------------------------------------------- tbStatus <= running; WExE <= '0'; RExE <= '0'; AddrxD <= (others => '0'); DataInxD <= (others => '0'); for i in 0 to NRUNCYCLES-1 loop wait for CLK_PERIOD; end loop; -- i -- ----------------------------------------------- -- pop data from out buffer (ZREG_FIFO1:R) -- ----------------------------------------------- tbStatus <= pop_data; WExE <= '0'; RExE <= '1'; DataInxD <= (others => '0'); for i in 0 to NDATA loop AddrxD <= std_logic_vector(to_unsigned(ZREG_FIFO1, IFWIDTH)); wait for CLK_PERIOD; end loop; -- i tbStatus <= idle; -- idle WExE <= '0'; RExE <= '0'; AddrxD <= (others => '0'); DataInxD <= (others => '0'); wait for CLK_PERIOD; wait for CLK_PERIOD; -- ----------------------------------------------- -- done; stop simulation -- ----------------------------------------------- tbStatus <= done; -- done WExE <= '0'; RExE <= '0'; AddrxD <= (others => '0'); DataInxD <= (others => '0'); wait for CLK_PERIOD; -- stop simulation wait until (ClkxC'event and ClkxC = '1'); assert false report "stimuli processed; sim. terminated after " & int2str(ccount) & " cycles" severity failure; end process stimuliTb; ---------------------------------------------------------------------------- -- clock and reset generation ---------------------------------------------------------------------------- ClkxC <= not ClkxC after CLK_PERIOD/2; RstxRB <= '0', '1' after CLK_PERIOD*1.25; ---------------------------------------------------------------------------- -- cycle counter ---------------------------------------------------------------------------- cyclecounter : process (ClkxC) begin if (ClkxC'event and ClkxC = '1') then ccount <= ccount + 1; end if; end process cyclecounter; end fir4sh;
library ieee; use ieee.std_logic_1164.all; package jump_pack is constant cpu_width : integer := 32; constant ram_size : integer := 10; subtype word_type is std_logic_vector(cpu_width-1 downto 0); type ram_type is array(0 to ram_size-1) of word_type; function load_hex return ram_type; end package; package body jump_pack is function load_hex return ram_type is variable ram_buffer : ram_type := (others=>(others=>'0')); begin ram_buffer(0) := X"3C080100"; ram_buffer(1) := X"35080000"; ram_buffer(2) := X"01000008"; ram_buffer(3) := X"00000000"; ram_buffer(4) := X"00000100"; ram_buffer(5) := X"01010001"; ram_buffer(6) := X"00000000"; ram_buffer(7) := X"00000000"; ram_buffer(8) := X"00000000"; ram_buffer(9) := X"00000000"; return ram_buffer; end; end;
library ieee; use ieee.std_logic_1164.all; package jump_pack is constant cpu_width : integer := 32; constant ram_size : integer := 10; subtype word_type is std_logic_vector(cpu_width-1 downto 0); type ram_type is array(0 to ram_size-1) of word_type; function load_hex return ram_type; end package; package body jump_pack is function load_hex return ram_type is variable ram_buffer : ram_type := (others=>(others=>'0')); begin ram_buffer(0) := X"3C080100"; ram_buffer(1) := X"35080000"; ram_buffer(2) := X"01000008"; ram_buffer(3) := X"00000000"; ram_buffer(4) := X"00000100"; ram_buffer(5) := X"01010001"; ram_buffer(6) := X"00000000"; ram_buffer(7) := X"00000000"; ram_buffer(8) := X"00000000"; ram_buffer(9) := X"00000000"; return ram_buffer; end; end;
---------------------------------------------------------------------------------- -- Company: -- Engineer: -- -- Create Date: 05.07.2017 16:26:02 -- Design Name: -- Module Name: wrapper_compute_max - Structural -- Project Name: -- Target Devices: -- Tool Versions: -- Description: -- -- Dependencies: -- -- Revision: -- Revision 0.01 - File Created -- Additional Comments: -- ---------------------------------------------------------------------------------- --! @file wrapper_compute_max.vhd --! @author Antonio Riccio, Andrea Scognamiglio, Stefano Sorrentino --! @brief Wrapper di @ref compute_max che fornisce funzioni di comunicazione --! @anchor wrapper_compute_max library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.math_real.ceil; use IEEE.math_real.log2; -- Uncomment the following library declaration if using -- arithmetic functions with Signed or Unsigned values --use IEEE.NUMERIC_STD.ALL; -- Uncomment the following library declaration if instantiating -- any Xilinx leaf cells in this code. --library UNISIM; --use UNISIM.VComponents.all; --! @brief Wrapper per l'entità @ref compute_max --! @details Questo componente arricchisce il modulo @ref compute_max con funzionalità --! di comunicazione. Queste funzionalità sono necessarie per il collegamento del --! blocco con altri componenti. entity wrapper_compute_max is Generic ( sample_width : natural := 32; --! Parallelismo in bit del campione s : natural := 2; --! Numero di satelliti d : natural := 2; --! Numero di intervalli doppler c : natural := 3); --! Numero di campioni per intervallo doppler Port ( clock : in STD_LOGIC; --! Segnale di temporizzazione reset_n : in STD_LOGIC; --! Segnale di reset 0-attivo valid_in : in STD_LOGIC; --! Indica che il dato sulla linea di ingresso è valido ready_in : in STD_LOGIC; --! Indica che il componente a valle è pronto ad accettare valori in ingresso sample_abs : in STD_LOGIC_VECTOR (sample_width-1 downto 0); sample : in STD_LOGIC_VECTOR (sample_width-1 downto 0); pos_campione : out STD_LOGIC_VECTOR(natural(ceil(log2(real(c))))-1 downto 0); --! Posizione del massimo nell'intervallo doppler pos_doppler : out STD_LOGIC_VECTOR(natural(ceil(log2(real(d))))-1 downto 0); --! Intervallo di frequenze doppler al quale appartiene il massimo pos_satellite : out STD_LOGIC_VECTOR(natural(ceil(log2(real(s))))-1 downto 0); --! Satellite associato al massimo max : out STD_LOGIC_VECTOR (sample_width-1 downto 0); --! Modulo del massimo sample_max : out STD_LOGIC_VECTOR(sample_width-1 downto 0); --! Valore complesso del massimo valid_out : out STD_LOGIC; --! Indica che il dato sulla linea di uscita è valido ready_out : out STD_LOGIC); --! Indica che questo componente è pronto ad accettare valori in ingresso end wrapper_compute_max; --! @brief Architettura del componente descritta nel dominio strutturale architecture Structural of wrapper_compute_max is --! @brief Registro a parallelismo generico che opera sul fronte di salita del clock component register_n_bit is generic ( n : natural := 8 ); port ( I : in STD_LOGIC_VECTOR (n-1 downto 0); clock : in STD_LOGIC; load : in STD_LOGIC; reset_n : in STD_LOGIC; O : out STD_LOGIC_VECTOR (n-1 downto 0) ); end component register_n_bit; --! @brief Calcola il massimo per un insieme di s*d*c campioni\ --! @see compute_max component compute_max is generic ( sample_width : natural := 32; s : natural := 2; d : natural := 2; c : natural := 3 ); port ( clock : in STD_LOGIC; reset_n : in STD_LOGIC; enable : in STD_LOGIC; sample_abs : in STD_LOGIC_VECTOR (sample_width-1 downto 0); sample : in STD_LOGIC_VECTOR(sample_width-1 downto 0); pos_campione : out STD_LOGIC_VECTOR(natural(ceil(log2(real(c))))-1 downto 0); pos_doppler : out STD_LOGIC_VECTOR(natural(ceil(log2(real(d))))-1 downto 0); pos_satellite : out STD_LOGIC_VECTOR(natural(ceil(log2(real(s))))-1 downto 0); max : out STD_LOGIC_VECTOR (sample_width-1 downto 0); sample_max : out STD_LOGIC_VECTOR(sample_width-1 downto 0); done : out STD_LOGIC ); end component compute_max; --! @brief Parte di controllo di questo blocco component fsm_compute_max is port ( clock : in STD_LOGIC; reset_n : in STD_LOGIC; valid_in : in STD_LOGIC; ready_in : in STD_LOGIC; max_done : in STD_LOGIC; start : out STD_LOGIC; valid_out : out STD_LOGIC; ready_out : out STD_LOGIC; reset_n_all : out STD_LOGIC ); end component fsm_compute_max; -- for all : compute_max use entity work.compute_max(Behavioral); for all : compute_max use entity work.compute_max(Structural_non_continous); signal max_done, start, reset_n_all_sig : std_logic := '0'; signal max_sig : std_logic_vector(sample_width-1 downto 0) := (others => '0'); signal sample_max_sig : std_logic_vector(sample_width-1 downto 0) := (others => '0'); signal pos_campione_sig : std_logic_vector(natural(ceil(log2(real(c))))-1 downto 0) := (others => '0'); signal pos_doppler_sig : std_logic_vector(natural(ceil(log2(real(d))))-1 downto 0) := (others => '0'); signal pos_satellite_sig : std_logic_vector(natural(ceil(log2(real(s))))-1 downto 0) := (others => '0'); begin --! @brief Componente che calcola il massimo sui moduli dei campioni in ingresso compute_max_inst: compute_max generic map ( sample_width => sample_width, s => s, d => d, c => c ) port map ( clock => clock, reset_n => reset_n_all_sig, enable => start, sample_abs => sample_abs, sample => sample, pos_campione => pos_campione_sig, pos_doppler => pos_doppler_sig, pos_satellite => pos_satellite_sig, max => max_sig, sample_max => sample_max_sig, done => max_done ); --! @brief Automa a stati finiti per la gestione dei segnali di comunicazione fsm_compute_max_inst: fsm_compute_max port map ( clock => clock, reset_n => reset_n, valid_in => valid_in, ready_in => ready_in, max_done => max_done, start => start, valid_out => valid_out, ready_out => ready_out, reset_n_all => reset_n_all_sig ); --! @brief Memorizza il massimo (in valore assoluto) ottenuto dal blocco compute_max --! @details Questo registro è necessario per memorizzare il risultato(max) di compute_max --! dato che il componente si resetta dopo che ha terminato l'elaborazione. reg_max: register_n_bit generic map ( n => sample_width ) port map ( I => max_sig, clock => clock, load => max_done, reset_n => reset_n, O => max ); --! @brief Memorizza il massimo campione ottenuto dal blocco compute_max --! @details Questo registro è necessario per memorizzare il risultato(sample_max) di compute_max --! dato che il componente si resetta dopo che ha terminato l'elaborazione. reg_sample_max: register_n_bit generic map ( n => sample_width ) port map ( I => sample_max_sig, clock => clock, load => max_done, reset_n => reset_n, O => sample_max ); --! @brief Memorizza la pos_campione del risultato ottenuto dal blocco compute_max --! @details Questo registro è necessario per memorizzare pos_campione di compute_max --! dato che il componente si resetta dopo che ha terminato l'elaborazione. reg_pos_campione: register_n_bit generic map ( n => natural(ceil(log2(real(c)))) ) port map ( I => pos_campione_sig, clock => clock, load => max_done, reset_n => reset_n, O => pos_campione ); --! @brief Memorizza la pos_doppler del risultato ottenuto dal blocco compute_max --! @details Questo registro è necessario per memorizzare pos_doppler di compute_max --! dato che il componente si resetta dopo che ha terminato l'elaborazione. reg_pos_doppler: register_n_bit generic map ( n => natural(ceil(log2(real(d)))) ) port map ( I => pos_doppler_sig, clock => clock, load => max_done, reset_n => reset_n, O => pos_doppler ); --! @brief Memorizza la pos_satellite del risultato ottenuto dal blocco compute_max --! @details Questo registro è necessario per memorizzare pos_satellite di compute_max --! dato che il componente si resetta dopo che ha terminato l'elaborazione. reg_pos_satellite: register_n_bit generic map ( n => natural(ceil(log2(real(s)))) ) port map ( I => pos_satellite_sig, clock => clock, load => max_done, reset_n => reset_n, O => pos_satellite ); end Structural;
-- ============================================================== -- RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC -- Version: 2017.4 -- Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved. -- -- =========================================================== library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity hls_contrast_stretch is generic ( C_S_AXI_AXILITES_ADDR_WIDTH : INTEGER := 6; C_S_AXI_AXILITES_DATA_WIDTH : INTEGER := 32 ); port ( s_axi_AXILiteS_AWVALID : IN STD_LOGIC; s_axi_AXILiteS_AWREADY : OUT STD_LOGIC; s_axi_AXILiteS_AWADDR : IN STD_LOGIC_VECTOR (C_S_AXI_AXILITES_ADDR_WIDTH-1 downto 0); s_axi_AXILiteS_WVALID : IN STD_LOGIC; s_axi_AXILiteS_WREADY : OUT STD_LOGIC; s_axi_AXILiteS_WDATA : IN STD_LOGIC_VECTOR (C_S_AXI_AXILITES_DATA_WIDTH-1 downto 0); s_axi_AXILiteS_WSTRB : IN STD_LOGIC_VECTOR (C_S_AXI_AXILITES_DATA_WIDTH/8-1 downto 0); s_axi_AXILiteS_ARVALID : IN STD_LOGIC; s_axi_AXILiteS_ARREADY : OUT STD_LOGIC; s_axi_AXILiteS_ARADDR : IN STD_LOGIC_VECTOR (C_S_AXI_AXILITES_ADDR_WIDTH-1 downto 0); s_axi_AXILiteS_RVALID : OUT STD_LOGIC; s_axi_AXILiteS_RREADY : IN STD_LOGIC; s_axi_AXILiteS_RDATA : OUT STD_LOGIC_VECTOR (C_S_AXI_AXILITES_DATA_WIDTH-1 downto 0); s_axi_AXILiteS_RRESP : OUT STD_LOGIC_VECTOR (1 downto 0); s_axi_AXILiteS_BVALID : OUT STD_LOGIC; s_axi_AXILiteS_BREADY : IN STD_LOGIC; s_axi_AXILiteS_BRESP : OUT STD_LOGIC_VECTOR (1 downto 0); ap_clk : IN STD_LOGIC; ap_rst_n : IN STD_LOGIC; stream_in_TDATA : IN STD_LOGIC_VECTOR (23 downto 0); stream_in_TKEEP : IN STD_LOGIC_VECTOR (2 downto 0); stream_in_TSTRB : IN STD_LOGIC_VECTOR (2 downto 0); stream_in_TUSER : IN STD_LOGIC_VECTOR (0 downto 0); stream_in_TLAST : IN STD_LOGIC_VECTOR (0 downto 0); stream_in_TID : IN STD_LOGIC_VECTOR (0 downto 0); stream_in_TDEST : IN STD_LOGIC_VECTOR (0 downto 0); stream_out_TDATA : OUT STD_LOGIC_VECTOR (23 downto 0); stream_out_TKEEP : OUT STD_LOGIC_VECTOR (2 downto 0); stream_out_TSTRB : OUT STD_LOGIC_VECTOR (2 downto 0); stream_out_TUSER : OUT STD_LOGIC_VECTOR (0 downto 0); stream_out_TLAST : OUT STD_LOGIC_VECTOR (0 downto 0); stream_out_TID : OUT STD_LOGIC_VECTOR (0 downto 0); stream_out_TDEST : OUT STD_LOGIC_VECTOR (0 downto 0); stream_in_TVALID : IN STD_LOGIC; stream_in_TREADY : OUT STD_LOGIC; stream_out_TVALID : OUT STD_LOGIC; stream_out_TREADY : IN STD_LOGIC ); end; architecture behav of hls_contrast_stretch is attribute CORE_GENERATION_INFO : STRING; attribute CORE_GENERATION_INFO of behav : architecture is "hls_contrast_stretch,hls_ip_2017_4,{HLS_INPUT_TYPE=cxx,HLS_INPUT_FLOAT=0,HLS_INPUT_FIXED=0,HLS_INPUT_PART=xc7z020clg400-1,HLS_INPUT_CLOCK=6.670000,HLS_INPUT_ARCH=dataflow,HLS_SYN_CLOCK=6.380000,HLS_SYN_LAT=-1,HLS_SYN_TPT=-1,HLS_SYN_MEM=0,HLS_SYN_DSP=9,HLS_SYN_FF=3094,HLS_SYN_LUT=4583}"; constant C_S_AXI_DATA_WIDTH : INTEGER range 63 downto 0 := 20; constant C_S_AXI_WSTRB_WIDTH : INTEGER range 63 downto 0 := 4; constant C_S_AXI_ADDR_WIDTH : INTEGER range 63 downto 0 := 20; constant ap_const_logic_1 : STD_LOGIC := '1'; constant ap_const_lv24_0 : STD_LOGIC_VECTOR (23 downto 0) := "000000000000000000000000"; constant ap_const_lv3_0 : STD_LOGIC_VECTOR (2 downto 0) := "000"; constant ap_const_lv1_0 : STD_LOGIC_VECTOR (0 downto 0) := "0"; constant ap_const_logic_0 : STD_LOGIC := '0'; signal ap_rst_n_inv : STD_LOGIC; signal height : STD_LOGIC_VECTOR (15 downto 0); signal width : STD_LOGIC_VECTOR (15 downto 0); signal min : STD_LOGIC_VECTOR (7 downto 0); signal max : STD_LOGIC_VECTOR (7 downto 0); signal Block_Mat_exit1573_p_U0_ap_start : STD_LOGIC; signal Block_Mat_exit1573_p_U0_start_full_n : STD_LOGIC; signal Block_Mat_exit1573_p_U0_ap_done : STD_LOGIC; signal Block_Mat_exit1573_p_U0_ap_continue : STD_LOGIC; signal Block_Mat_exit1573_p_U0_ap_idle : STD_LOGIC; signal Block_Mat_exit1573_p_U0_ap_ready : STD_LOGIC; signal Block_Mat_exit1573_p_U0_start_out : STD_LOGIC; signal Block_Mat_exit1573_p_U0_start_write : STD_LOGIC; signal Block_Mat_exit1573_p_U0_min_out_din : STD_LOGIC_VECTOR (7 downto 0); signal Block_Mat_exit1573_p_U0_min_out_write : STD_LOGIC; signal Block_Mat_exit1573_p_U0_img0_rows_V_out_din : STD_LOGIC_VECTOR (15 downto 0); signal Block_Mat_exit1573_p_U0_img0_rows_V_out_write : STD_LOGIC; signal Block_Mat_exit1573_p_U0_img0_cols_V_out_din : STD_LOGIC_VECTOR (15 downto 0); signal Block_Mat_exit1573_p_U0_img0_cols_V_out_write : STD_LOGIC; signal Block_Mat_exit1573_p_U0_img2_rows_V_out_din : STD_LOGIC_VECTOR (15 downto 0); signal Block_Mat_exit1573_p_U0_img2_rows_V_out_write : STD_LOGIC; signal Block_Mat_exit1573_p_U0_img2_cols_V_out_din : STD_LOGIC_VECTOR (15 downto 0); signal Block_Mat_exit1573_p_U0_img2_cols_V_out_write : STD_LOGIC; signal Block_Mat_exit1573_p_U0_img3_rows_V_out_din : STD_LOGIC_VECTOR (15 downto 0); signal Block_Mat_exit1573_p_U0_img3_rows_V_out_write : STD_LOGIC; signal Block_Mat_exit1573_p_U0_img3_cols_V_out_din : STD_LOGIC_VECTOR (15 downto 0); signal Block_Mat_exit1573_p_U0_img3_cols_V_out_write : STD_LOGIC; signal Block_Mat_exit1573_p_U0_p_cols_assign_cast_out_out_din : STD_LOGIC_VECTOR (11 downto 0); signal Block_Mat_exit1573_p_U0_p_cols_assign_cast_out_out_write : STD_LOGIC; signal Block_Mat_exit1573_p_U0_p_rows_assign_cast_out_out_din : STD_LOGIC_VECTOR (11 downto 0); signal Block_Mat_exit1573_p_U0_p_rows_assign_cast_out_out_write : STD_LOGIC; signal Block_Mat_exit1573_p_U0_tmp_3_cast_out_out_din : STD_LOGIC_VECTOR (7 downto 0); signal Block_Mat_exit1573_p_U0_tmp_3_cast_out_out_write : STD_LOGIC; signal Block_Mat_exit1573_p_U0_max_out_din : STD_LOGIC_VECTOR (7 downto 0); signal Block_Mat_exit1573_p_U0_max_out_write : STD_LOGIC; signal AXIvideo2Mat_U0_ap_start : STD_LOGIC; signal AXIvideo2Mat_U0_ap_done : STD_LOGIC; signal AXIvideo2Mat_U0_ap_continue : STD_LOGIC; signal AXIvideo2Mat_U0_ap_idle : STD_LOGIC; signal AXIvideo2Mat_U0_ap_ready : STD_LOGIC; signal AXIvideo2Mat_U0_start_out : STD_LOGIC; signal AXIvideo2Mat_U0_start_write : STD_LOGIC; signal AXIvideo2Mat_U0_stream_in_TREADY : STD_LOGIC; signal AXIvideo2Mat_U0_img_rows_V_read : STD_LOGIC; signal AXIvideo2Mat_U0_img_cols_V_read : STD_LOGIC; signal AXIvideo2Mat_U0_img_data_stream_0_V_din : STD_LOGIC_VECTOR (7 downto 0); signal AXIvideo2Mat_U0_img_data_stream_0_V_write : STD_LOGIC; signal AXIvideo2Mat_U0_img_data_stream_1_V_din : STD_LOGIC_VECTOR (7 downto 0); signal AXIvideo2Mat_U0_img_data_stream_1_V_write : STD_LOGIC; signal AXIvideo2Mat_U0_img_data_stream_2_V_din : STD_LOGIC_VECTOR (7 downto 0); signal AXIvideo2Mat_U0_img_data_stream_2_V_write : STD_LOGIC; signal AXIvideo2Mat_U0_img_rows_V_out_din : STD_LOGIC_VECTOR (15 downto 0); signal AXIvideo2Mat_U0_img_rows_V_out_write : STD_LOGIC; signal AXIvideo2Mat_U0_img_cols_V_out_din : STD_LOGIC_VECTOR (15 downto 0); signal AXIvideo2Mat_U0_img_cols_V_out_write : STD_LOGIC; signal CvtColor_1_U0_ap_start : STD_LOGIC; signal CvtColor_1_U0_ap_done : STD_LOGIC; signal CvtColor_1_U0_ap_continue : STD_LOGIC; signal CvtColor_1_U0_ap_idle : STD_LOGIC; signal CvtColor_1_U0_ap_ready : STD_LOGIC; signal CvtColor_1_U0_p_src_rows_V_read : STD_LOGIC; signal CvtColor_1_U0_p_src_cols_V_read : STD_LOGIC; signal CvtColor_1_U0_p_src_data_stream_0_V_read : STD_LOGIC; signal CvtColor_1_U0_p_src_data_stream_1_V_read : STD_LOGIC; signal CvtColor_1_U0_p_src_data_stream_2_V_read : STD_LOGIC; signal CvtColor_1_U0_p_dst_data_stream_0_V_din : STD_LOGIC_VECTOR (7 downto 0); signal CvtColor_1_U0_p_dst_data_stream_0_V_write : STD_LOGIC; signal CvtColor_1_U0_p_dst_data_stream_1_V_din : STD_LOGIC_VECTOR (7 downto 0); signal CvtColor_1_U0_p_dst_data_stream_1_V_write : STD_LOGIC; signal CvtColor_1_U0_p_dst_data_stream_2_V_din : STD_LOGIC_VECTOR (7 downto 0); signal CvtColor_1_U0_p_dst_data_stream_2_V_write : STD_LOGIC; signal Loop_loop_height_pro_U0_ap_start : STD_LOGIC; signal Loop_loop_height_pro_U0_ap_done : STD_LOGIC; signal Loop_loop_height_pro_U0_ap_continue : STD_LOGIC; signal Loop_loop_height_pro_U0_ap_idle : STD_LOGIC; signal Loop_loop_height_pro_U0_ap_ready : STD_LOGIC; signal Loop_loop_height_pro_U0_max_read : STD_LOGIC; signal Loop_loop_height_pro_U0_p_rows_assign_cast_loc_read : STD_LOGIC; signal Loop_loop_height_pro_U0_p_cols_assign_cast_loc_read : STD_LOGIC; signal Loop_loop_height_pro_U0_img2_data_stream_0_V_din : STD_LOGIC_VECTOR (7 downto 0); signal Loop_loop_height_pro_U0_img2_data_stream_0_V_write : STD_LOGIC; signal Loop_loop_height_pro_U0_img2_data_stream_1_V_din : STD_LOGIC_VECTOR (7 downto 0); signal Loop_loop_height_pro_U0_img2_data_stream_1_V_write : STD_LOGIC; signal Loop_loop_height_pro_U0_img2_data_stream_2_V_din : STD_LOGIC_VECTOR (7 downto 0); signal Loop_loop_height_pro_U0_img2_data_stream_2_V_write : STD_LOGIC; signal Loop_loop_height_pro_U0_img1_data_stream_0_V_read : STD_LOGIC; signal Loop_loop_height_pro_U0_img1_data_stream_1_V_read : STD_LOGIC; signal Loop_loop_height_pro_U0_img1_data_stream_2_V_read : STD_LOGIC; signal Loop_loop_height_pro_U0_min_read : STD_LOGIC; signal Loop_loop_height_pro_U0_tmp_3_cast_loc_read : STD_LOGIC; signal CvtColor_U0_ap_start : STD_LOGIC; signal CvtColor_U0_ap_done : STD_LOGIC; signal CvtColor_U0_ap_continue : STD_LOGIC; signal CvtColor_U0_ap_idle : STD_LOGIC; signal CvtColor_U0_ap_ready : STD_LOGIC; signal CvtColor_U0_p_src_rows_V_read : STD_LOGIC; signal CvtColor_U0_p_src_cols_V_read : STD_LOGIC; signal CvtColor_U0_p_src_data_stream_0_V_read : STD_LOGIC; signal CvtColor_U0_p_src_data_stream_1_V_read : STD_LOGIC; signal CvtColor_U0_p_src_data_stream_2_V_read : STD_LOGIC; signal CvtColor_U0_p_dst_data_stream_0_V_din : STD_LOGIC_VECTOR (7 downto 0); signal CvtColor_U0_p_dst_data_stream_0_V_write : STD_LOGIC; signal CvtColor_U0_p_dst_data_stream_1_V_din : STD_LOGIC_VECTOR (7 downto 0); signal CvtColor_U0_p_dst_data_stream_1_V_write : STD_LOGIC; signal CvtColor_U0_p_dst_data_stream_2_V_din : STD_LOGIC_VECTOR (7 downto 0); signal CvtColor_U0_p_dst_data_stream_2_V_write : STD_LOGIC; signal Mat2AXIvideo_U0_ap_start : STD_LOGIC; signal Mat2AXIvideo_U0_ap_done : STD_LOGIC; signal Mat2AXIvideo_U0_ap_continue : STD_LOGIC; signal Mat2AXIvideo_U0_ap_idle : STD_LOGIC; signal Mat2AXIvideo_U0_ap_ready : STD_LOGIC; signal Mat2AXIvideo_U0_img_rows_V_read : STD_LOGIC; signal Mat2AXIvideo_U0_img_cols_V_read : STD_LOGIC; signal Mat2AXIvideo_U0_img_data_stream_0_V_read : STD_LOGIC; signal Mat2AXIvideo_U0_img_data_stream_1_V_read : STD_LOGIC; signal Mat2AXIvideo_U0_img_data_stream_2_V_read : STD_LOGIC; signal Mat2AXIvideo_U0_stream_out_TDATA : STD_LOGIC_VECTOR (23 downto 0); signal Mat2AXIvideo_U0_stream_out_TVALID : STD_LOGIC; signal Mat2AXIvideo_U0_stream_out_TKEEP : STD_LOGIC_VECTOR (2 downto 0); signal Mat2AXIvideo_U0_stream_out_TSTRB : STD_LOGIC_VECTOR (2 downto 0); signal Mat2AXIvideo_U0_stream_out_TUSER : STD_LOGIC_VECTOR (0 downto 0); signal Mat2AXIvideo_U0_stream_out_TLAST : STD_LOGIC_VECTOR (0 downto 0); signal Mat2AXIvideo_U0_stream_out_TID : STD_LOGIC_VECTOR (0 downto 0); signal Mat2AXIvideo_U0_stream_out_TDEST : STD_LOGIC_VECTOR (0 downto 0); signal ap_sync_continue : STD_LOGIC; signal min_c_full_n : STD_LOGIC; signal min_c_dout : STD_LOGIC_VECTOR (7 downto 0); signal min_c_empty_n : STD_LOGIC; signal img0_rows_V_c_full_n : STD_LOGIC; signal img0_rows_V_c_dout : STD_LOGIC_VECTOR (15 downto 0); signal img0_rows_V_c_empty_n : STD_LOGIC; signal img0_cols_V_c_full_n : STD_LOGIC; signal img0_cols_V_c_dout : STD_LOGIC_VECTOR (15 downto 0); signal img0_cols_V_c_empty_n : STD_LOGIC; signal img2_rows_V_c_full_n : STD_LOGIC; signal img2_rows_V_c_dout : STD_LOGIC_VECTOR (15 downto 0); signal img2_rows_V_c_empty_n : STD_LOGIC; signal img2_cols_V_c_full_n : STD_LOGIC; signal img2_cols_V_c_dout : STD_LOGIC_VECTOR (15 downto 0); signal img2_cols_V_c_empty_n : STD_LOGIC; signal img3_rows_V_c_full_n : STD_LOGIC; signal img3_rows_V_c_dout : STD_LOGIC_VECTOR (15 downto 0); signal img3_rows_V_c_empty_n : STD_LOGIC; signal img3_cols_V_c_full_n : STD_LOGIC; signal img3_cols_V_c_dout : STD_LOGIC_VECTOR (15 downto 0); signal img3_cols_V_c_empty_n : STD_LOGIC; signal p_cols_assign_cast_lo_full_n : STD_LOGIC; signal p_cols_assign_cast_lo_dout : STD_LOGIC_VECTOR (11 downto 0); signal p_cols_assign_cast_lo_empty_n : STD_LOGIC; signal p_rows_assign_cast_lo_full_n : STD_LOGIC; signal p_rows_assign_cast_lo_dout : STD_LOGIC_VECTOR (11 downto 0); signal p_rows_assign_cast_lo_empty_n : STD_LOGIC; signal tmp_3_cast_loc_c_full_n : STD_LOGIC; signal tmp_3_cast_loc_c_dout : STD_LOGIC_VECTOR (7 downto 0); signal tmp_3_cast_loc_c_empty_n : STD_LOGIC; signal max_c_full_n : STD_LOGIC; signal max_c_dout : STD_LOGIC_VECTOR (7 downto 0); signal max_c_empty_n : STD_LOGIC; signal img0_data_stream_0_s_full_n : STD_LOGIC; signal img0_data_stream_0_s_dout : STD_LOGIC_VECTOR (7 downto 0); signal img0_data_stream_0_s_empty_n : STD_LOGIC; signal img0_data_stream_1_s_full_n : STD_LOGIC; signal img0_data_stream_1_s_dout : STD_LOGIC_VECTOR (7 downto 0); signal img0_data_stream_1_s_empty_n : STD_LOGIC; signal img0_data_stream_2_s_full_n : STD_LOGIC; signal img0_data_stream_2_s_dout : STD_LOGIC_VECTOR (7 downto 0); signal img0_data_stream_2_s_empty_n : STD_LOGIC; signal img0_rows_V_c83_full_n : STD_LOGIC; signal img0_rows_V_c83_dout : STD_LOGIC_VECTOR (15 downto 0); signal img0_rows_V_c83_empty_n : STD_LOGIC; signal img0_cols_V_c84_full_n : STD_LOGIC; signal img0_cols_V_c84_dout : STD_LOGIC_VECTOR (15 downto 0); signal img0_cols_V_c84_empty_n : STD_LOGIC; signal img1_data_stream_0_s_full_n : STD_LOGIC; signal img1_data_stream_0_s_dout : STD_LOGIC_VECTOR (7 downto 0); signal img1_data_stream_0_s_empty_n : STD_LOGIC; signal img1_data_stream_1_s_full_n : STD_LOGIC; signal img1_data_stream_1_s_dout : STD_LOGIC_VECTOR (7 downto 0); signal img1_data_stream_1_s_empty_n : STD_LOGIC; signal img1_data_stream_2_s_full_n : STD_LOGIC; signal img1_data_stream_2_s_dout : STD_LOGIC_VECTOR (7 downto 0); signal img1_data_stream_2_s_empty_n : STD_LOGIC; signal img2_data_stream_0_s_full_n : STD_LOGIC; signal img2_data_stream_0_s_dout : STD_LOGIC_VECTOR (7 downto 0); signal img2_data_stream_0_s_empty_n : STD_LOGIC; signal img2_data_stream_1_s_full_n : STD_LOGIC; signal img2_data_stream_1_s_dout : STD_LOGIC_VECTOR (7 downto 0); signal img2_data_stream_1_s_empty_n : STD_LOGIC; signal img2_data_stream_2_s_full_n : STD_LOGIC; signal img2_data_stream_2_s_dout : STD_LOGIC_VECTOR (7 downto 0); signal img2_data_stream_2_s_empty_n : STD_LOGIC; signal img3_data_stream_0_s_full_n : STD_LOGIC; signal img3_data_stream_0_s_dout : STD_LOGIC_VECTOR (7 downto 0); signal img3_data_stream_0_s_empty_n : STD_LOGIC; signal img3_data_stream_1_s_full_n : STD_LOGIC; signal img3_data_stream_1_s_dout : STD_LOGIC_VECTOR (7 downto 0); signal img3_data_stream_1_s_empty_n : STD_LOGIC; signal img3_data_stream_2_s_full_n : STD_LOGIC; signal img3_data_stream_2_s_dout : STD_LOGIC_VECTOR (7 downto 0); signal img3_data_stream_2_s_empty_n : STD_LOGIC; signal start_for_Loop_loop_height_pro_U0_din : STD_LOGIC_VECTOR (0 downto 0); signal start_for_Loop_loop_height_pro_U0_full_n : STD_LOGIC; signal start_for_Loop_loop_height_pro_U0_dout : STD_LOGIC_VECTOR (0 downto 0); signal start_for_Loop_loop_height_pro_U0_empty_n : STD_LOGIC; signal start_for_CvtColor_U0_din : STD_LOGIC_VECTOR (0 downto 0); signal start_for_CvtColor_U0_full_n : STD_LOGIC; signal start_for_CvtColor_U0_dout : STD_LOGIC_VECTOR (0 downto 0); signal start_for_CvtColor_U0_empty_n : STD_LOGIC; signal start_for_Mat2AXIvideo_U0_din : STD_LOGIC_VECTOR (0 downto 0); signal start_for_Mat2AXIvideo_U0_full_n : STD_LOGIC; signal start_for_Mat2AXIvideo_U0_dout : STD_LOGIC_VECTOR (0 downto 0); signal start_for_Mat2AXIvideo_U0_empty_n : STD_LOGIC; signal start_for_CvtColor_1_U0_din : STD_LOGIC_VECTOR (0 downto 0); signal start_for_CvtColor_1_U0_full_n : STD_LOGIC; signal start_for_CvtColor_1_U0_dout : STD_LOGIC_VECTOR (0 downto 0); signal start_for_CvtColor_1_U0_empty_n : STD_LOGIC; signal CvtColor_1_U0_start_full_n : STD_LOGIC; signal CvtColor_1_U0_start_write : STD_LOGIC; signal Loop_loop_height_pro_U0_start_full_n : STD_LOGIC; signal Loop_loop_height_pro_U0_start_write : STD_LOGIC; signal CvtColor_U0_start_full_n : STD_LOGIC; signal CvtColor_U0_start_write : STD_LOGIC; signal Mat2AXIvideo_U0_start_full_n : STD_LOGIC; signal Mat2AXIvideo_U0_start_write : STD_LOGIC; component Block_Mat_exit1573_p IS port ( ap_clk : IN STD_LOGIC; ap_rst : IN STD_LOGIC; ap_start : IN STD_LOGIC; start_full_n : IN STD_LOGIC; ap_done : OUT STD_LOGIC; ap_continue : IN STD_LOGIC; ap_idle : OUT STD_LOGIC; ap_ready : OUT STD_LOGIC; start_out : OUT STD_LOGIC; start_write : OUT STD_LOGIC; height : IN STD_LOGIC_VECTOR (15 downto 0); width : IN STD_LOGIC_VECTOR (15 downto 0); min : IN STD_LOGIC_VECTOR (7 downto 0); max : IN STD_LOGIC_VECTOR (7 downto 0); min_out_din : OUT STD_LOGIC_VECTOR (7 downto 0); min_out_full_n : IN STD_LOGIC; min_out_write : OUT STD_LOGIC; img0_rows_V_out_din : OUT STD_LOGIC_VECTOR (15 downto 0); img0_rows_V_out_full_n : IN STD_LOGIC; img0_rows_V_out_write : OUT STD_LOGIC; img0_cols_V_out_din : OUT STD_LOGIC_VECTOR (15 downto 0); img0_cols_V_out_full_n : IN STD_LOGIC; img0_cols_V_out_write : OUT STD_LOGIC; img2_rows_V_out_din : OUT STD_LOGIC_VECTOR (15 downto 0); img2_rows_V_out_full_n : IN STD_LOGIC; img2_rows_V_out_write : OUT STD_LOGIC; img2_cols_V_out_din : OUT STD_LOGIC_VECTOR (15 downto 0); img2_cols_V_out_full_n : IN STD_LOGIC; img2_cols_V_out_write : OUT STD_LOGIC; img3_rows_V_out_din : OUT STD_LOGIC_VECTOR (15 downto 0); img3_rows_V_out_full_n : IN STD_LOGIC; img3_rows_V_out_write : OUT STD_LOGIC; img3_cols_V_out_din : OUT STD_LOGIC_VECTOR (15 downto 0); img3_cols_V_out_full_n : IN STD_LOGIC; img3_cols_V_out_write : OUT STD_LOGIC; p_cols_assign_cast_out_out_din : OUT STD_LOGIC_VECTOR (11 downto 0); p_cols_assign_cast_out_out_full_n : IN STD_LOGIC; p_cols_assign_cast_out_out_write : OUT STD_LOGIC; p_rows_assign_cast_out_out_din : OUT STD_LOGIC_VECTOR (11 downto 0); p_rows_assign_cast_out_out_full_n : IN STD_LOGIC; p_rows_assign_cast_out_out_write : OUT STD_LOGIC; tmp_3_cast_out_out_din : OUT STD_LOGIC_VECTOR (7 downto 0); tmp_3_cast_out_out_full_n : IN STD_LOGIC; tmp_3_cast_out_out_write : OUT STD_LOGIC; max_out_din : OUT STD_LOGIC_VECTOR (7 downto 0); max_out_full_n : IN STD_LOGIC; max_out_write : OUT STD_LOGIC ); end component; component AXIvideo2Mat IS port ( ap_clk : IN STD_LOGIC; ap_rst : IN STD_LOGIC; ap_start : IN STD_LOGIC; start_full_n : IN STD_LOGIC; ap_done : OUT STD_LOGIC; ap_continue : IN STD_LOGIC; ap_idle : OUT STD_LOGIC; ap_ready : OUT STD_LOGIC; start_out : OUT STD_LOGIC; start_write : OUT STD_LOGIC; stream_in_TDATA : IN STD_LOGIC_VECTOR (23 downto 0); stream_in_TVALID : IN STD_LOGIC; stream_in_TREADY : OUT STD_LOGIC; stream_in_TKEEP : IN STD_LOGIC_VECTOR (2 downto 0); stream_in_TSTRB : IN STD_LOGIC_VECTOR (2 downto 0); stream_in_TUSER : IN STD_LOGIC_VECTOR (0 downto 0); stream_in_TLAST : IN STD_LOGIC_VECTOR (0 downto 0); stream_in_TID : IN STD_LOGIC_VECTOR (0 downto 0); stream_in_TDEST : IN STD_LOGIC_VECTOR (0 downto 0); img_rows_V_dout : IN STD_LOGIC_VECTOR (15 downto 0); img_rows_V_empty_n : IN STD_LOGIC; img_rows_V_read : OUT STD_LOGIC; img_cols_V_dout : IN STD_LOGIC_VECTOR (15 downto 0); img_cols_V_empty_n : IN STD_LOGIC; img_cols_V_read : OUT STD_LOGIC; img_data_stream_0_V_din : OUT STD_LOGIC_VECTOR (7 downto 0); img_data_stream_0_V_full_n : IN STD_LOGIC; img_data_stream_0_V_write : OUT STD_LOGIC; img_data_stream_1_V_din : OUT STD_LOGIC_VECTOR (7 downto 0); img_data_stream_1_V_full_n : IN STD_LOGIC; img_data_stream_1_V_write : OUT STD_LOGIC; img_data_stream_2_V_din : OUT STD_LOGIC_VECTOR (7 downto 0); img_data_stream_2_V_full_n : IN STD_LOGIC; img_data_stream_2_V_write : OUT STD_LOGIC; img_rows_V_out_din : OUT STD_LOGIC_VECTOR (15 downto 0); img_rows_V_out_full_n : IN STD_LOGIC; img_rows_V_out_write : OUT STD_LOGIC; img_cols_V_out_din : OUT STD_LOGIC_VECTOR (15 downto 0); img_cols_V_out_full_n : IN STD_LOGIC; img_cols_V_out_write : OUT STD_LOGIC ); end component; component CvtColor_1 IS port ( ap_clk : IN STD_LOGIC; ap_rst : IN STD_LOGIC; ap_start : IN STD_LOGIC; ap_done : OUT STD_LOGIC; ap_continue : IN STD_LOGIC; ap_idle : OUT STD_LOGIC; ap_ready : OUT STD_LOGIC; p_src_rows_V_dout : IN STD_LOGIC_VECTOR (15 downto 0); p_src_rows_V_empty_n : IN STD_LOGIC; p_src_rows_V_read : OUT STD_LOGIC; p_src_cols_V_dout : IN STD_LOGIC_VECTOR (15 downto 0); p_src_cols_V_empty_n : IN STD_LOGIC; p_src_cols_V_read : OUT STD_LOGIC; p_src_data_stream_0_V_dout : IN STD_LOGIC_VECTOR (7 downto 0); p_src_data_stream_0_V_empty_n : IN STD_LOGIC; p_src_data_stream_0_V_read : OUT STD_LOGIC; p_src_data_stream_1_V_dout : IN STD_LOGIC_VECTOR (7 downto 0); p_src_data_stream_1_V_empty_n : IN STD_LOGIC; p_src_data_stream_1_V_read : OUT STD_LOGIC; p_src_data_stream_2_V_dout : IN STD_LOGIC_VECTOR (7 downto 0); p_src_data_stream_2_V_empty_n : IN STD_LOGIC; p_src_data_stream_2_V_read : OUT STD_LOGIC; p_dst_data_stream_0_V_din : OUT STD_LOGIC_VECTOR (7 downto 0); p_dst_data_stream_0_V_full_n : IN STD_LOGIC; p_dst_data_stream_0_V_write : OUT STD_LOGIC; p_dst_data_stream_1_V_din : OUT STD_LOGIC_VECTOR (7 downto 0); p_dst_data_stream_1_V_full_n : IN STD_LOGIC; p_dst_data_stream_1_V_write : OUT STD_LOGIC; p_dst_data_stream_2_V_din : OUT STD_LOGIC_VECTOR (7 downto 0); p_dst_data_stream_2_V_full_n : IN STD_LOGIC; p_dst_data_stream_2_V_write : OUT STD_LOGIC ); end component; component Loop_loop_height_pro IS port ( ap_clk : IN STD_LOGIC; ap_rst : IN STD_LOGIC; ap_start : IN STD_LOGIC; ap_done : OUT STD_LOGIC; ap_continue : IN STD_LOGIC; ap_idle : OUT STD_LOGIC; ap_ready : OUT STD_LOGIC; max_dout : IN STD_LOGIC_VECTOR (7 downto 0); max_empty_n : IN STD_LOGIC; max_read : OUT STD_LOGIC; p_rows_assign_cast_loc_dout : IN STD_LOGIC_VECTOR (11 downto 0); p_rows_assign_cast_loc_empty_n : IN STD_LOGIC; p_rows_assign_cast_loc_read : OUT STD_LOGIC; p_cols_assign_cast_loc_dout : IN STD_LOGIC_VECTOR (11 downto 0); p_cols_assign_cast_loc_empty_n : IN STD_LOGIC; p_cols_assign_cast_loc_read : OUT STD_LOGIC; img2_data_stream_0_V_din : OUT STD_LOGIC_VECTOR (7 downto 0); img2_data_stream_0_V_full_n : IN STD_LOGIC; img2_data_stream_0_V_write : OUT STD_LOGIC; img2_data_stream_1_V_din : OUT STD_LOGIC_VECTOR (7 downto 0); img2_data_stream_1_V_full_n : IN STD_LOGIC; img2_data_stream_1_V_write : OUT STD_LOGIC; img2_data_stream_2_V_din : OUT STD_LOGIC_VECTOR (7 downto 0); img2_data_stream_2_V_full_n : IN STD_LOGIC; img2_data_stream_2_V_write : OUT STD_LOGIC; img1_data_stream_0_V_dout : IN STD_LOGIC_VECTOR (7 downto 0); img1_data_stream_0_V_empty_n : IN STD_LOGIC; img1_data_stream_0_V_read : OUT STD_LOGIC; img1_data_stream_1_V_dout : IN STD_LOGIC_VECTOR (7 downto 0); img1_data_stream_1_V_empty_n : IN STD_LOGIC; img1_data_stream_1_V_read : OUT STD_LOGIC; img1_data_stream_2_V_dout : IN STD_LOGIC_VECTOR (7 downto 0); img1_data_stream_2_V_empty_n : IN STD_LOGIC; img1_data_stream_2_V_read : OUT STD_LOGIC; min_dout : IN STD_LOGIC_VECTOR (7 downto 0); min_empty_n : IN STD_LOGIC; min_read : OUT STD_LOGIC; tmp_3_cast_loc_dout : IN STD_LOGIC_VECTOR (7 downto 0); tmp_3_cast_loc_empty_n : IN STD_LOGIC; tmp_3_cast_loc_read : OUT STD_LOGIC ); end component; component CvtColor IS port ( ap_clk : IN STD_LOGIC; ap_rst : IN STD_LOGIC; ap_start : IN STD_LOGIC; ap_done : OUT STD_LOGIC; ap_continue : IN STD_LOGIC; ap_idle : OUT STD_LOGIC; ap_ready : OUT STD_LOGIC; p_src_rows_V_dout : IN STD_LOGIC_VECTOR (15 downto 0); p_src_rows_V_empty_n : IN STD_LOGIC; p_src_rows_V_read : OUT STD_LOGIC; p_src_cols_V_dout : IN STD_LOGIC_VECTOR (15 downto 0); p_src_cols_V_empty_n : IN STD_LOGIC; p_src_cols_V_read : OUT STD_LOGIC; p_src_data_stream_0_V_dout : IN STD_LOGIC_VECTOR (7 downto 0); p_src_data_stream_0_V_empty_n : IN STD_LOGIC; p_src_data_stream_0_V_read : OUT STD_LOGIC; p_src_data_stream_1_V_dout : IN STD_LOGIC_VECTOR (7 downto 0); p_src_data_stream_1_V_empty_n : IN STD_LOGIC; p_src_data_stream_1_V_read : OUT STD_LOGIC; p_src_data_stream_2_V_dout : IN STD_LOGIC_VECTOR (7 downto 0); p_src_data_stream_2_V_empty_n : IN STD_LOGIC; p_src_data_stream_2_V_read : OUT STD_LOGIC; p_dst_data_stream_0_V_din : OUT STD_LOGIC_VECTOR (7 downto 0); p_dst_data_stream_0_V_full_n : IN STD_LOGIC; p_dst_data_stream_0_V_write : OUT STD_LOGIC; p_dst_data_stream_1_V_din : OUT STD_LOGIC_VECTOR (7 downto 0); p_dst_data_stream_1_V_full_n : IN STD_LOGIC; p_dst_data_stream_1_V_write : OUT STD_LOGIC; p_dst_data_stream_2_V_din : OUT STD_LOGIC_VECTOR (7 downto 0); p_dst_data_stream_2_V_full_n : IN STD_LOGIC; p_dst_data_stream_2_V_write : OUT STD_LOGIC ); end component; component Mat2AXIvideo IS port ( ap_clk : IN STD_LOGIC; ap_rst : IN STD_LOGIC; ap_start : IN STD_LOGIC; ap_done : OUT STD_LOGIC; ap_continue : IN STD_LOGIC; ap_idle : OUT STD_LOGIC; ap_ready : OUT STD_LOGIC; img_rows_V_dout : IN STD_LOGIC_VECTOR (15 downto 0); img_rows_V_empty_n : IN STD_LOGIC; img_rows_V_read : OUT STD_LOGIC; img_cols_V_dout : IN STD_LOGIC_VECTOR (15 downto 0); img_cols_V_empty_n : IN STD_LOGIC; img_cols_V_read : OUT STD_LOGIC; img_data_stream_0_V_dout : IN STD_LOGIC_VECTOR (7 downto 0); img_data_stream_0_V_empty_n : IN STD_LOGIC; img_data_stream_0_V_read : OUT STD_LOGIC; img_data_stream_1_V_dout : IN STD_LOGIC_VECTOR (7 downto 0); img_data_stream_1_V_empty_n : IN STD_LOGIC; img_data_stream_1_V_read : OUT STD_LOGIC; img_data_stream_2_V_dout : IN STD_LOGIC_VECTOR (7 downto 0); img_data_stream_2_V_empty_n : IN STD_LOGIC; img_data_stream_2_V_read : OUT STD_LOGIC; stream_out_TDATA : OUT STD_LOGIC_VECTOR (23 downto 0); stream_out_TVALID : OUT STD_LOGIC; stream_out_TREADY : IN STD_LOGIC; stream_out_TKEEP : OUT STD_LOGIC_VECTOR (2 downto 0); stream_out_TSTRB : OUT STD_LOGIC_VECTOR (2 downto 0); stream_out_TUSER : OUT STD_LOGIC_VECTOR (0 downto 0); stream_out_TLAST : OUT STD_LOGIC_VECTOR (0 downto 0); stream_out_TID : OUT STD_LOGIC_VECTOR (0 downto 0); stream_out_TDEST : OUT STD_LOGIC_VECTOR (0 downto 0) ); end component; component fifo_w8_d3_A IS port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; if_read_ce : IN STD_LOGIC; if_write_ce : IN STD_LOGIC; if_din : IN STD_LOGIC_VECTOR (7 downto 0); if_full_n : OUT STD_LOGIC; if_write : IN STD_LOGIC; if_dout : OUT STD_LOGIC_VECTOR (7 downto 0); if_empty_n : OUT STD_LOGIC; if_read : IN STD_LOGIC ); end component; component fifo_w16_d1_A IS port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; if_read_ce : IN STD_LOGIC; if_write_ce : IN STD_LOGIC; if_din : IN STD_LOGIC_VECTOR (15 downto 0); if_full_n : OUT STD_LOGIC; if_write : IN STD_LOGIC; if_dout : OUT STD_LOGIC_VECTOR (15 downto 0); if_empty_n : OUT STD_LOGIC; if_read : IN STD_LOGIC ); end component; component fifo_w16_d4_A IS port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; if_read_ce : IN STD_LOGIC; if_write_ce : IN STD_LOGIC; if_din : IN STD_LOGIC_VECTOR (15 downto 0); if_full_n : OUT STD_LOGIC; if_write : IN STD_LOGIC; if_dout : OUT STD_LOGIC_VECTOR (15 downto 0); if_empty_n : OUT STD_LOGIC; if_read : IN STD_LOGIC ); end component; component fifo_w16_d5_A IS port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; if_read_ce : IN STD_LOGIC; if_write_ce : IN STD_LOGIC; if_din : IN STD_LOGIC_VECTOR (15 downto 0); if_full_n : OUT STD_LOGIC; if_write : IN STD_LOGIC; if_dout : OUT STD_LOGIC_VECTOR (15 downto 0); if_empty_n : OUT STD_LOGIC; if_read : IN STD_LOGIC ); end component; component fifo_w12_d3_A IS port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; if_read_ce : IN STD_LOGIC; if_write_ce : IN STD_LOGIC; if_din : IN STD_LOGIC_VECTOR (11 downto 0); if_full_n : OUT STD_LOGIC; if_write : IN STD_LOGIC; if_dout : OUT STD_LOGIC_VECTOR (11 downto 0); if_empty_n : OUT STD_LOGIC; if_read : IN STD_LOGIC ); end component; component fifo_w8_d1_A IS port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; if_read_ce : IN STD_LOGIC; if_write_ce : IN STD_LOGIC; if_din : IN STD_LOGIC_VECTOR (7 downto 0); if_full_n : OUT STD_LOGIC; if_write : IN STD_LOGIC; if_dout : OUT STD_LOGIC_VECTOR (7 downto 0); if_empty_n : OUT STD_LOGIC; if_read : IN STD_LOGIC ); end component; component start_for_Loop_lojbC IS port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; if_read_ce : IN STD_LOGIC; if_write_ce : IN STD_LOGIC; if_din : IN STD_LOGIC_VECTOR (0 downto 0); if_full_n : OUT STD_LOGIC; if_write : IN STD_LOGIC; if_dout : OUT STD_LOGIC_VECTOR (0 downto 0); if_empty_n : OUT STD_LOGIC; if_read : IN STD_LOGIC ); end component; component start_for_CvtColokbM IS port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; if_read_ce : IN STD_LOGIC; if_write_ce : IN STD_LOGIC; if_din : IN STD_LOGIC_VECTOR (0 downto 0); if_full_n : OUT STD_LOGIC; if_write : IN STD_LOGIC; if_dout : OUT STD_LOGIC_VECTOR (0 downto 0); if_empty_n : OUT STD_LOGIC; if_read : IN STD_LOGIC ); end component; component start_for_Mat2AXIlbW IS port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; if_read_ce : IN STD_LOGIC; if_write_ce : IN STD_LOGIC; if_din : IN STD_LOGIC_VECTOR (0 downto 0); if_full_n : OUT STD_LOGIC; if_write : IN STD_LOGIC; if_dout : OUT STD_LOGIC_VECTOR (0 downto 0); if_empty_n : OUT STD_LOGIC; if_read : IN STD_LOGIC ); end component; component start_for_CvtColomb6 IS port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; if_read_ce : IN STD_LOGIC; if_write_ce : IN STD_LOGIC; if_din : IN STD_LOGIC_VECTOR (0 downto 0); if_full_n : OUT STD_LOGIC; if_write : IN STD_LOGIC; if_dout : OUT STD_LOGIC_VECTOR (0 downto 0); if_empty_n : OUT STD_LOGIC; if_read : IN STD_LOGIC ); end component; component hls_contrast_stretch_AXILiteS_s_axi IS generic ( C_S_AXI_ADDR_WIDTH : INTEGER; C_S_AXI_DATA_WIDTH : INTEGER ); port ( AWVALID : IN STD_LOGIC; AWREADY : OUT STD_LOGIC; AWADDR : IN STD_LOGIC_VECTOR (C_S_AXI_ADDR_WIDTH-1 downto 0); WVALID : IN STD_LOGIC; WREADY : OUT STD_LOGIC; WDATA : IN STD_LOGIC_VECTOR (C_S_AXI_DATA_WIDTH-1 downto 0); WSTRB : IN STD_LOGIC_VECTOR (C_S_AXI_DATA_WIDTH/8-1 downto 0); ARVALID : IN STD_LOGIC; ARREADY : OUT STD_LOGIC; ARADDR : IN STD_LOGIC_VECTOR (C_S_AXI_ADDR_WIDTH-1 downto 0); RVALID : OUT STD_LOGIC; RREADY : IN STD_LOGIC; RDATA : OUT STD_LOGIC_VECTOR (C_S_AXI_DATA_WIDTH-1 downto 0); RRESP : OUT STD_LOGIC_VECTOR (1 downto 0); BVALID : OUT STD_LOGIC; BREADY : IN STD_LOGIC; BRESP : OUT STD_LOGIC_VECTOR (1 downto 0); ACLK : IN STD_LOGIC; ARESET : IN STD_LOGIC; ACLK_EN : IN STD_LOGIC; height : OUT STD_LOGIC_VECTOR (15 downto 0); width : OUT STD_LOGIC_VECTOR (15 downto 0); min : OUT STD_LOGIC_VECTOR (7 downto 0); max : OUT STD_LOGIC_VECTOR (7 downto 0) ); end component; begin hls_contrast_stretch_AXILiteS_s_axi_U : component hls_contrast_stretch_AXILiteS_s_axi generic map ( C_S_AXI_ADDR_WIDTH => C_S_AXI_AXILITES_ADDR_WIDTH, C_S_AXI_DATA_WIDTH => C_S_AXI_AXILITES_DATA_WIDTH) port map ( AWVALID => s_axi_AXILiteS_AWVALID, AWREADY => s_axi_AXILiteS_AWREADY, AWADDR => s_axi_AXILiteS_AWADDR, WVALID => s_axi_AXILiteS_WVALID, WREADY => s_axi_AXILiteS_WREADY, WDATA => s_axi_AXILiteS_WDATA, WSTRB => s_axi_AXILiteS_WSTRB, ARVALID => s_axi_AXILiteS_ARVALID, ARREADY => s_axi_AXILiteS_ARREADY, ARADDR => s_axi_AXILiteS_ARADDR, RVALID => s_axi_AXILiteS_RVALID, RREADY => s_axi_AXILiteS_RREADY, RDATA => s_axi_AXILiteS_RDATA, RRESP => s_axi_AXILiteS_RRESP, BVALID => s_axi_AXILiteS_BVALID, BREADY => s_axi_AXILiteS_BREADY, BRESP => s_axi_AXILiteS_BRESP, ACLK => ap_clk, ARESET => ap_rst_n_inv, ACLK_EN => ap_const_logic_1, height => height, width => width, min => min, max => max); Block_Mat_exit1573_p_U0 : component Block_Mat_exit1573_p port map ( ap_clk => ap_clk, ap_rst => ap_rst_n_inv, ap_start => Block_Mat_exit1573_p_U0_ap_start, start_full_n => Block_Mat_exit1573_p_U0_start_full_n, ap_done => Block_Mat_exit1573_p_U0_ap_done, ap_continue => Block_Mat_exit1573_p_U0_ap_continue, ap_idle => Block_Mat_exit1573_p_U0_ap_idle, ap_ready => Block_Mat_exit1573_p_U0_ap_ready, start_out => Block_Mat_exit1573_p_U0_start_out, start_write => Block_Mat_exit1573_p_U0_start_write, height => height, width => width, min => min, max => max, min_out_din => Block_Mat_exit1573_p_U0_min_out_din, min_out_full_n => min_c_full_n, min_out_write => Block_Mat_exit1573_p_U0_min_out_write, img0_rows_V_out_din => Block_Mat_exit1573_p_U0_img0_rows_V_out_din, img0_rows_V_out_full_n => img0_rows_V_c_full_n, img0_rows_V_out_write => Block_Mat_exit1573_p_U0_img0_rows_V_out_write, img0_cols_V_out_din => Block_Mat_exit1573_p_U0_img0_cols_V_out_din, img0_cols_V_out_full_n => img0_cols_V_c_full_n, img0_cols_V_out_write => Block_Mat_exit1573_p_U0_img0_cols_V_out_write, img2_rows_V_out_din => Block_Mat_exit1573_p_U0_img2_rows_V_out_din, img2_rows_V_out_full_n => img2_rows_V_c_full_n, img2_rows_V_out_write => Block_Mat_exit1573_p_U0_img2_rows_V_out_write, img2_cols_V_out_din => Block_Mat_exit1573_p_U0_img2_cols_V_out_din, img2_cols_V_out_full_n => img2_cols_V_c_full_n, img2_cols_V_out_write => Block_Mat_exit1573_p_U0_img2_cols_V_out_write, img3_rows_V_out_din => Block_Mat_exit1573_p_U0_img3_rows_V_out_din, img3_rows_V_out_full_n => img3_rows_V_c_full_n, img3_rows_V_out_write => Block_Mat_exit1573_p_U0_img3_rows_V_out_write, img3_cols_V_out_din => Block_Mat_exit1573_p_U0_img3_cols_V_out_din, img3_cols_V_out_full_n => img3_cols_V_c_full_n, img3_cols_V_out_write => Block_Mat_exit1573_p_U0_img3_cols_V_out_write, p_cols_assign_cast_out_out_din => Block_Mat_exit1573_p_U0_p_cols_assign_cast_out_out_din, p_cols_assign_cast_out_out_full_n => p_cols_assign_cast_lo_full_n, p_cols_assign_cast_out_out_write => Block_Mat_exit1573_p_U0_p_cols_assign_cast_out_out_write, p_rows_assign_cast_out_out_din => Block_Mat_exit1573_p_U0_p_rows_assign_cast_out_out_din, p_rows_assign_cast_out_out_full_n => p_rows_assign_cast_lo_full_n, p_rows_assign_cast_out_out_write => Block_Mat_exit1573_p_U0_p_rows_assign_cast_out_out_write, tmp_3_cast_out_out_din => Block_Mat_exit1573_p_U0_tmp_3_cast_out_out_din, tmp_3_cast_out_out_full_n => tmp_3_cast_loc_c_full_n, tmp_3_cast_out_out_write => Block_Mat_exit1573_p_U0_tmp_3_cast_out_out_write, max_out_din => Block_Mat_exit1573_p_U0_max_out_din, max_out_full_n => max_c_full_n, max_out_write => Block_Mat_exit1573_p_U0_max_out_write); AXIvideo2Mat_U0 : component AXIvideo2Mat port map ( ap_clk => ap_clk, ap_rst => ap_rst_n_inv, ap_start => AXIvideo2Mat_U0_ap_start, start_full_n => start_for_CvtColor_1_U0_full_n, ap_done => AXIvideo2Mat_U0_ap_done, ap_continue => AXIvideo2Mat_U0_ap_continue, ap_idle => AXIvideo2Mat_U0_ap_idle, ap_ready => AXIvideo2Mat_U0_ap_ready, start_out => AXIvideo2Mat_U0_start_out, start_write => AXIvideo2Mat_U0_start_write, stream_in_TDATA => stream_in_TDATA, stream_in_TVALID => stream_in_TVALID, stream_in_TREADY => AXIvideo2Mat_U0_stream_in_TREADY, stream_in_TKEEP => stream_in_TKEEP, stream_in_TSTRB => stream_in_TSTRB, stream_in_TUSER => stream_in_TUSER, stream_in_TLAST => stream_in_TLAST, stream_in_TID => stream_in_TID, stream_in_TDEST => stream_in_TDEST, img_rows_V_dout => img0_rows_V_c_dout, img_rows_V_empty_n => img0_rows_V_c_empty_n, img_rows_V_read => AXIvideo2Mat_U0_img_rows_V_read, img_cols_V_dout => img0_cols_V_c_dout, img_cols_V_empty_n => img0_cols_V_c_empty_n, img_cols_V_read => AXIvideo2Mat_U0_img_cols_V_read, img_data_stream_0_V_din => AXIvideo2Mat_U0_img_data_stream_0_V_din, img_data_stream_0_V_full_n => img0_data_stream_0_s_full_n, img_data_stream_0_V_write => AXIvideo2Mat_U0_img_data_stream_0_V_write, img_data_stream_1_V_din => AXIvideo2Mat_U0_img_data_stream_1_V_din, img_data_stream_1_V_full_n => img0_data_stream_1_s_full_n, img_data_stream_1_V_write => AXIvideo2Mat_U0_img_data_stream_1_V_write, img_data_stream_2_V_din => AXIvideo2Mat_U0_img_data_stream_2_V_din, img_data_stream_2_V_full_n => img0_data_stream_2_s_full_n, img_data_stream_2_V_write => AXIvideo2Mat_U0_img_data_stream_2_V_write, img_rows_V_out_din => AXIvideo2Mat_U0_img_rows_V_out_din, img_rows_V_out_full_n => img0_rows_V_c83_full_n, img_rows_V_out_write => AXIvideo2Mat_U0_img_rows_V_out_write, img_cols_V_out_din => AXIvideo2Mat_U0_img_cols_V_out_din, img_cols_V_out_full_n => img0_cols_V_c84_full_n, img_cols_V_out_write => AXIvideo2Mat_U0_img_cols_V_out_write); CvtColor_1_U0 : component CvtColor_1 port map ( ap_clk => ap_clk, ap_rst => ap_rst_n_inv, ap_start => CvtColor_1_U0_ap_start, ap_done => CvtColor_1_U0_ap_done, ap_continue => CvtColor_1_U0_ap_continue, ap_idle => CvtColor_1_U0_ap_idle, ap_ready => CvtColor_1_U0_ap_ready, p_src_rows_V_dout => img0_rows_V_c83_dout, p_src_rows_V_empty_n => img0_rows_V_c83_empty_n, p_src_rows_V_read => CvtColor_1_U0_p_src_rows_V_read, p_src_cols_V_dout => img0_cols_V_c84_dout, p_src_cols_V_empty_n => img0_cols_V_c84_empty_n, p_src_cols_V_read => CvtColor_1_U0_p_src_cols_V_read, p_src_data_stream_0_V_dout => img0_data_stream_0_s_dout, p_src_data_stream_0_V_empty_n => img0_data_stream_0_s_empty_n, p_src_data_stream_0_V_read => CvtColor_1_U0_p_src_data_stream_0_V_read, p_src_data_stream_1_V_dout => img0_data_stream_1_s_dout, p_src_data_stream_1_V_empty_n => img0_data_stream_1_s_empty_n, p_src_data_stream_1_V_read => CvtColor_1_U0_p_src_data_stream_1_V_read, p_src_data_stream_2_V_dout => img0_data_stream_2_s_dout, p_src_data_stream_2_V_empty_n => img0_data_stream_2_s_empty_n, p_src_data_stream_2_V_read => CvtColor_1_U0_p_src_data_stream_2_V_read, p_dst_data_stream_0_V_din => CvtColor_1_U0_p_dst_data_stream_0_V_din, p_dst_data_stream_0_V_full_n => img1_data_stream_0_s_full_n, p_dst_data_stream_0_V_write => CvtColor_1_U0_p_dst_data_stream_0_V_write, p_dst_data_stream_1_V_din => CvtColor_1_U0_p_dst_data_stream_1_V_din, p_dst_data_stream_1_V_full_n => img1_data_stream_1_s_full_n, p_dst_data_stream_1_V_write => CvtColor_1_U0_p_dst_data_stream_1_V_write, p_dst_data_stream_2_V_din => CvtColor_1_U0_p_dst_data_stream_2_V_din, p_dst_data_stream_2_V_full_n => img1_data_stream_2_s_full_n, p_dst_data_stream_2_V_write => CvtColor_1_U0_p_dst_data_stream_2_V_write); Loop_loop_height_pro_U0 : component Loop_loop_height_pro port map ( ap_clk => ap_clk, ap_rst => ap_rst_n_inv, ap_start => Loop_loop_height_pro_U0_ap_start, ap_done => Loop_loop_height_pro_U0_ap_done, ap_continue => Loop_loop_height_pro_U0_ap_continue, ap_idle => Loop_loop_height_pro_U0_ap_idle, ap_ready => Loop_loop_height_pro_U0_ap_ready, max_dout => max_c_dout, max_empty_n => max_c_empty_n, max_read => Loop_loop_height_pro_U0_max_read, p_rows_assign_cast_loc_dout => p_rows_assign_cast_lo_dout, p_rows_assign_cast_loc_empty_n => p_rows_assign_cast_lo_empty_n, p_rows_assign_cast_loc_read => Loop_loop_height_pro_U0_p_rows_assign_cast_loc_read, p_cols_assign_cast_loc_dout => p_cols_assign_cast_lo_dout, p_cols_assign_cast_loc_empty_n => p_cols_assign_cast_lo_empty_n, p_cols_assign_cast_loc_read => Loop_loop_height_pro_U0_p_cols_assign_cast_loc_read, img2_data_stream_0_V_din => Loop_loop_height_pro_U0_img2_data_stream_0_V_din, img2_data_stream_0_V_full_n => img2_data_stream_0_s_full_n, img2_data_stream_0_V_write => Loop_loop_height_pro_U0_img2_data_stream_0_V_write, img2_data_stream_1_V_din => Loop_loop_height_pro_U0_img2_data_stream_1_V_din, img2_data_stream_1_V_full_n => img2_data_stream_1_s_full_n, img2_data_stream_1_V_write => Loop_loop_height_pro_U0_img2_data_stream_1_V_write, img2_data_stream_2_V_din => Loop_loop_height_pro_U0_img2_data_stream_2_V_din, img2_data_stream_2_V_full_n => img2_data_stream_2_s_full_n, img2_data_stream_2_V_write => Loop_loop_height_pro_U0_img2_data_stream_2_V_write, img1_data_stream_0_V_dout => img1_data_stream_0_s_dout, img1_data_stream_0_V_empty_n => img1_data_stream_0_s_empty_n, img1_data_stream_0_V_read => Loop_loop_height_pro_U0_img1_data_stream_0_V_read, img1_data_stream_1_V_dout => img1_data_stream_1_s_dout, img1_data_stream_1_V_empty_n => img1_data_stream_1_s_empty_n, img1_data_stream_1_V_read => Loop_loop_height_pro_U0_img1_data_stream_1_V_read, img1_data_stream_2_V_dout => img1_data_stream_2_s_dout, img1_data_stream_2_V_empty_n => img1_data_stream_2_s_empty_n, img1_data_stream_2_V_read => Loop_loop_height_pro_U0_img1_data_stream_2_V_read, min_dout => min_c_dout, min_empty_n => min_c_empty_n, min_read => Loop_loop_height_pro_U0_min_read, tmp_3_cast_loc_dout => tmp_3_cast_loc_c_dout, tmp_3_cast_loc_empty_n => tmp_3_cast_loc_c_empty_n, tmp_3_cast_loc_read => Loop_loop_height_pro_U0_tmp_3_cast_loc_read); CvtColor_U0 : component CvtColor port map ( ap_clk => ap_clk, ap_rst => ap_rst_n_inv, ap_start => CvtColor_U0_ap_start, ap_done => CvtColor_U0_ap_done, ap_continue => CvtColor_U0_ap_continue, ap_idle => CvtColor_U0_ap_idle, ap_ready => CvtColor_U0_ap_ready, p_src_rows_V_dout => img2_rows_V_c_dout, p_src_rows_V_empty_n => img2_rows_V_c_empty_n, p_src_rows_V_read => CvtColor_U0_p_src_rows_V_read, p_src_cols_V_dout => img2_cols_V_c_dout, p_src_cols_V_empty_n => img2_cols_V_c_empty_n, p_src_cols_V_read => CvtColor_U0_p_src_cols_V_read, p_src_data_stream_0_V_dout => img2_data_stream_0_s_dout, p_src_data_stream_0_V_empty_n => img2_data_stream_0_s_empty_n, p_src_data_stream_0_V_read => CvtColor_U0_p_src_data_stream_0_V_read, p_src_data_stream_1_V_dout => img2_data_stream_1_s_dout, p_src_data_stream_1_V_empty_n => img2_data_stream_1_s_empty_n, p_src_data_stream_1_V_read => CvtColor_U0_p_src_data_stream_1_V_read, p_src_data_stream_2_V_dout => img2_data_stream_2_s_dout, p_src_data_stream_2_V_empty_n => img2_data_stream_2_s_empty_n, p_src_data_stream_2_V_read => CvtColor_U0_p_src_data_stream_2_V_read, p_dst_data_stream_0_V_din => CvtColor_U0_p_dst_data_stream_0_V_din, p_dst_data_stream_0_V_full_n => img3_data_stream_0_s_full_n, p_dst_data_stream_0_V_write => CvtColor_U0_p_dst_data_stream_0_V_write, p_dst_data_stream_1_V_din => CvtColor_U0_p_dst_data_stream_1_V_din, p_dst_data_stream_1_V_full_n => img3_data_stream_1_s_full_n, p_dst_data_stream_1_V_write => CvtColor_U0_p_dst_data_stream_1_V_write, p_dst_data_stream_2_V_din => CvtColor_U0_p_dst_data_stream_2_V_din, p_dst_data_stream_2_V_full_n => img3_data_stream_2_s_full_n, p_dst_data_stream_2_V_write => CvtColor_U0_p_dst_data_stream_2_V_write); Mat2AXIvideo_U0 : component Mat2AXIvideo port map ( ap_clk => ap_clk, ap_rst => ap_rst_n_inv, ap_start => Mat2AXIvideo_U0_ap_start, ap_done => Mat2AXIvideo_U0_ap_done, ap_continue => Mat2AXIvideo_U0_ap_continue, ap_idle => Mat2AXIvideo_U0_ap_idle, ap_ready => Mat2AXIvideo_U0_ap_ready, img_rows_V_dout => img3_rows_V_c_dout, img_rows_V_empty_n => img3_rows_V_c_empty_n, img_rows_V_read => Mat2AXIvideo_U0_img_rows_V_read, img_cols_V_dout => img3_cols_V_c_dout, img_cols_V_empty_n => img3_cols_V_c_empty_n, img_cols_V_read => Mat2AXIvideo_U0_img_cols_V_read, img_data_stream_0_V_dout => img3_data_stream_0_s_dout, img_data_stream_0_V_empty_n => img3_data_stream_0_s_empty_n, img_data_stream_0_V_read => Mat2AXIvideo_U0_img_data_stream_0_V_read, img_data_stream_1_V_dout => img3_data_stream_1_s_dout, img_data_stream_1_V_empty_n => img3_data_stream_1_s_empty_n, img_data_stream_1_V_read => Mat2AXIvideo_U0_img_data_stream_1_V_read, img_data_stream_2_V_dout => img3_data_stream_2_s_dout, img_data_stream_2_V_empty_n => img3_data_stream_2_s_empty_n, img_data_stream_2_V_read => Mat2AXIvideo_U0_img_data_stream_2_V_read, stream_out_TDATA => Mat2AXIvideo_U0_stream_out_TDATA, stream_out_TVALID => Mat2AXIvideo_U0_stream_out_TVALID, stream_out_TREADY => stream_out_TREADY, stream_out_TKEEP => Mat2AXIvideo_U0_stream_out_TKEEP, stream_out_TSTRB => Mat2AXIvideo_U0_stream_out_TSTRB, stream_out_TUSER => Mat2AXIvideo_U0_stream_out_TUSER, stream_out_TLAST => Mat2AXIvideo_U0_stream_out_TLAST, stream_out_TID => Mat2AXIvideo_U0_stream_out_TID, stream_out_TDEST => Mat2AXIvideo_U0_stream_out_TDEST); min_c_U : component fifo_w8_d3_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => Block_Mat_exit1573_p_U0_min_out_din, if_full_n => min_c_full_n, if_write => Block_Mat_exit1573_p_U0_min_out_write, if_dout => min_c_dout, if_empty_n => min_c_empty_n, if_read => Loop_loop_height_pro_U0_min_read); img0_rows_V_c_U : component fifo_w16_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => Block_Mat_exit1573_p_U0_img0_rows_V_out_din, if_full_n => img0_rows_V_c_full_n, if_write => Block_Mat_exit1573_p_U0_img0_rows_V_out_write, if_dout => img0_rows_V_c_dout, if_empty_n => img0_rows_V_c_empty_n, if_read => AXIvideo2Mat_U0_img_rows_V_read); img0_cols_V_c_U : component fifo_w16_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => Block_Mat_exit1573_p_U0_img0_cols_V_out_din, if_full_n => img0_cols_V_c_full_n, if_write => Block_Mat_exit1573_p_U0_img0_cols_V_out_write, if_dout => img0_cols_V_c_dout, if_empty_n => img0_cols_V_c_empty_n, if_read => AXIvideo2Mat_U0_img_cols_V_read); img2_rows_V_c_U : component fifo_w16_d4_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => Block_Mat_exit1573_p_U0_img2_rows_V_out_din, if_full_n => img2_rows_V_c_full_n, if_write => Block_Mat_exit1573_p_U0_img2_rows_V_out_write, if_dout => img2_rows_V_c_dout, if_empty_n => img2_rows_V_c_empty_n, if_read => CvtColor_U0_p_src_rows_V_read); img2_cols_V_c_U : component fifo_w16_d4_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => Block_Mat_exit1573_p_U0_img2_cols_V_out_din, if_full_n => img2_cols_V_c_full_n, if_write => Block_Mat_exit1573_p_U0_img2_cols_V_out_write, if_dout => img2_cols_V_c_dout, if_empty_n => img2_cols_V_c_empty_n, if_read => CvtColor_U0_p_src_cols_V_read); img3_rows_V_c_U : component fifo_w16_d5_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => Block_Mat_exit1573_p_U0_img3_rows_V_out_din, if_full_n => img3_rows_V_c_full_n, if_write => Block_Mat_exit1573_p_U0_img3_rows_V_out_write, if_dout => img3_rows_V_c_dout, if_empty_n => img3_rows_V_c_empty_n, if_read => Mat2AXIvideo_U0_img_rows_V_read); img3_cols_V_c_U : component fifo_w16_d5_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => Block_Mat_exit1573_p_U0_img3_cols_V_out_din, if_full_n => img3_cols_V_c_full_n, if_write => Block_Mat_exit1573_p_U0_img3_cols_V_out_write, if_dout => img3_cols_V_c_dout, if_empty_n => img3_cols_V_c_empty_n, if_read => Mat2AXIvideo_U0_img_cols_V_read); p_cols_assign_cast_lo_U : component fifo_w12_d3_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => Block_Mat_exit1573_p_U0_p_cols_assign_cast_out_out_din, if_full_n => p_cols_assign_cast_lo_full_n, if_write => Block_Mat_exit1573_p_U0_p_cols_assign_cast_out_out_write, if_dout => p_cols_assign_cast_lo_dout, if_empty_n => p_cols_assign_cast_lo_empty_n, if_read => Loop_loop_height_pro_U0_p_cols_assign_cast_loc_read); p_rows_assign_cast_lo_U : component fifo_w12_d3_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => Block_Mat_exit1573_p_U0_p_rows_assign_cast_out_out_din, if_full_n => p_rows_assign_cast_lo_full_n, if_write => Block_Mat_exit1573_p_U0_p_rows_assign_cast_out_out_write, if_dout => p_rows_assign_cast_lo_dout, if_empty_n => p_rows_assign_cast_lo_empty_n, if_read => Loop_loop_height_pro_U0_p_rows_assign_cast_loc_read); tmp_3_cast_loc_c_U : component fifo_w8_d3_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => Block_Mat_exit1573_p_U0_tmp_3_cast_out_out_din, if_full_n => tmp_3_cast_loc_c_full_n, if_write => Block_Mat_exit1573_p_U0_tmp_3_cast_out_out_write, if_dout => tmp_3_cast_loc_c_dout, if_empty_n => tmp_3_cast_loc_c_empty_n, if_read => Loop_loop_height_pro_U0_tmp_3_cast_loc_read); max_c_U : component fifo_w8_d3_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => Block_Mat_exit1573_p_U0_max_out_din, if_full_n => max_c_full_n, if_write => Block_Mat_exit1573_p_U0_max_out_write, if_dout => max_c_dout, if_empty_n => max_c_empty_n, if_read => Loop_loop_height_pro_U0_max_read); img0_data_stream_0_s_U : component fifo_w8_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => AXIvideo2Mat_U0_img_data_stream_0_V_din, if_full_n => img0_data_stream_0_s_full_n, if_write => AXIvideo2Mat_U0_img_data_stream_0_V_write, if_dout => img0_data_stream_0_s_dout, if_empty_n => img0_data_stream_0_s_empty_n, if_read => CvtColor_1_U0_p_src_data_stream_0_V_read); img0_data_stream_1_s_U : component fifo_w8_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => AXIvideo2Mat_U0_img_data_stream_1_V_din, if_full_n => img0_data_stream_1_s_full_n, if_write => AXIvideo2Mat_U0_img_data_stream_1_V_write, if_dout => img0_data_stream_1_s_dout, if_empty_n => img0_data_stream_1_s_empty_n, if_read => CvtColor_1_U0_p_src_data_stream_1_V_read); img0_data_stream_2_s_U : component fifo_w8_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => AXIvideo2Mat_U0_img_data_stream_2_V_din, if_full_n => img0_data_stream_2_s_full_n, if_write => AXIvideo2Mat_U0_img_data_stream_2_V_write, if_dout => img0_data_stream_2_s_dout, if_empty_n => img0_data_stream_2_s_empty_n, if_read => CvtColor_1_U0_p_src_data_stream_2_V_read); img0_rows_V_c83_U : component fifo_w16_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => AXIvideo2Mat_U0_img_rows_V_out_din, if_full_n => img0_rows_V_c83_full_n, if_write => AXIvideo2Mat_U0_img_rows_V_out_write, if_dout => img0_rows_V_c83_dout, if_empty_n => img0_rows_V_c83_empty_n, if_read => CvtColor_1_U0_p_src_rows_V_read); img0_cols_V_c84_U : component fifo_w16_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => AXIvideo2Mat_U0_img_cols_V_out_din, if_full_n => img0_cols_V_c84_full_n, if_write => AXIvideo2Mat_U0_img_cols_V_out_write, if_dout => img0_cols_V_c84_dout, if_empty_n => img0_cols_V_c84_empty_n, if_read => CvtColor_1_U0_p_src_cols_V_read); img1_data_stream_0_s_U : component fifo_w8_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => CvtColor_1_U0_p_dst_data_stream_0_V_din, if_full_n => img1_data_stream_0_s_full_n, if_write => CvtColor_1_U0_p_dst_data_stream_0_V_write, if_dout => img1_data_stream_0_s_dout, if_empty_n => img1_data_stream_0_s_empty_n, if_read => Loop_loop_height_pro_U0_img1_data_stream_0_V_read); img1_data_stream_1_s_U : component fifo_w8_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => CvtColor_1_U0_p_dst_data_stream_1_V_din, if_full_n => img1_data_stream_1_s_full_n, if_write => CvtColor_1_U0_p_dst_data_stream_1_V_write, if_dout => img1_data_stream_1_s_dout, if_empty_n => img1_data_stream_1_s_empty_n, if_read => Loop_loop_height_pro_U0_img1_data_stream_1_V_read); img1_data_stream_2_s_U : component fifo_w8_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => CvtColor_1_U0_p_dst_data_stream_2_V_din, if_full_n => img1_data_stream_2_s_full_n, if_write => CvtColor_1_U0_p_dst_data_stream_2_V_write, if_dout => img1_data_stream_2_s_dout, if_empty_n => img1_data_stream_2_s_empty_n, if_read => Loop_loop_height_pro_U0_img1_data_stream_2_V_read); img2_data_stream_0_s_U : component fifo_w8_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => Loop_loop_height_pro_U0_img2_data_stream_0_V_din, if_full_n => img2_data_stream_0_s_full_n, if_write => Loop_loop_height_pro_U0_img2_data_stream_0_V_write, if_dout => img2_data_stream_0_s_dout, if_empty_n => img2_data_stream_0_s_empty_n, if_read => CvtColor_U0_p_src_data_stream_0_V_read); img2_data_stream_1_s_U : component fifo_w8_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => Loop_loop_height_pro_U0_img2_data_stream_1_V_din, if_full_n => img2_data_stream_1_s_full_n, if_write => Loop_loop_height_pro_U0_img2_data_stream_1_V_write, if_dout => img2_data_stream_1_s_dout, if_empty_n => img2_data_stream_1_s_empty_n, if_read => CvtColor_U0_p_src_data_stream_1_V_read); img2_data_stream_2_s_U : component fifo_w8_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => Loop_loop_height_pro_U0_img2_data_stream_2_V_din, if_full_n => img2_data_stream_2_s_full_n, if_write => Loop_loop_height_pro_U0_img2_data_stream_2_V_write, if_dout => img2_data_stream_2_s_dout, if_empty_n => img2_data_stream_2_s_empty_n, if_read => CvtColor_U0_p_src_data_stream_2_V_read); img3_data_stream_0_s_U : component fifo_w8_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => CvtColor_U0_p_dst_data_stream_0_V_din, if_full_n => img3_data_stream_0_s_full_n, if_write => CvtColor_U0_p_dst_data_stream_0_V_write, if_dout => img3_data_stream_0_s_dout, if_empty_n => img3_data_stream_0_s_empty_n, if_read => Mat2AXIvideo_U0_img_data_stream_0_V_read); img3_data_stream_1_s_U : component fifo_w8_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => CvtColor_U0_p_dst_data_stream_1_V_din, if_full_n => img3_data_stream_1_s_full_n, if_write => CvtColor_U0_p_dst_data_stream_1_V_write, if_dout => img3_data_stream_1_s_dout, if_empty_n => img3_data_stream_1_s_empty_n, if_read => Mat2AXIvideo_U0_img_data_stream_1_V_read); img3_data_stream_2_s_U : component fifo_w8_d1_A port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => CvtColor_U0_p_dst_data_stream_2_V_din, if_full_n => img3_data_stream_2_s_full_n, if_write => CvtColor_U0_p_dst_data_stream_2_V_write, if_dout => img3_data_stream_2_s_dout, if_empty_n => img3_data_stream_2_s_empty_n, if_read => Mat2AXIvideo_U0_img_data_stream_2_V_read); start_for_Loop_lojbC_U : component start_for_Loop_lojbC port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => start_for_Loop_loop_height_pro_U0_din, if_full_n => start_for_Loop_loop_height_pro_U0_full_n, if_write => Block_Mat_exit1573_p_U0_start_write, if_dout => start_for_Loop_loop_height_pro_U0_dout, if_empty_n => start_for_Loop_loop_height_pro_U0_empty_n, if_read => Loop_loop_height_pro_U0_ap_ready); start_for_CvtColokbM_U : component start_for_CvtColokbM port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => start_for_CvtColor_U0_din, if_full_n => start_for_CvtColor_U0_full_n, if_write => Block_Mat_exit1573_p_U0_start_write, if_dout => start_for_CvtColor_U0_dout, if_empty_n => start_for_CvtColor_U0_empty_n, if_read => CvtColor_U0_ap_ready); start_for_Mat2AXIlbW_U : component start_for_Mat2AXIlbW port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => start_for_Mat2AXIvideo_U0_din, if_full_n => start_for_Mat2AXIvideo_U0_full_n, if_write => Block_Mat_exit1573_p_U0_start_write, if_dout => start_for_Mat2AXIvideo_U0_dout, if_empty_n => start_for_Mat2AXIvideo_U0_empty_n, if_read => Mat2AXIvideo_U0_ap_ready); start_for_CvtColomb6_U : component start_for_CvtColomb6 port map ( clk => ap_clk, reset => ap_rst_n_inv, if_read_ce => ap_const_logic_1, if_write_ce => ap_const_logic_1, if_din => start_for_CvtColor_1_U0_din, if_full_n => start_for_CvtColor_1_U0_full_n, if_write => AXIvideo2Mat_U0_start_write, if_dout => start_for_CvtColor_1_U0_dout, if_empty_n => start_for_CvtColor_1_U0_empty_n, if_read => CvtColor_1_U0_ap_ready); AXIvideo2Mat_U0_ap_continue <= ap_const_logic_1; AXIvideo2Mat_U0_ap_start <= ap_const_logic_1; Block_Mat_exit1573_p_U0_ap_continue <= ap_const_logic_1; Block_Mat_exit1573_p_U0_ap_start <= ap_const_logic_1; Block_Mat_exit1573_p_U0_start_full_n <= (start_for_Mat2AXIvideo_U0_full_n and start_for_Loop_loop_height_pro_U0_full_n and start_for_CvtColor_U0_full_n); CvtColor_1_U0_ap_continue <= ap_const_logic_1; CvtColor_1_U0_ap_start <= start_for_CvtColor_1_U0_empty_n; CvtColor_1_U0_start_full_n <= ap_const_logic_1; CvtColor_1_U0_start_write <= ap_const_logic_0; CvtColor_U0_ap_continue <= ap_const_logic_1; CvtColor_U0_ap_start <= start_for_CvtColor_U0_empty_n; CvtColor_U0_start_full_n <= ap_const_logic_1; CvtColor_U0_start_write <= ap_const_logic_0; Loop_loop_height_pro_U0_ap_continue <= ap_const_logic_1; Loop_loop_height_pro_U0_ap_start <= start_for_Loop_loop_height_pro_U0_empty_n; Loop_loop_height_pro_U0_start_full_n <= ap_const_logic_1; Loop_loop_height_pro_U0_start_write <= ap_const_logic_0; Mat2AXIvideo_U0_ap_continue <= ap_const_logic_1; Mat2AXIvideo_U0_ap_start <= start_for_Mat2AXIvideo_U0_empty_n; Mat2AXIvideo_U0_start_full_n <= ap_const_logic_1; Mat2AXIvideo_U0_start_write <= ap_const_logic_0; ap_rst_n_inv_assign_proc : process(ap_rst_n) begin ap_rst_n_inv <= not(ap_rst_n); end process; ap_sync_continue <= ap_const_logic_0; start_for_CvtColor_1_U0_din <= (0=>ap_const_logic_1, others=>'-'); start_for_CvtColor_U0_din <= (0=>ap_const_logic_1, others=>'-'); start_for_Loop_loop_height_pro_U0_din <= (0=>ap_const_logic_1, others=>'-'); start_for_Mat2AXIvideo_U0_din <= (0=>ap_const_logic_1, others=>'-'); stream_in_TREADY <= AXIvideo2Mat_U0_stream_in_TREADY; stream_out_TDATA <= Mat2AXIvideo_U0_stream_out_TDATA; stream_out_TDEST <= Mat2AXIvideo_U0_stream_out_TDEST; stream_out_TID <= Mat2AXIvideo_U0_stream_out_TID; stream_out_TKEEP <= Mat2AXIvideo_U0_stream_out_TKEEP; stream_out_TLAST <= Mat2AXIvideo_U0_stream_out_TLAST; stream_out_TSTRB <= Mat2AXIvideo_U0_stream_out_TSTRB; stream_out_TUSER <= Mat2AXIvideo_U0_stream_out_TUSER; stream_out_TVALID <= Mat2AXIvideo_U0_stream_out_TVALID; end behav;
-- ------------------------------------------------------------- -- -- Generated Configuration for ent_a -- -- Generated -- by: wig -- on: Mon Jul 18 16:07:02 2005 -- cmd: h:/work/eclipse/mix/mix_0.pl -sheet HIER=HIER_VHDL -strip -nodelta ../../verilog.xls -- -- !!! Do not edit this file! Autogenerated by MIX !!! -- $Author: wig $ -- $Id: ent_a-rtl-conf-c.vhd,v 1.3 2005/07/19 07:13:12 wig Exp $ -- $Date: 2005/07/19 07:13:12 $ -- $Log: ent_a-rtl-conf-c.vhd,v $ -- Revision 1.3 2005/07/19 07:13:12 wig -- Update testcases. Added highlow/nolowbus -- -- -- Based on Mix Entity Template built into RCSfile: MixWriter.pm,v -- Id: MixWriter.pm,v 1.57 2005/07/18 08:58:22 wig Exp -- -- Generator: mix_0.pl Version: Revision: 1.36 , [email protected] -- (C) 2003 Micronas GmbH -- -- -------------------------------------------------------------- library IEEE; use IEEE.std_logic_1164.all; -- No project specific VHDL libraries/conf -- -- Start of Generated Configuration ent_a_rtl_conf / ent_a -- configuration ent_a_rtl_conf of ent_a is for rtl -- Generated Configuration for inst_aa : ent_aa use configuration work.ent_aa_rtl_conf; end for; for inst_ab : ent_ab use configuration work.ent_ab_rtl_conf; end for; for inst_ac : ent_ac use configuration work.ent_ac_rtl_conf; end for; for inst_ad : ent_ad use configuration work.ent_ad_rtl_conf; end for; for inst_ae : ent_ae use configuration work.ent_ae_rtl_conf; end for; end for; end ent_a_rtl_conf; -- -- End of Generated Configuration ent_a_rtl_conf -- -- --!End of Configuration/ies -- --------------------------------------------------------------
-- (c) Copyright 1995-2017 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. -- -- DO NOT MODIFY THIS FILE. -- IP VLNV: xilinx.com:user:zed_hdmi:1.0 -- IP Revision: 11 LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; ENTITY system_zed_hdmi_0_0 IS PORT ( clk : IN STD_LOGIC; clk_x2 : IN STD_LOGIC; clk_100 : IN STD_LOGIC; active : IN STD_LOGIC; hsync : IN STD_LOGIC; vsync : IN STD_LOGIC; rgb888 : IN STD_LOGIC_VECTOR(23 DOWNTO 0); hdmi_clk : OUT STD_LOGIC; hdmi_hsync : OUT STD_LOGIC; hdmi_vsync : OUT STD_LOGIC; hdmi_d : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); hdmi_de : OUT STD_LOGIC; hdmi_scl : OUT STD_LOGIC; hdmi_sda : INOUT STD_LOGIC ); END system_zed_hdmi_0_0; ARCHITECTURE system_zed_hdmi_0_0_arch OF system_zed_hdmi_0_0 IS ATTRIBUTE DowngradeIPIdentifiedWarnings : STRING; ATTRIBUTE DowngradeIPIdentifiedWarnings OF system_zed_hdmi_0_0_arch: ARCHITECTURE IS "yes"; COMPONENT zed_hdmi IS PORT ( clk : IN STD_LOGIC; clk_x2 : IN STD_LOGIC; clk_100 : IN STD_LOGIC; active : IN STD_LOGIC; hsync : IN STD_LOGIC; vsync : IN STD_LOGIC; rgb888 : IN STD_LOGIC_VECTOR(23 DOWNTO 0); hdmi_clk : OUT STD_LOGIC; hdmi_hsync : OUT STD_LOGIC; hdmi_vsync : OUT STD_LOGIC; hdmi_d : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); hdmi_de : OUT STD_LOGIC; hdmi_scl : OUT STD_LOGIC; hdmi_sda : INOUT STD_LOGIC ); END COMPONENT zed_hdmi; ATTRIBUTE X_INTERFACE_INFO : STRING; ATTRIBUTE X_INTERFACE_INFO OF clk: SIGNAL IS "xilinx.com:signal:clock:1.0 clk CLK"; ATTRIBUTE X_INTERFACE_INFO OF hdmi_clk: SIGNAL IS "xilinx.com:signal:clock:1.0 hdmi_clk CLK"; BEGIN U0 : zed_hdmi PORT MAP ( clk => clk, clk_x2 => clk_x2, clk_100 => clk_100, active => active, hsync => hsync, vsync => vsync, rgb888 => rgb888, hdmi_clk => hdmi_clk, hdmi_hsync => hdmi_hsync, hdmi_vsync => hdmi_vsync, hdmi_d => hdmi_d, hdmi_de => hdmi_de, hdmi_scl => hdmi_scl, hdmi_sda => hdmi_sda ); END system_zed_hdmi_0_0_arch;
-- (c) Copyright 1995-2017 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. -- -- DO NOT MODIFY THIS FILE. -- IP VLNV: xilinx.com:user:zed_hdmi:1.0 -- IP Revision: 11 LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; ENTITY system_zed_hdmi_0_0 IS PORT ( clk : IN STD_LOGIC; clk_x2 : IN STD_LOGIC; clk_100 : IN STD_LOGIC; active : IN STD_LOGIC; hsync : IN STD_LOGIC; vsync : IN STD_LOGIC; rgb888 : IN STD_LOGIC_VECTOR(23 DOWNTO 0); hdmi_clk : OUT STD_LOGIC; hdmi_hsync : OUT STD_LOGIC; hdmi_vsync : OUT STD_LOGIC; hdmi_d : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); hdmi_de : OUT STD_LOGIC; hdmi_scl : OUT STD_LOGIC; hdmi_sda : INOUT STD_LOGIC ); END system_zed_hdmi_0_0; ARCHITECTURE system_zed_hdmi_0_0_arch OF system_zed_hdmi_0_0 IS ATTRIBUTE DowngradeIPIdentifiedWarnings : STRING; ATTRIBUTE DowngradeIPIdentifiedWarnings OF system_zed_hdmi_0_0_arch: ARCHITECTURE IS "yes"; COMPONENT zed_hdmi IS PORT ( clk : IN STD_LOGIC; clk_x2 : IN STD_LOGIC; clk_100 : IN STD_LOGIC; active : IN STD_LOGIC; hsync : IN STD_LOGIC; vsync : IN STD_LOGIC; rgb888 : IN STD_LOGIC_VECTOR(23 DOWNTO 0); hdmi_clk : OUT STD_LOGIC; hdmi_hsync : OUT STD_LOGIC; hdmi_vsync : OUT STD_LOGIC; hdmi_d : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); hdmi_de : OUT STD_LOGIC; hdmi_scl : OUT STD_LOGIC; hdmi_sda : INOUT STD_LOGIC ); END COMPONENT zed_hdmi; ATTRIBUTE X_INTERFACE_INFO : STRING; ATTRIBUTE X_INTERFACE_INFO OF clk: SIGNAL IS "xilinx.com:signal:clock:1.0 clk CLK"; ATTRIBUTE X_INTERFACE_INFO OF hdmi_clk: SIGNAL IS "xilinx.com:signal:clock:1.0 hdmi_clk CLK"; BEGIN U0 : zed_hdmi PORT MAP ( clk => clk, clk_x2 => clk_x2, clk_100 => clk_100, active => active, hsync => hsync, vsync => vsync, rgb888 => rgb888, hdmi_clk => hdmi_clk, hdmi_hsync => hdmi_hsync, hdmi_vsync => hdmi_vsync, hdmi_d => hdmi_d, hdmi_de => hdmi_de, hdmi_scl => hdmi_scl, hdmi_sda => hdmi_sda ); END system_zed_hdmi_0_0_arch;
-- (c) Copyright 1995-2017 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. -- -- DO NOT MODIFY THIS FILE. -- IP VLNV: xilinx.com:user:zed_hdmi:1.0 -- IP Revision: 11 LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; ENTITY system_zed_hdmi_0_0 IS PORT ( clk : IN STD_LOGIC; clk_x2 : IN STD_LOGIC; clk_100 : IN STD_LOGIC; active : IN STD_LOGIC; hsync : IN STD_LOGIC; vsync : IN STD_LOGIC; rgb888 : IN STD_LOGIC_VECTOR(23 DOWNTO 0); hdmi_clk : OUT STD_LOGIC; hdmi_hsync : OUT STD_LOGIC; hdmi_vsync : OUT STD_LOGIC; hdmi_d : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); hdmi_de : OUT STD_LOGIC; hdmi_scl : OUT STD_LOGIC; hdmi_sda : INOUT STD_LOGIC ); END system_zed_hdmi_0_0; ARCHITECTURE system_zed_hdmi_0_0_arch OF system_zed_hdmi_0_0 IS ATTRIBUTE DowngradeIPIdentifiedWarnings : STRING; ATTRIBUTE DowngradeIPIdentifiedWarnings OF system_zed_hdmi_0_0_arch: ARCHITECTURE IS "yes"; COMPONENT zed_hdmi IS PORT ( clk : IN STD_LOGIC; clk_x2 : IN STD_LOGIC; clk_100 : IN STD_LOGIC; active : IN STD_LOGIC; hsync : IN STD_LOGIC; vsync : IN STD_LOGIC; rgb888 : IN STD_LOGIC_VECTOR(23 DOWNTO 0); hdmi_clk : OUT STD_LOGIC; hdmi_hsync : OUT STD_LOGIC; hdmi_vsync : OUT STD_LOGIC; hdmi_d : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); hdmi_de : OUT STD_LOGIC; hdmi_scl : OUT STD_LOGIC; hdmi_sda : INOUT STD_LOGIC ); END COMPONENT zed_hdmi; ATTRIBUTE X_INTERFACE_INFO : STRING; ATTRIBUTE X_INTERFACE_INFO OF clk: SIGNAL IS "xilinx.com:signal:clock:1.0 clk CLK"; ATTRIBUTE X_INTERFACE_INFO OF hdmi_clk: SIGNAL IS "xilinx.com:signal:clock:1.0 hdmi_clk CLK"; BEGIN U0 : zed_hdmi PORT MAP ( clk => clk, clk_x2 => clk_x2, clk_100 => clk_100, active => active, hsync => hsync, vsync => vsync, rgb888 => rgb888, hdmi_clk => hdmi_clk, hdmi_hsync => hdmi_hsync, hdmi_vsync => hdmi_vsync, hdmi_d => hdmi_d, hdmi_de => hdmi_de, hdmi_scl => hdmi_scl, hdmi_sda => hdmi_sda ); END system_zed_hdmi_0_0_arch;
-- (c) Copyright 1995-2017 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. -- -- DO NOT MODIFY THIS FILE. -- IP VLNV: xilinx.com:user:zed_hdmi:1.0 -- IP Revision: 11 LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; ENTITY system_zed_hdmi_0_0 IS PORT ( clk : IN STD_LOGIC; clk_x2 : IN STD_LOGIC; clk_100 : IN STD_LOGIC; active : IN STD_LOGIC; hsync : IN STD_LOGIC; vsync : IN STD_LOGIC; rgb888 : IN STD_LOGIC_VECTOR(23 DOWNTO 0); hdmi_clk : OUT STD_LOGIC; hdmi_hsync : OUT STD_LOGIC; hdmi_vsync : OUT STD_LOGIC; hdmi_d : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); hdmi_de : OUT STD_LOGIC; hdmi_scl : OUT STD_LOGIC; hdmi_sda : INOUT STD_LOGIC ); END system_zed_hdmi_0_0; ARCHITECTURE system_zed_hdmi_0_0_arch OF system_zed_hdmi_0_0 IS ATTRIBUTE DowngradeIPIdentifiedWarnings : STRING; ATTRIBUTE DowngradeIPIdentifiedWarnings OF system_zed_hdmi_0_0_arch: ARCHITECTURE IS "yes"; COMPONENT zed_hdmi IS PORT ( clk : IN STD_LOGIC; clk_x2 : IN STD_LOGIC; clk_100 : IN STD_LOGIC; active : IN STD_LOGIC; hsync : IN STD_LOGIC; vsync : IN STD_LOGIC; rgb888 : IN STD_LOGIC_VECTOR(23 DOWNTO 0); hdmi_clk : OUT STD_LOGIC; hdmi_hsync : OUT STD_LOGIC; hdmi_vsync : OUT STD_LOGIC; hdmi_d : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); hdmi_de : OUT STD_LOGIC; hdmi_scl : OUT STD_LOGIC; hdmi_sda : INOUT STD_LOGIC ); END COMPONENT zed_hdmi; ATTRIBUTE X_INTERFACE_INFO : STRING; ATTRIBUTE X_INTERFACE_INFO OF clk: SIGNAL IS "xilinx.com:signal:clock:1.0 clk CLK"; ATTRIBUTE X_INTERFACE_INFO OF hdmi_clk: SIGNAL IS "xilinx.com:signal:clock:1.0 hdmi_clk CLK"; BEGIN U0 : zed_hdmi PORT MAP ( clk => clk, clk_x2 => clk_x2, clk_100 => clk_100, active => active, hsync => hsync, vsync => vsync, rgb888 => rgb888, hdmi_clk => hdmi_clk, hdmi_hsync => hdmi_hsync, hdmi_vsync => hdmi_vsync, hdmi_d => hdmi_d, hdmi_de => hdmi_de, hdmi_scl => hdmi_scl, hdmi_sda => hdmi_sda ); END system_zed_hdmi_0_0_arch;
-- (c) Copyright 1995-2017 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. -- -- DO NOT MODIFY THIS FILE. -- IP VLNV: xilinx.com:user:zed_hdmi:1.0 -- IP Revision: 11 LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; ENTITY system_zed_hdmi_0_0 IS PORT ( clk : IN STD_LOGIC; clk_x2 : IN STD_LOGIC; clk_100 : IN STD_LOGIC; active : IN STD_LOGIC; hsync : IN STD_LOGIC; vsync : IN STD_LOGIC; rgb888 : IN STD_LOGIC_VECTOR(23 DOWNTO 0); hdmi_clk : OUT STD_LOGIC; hdmi_hsync : OUT STD_LOGIC; hdmi_vsync : OUT STD_LOGIC; hdmi_d : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); hdmi_de : OUT STD_LOGIC; hdmi_scl : OUT STD_LOGIC; hdmi_sda : INOUT STD_LOGIC ); END system_zed_hdmi_0_0; ARCHITECTURE system_zed_hdmi_0_0_arch OF system_zed_hdmi_0_0 IS ATTRIBUTE DowngradeIPIdentifiedWarnings : STRING; ATTRIBUTE DowngradeIPIdentifiedWarnings OF system_zed_hdmi_0_0_arch: ARCHITECTURE IS "yes"; COMPONENT zed_hdmi IS PORT ( clk : IN STD_LOGIC; clk_x2 : IN STD_LOGIC; clk_100 : IN STD_LOGIC; active : IN STD_LOGIC; hsync : IN STD_LOGIC; vsync : IN STD_LOGIC; rgb888 : IN STD_LOGIC_VECTOR(23 DOWNTO 0); hdmi_clk : OUT STD_LOGIC; hdmi_hsync : OUT STD_LOGIC; hdmi_vsync : OUT STD_LOGIC; hdmi_d : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); hdmi_de : OUT STD_LOGIC; hdmi_scl : OUT STD_LOGIC; hdmi_sda : INOUT STD_LOGIC ); END COMPONENT zed_hdmi; ATTRIBUTE X_INTERFACE_INFO : STRING; ATTRIBUTE X_INTERFACE_INFO OF clk: SIGNAL IS "xilinx.com:signal:clock:1.0 clk CLK"; ATTRIBUTE X_INTERFACE_INFO OF hdmi_clk: SIGNAL IS "xilinx.com:signal:clock:1.0 hdmi_clk CLK"; BEGIN U0 : zed_hdmi PORT MAP ( clk => clk, clk_x2 => clk_x2, clk_100 => clk_100, active => active, hsync => hsync, vsync => vsync, rgb888 => rgb888, hdmi_clk => hdmi_clk, hdmi_hsync => hdmi_hsync, hdmi_vsync => hdmi_vsync, hdmi_d => hdmi_d, hdmi_de => hdmi_de, hdmi_scl => hdmi_scl, hdmi_sda => hdmi_sda ); END system_zed_hdmi_0_0_arch;
-- (c) Copyright 1995-2017 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. -- -- DO NOT MODIFY THIS FILE. -- IP VLNV: xilinx.com:user:zed_hdmi:1.0 -- IP Revision: 11 LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; ENTITY system_zed_hdmi_0_0 IS PORT ( clk : IN STD_LOGIC; clk_x2 : IN STD_LOGIC; clk_100 : IN STD_LOGIC; active : IN STD_LOGIC; hsync : IN STD_LOGIC; vsync : IN STD_LOGIC; rgb888 : IN STD_LOGIC_VECTOR(23 DOWNTO 0); hdmi_clk : OUT STD_LOGIC; hdmi_hsync : OUT STD_LOGIC; hdmi_vsync : OUT STD_LOGIC; hdmi_d : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); hdmi_de : OUT STD_LOGIC; hdmi_scl : OUT STD_LOGIC; hdmi_sda : INOUT STD_LOGIC ); END system_zed_hdmi_0_0; ARCHITECTURE system_zed_hdmi_0_0_arch OF system_zed_hdmi_0_0 IS ATTRIBUTE DowngradeIPIdentifiedWarnings : STRING; ATTRIBUTE DowngradeIPIdentifiedWarnings OF system_zed_hdmi_0_0_arch: ARCHITECTURE IS "yes"; COMPONENT zed_hdmi IS PORT ( clk : IN STD_LOGIC; clk_x2 : IN STD_LOGIC; clk_100 : IN STD_LOGIC; active : IN STD_LOGIC; hsync : IN STD_LOGIC; vsync : IN STD_LOGIC; rgb888 : IN STD_LOGIC_VECTOR(23 DOWNTO 0); hdmi_clk : OUT STD_LOGIC; hdmi_hsync : OUT STD_LOGIC; hdmi_vsync : OUT STD_LOGIC; hdmi_d : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); hdmi_de : OUT STD_LOGIC; hdmi_scl : OUT STD_LOGIC; hdmi_sda : INOUT STD_LOGIC ); END COMPONENT zed_hdmi; ATTRIBUTE X_INTERFACE_INFO : STRING; ATTRIBUTE X_INTERFACE_INFO OF clk: SIGNAL IS "xilinx.com:signal:clock:1.0 clk CLK"; ATTRIBUTE X_INTERFACE_INFO OF hdmi_clk: SIGNAL IS "xilinx.com:signal:clock:1.0 hdmi_clk CLK"; BEGIN U0 : zed_hdmi PORT MAP ( clk => clk, clk_x2 => clk_x2, clk_100 => clk_100, active => active, hsync => hsync, vsync => vsync, rgb888 => rgb888, hdmi_clk => hdmi_clk, hdmi_hsync => hdmi_hsync, hdmi_vsync => hdmi_vsync, hdmi_d => hdmi_d, hdmi_de => hdmi_de, hdmi_scl => hdmi_scl, hdmi_sda => hdmi_sda ); END system_zed_hdmi_0_0_arch;
library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.std_logic_unsigned.ALL; use IEEE.numeric_std.all; use work.MurmurHashUtils.ALL; entity SearchRowTestbench is end SearchRowTestbench; architecture Behavioral of SearchRowTestbench is constant DATA_WIDTH_A_USAR : integer := 32; constant ADDR_WIDTH_A_USAR : integer := 10; signal clk : std_logic;-- un solo reloj para ambos puertos de la BRAM signal dataToCompare : std_logic_vector((DATA_WIDTH_A_USAR-1) downto 0); signal operationID : std_logic_vector((DATA_WIDTH_A_USAR-1) downto 0); signal previousIndex : std_logic_vector( (ADDR_WIDTH_A_USAR-1) downto 0); signal compare : std_logic := '0';--El dato actual se debe comparar signal previousResult : std_logic;--El resultado es encontrado'1' o no signal porta_wr : std_logic; signal porta_waddr : std_logic_vector( (ADDR_WIDTH_A_USAR-1) downto 0); signal porta_din : std_logic_vector( (DATA_WIDTH_A_USAR-1) downto 0); --valores de saldia de esta columna signal result : std_logic;--El resultado es encontrado'1' o no signal nextIndex : std_logic_vector( (ADDR_WIDTH_A_USAR-1) downto 0); signal compareFinished : std_logic; --Resultado de una comparación listo signal dataReadDuringIOTest : std_logic_vector( (DATA_WIDTH_A_USAR-1) downto 0); signal dataCompared : std_logic_vector((DATA_WIDTH_A_USAR-1) downto 0); signal valorLeido_dbg : ieee.numeric_std.unsigned( (DATA_WIDTH_A_USAR-1) downto 0); constant clk_period : time := 10 ns; constant radioTest : std_logic_vector( (ADDR_WIDTH_A_USAR-1) downto 0):="0100000000"; begin uut : entity work.BinarySearch_ComparingRow generic map ( DATA_WIDTH => DATA_WIDTH_A_USAR, ADDR_WIDTH => ADDR_WIDTH_A_USAR ) port map( clk => clk, radio => radioTest, dataToCompare => dataToCompare, operationID => operationID, previousIndex => previousIndex, compare => compare, previousResult => previousResult, porta_wr => porta_wr, porta_waddr => porta_waddr, porta_din => porta_din, result => result, nextIndex => nextIndex, compareFinished => compareFinished, dataCompared => dataCompared, valorLeido_dbg => valorLeido_dbg ); clk_process :process begin clk <= '0'; wait for clk_period/2; clk <= '1'; wait for clk_period/2; end process; test : process variable readWriteCounter : integer := 0; variable dataToWrite : std_logic_vector((DATA_WIDTH_A_USAR-1) downto 0) := ( others => '0'); variable addrToWrite : std_logic_vector((ADDR_WIDTH_A_USAR-1) downto 0) := ( others => '0'); begin -- Primero grabar los datos en la memoria porta_wr <= '0'; porta_waddr <= addrToWrite; porta_din <= dataToWrite; previousResult <= '0'; wait for clk_period; porta_wr <= '1'; while readWriteCounter < (2**ADDR_WIDTH_A_USAR) loop porta_waddr <= addrToWrite; porta_din <= dataToWrite; wait for clk_period; dataToWrite := dataToWrite+1; addrToWrite := addrToWrite+1; readWriteCounter := readWriteCounter+1; end loop; -- Ahora comparar un dato de prueba porta_wr <= '0'; wait for clk_period; dataToCompare <= x"00000001"; operationID <= (others=>'1'); previousIndex <= "1000000000"; compare<= '0'; previousResult <= '0'; wait for clk_period; compare<= '1'; wait for clk_period; compare<= '0'; wait; end process; end Behavioral;
-- -- Author: Pawel Szostek ([email protected]) -- Date: 27.07.2011 library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity dummy is port (o1: out std_logic_vector(7 downto 0); -- intentionally messed indices i1: in std_logic_vector(0 to 7) -- ); end; architecture behaviour of dummy is begin o1 <= i1; end;
-- -- Author: Pawel Szostek ([email protected]) -- Date: 27.07.2011 library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity dummy is port (o1: out std_logic_vector(7 downto 0); -- intentionally messed indices i1: in std_logic_vector(0 to 7) -- ); end; architecture behaviour of dummy is begin o1 <= i1; end;
library ieee; use ieee.std_logic_1164.all; package defs is constant ADDR_BUS_SIZE : integer := 8; constant INSTRUCTION_BUS_SIZE : integer := 24; constant DATA_BUS_SIZE : integer := 16; constant INSTRUCTION_MEMORY_LENGTH : integer := 128; constant DATA_MEMORY_LENGTH : integer := 128; end defs;
entity top is generic (width : natural := 8); end top; architecture behav of top is type arr1 is array (1 to width) of natural; type rec1 is record i : integer; a : arr1; c : character; end record; type arr2 is array (natural range <>) of rec1; function resolv (vec : arr2) return rec1 is begin return vec (vec'left); end resolv; signal s : resolv rec1; begin end;
entity top is generic (width : natural := 8); end top; architecture behav of top is type arr1 is array (1 to width) of natural; type rec1 is record i : integer; a : arr1; c : character; end record; type arr2 is array (natural range <>) of rec1; function resolv (vec : arr2) return rec1 is begin return vec (vec'left); end resolv; signal s : resolv rec1; begin end;
entity top is generic (width : natural := 8); end top; architecture behav of top is type arr1 is array (1 to width) of natural; type rec1 is record i : integer; a : arr1; c : character; end record; type arr2 is array (natural range <>) of rec1; function resolv (vec : arr2) return rec1 is begin return vec (vec'left); end resolv; signal s : resolv rec1; begin end;
-- megafunction wizard: %FIFO% -- GENERATION: STANDARD -- VERSION: WM1.0 -- MODULE: dcfifo_mixed_widths -- ============================================================ -- File Name: FIFO_LED_PIC.vhd -- Megafunction Name(s): -- dcfifo_mixed_widths -- -- Simulation Library Files(s): -- altera_mf -- ============================================================ -- ************************************************************ -- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE! -- -- 13.0.1 Build 232 06/12/2013 SP 1 SJ Full Version -- ************************************************************ --Copyright (C) 1991-2013 Altera Corporation --Your use of Altera Corporation's design tools, logic functions --and other software and tools, and its AMPP partner logic --functions, and any output files from any of the foregoing --(including device programming or simulation files), and any --associated documentation or information are expressly subject --to the terms and conditions of the Altera Program License --Subscription Agreement, Altera MegaCore Function License --Agreement, or other applicable license agreement, including, --without limitation, that your use is for the sole purpose of --programming logic devices manufactured by Altera and sold by --Altera or its authorized distributors. Please refer to the --applicable agreement for further details. LIBRARY ieee; USE ieee.std_logic_1164.all; LIBRARY altera_mf; USE altera_mf.all; ENTITY FIFO_LED_PIC IS PORT ( aclr : IN STD_LOGIC := '0'; data : IN STD_LOGIC_VECTOR (79 DOWNTO 0); rdclk : IN STD_LOGIC ; rdreq : IN STD_LOGIC ; wrclk : IN STD_LOGIC ; wrreq : IN STD_LOGIC ; q : OUT STD_LOGIC_VECTOR (39 DOWNTO 0); rdusedw : OUT STD_LOGIC_VECTOR (7 DOWNTO 0); wrusedw : OUT STD_LOGIC_VECTOR (6 DOWNTO 0) ); END FIFO_LED_PIC; ARCHITECTURE SYN OF fifo_led_pic IS SIGNAL sub_wire0 : STD_LOGIC_VECTOR (39 DOWNTO 0); SIGNAL sub_wire1 : STD_LOGIC_VECTOR (6 DOWNTO 0); SIGNAL sub_wire2 : STD_LOGIC_VECTOR (7 DOWNTO 0); COMPONENT dcfifo_mixed_widths GENERIC ( add_usedw_msb_bit : STRING; intended_device_family : STRING; lpm_numwords : NATURAL; lpm_showahead : STRING; lpm_type : STRING; lpm_width : NATURAL; lpm_widthu : NATURAL; lpm_widthu_r : NATURAL; lpm_width_r : NATURAL; overflow_checking : STRING; rdsync_delaypipe : NATURAL; read_aclr_synch : STRING; underflow_checking : STRING; use_eab : STRING; write_aclr_synch : STRING; wrsync_delaypipe : NATURAL ); PORT ( rdclk : IN STD_LOGIC ; q : OUT STD_LOGIC_VECTOR (39 DOWNTO 0); wrclk : IN STD_LOGIC ; wrreq : IN STD_LOGIC ; wrusedw : OUT STD_LOGIC_VECTOR (6 DOWNTO 0); aclr : IN STD_LOGIC ; data : IN STD_LOGIC_VECTOR (79 DOWNTO 0); rdreq : IN STD_LOGIC ; rdusedw : OUT STD_LOGIC_VECTOR (7 DOWNTO 0) ); END COMPONENT; BEGIN q <= sub_wire0(39 DOWNTO 0); wrusedw <= sub_wire1(6 DOWNTO 0); rdusedw <= sub_wire2(7 DOWNTO 0); dcfifo_mixed_widths_component : dcfifo_mixed_widths GENERIC MAP ( add_usedw_msb_bit => "ON", intended_device_family => "Cyclone IV E", lpm_numwords => 64, lpm_showahead => "OFF", lpm_type => "dcfifo_mixed_widths", lpm_width => 80, lpm_widthu => 7, lpm_widthu_r => 8, lpm_width_r => 40, overflow_checking => "ON", rdsync_delaypipe => 5, read_aclr_synch => "ON", underflow_checking => "ON", use_eab => "ON", write_aclr_synch => "OFF", wrsync_delaypipe => 5 ) PORT MAP ( rdclk => rdclk, wrclk => wrclk, wrreq => wrreq, aclr => aclr, data => data, rdreq => rdreq, q => sub_wire0, wrusedw => sub_wire1, rdusedw => sub_wire2 ); END SYN; -- ============================================================ -- CNX file retrieval info -- ============================================================ -- Retrieval info: PRIVATE: AlmostEmpty NUMERIC "0" -- Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "-1" -- Retrieval info: PRIVATE: AlmostFull NUMERIC "0" -- Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1" -- Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0" -- Retrieval info: PRIVATE: Clock NUMERIC "4" -- Retrieval info: PRIVATE: Depth NUMERIC "64" -- Retrieval info: PRIVATE: Empty NUMERIC "1" -- Retrieval info: PRIVATE: Full NUMERIC "1" -- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E" -- Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0" -- Retrieval info: PRIVATE: LegacyRREQ NUMERIC "1" -- Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0" -- Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "0" -- Retrieval info: PRIVATE: Optimize NUMERIC "2" -- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0" -- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0" -- Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "0" -- Retrieval info: PRIVATE: UsedW NUMERIC "1" -- Retrieval info: PRIVATE: Width NUMERIC "80" -- Retrieval info: PRIVATE: dc_aclr NUMERIC "1" -- Retrieval info: PRIVATE: diff_widths NUMERIC "1" -- Retrieval info: PRIVATE: msb_usedw NUMERIC "1" -- Retrieval info: PRIVATE: output_width NUMERIC "40" -- Retrieval info: PRIVATE: rsEmpty NUMERIC "0" -- Retrieval info: PRIVATE: rsFull NUMERIC "0" -- Retrieval info: PRIVATE: rsUsedW NUMERIC "1" -- Retrieval info: PRIVATE: sc_aclr NUMERIC "0" -- Retrieval info: PRIVATE: sc_sclr NUMERIC "0" -- Retrieval info: PRIVATE: wsEmpty NUMERIC "0" -- Retrieval info: PRIVATE: wsFull NUMERIC "0" -- Retrieval info: PRIVATE: wsUsedW NUMERIC "1" -- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all -- Retrieval info: CONSTANT: ADD_USEDW_MSB_BIT STRING "ON" -- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E" -- Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "64" -- Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "OFF" -- Retrieval info: CONSTANT: LPM_TYPE STRING "dcfifo_mixed_widths" -- Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "80" -- Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "7" -- Retrieval info: CONSTANT: LPM_WIDTHU_R NUMERIC "8" -- Retrieval info: CONSTANT: LPM_WIDTH_R NUMERIC "40" -- Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "ON" -- Retrieval info: CONSTANT: RDSYNC_DELAYPIPE NUMERIC "5" -- Retrieval info: CONSTANT: READ_ACLR_SYNCH STRING "ON" -- Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "ON" -- Retrieval info: CONSTANT: USE_EAB STRING "ON" -- Retrieval info: CONSTANT: WRITE_ACLR_SYNCH STRING "OFF" -- Retrieval info: CONSTANT: WRSYNC_DELAYPIPE NUMERIC "5" -- Retrieval info: USED_PORT: aclr 0 0 0 0 INPUT GND "aclr" -- Retrieval info: USED_PORT: data 0 0 80 0 INPUT NODEFVAL "data[79..0]" -- Retrieval info: USED_PORT: q 0 0 40 0 OUTPUT NODEFVAL "q[39..0]" -- Retrieval info: USED_PORT: rdclk 0 0 0 0 INPUT NODEFVAL "rdclk" -- Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL "rdreq" -- Retrieval info: USED_PORT: rdusedw 0 0 8 0 OUTPUT NODEFVAL "rdusedw[7..0]" -- Retrieval info: USED_PORT: wrclk 0 0 0 0 INPUT NODEFVAL "wrclk" -- Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL "wrreq" -- Retrieval info: USED_PORT: wrusedw 0 0 7 0 OUTPUT NODEFVAL "wrusedw[6..0]" -- Retrieval info: CONNECT: @aclr 0 0 0 0 aclr 0 0 0 0 -- Retrieval info: CONNECT: @data 0 0 80 0 data 0 0 80 0 -- Retrieval info: CONNECT: @rdclk 0 0 0 0 rdclk 0 0 0 0 -- Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0 -- Retrieval info: CONNECT: @wrclk 0 0 0 0 wrclk 0 0 0 0 -- Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0 -- Retrieval info: CONNECT: q 0 0 40 0 @q 0 0 40 0 -- Retrieval info: CONNECT: rdusedw 0 0 8 0 @rdusedw 0 0 8 0 -- Retrieval info: CONNECT: wrusedw 0 0 7 0 @wrusedw 0 0 7 0 -- Retrieval info: GEN_FILE: TYPE_NORMAL FIFO_LED_PIC.vhd TRUE -- Retrieval info: GEN_FILE: TYPE_NORMAL FIFO_LED_PIC.inc FALSE -- Retrieval info: GEN_FILE: TYPE_NORMAL FIFO_LED_PIC.cmp TRUE -- Retrieval info: GEN_FILE: TYPE_NORMAL FIFO_LED_PIC.bsf FALSE -- Retrieval info: GEN_FILE: TYPE_NORMAL FIFO_LED_PIC_inst.vhd FALSE -- Retrieval info: LIB_FILE: altera_mf
----------------------------------------------------------------------------- -- LEON3 Demonstration design test bench configuration -- Copyright (C) 2009 Aeroflex Gaisler ------------------------------------------------------------------------------ library techmap; use techmap.gencomp.all; package config is -- Technology and synthesis options constant CFG_FABTECH : integer := spartan3; constant CFG_MEMTECH : integer := spartan3; constant CFG_PADTECH : integer := spartan3; constant CFG_NOASYNC : integer := 0; constant CFG_SCAN : integer := 0; -- Clock generator constant CFG_CLKTECH : integer := spartan3; constant CFG_CLKMUL : integer := (4); constant CFG_CLKDIV : integer := (5); constant CFG_OCLKDIV : integer := 1; constant CFG_OCLKBDIV : integer := 0; constant CFG_OCLKCDIV : integer := 0; constant CFG_PCIDLL : integer := 0; constant CFG_PCISYSCLK: integer := 0; constant CFG_CLK_NOFB : integer := 0; -- LEON3 processor core constant CFG_LEON3 : integer := 1; constant CFG_NCPU : integer := (1); constant CFG_NWIN : integer := (8); constant CFG_V8 : integer := 16#32# + 4*0; constant CFG_MAC : integer := 0; constant CFG_BP : integer := 1; constant CFG_SVT : integer := 1; constant CFG_RSTADDR : integer := 16#00000#; constant CFG_LDDEL : integer := (1); constant CFG_NOTAG : integer := 0; constant CFG_NWP : integer := (4); constant CFG_PWD : integer := 0*2; constant CFG_FPU : integer := 0 + 16*0 + 32*0; constant CFG_GRFPUSH : integer := 0; constant CFG_ICEN : integer := 1; constant CFG_ISETS : integer := 2; constant CFG_ISETSZ : integer := 4; constant CFG_ILINE : integer := 8; constant CFG_IREPL : integer := 0; constant CFG_ILOCK : integer := 0; constant CFG_ILRAMEN : integer := 0; constant CFG_ILRAMADDR: integer := 16#8E#; constant CFG_ILRAMSZ : integer := 1; constant CFG_DCEN : integer := 1; constant CFG_DSETS : integer := 1; constant CFG_DSETSZ : integer := 4; constant CFG_DLINE : integer := 4; constant CFG_DREPL : integer := 0; constant CFG_DLOCK : integer := 0; constant CFG_DSNOOP : integer := 1*2 + 4*0; constant CFG_DFIXED : integer := 16#0#; constant CFG_DLRAMEN : integer := 0; constant CFG_DLRAMADDR: integer := 16#8F#; constant CFG_DLRAMSZ : integer := 1; constant CFG_MMUEN : integer := 1; constant CFG_ITLBNUM : integer := 8; constant CFG_DTLBNUM : integer := 8; constant CFG_TLB_TYPE : integer := 0 + 1*2; constant CFG_TLB_REP : integer := 0; constant CFG_MMU_PAGE : integer := 4; constant CFG_DSU : integer := 1; constant CFG_ITBSZ : integer := 2; constant CFG_ATBSZ : integer := 2; constant CFG_LEON3FT_EN : integer := 0; constant CFG_IUFT_EN : integer := 0; constant CFG_FPUFT_EN : integer := 0; constant CFG_RF_ERRINJ : integer := 0; constant CFG_CACHE_FT_EN : integer := 0; constant CFG_CACHE_ERRINJ : integer := 0; constant CFG_LEON3_NETLIST: integer := 0; constant CFG_DISAS : integer := 0 + 0; constant CFG_PCLOW : integer := 2; -- AMBA settings constant CFG_DEFMST : integer := (0); constant CFG_RROBIN : integer := 1; constant CFG_SPLIT : integer := 0; constant CFG_FPNPEN : integer := 0; constant CFG_AHBIO : integer := 16#FFF#; constant CFG_APBADDR : integer := 16#800#; constant CFG_AHB_MON : integer := 0; constant CFG_AHB_MONERR : integer := 0; constant CFG_AHB_MONWAR : integer := 0; constant CFG_AHB_DTRACE : integer := 0; -- DSU UART constant CFG_AHB_UART : integer := 1; -- JTAG based DSU interface constant CFG_AHB_JTAG : integer := 1; -- USB DSU constant CFG_GRUSB_DCL : integer := 0; constant CFG_GRUSB_DCL_UIFACE : integer := 1; constant CFG_GRUSB_DCL_DW : integer := 8; -- Ethernet DSU constant CFG_DSU_ETH : integer := 1 + 0 + 0; constant CFG_ETH_BUF : integer := 2; constant CFG_ETH_IPM : integer := 16#C0A8#; constant CFG_ETH_IPL : integer := 16#0033#; constant CFG_ETH_ENM : integer := 16#020000#; constant CFG_ETH_ENL : integer := 16#000008#; -- LEON2 memory controller constant CFG_MCTRL_LEON2 : integer := 1; constant CFG_MCTRL_RAM8BIT : integer := 1; constant CFG_MCTRL_RAM16BIT : integer := 0; constant CFG_MCTRL_5CS : integer := 0; constant CFG_MCTRL_SDEN : integer := 1; constant CFG_MCTRL_SEPBUS : integer := 0; constant CFG_MCTRL_INVCLK : integer := 0; constant CFG_MCTRL_SD64 : integer := 0; constant CFG_MCTRL_PAGE : integer := 1 + 0; -- AHB status register constant CFG_AHBSTAT : integer := 0; constant CFG_AHBSTATN : integer := 1; -- AHB ROM constant CFG_AHBROMEN : integer := 0; constant CFG_AHBROPIP : integer := 0; constant CFG_AHBRODDR : integer := 16#000#; constant CFG_ROMADDR : integer := 16#000#; constant CFG_ROMMASK : integer := 16#E00# + 16#000#; -- AHB RAM constant CFG_AHBRAMEN : integer := 0; constant CFG_AHBRSZ : integer := 1; constant CFG_AHBRADDR : integer := 16#A00#; constant CFG_AHBRPIPE : integer := 0; -- Gaisler Ethernet core constant CFG_GRETH : integer := 1; constant CFG_GRETH1G : integer := 0; constant CFG_ETH_FIFO : integer := 16; -- CAN 2.0 interface constant CFG_CAN : integer := 0; constant CFG_CAN_NUM : integer := 1; constant CFG_CANIO : integer := 16#0#; constant CFG_CANIRQ : integer := 0; constant CFG_CANSEPIRQ: integer := 0; constant CFG_CAN_SYNCRST : integer := 0; constant CFG_CANFT : integer := 0; -- GR USB 2.0 Device Controller constant CFG_GRUSBDC : integer := 0; constant CFG_GRUSBDC_AIFACE : integer := 0; constant CFG_GRUSBDC_UIFACE : integer := 1; constant CFG_GRUSBDC_DW : integer := 8; constant CFG_GRUSBDC_NEPI : integer := 1; constant CFG_GRUSBDC_NEPO : integer := 1; constant CFG_GRUSBDC_I0 : integer := 1024; constant CFG_GRUSBDC_I1 : integer := 1024; constant CFG_GRUSBDC_I2 : integer := 1024; constant CFG_GRUSBDC_I3 : integer := 1024; constant CFG_GRUSBDC_I4 : integer := 1024; constant CFG_GRUSBDC_I5 : integer := 1024; constant CFG_GRUSBDC_I6 : integer := 1024; constant CFG_GRUSBDC_I7 : integer := 1024; constant CFG_GRUSBDC_I8 : integer := 1024; constant CFG_GRUSBDC_I9 : integer := 1024; constant CFG_GRUSBDC_I10 : integer := 1024; constant CFG_GRUSBDC_I11 : integer := 1024; constant CFG_GRUSBDC_I12 : integer := 1024; constant CFG_GRUSBDC_I13 : integer := 1024; constant CFG_GRUSBDC_I14 : integer := 1024; constant CFG_GRUSBDC_I15 : integer := 1024; constant CFG_GRUSBDC_O0 : integer := 1024; constant CFG_GRUSBDC_O1 : integer := 1024; constant CFG_GRUSBDC_O2 : integer := 1024; constant CFG_GRUSBDC_O3 : integer := 1024; constant CFG_GRUSBDC_O4 : integer := 1024; constant CFG_GRUSBDC_O5 : integer := 1024; constant CFG_GRUSBDC_O6 : integer := 1024; constant CFG_GRUSBDC_O7 : integer := 1024; constant CFG_GRUSBDC_O8 : integer := 1024; constant CFG_GRUSBDC_O9 : integer := 1024; constant CFG_GRUSBDC_O10 : integer := 1024; constant CFG_GRUSBDC_O11 : integer := 1024; constant CFG_GRUSBDC_O12 : integer := 1024; constant CFG_GRUSBDC_O13 : integer := 1024; constant CFG_GRUSBDC_O14 : integer := 1024; constant CFG_GRUSBDC_O15 : integer := 1024; -- UART 1 constant CFG_UART1_ENABLE : integer := 1; constant CFG_UART1_FIFO : integer := 4; -- UART 2 constant CFG_UART2_ENABLE : integer := 0; constant CFG_UART2_FIFO : integer := 1; -- LEON3 interrupt controller constant CFG_IRQ3_ENABLE : integer := 1; constant CFG_IRQ3_NSEC : integer := 0; -- Modular timer constant CFG_GPT_ENABLE : integer := 1; constant CFG_GPT_NTIM : integer := (2); constant CFG_GPT_SW : integer := (8); constant CFG_GPT_TW : integer := (32); constant CFG_GPT_IRQ : integer := (8); constant CFG_GPT_SEPIRQ : integer := 1; constant CFG_GPT_WDOGEN : integer := 0; constant CFG_GPT_WDOG : integer := 16#0#; -- GPIO port constant CFG_GRGPIO_ENABLE : integer := 1; constant CFG_GRGPIO_IMASK : integer := 16#0000#; constant CFG_GRGPIO_WIDTH : integer := (8); -- Spacewire interface constant CFG_SPW_EN : integer := 0; constant CFG_SPW_NUM : integer := 1; constant CFG_SPW_AHBFIFO : integer := 4; constant CFG_SPW_RXFIFO : integer := 16; constant CFG_SPW_RMAP : integer := 0; constant CFG_SPW_RMAPBUF : integer := 4; constant CFG_SPW_RMAPCRC : integer := 0; constant CFG_SPW_NETLIST : integer := 0; constant CFG_SPW_FT : integer := 0; constant CFG_SPW_GRSPW : integer := 2; constant CFG_SPW_RXUNAL : integer := 0; constant CFG_SPW_DMACHAN : integer := 1; constant CFG_SPW_PORTS : integer := 1; constant CFG_SPW_INPUT : integer := 2; constant CFG_SPW_OUTPUT : integer := 0; constant CFG_SPW_RTSAME : integer := 0; -- VGA and PS2/ interface constant CFG_KBD_ENABLE : integer := 1; constant CFG_VGA_ENABLE : integer := 0; constant CFG_SVGA_ENABLE : integer := 1; -- GRLIB debugging constant CFG_DUART : integer := 0; end;
library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use work.mcu_pkg.all; entity tb_mcu is end tb_mcu; architecture TB of tb_mcu is signal rst : std_logic; signal clk : std_logic := '0'; signal LED : std_logic_vector(7 downto 0); signal SW : std_logic_vector(3 downto 0); signal ROT_C : std_logic; signal BTN_EAST : std_logic; signal BTN_WEST : std_logic; signal BTN_NORTH : std_logic; signal LCD : std_logic_vector(LCD_PW-1 downto 0); signal step_to_floppy : std_logic; signal dir_to_floppy : std_logic; begin -- instantiate MUT MUT : entity work.mcu port map( rst => rst, clk => clk, LED => LED, SW => SW, ROT_C => ROT_C, BTN_EAST => BTN_EAST, BTN_WEST => BTN_WEST, BTN_NORTH => BTN_NORTH, LCD => LCD, step_to_floppy => step_to_floppy, dir_to_floppy => dir_to_floppy ); -- generate reset rst <= '1', '0' after 5us; ROT_C <= '1', '0' after 1ms; SW <= "0011"; BTN_EAST <= '0'; BTN_WEST <= '0'; BTN_NORTH <= '0'; -- clock generation p_clk: process begin wait for 1 sec / CF/2; clk <= not clk; end process; end TB;
-- Copyright 1986-2015 Xilinx, Inc. All Rights Reserved. -- -------------------------------------------------------------------------------- -- Tool Version: Vivado v.2015.2 (lin64) Build 1266856 Fri Jun 26 16:35:25 MDT 2015 -- Date : Fri Dec 2 16:43:55 2016 -- Host : chinook.andrew.cmu.edu running 64-bit Red Hat Enterprise Linux Server release 7.2 (Maipo) -- Command : write_vhdl -force -mode synth_stub -- /afs/ece.cmu.edu/usr/jacobwei/Public/FPGA/FPGA.srcs/sources_1/ip/blk_mem_gen_1/blk_mem_gen_1_stub.vhdl -- Design : blk_mem_gen_1 -- Purpose : Stub declaration of top-level module interface -- Device : xc7z020clg484-1 -- -------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity blk_mem_gen_1 is Port ( clka : in STD_LOGIC; wea : in STD_LOGIC_VECTOR ( 0 to 0 ); addra : in STD_LOGIC_VECTOR ( 18 downto 0 ); dina : in STD_LOGIC_VECTOR ( 11 downto 0 ); clkb : in STD_LOGIC; addrb : in STD_LOGIC_VECTOR ( 18 downto 0 ); doutb : out STD_LOGIC_VECTOR ( 11 downto 0 ) ); end blk_mem_gen_1; architecture stub of blk_mem_gen_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 "clka,wea[0:0],addra[18:0],dina[11:0],clkb,addrb[18:0],doutb[11:0]"; attribute x_core_info : string; attribute x_core_info of stub : architecture is "blk_mem_gen_v8_2,Vivado 2015.2"; begin end;
-- 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: ch_04_fg_04_03.vhd,v 1.2 2001-10-26 16:29:33 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- entity fg_04_03 is end entity fg_04_03; ---------------------------------------------------------------- architecture test of fg_04_03 is begin -- code from book: modem_controller : process is type symbol is ('a', 't', 'd', 'h', digit, cr, other); type symbol_string is array (1 to 20) of symbol; type state is range 0 to 6; type transition_matrix is array (state, symbol) of state; constant next_state : transition_matrix := ( 0 => ('a' => 1, others => 6), 1 => ('t' => 2, others => 6), 2 => ('d' => 3, 'h' => 5, others => 6), 3 => (digit => 4, others => 6), 4 => (digit => 4, cr => 0, others => 6), 5 => (cr => 0, others => 6), 6 => (cr => 0, others => 6) ); variable command : symbol_string; variable current_state : state := 0; -- not in book: type sample_array is array (positive range <>) of symbol_string; constant sample_command : sample_array := ( 1 => ( 'a', 't', 'd', digit, digit, cr, others => other ), 2 => ( 'a', 't', 'h', cr, others => other ), 3 => ( 'a', 't', other, other, cr, others => other ) ); -- end not in book begin -- . . . -- not in book: for command_index in sample_command'range loop command := sample_command(command_index); -- end not in book for index in 1 to 20 loop current_state := next_state( current_state, command(index) ); case current_state is -- . . . -- not in book: when 0 => exit; when others => null; -- end not in book end case; end loop; -- . . . -- not in book: end loop; wait; -- end not in book end process modem_controller; -- end of code from book 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: ch_04_fg_04_03.vhd,v 1.2 2001-10-26 16:29:33 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- entity fg_04_03 is end entity fg_04_03; ---------------------------------------------------------------- architecture test of fg_04_03 is begin -- code from book: modem_controller : process is type symbol is ('a', 't', 'd', 'h', digit, cr, other); type symbol_string is array (1 to 20) of symbol; type state is range 0 to 6; type transition_matrix is array (state, symbol) of state; constant next_state : transition_matrix := ( 0 => ('a' => 1, others => 6), 1 => ('t' => 2, others => 6), 2 => ('d' => 3, 'h' => 5, others => 6), 3 => (digit => 4, others => 6), 4 => (digit => 4, cr => 0, others => 6), 5 => (cr => 0, others => 6), 6 => (cr => 0, others => 6) ); variable command : symbol_string; variable current_state : state := 0; -- not in book: type sample_array is array (positive range <>) of symbol_string; constant sample_command : sample_array := ( 1 => ( 'a', 't', 'd', digit, digit, cr, others => other ), 2 => ( 'a', 't', 'h', cr, others => other ), 3 => ( 'a', 't', other, other, cr, others => other ) ); -- end not in book begin -- . . . -- not in book: for command_index in sample_command'range loop command := sample_command(command_index); -- end not in book for index in 1 to 20 loop current_state := next_state( current_state, command(index) ); case current_state is -- . . . -- not in book: when 0 => exit; when others => null; -- end not in book end case; end loop; -- . . . -- not in book: end loop; wait; -- end not in book end process modem_controller; -- end of code from book 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: ch_04_fg_04_03.vhd,v 1.2 2001-10-26 16:29:33 paw Exp $ -- $Revision: 1.2 $ -- -- --------------------------------------------------------------------- entity fg_04_03 is end entity fg_04_03; ---------------------------------------------------------------- architecture test of fg_04_03 is begin -- code from book: modem_controller : process is type symbol is ('a', 't', 'd', 'h', digit, cr, other); type symbol_string is array (1 to 20) of symbol; type state is range 0 to 6; type transition_matrix is array (state, symbol) of state; constant next_state : transition_matrix := ( 0 => ('a' => 1, others => 6), 1 => ('t' => 2, others => 6), 2 => ('d' => 3, 'h' => 5, others => 6), 3 => (digit => 4, others => 6), 4 => (digit => 4, cr => 0, others => 6), 5 => (cr => 0, others => 6), 6 => (cr => 0, others => 6) ); variable command : symbol_string; variable current_state : state := 0; -- not in book: type sample_array is array (positive range <>) of symbol_string; constant sample_command : sample_array := ( 1 => ( 'a', 't', 'd', digit, digit, cr, others => other ), 2 => ( 'a', 't', 'h', cr, others => other ), 3 => ( 'a', 't', other, other, cr, others => other ) ); -- end not in book begin -- . . . -- not in book: for command_index in sample_command'range loop command := sample_command(command_index); -- end not in book for index in 1 to 20 loop current_state := next_state( current_state, command(index) ); case current_state is -- . . . -- not in book: when 0 => exit; when others => null; -- end not in book end case; end loop; -- . . . -- not in book: end loop; wait; -- end not in book end process modem_controller; -- end of code from book end architecture test;
library ieee; use ieee.std_logic_1164.all; entity resonant_pfd is port ( -- Inputs clk : in std_logic; reset : in std_logic; sig_in : in std_logic; ref_in : in std_logic; -- Outputs up_out : out std_logic; down_out : out std_logic ); end resonant_pfd; architecture rtl of resonant_pfd is signal ff : std_logic; begin -- D-type flip-flop ff_p: process(clk, reset) variable last_sig : std_logic; begin if reset = '1' then ff <= '0'; last_sig := '0'; -- FF is synchronous so we do not have to synchronize the output after elsif rising_edge(clk) then if not sig_in = last_sig and sig_in = '1' then ff <= ref_in; end if; last_sig := sig_in; end if; end process; -- Actual phase-frequency detector pfd_p: process(clk, reset) variable sig_ref_xor : std_logic; begin if reset = '1' then up_out <= '0'; down_out <= '0'; sig_ref_xor := '0'; elsif rising_edge(clk) then sig_ref_xor := sig_in xor ref_in; up_out <= sig_ref_xor and ff; down_out <= sig_ref_xor and not ff; end if; end process; end;
----------------------------------------------- -- UART core -- ----------------------------------------------- -- RxRdy es generado por la uart cuando recibe un dato correctamente (luego de leer cada uno de los 8 bits, genera un pulso en dicha señal en el STOP BIT, y luego vuelve a 0 en IDLE o en el siguiente START BIT) library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; --library work; --use work.uart_comps.all; use work.uart_comps.all; entity uart is generic ( F : natural := 50000; -- Device clock frequency [KHz]. baud_rate : natural := 1200; num_data_bits : natural := 8 ); port ( Rx : in std_logic; Tx : out std_logic; Din : in std_logic_vector(num_data_bits-1 downto 0); StartTx : in std_logic; TxBusy : out std_logic; Dout : out std_logic_vector(num_data_bits-1 downto 0); RxRdy : out std_logic; RxErr : out std_logic; clk : in std_logic; rst : in std_logic ); end; architecture arch of uart is signal top16 : std_logic; signal toprx : std_logic; signal toptx : std_logic; signal Sig_ClrDiv : std_logic; begin reception_unit: receive generic map ( NDBits => num_data_bits ) port map ( CLK => clk, RST => rst, Rx => Rx, Dout => Dout, RxErr => RxErr, RxRdy => RxRdy, ClrDiv => Sig_ClrDiv, Top16 => top16, TopRx => toprx ); transmission_unit: transmit generic map ( NDBits => num_data_bits ) port map ( CLK => clk, RST => rst, Tx => Tx, Din => Din, TxBusy => TxBusy, TopTx => toptx, StartTx => StartTx ); timings_unit: timing generic map ( F => F, baud_rate => baud_rate ) port map ( CLK => clk, RST => rst, ClrDiv => Sig_ClrDiv, Top16 => top16, TopTx => toptx, TopRx => toprx ); end;
architecture rtl of fifo is begin my_signal <= '1' when input = "00" else my_signal2 or my_sig3 when input = "01" else my_sig4 and my_sig5 when input = "10" else '0'; my_signal <= '1' when input = "0000" else my_signal2 or my_sig3 when input = "0100" and input = "1100" else my_sig4 when input = "0010" else '0'; my_signal <= '1' when input(1 downto 0) = "00" and func1(func2(G_VALUE1), to_integer(cons1(37 downto 0))) = 256 else '0' when input(3 downto 0) = "0010" else 'Z'; my_signal <= '1' when input(1 downto 0) = "00" and func1(func2(G_VALUE1), to_integer(cons1(37 downto 0))) = 256 else '0' when input(3 downto 0) = "0010" else 'Z'; my_signal <= '1' when a = "0000" and func1(345) or b = "1000" and func2(567) and c = "00" else sig1 when a = "1000" and func2(560) and b = "0010" else '0'; my_signal <= '1' when input(1 downto 0) = "00" and func1(func2(G_VALUE1), to_integer(cons1(37 downto 0))) = 256 else my_signal when input(3 downto 0) = "0010" else 'Z'; -- Testing no code after assignment my_signal <= '1' when input(1 downto 0) = "00" and func1(func2(G_VALUE1), to_integer(cons1(37 downto 0))) = 256 else my_signal when input(3 downto 0) = "0010" else 'Z'; my_signal <= (others => '0') when input(1 downto 0) = "00" and func1(func2(G_VALUE1), to_integer(cons1(37 downto 0))) = 256 else my_signal when input(3 downto 0) = "0010" else 'Z'; end architecture rtl;
------------------------------- ---- Project: EurySPACE CCSDS RX/TX with wishbone interface ---- Design Name: ccsds_tx_physical_layer ---- Version: 1.0.0 ---- Description: ---- Implementation of standard CCSDS 401.0-B ------------------------------- ---- Author(s): ---- Guillaume REMBERT ------------------------------- ---- Licence: ---- MIT ------------------------------- ---- Changes list: ---- 2015/11/17: initial release ------------------------------- --TODO: Gray coder -- libraries used library ieee; use ieee.std_logic_1164.all; -- unitary tx physical layer entity ccsds_tx_physical_layer is generic ( constant CCSDS_TX_PHYSICAL_BITS_PER_SYMBOL: integer; constant CCSDS_TX_PHYSICAL_MODULATION_TYPE: integer; constant CCSDS_TX_PHYSICAL_DATA_BUS_SIZE: integer; constant CCSDS_TX_PHYSICAL_OVERSAMPLING_RATIO: integer; constant CCSDS_TX_PHYSICAL_SIG_QUANT_DEPTH : integer ); port( -- inputs clk_sam_i: in std_logic; clk_sym_i: in std_logic; dat_i: in std_logic_vector(CCSDS_TX_PHYSICAL_DATA_BUS_SIZE-1 downto 0); dat_val_i: in std_logic; rst_i: in std_logic; -- outputs sam_i_o: out std_logic_vector(CCSDS_TX_PHYSICAL_SIG_QUANT_DEPTH-1 downto 0); sam_q_o: out std_logic_vector(CCSDS_TX_PHYSICAL_SIG_QUANT_DEPTH-1 downto 0) ); end ccsds_tx_physical_layer; -- internal processing architecture structure of ccsds_tx_physical_layer is component ccsds_tx_mapper_bits_symbols is generic( CCSDS_TX_MAPPER_DATA_BUS_SIZE: integer; CCSDS_TX_MAPPER_MODULATION_TYPE: integer; CCSDS_TX_MAPPER_BITS_PER_SYMBOL: integer ); port( clk_i: in std_logic; dat_i: in std_logic_vector(CCSDS_TX_MAPPER_DATA_BUS_SIZE-1 downto 0); dat_val_i: in std_logic; rst_i: in std_logic; sym_val_o: out std_logic; sym_i_o: out std_logic_vector(CCSDS_TX_MAPPER_BITS_PER_SYMBOL-1 downto 0); sym_q_o: out std_logic_vector(CCSDS_TX_MAPPER_BITS_PER_SYMBOL-1 downto 0) ); end component; component ccsds_tx_filter is generic( CCSDS_TX_FILTER_OVERSAMPLING_RATIO: integer; CCSDS_TX_FILTER_SIG_QUANT_DEPTH: integer; CCSDS_TX_FILTER_MODULATION_TYPE: integer; CCSDS_TX_FILTER_BITS_PER_SYMBOL: integer ); port( clk_i: in std_logic; sym_val_i: in std_logic; sym_i_i: in std_logic_vector(CCSDS_TX_FILTER_BITS_PER_SYMBOL-1 downto 0); sym_q_i: in std_logic_vector(CCSDS_TX_FILTER_BITS_PER_SYMBOL-1 downto 0); rst_i: in std_logic; sam_i_o: out std_logic_vector(CCSDS_TX_FILTER_SIG_QUANT_DEPTH-1 downto 0); sam_q_o: out std_logic_vector(CCSDS_TX_FILTER_SIG_QUANT_DEPTH-1 downto 0); sam_val_o: out std_logic ); end component; signal wire_sym_i: std_logic_vector(CCSDS_TX_PHYSICAL_BITS_PER_SYMBOL-1 downto 0); signal wire_sym_q: std_logic_vector(CCSDS_TX_PHYSICAL_BITS_PER_SYMBOL-1 downto 0); signal wire_sym_val: std_logic; begin tx_mapper_bits_symbols_0: ccsds_tx_mapper_bits_symbols generic map( CCSDS_TX_MAPPER_BITS_PER_SYMBOL => CCSDS_TX_PHYSICAL_BITS_PER_SYMBOL, CCSDS_TX_MAPPER_MODULATION_TYPE => CCSDS_TX_PHYSICAL_MODULATION_TYPE, CCSDS_TX_MAPPER_DATA_BUS_SIZE => CCSDS_TX_PHYSICAL_DATA_BUS_SIZE ) port map( clk_i => clk_sym_i, dat_i => dat_i, dat_val_i => dat_val_i, rst_i => rst_i, sym_i_o => wire_sym_i, sym_q_o => wire_sym_q, sym_val_o => wire_sym_val ); tx_filter_0: ccsds_tx_filter generic map( CCSDS_TX_FILTER_OVERSAMPLING_RATIO => CCSDS_TX_PHYSICAL_OVERSAMPLING_RATIO, CCSDS_TX_FILTER_MODULATION_TYPE => CCSDS_TX_PHYSICAL_MODULATION_TYPE, CCSDS_TX_FILTER_SIG_QUANT_DEPTH => CCSDS_TX_PHYSICAL_SIG_QUANT_DEPTH, CCSDS_TX_FILTER_BITS_PER_SYMBOL => CCSDS_TX_PHYSICAL_BITS_PER_SYMBOL ) port map( clk_i => clk_sam_i, sym_i_i => wire_sym_i, sym_q_i => wire_sym_q, sym_val_i => wire_sym_val, rst_i => rst_i, -- sam_val_o => , sam_i_o => sam_i_o, sam_q_o => sam_q_o ); end structure;
library IEEE; use ieee.std_logic_1164.all; entity pw_string is port ( push_pop : in std_logic; char : in character; clk : in std_logic; enable: in std_logic; pwd : out string ); end pw_string; architecture arch_pw_string of pw_string is signal zero_addr : std_logic := '0'; begin process(clk) variable addr : positive := 1; begin if falling_edge(clk) and enable = '1' then if push_pop = '1' then if addr < pwd'length then if zero_addr = '0' then zero_addr <= '1'; else addr := addr + 1; end if; pwd(addr) <= char; end if; else pwd(addr) <= nul; if addr > 1 then addr := addr - 1; else -- if addr = 0 then zero_addr <= '0'; end if; end if; end if; end process; end arch_pw_string;
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity output_split3 is port ( wa0_data : in std_logic_vector(7 downto 0); wa0_addr : in std_logic_vector(2 downto 0); ra0_data : out std_logic_vector(7 downto 0); ra0_addr : in std_logic_vector(2 downto 0); wa0_en : in std_logic; clk : in std_logic ); end output_split3; architecture augh of output_split3 is -- Embedded RAM type ram_type is array (0 to 7) of std_logic_vector(7 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) ); end architecture;
library ieee; use ieee.std_logic_1164.all; library ieee; use ieee.numeric_std.all; entity output_split3 is port ( wa0_data : in std_logic_vector(7 downto 0); wa0_addr : in std_logic_vector(2 downto 0); ra0_data : out std_logic_vector(7 downto 0); ra0_addr : in std_logic_vector(2 downto 0); wa0_en : in std_logic; clk : in std_logic ); end output_split3; architecture augh of output_split3 is -- Embedded RAM type ram_type is array (0 to 7) of std_logic_vector(7 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) ); end architecture;
-- Manually adapted from ../../../../../reconfmodule/chll/out/chip-fpga_top-a.vhd architecture fpga_top of chip is component Core generic ( DBG_I2C_ADDR : integer := 42 ); port ( Reset_n_i : in std_logic; Clk_i : in std_logic; Cpu_En_i : in std_logic; LFXT_Clk_i : in std_logic; Dbg_En_i : in std_logic; Dbg_SCL_i : in std_logic; Dbg_SDA_Out_o : out std_logic; Dbg_SDA_In_i : in std_logic; P1_DOut_o : out std_logic_vector(7 downto 0); P1_En_o : out std_logic_vector(7 downto 0); P1_DIn_i : in std_logic_vector(7 downto 0); P2_DOut_o : out std_logic_vector(7 downto 0); P2_En_o : out std_logic_vector(7 downto 0); P2_DIn_i : in std_logic_vector(7 downto 0); UartRxD_i : in std_logic; UartTxD_o : out std_logic; SCK_o : out std_logic; MOSI_o : out std_logic; MISO_i : in std_logic; Inputs_i : in std_logic_vector(7 downto 0); Outputs_o : out std_logic_vector(7 downto 0); SPIMISO_i : in std_logic; SPIMOSI_o : out std_logic; SPISCK_o : out std_logic; I2CSCL_o : out std_logic; I2CSDA_i : in std_logic; I2CSDA_o : out std_logic; AdcConvComplete_i : in std_logic; AdcDoConvert_o : out std_logic; AdcValue_i : in std_logic_vector(9 downto 0) ); end component; signal Dbg_SDA_In_i : std_logic; signal Dbg_SDA_Out_o : std_logic; signal P1_DIn_i : std_logic_vector(7 downto 0); signal P1_DOut_o : std_logic_vector(7 downto 0); signal P1_En_o : std_logic_vector(7 downto 0); signal P2_DIn_i : std_logic_vector(7 downto 0); signal P2_DOut_o : std_logic_vector(7 downto 0); signal P2_En_o : std_logic_vector(7 downto 0); signal I2CSCL_o : std_logic; signal I2CSDA_i : std_logic; signal I2CSDA_o : std_logic; constant ClkDivWidth : integer := 10; constant StartValue : integer range 0 to (2**ClkDivWidth-1) := 4; -- 4: 10MHz, 49: 1MHz, 499: 100kHz signal Clk_s : std_logic; signal Counter : unsigned(ClkDivWidth-1 downto 0); begin ClkDividerProc: process (Clk_i, Reset_i) begin -- process ClkDividerProc if Reset_i = '1' then Counter <= (others => '0'); Clk_s <= '0'; elsif Clk_i'event and Clk_i = '1' then -- rising clock edge if Counter = 0 then Counter <= to_unsigned(StartValue,Counter'length); Clk_s <= not Clk_s; else Counter <= Counter - 1; end if; end if; end process ClkDividerProc; core_1: Core port map ( Reset_n_i => "not"(Reset_i), Clk_i => Clk_s, Cpu_En_i => '1', LFXT_Clk_i => '0', Dbg_En_i => Dbg_En_i, Dbg_SCL_i => Dbg_SCL_i, Dbg_SDA_In_i => Dbg_SDA_In_i, Dbg_SDA_Out_o => Dbg_SDA_Out_o, P1_DIn_i => P1_DIn_i, P1_DOut_o => P1_DOut_o, P1_En_o => P1_En_o, P2_DIn_i => P2_DIn_i, P2_DOut_o => P2_DOut_o, P2_En_o => P2_En_o, UartRxD_i => UartRxD_i, UartTxD_o => UartTxD_o, MISO_i => MISO_i, MOSI_o => MOSI_o, SCK_o => SCK_o, Inputs_i => Inputs_i, Outputs_o => Outputs_o, SPIMISO_i => SPIMISO_i, SPIMOSI_o => SPIMOSI_o, SPISCK_o => SPISCK_o, I2CSCL_o => I2CSCL_o, I2CSDA_i => I2CSDA_i, I2CSDA_o => I2CSDA_o, AdcConvComplete_i => AdcConvComplete_i, AdcDoConvert_o => AdcDoConvert_o, AdcValue_i => AdcValue_i ); Dbg_SDA_In_i <= To_X01(Dbg_SDA_b); OD_Dbg_SDA_b_Proc: process (Dbg_SDA_Out_o) begin if Dbg_SDA_Out_o = '1' then Dbg_SDA_b <= 'Z'; else Dbg_SDA_b <= '0'; end if; end process OD_Dbg_SDA_b_Proc; P1_DIn_i <= To_X01(P1_b); InOut_P1_b_Proc: process (P1_DOut_o,P1_En_o) begin for I in P1_DOut_o'range loop if P1_En_o(I) = '1' then P1_b(I) <= P1_DOut_o(I); else P1_b(I) <= 'Z'; end if; end loop; end process InOut_P1_b_Proc; P2_DIn_i <= To_X01(P2_b); InOut_P2_b_Proc: process (P2_DOut_o,P2_En_o) begin for I in P2_DOut_o'range loop if P2_En_o(I) = '1' then P2_b(I) <= P2_DOut_o(I); else P2_b(I) <= 'Z'; end if; end loop; end process InOut_P2_b_Proc; OD_I2CSCL_b_Proc: process (I2CSCL_o) begin if I2CSCL_o = '1' then I2CSCL_b <= 'Z'; else I2CSCL_b <= '0'; end if; end process OD_I2CSCL_b_Proc; I2CSDA_i <= To_X01(I2CSDA_b); OD_I2CSDA_b_Proc: process (I2CSDA_o) begin if I2CSDA_o = '1' then I2CSDA_b <= 'Z'; else I2CSDA_b <= '0'; end if; end process OD_I2CSDA_b_Proc; end fpga_top;
-- -- Simul Package -- Package of Simul, with additional procedures and functions only for simulations. -- -- Author(s): -- * Rodrigo A. Melo -- -- Copyright (c) 2015-2016 Authors and INTI -- Distributed under the BSD 3-Clause License -- library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; library STD; use STD.textio.all; package Simul is ---------------------------------------------------------------------------- -- Print ---------------------------------------------------------------------------- procedure print(message: character; reps: positive:=1); procedure print(message: string; reps: positive:=1); ---------------------------------------------------------------------------- -- Convertions ---------------------------------------------------------------------------- function hex2bin(arg: string) return string; function bin2hex(arg: string) return string; function to_str(arg: std_logic_vector; format: character:='B') return string; function to_str(arg: unsigned; format: character:='B') return string; function to_str(arg: signed; format: character:='B') return string; function to_str(arg: integer) return string; function to_char(arg: integer) return character; function to_char(arg: std_logic) return character; function to_char(arg: std_logic_vector(7 downto 0)) return character; function to_logic(arg: character) return std_logic; function to_vector(arg: string) return std_logic_vector; ---------------------------------------------------------------------------- -- Read/Write ---------------------------------------------------------------------------- procedure read(l: inout line; value: out std_logic); procedure read(l: inout line; value: out std_logic; good: out boolean); procedure read(l: inout line; value: out std_logic_vector); procedure read(l: inout line; value: out std_logic_vector; good: out boolean); procedure write(l: inout line; value: in std_logic); procedure write(l: inout line; value: in std_logic_vector); ---------------------------------------------------------------------------- -- Components ---------------------------------------------------------------------------- component Clock is generic( FREQUENCY : positive:=25e6; -- Hz PERIOD : time:=0 sec; -- Used insted of FREQUENCY when greater than 0 sec RESET_CLKS : real:=1.5 -- Reset duration expresed in clocks ); port( clk_o : out std_logic; rst_o : out std_logic; stop_i : in boolean:=FALSE -- Stop clock generation ); end component Clock; ---------------------------------------------------------------------------- end package Simul; package body Simul is ---------------------------------------------------------------------------- -- Print ---------------------------------------------------------------------------- procedure print(message: character; reps: positive:=1) is variable l : line; begin for i in 1 to reps loop write(l,message); end loop; writeline(output,l); end procedure print; procedure print(message: string; reps: positive:=1) is variable l : line; begin for i in 1 to reps loop write(l,message); end loop; writeline(output,l); end procedure print; ---------------------------------------------------------------------------- -- Conversions bin <> hex ---------------------------------------------------------------------------- function hex2bin(arg: string) return string is variable bin : string(1 to (arg'length * 4)); variable index : integer; variable char : character; begin index := 1; for i in arg'range loop char := arg(i); case char is when '0' => bin(index to index+3) := "0000"; when '1' => bin(index to index+3) := "0001"; when '2' => bin(index to index+3) := "0010"; when '3' => bin(index to index+3) := "0011"; when '4' => bin(index to index+3) := "0100"; when '5' => bin(index to index+3) := "0101"; when '6' => bin(index to index+3) := "0110"; when '7' => bin(index to index+3) := "0111"; when '8' => bin(index to index+3) := "1000"; when '9' => bin(index to index+3) := "1001"; when 'A'|'a' => bin(index to index+3) := "1010"; when 'B'|'b' => bin(index to index+3) := "1011"; when 'C'|'c' => bin(index to index+3) := "1100"; when 'D'|'d' => bin(index to index+3) := "1101"; when 'E'|'e' => bin(index to index+3) := "1110"; when 'F'|'f' => bin(index to index+3) := "1111"; -- when 'Z'|'z' => bin(index to index+3) := "ZZZZ"; when 'L'|'l' => bin(index to index+3) := "LLLL"; when 'H'|'h' => bin(index to index+3) := "HHHH"; when 'U'|'u' => bin(index to index+3) := "UUUU"; when 'W'|'w' => bin(index to index+3) := "WWWW"; when others => bin(index to index+3) := "XXXX"; end case; index := index + 4; end loop; return bin; end hex2bin; function bin2hex(arg: string) return string is constant high : positive:=arg'length/4; variable hex : string(1 to high); variable index : integer; variable str : string(1 to 4); begin index := 0; for i in 1 to high loop str := arg((i*4-3) to (i*4)); case str is when "0000" => hex(index+1):='0'; when "0001" => hex(index+1):='1'; when "0010" => hex(index+1):='2'; when "0011" => hex(index+1):='3'; when "0100" => hex(index+1):='4'; when "0101" => hex(index+1):='5'; when "0110" => hex(index+1):='6'; when "0111" => hex(index+1):='7'; when "1000" => hex(index+1):='8'; when "1001" => hex(index+1):='9'; when "1010" => hex(index+1):='A'; when "1011" => hex(index+1):='B'; when "1100" => hex(index+1):='C'; when "1101" => hex(index+1):='D'; when "1110" => hex(index+1):='E'; when "1111" => hex(index+1):='F'; -- when "ZZZZ" => hex(index+1):='Z'; when "LLLL" => hex(index+1):='L'; when "HHHH" => hex(index+1):='H'; when "UUUU" => hex(index+1):='U'; when "WWWW" => hex(index+1):='W'; when others => hex(index+1):='X'; end case; index := index + 1; end loop; return hex; end function bin2hex; ---------------------------------------------------------------------------- -- Conversions to string ---------------------------------------------------------------------------- function to_str(arg: std_logic_vector; format: character:='B') return string is variable str : string (1 to arg'length); variable index : integer; begin index := 1; for i in arg'range loop str(index) := to_char(arg(i)); index := index + 1; end loop; if format='B' or format='b' then return str; end if; if format='H' or format='h' then return bin2hex(str); end if; report "to_str: unsupported format parameter ("&format&")" severity failure; return str; end to_str; function to_str(arg: unsigned; format: character:='B') return string is begin return to_str(std_logic_vector(arg), format); end function to_str; function to_str(arg: signed; format: character:='B') return string is begin return to_str(std_logic_vector(arg), format); end function to_str; function to_str(arg: integer) return string is begin return integer'image(arg); end function to_str; ---------------------------------------------------------------------------- -- Conversions to char ---------------------------------------------------------------------------- function to_char(arg: integer) return character is begin return character'val(arg); end to_char; function to_char(arg: std_logic) return character is variable str : string(1 to 3); begin str:=std_logic'image(arg); return str(2); end to_char; function to_char(arg: std_logic_vector(7 downto 0)) return character is begin return character'val(to_integer(unsigned(arg))); end function to_char; ---------------------------------------------------------------------------- -- Conversions to standard logic ---------------------------------------------------------------------------- function to_logic(arg: character) return std_logic is variable sl: std_logic; begin case arg is when '0' => sl := '0'; when '1' => sl := '1'; when '-' => sl := '-'; when 'U'|'u' => sl := 'U'; when 'X'|'x' => sl := 'X'; when 'Z'|'z' => sl := 'Z'; when 'W'|'w' => sl := 'W'; when 'L'|'l' => sl := 'L'; when 'H'|'h' => sl := 'H'; when others => sl := 'X'; end case; return sl; end to_logic; function to_vector(arg: string) return std_logic_vector is variable slv : std_logic_vector(arg'length-1 downto 0); variable index : integer; begin index := arg'length-1; for i in arg'range loop slv(index) := to_logic(arg(i)); index := index - 1; end loop; return slv; end to_vector; ---------------------------------------------------------------------------- -- Read/Write ---------------------------------------------------------------------------- procedure read(l: inout line; value: out std_logic) is variable str : string(1 downto 1); begin read(l,str); value:=to_logic(str(1)); end procedure read; procedure read(l: inout line; value: out std_logic; good: out boolean) is variable str : string(1 downto 1); variable ok : boolean; begin read(l,str,ok); good:=ok; if ok then value:=to_logic(str(1)); end if; end procedure read; procedure read(l: inout line; value: out std_logic_vector) is variable str : string(value'length downto 1); begin read(l,str); value:=to_vector(str); end procedure read; procedure read(l: inout line; value: out std_logic_vector; good: out boolean) is variable str : string(value'length downto 1); variable ok : boolean; begin read(l,str,ok); good:=ok; if ok then value:=to_vector(str); end if; end procedure read; procedure write(l: inout line; value: in std_logic) is variable str : string(3 downto 1); begin str:=std_logic'image(value); write(l,str(2)); end procedure write; procedure write(l: inout line; value: in std_logic_vector) is variable str : string(3 downto 1); begin for i in value'range loop str:=std_logic'image(value(i)); write(l,str(2)); end loop; end procedure write; ---------------------------------------------------------------------------- end package body Simul;
-- (c) Copyright 1995-2017 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. -- -- DO NOT MODIFY THIS FILE. -- IP VLNV: xilinx.com:ip:cordic:6.0 -- IP Revision: 11 LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; LIBRARY cordic_v6_0_11; USE cordic_v6_0_11.cordic_v6_0_11; ENTITY sqrt IS PORT ( aclk : IN STD_LOGIC; s_axis_cartesian_tvalid : IN STD_LOGIC; s_axis_cartesian_tdata : IN STD_LOGIC_VECTOR(15 DOWNTO 0); m_axis_dout_tvalid : OUT STD_LOGIC; m_axis_dout_tdata : OUT STD_LOGIC_VECTOR(15 DOWNTO 0) ); END sqrt; ARCHITECTURE sqrt_arch OF sqrt IS ATTRIBUTE DowngradeIPIdentifiedWarnings : STRING; ATTRIBUTE DowngradeIPIdentifiedWarnings OF sqrt_arch: ARCHITECTURE IS "yes"; COMPONENT cordic_v6_0_11 IS GENERIC ( C_ARCHITECTURE : INTEGER; C_CORDIC_FUNCTION : INTEGER; C_COARSE_ROTATE : INTEGER; C_DATA_FORMAT : INTEGER; C_XDEVICEFAMILY : STRING; C_HAS_ACLKEN : INTEGER; C_HAS_ACLK : INTEGER; C_HAS_S_AXIS_CARTESIAN : INTEGER; C_HAS_S_AXIS_PHASE : INTEGER; C_HAS_ARESETN : INTEGER; C_INPUT_WIDTH : INTEGER; C_ITERATIONS : INTEGER; C_OUTPUT_WIDTH : INTEGER; C_PHASE_FORMAT : INTEGER; C_PIPELINE_MODE : INTEGER; C_PRECISION : INTEGER; C_ROUND_MODE : INTEGER; C_SCALE_COMP : INTEGER; C_THROTTLE_SCHEME : INTEGER; C_TLAST_RESOLUTION : INTEGER; C_HAS_S_AXIS_PHASE_TUSER : INTEGER; C_HAS_S_AXIS_PHASE_TLAST : INTEGER; C_S_AXIS_PHASE_TDATA_WIDTH : INTEGER; C_S_AXIS_PHASE_TUSER_WIDTH : INTEGER; C_HAS_S_AXIS_CARTESIAN_TUSER : INTEGER; C_HAS_S_AXIS_CARTESIAN_TLAST : INTEGER; C_S_AXIS_CARTESIAN_TDATA_WIDTH : INTEGER; C_S_AXIS_CARTESIAN_TUSER_WIDTH : INTEGER; C_M_AXIS_DOUT_TDATA_WIDTH : INTEGER; C_M_AXIS_DOUT_TUSER_WIDTH : INTEGER ); PORT ( aclk : IN STD_LOGIC; aclken : IN STD_LOGIC; aresetn : IN STD_LOGIC; s_axis_phase_tvalid : IN STD_LOGIC; s_axis_phase_tready : OUT STD_LOGIC; s_axis_phase_tuser : IN STD_LOGIC_VECTOR(0 DOWNTO 0); s_axis_phase_tlast : IN STD_LOGIC; s_axis_phase_tdata : IN STD_LOGIC_VECTOR(15 DOWNTO 0); s_axis_cartesian_tvalid : IN STD_LOGIC; s_axis_cartesian_tready : OUT STD_LOGIC; s_axis_cartesian_tuser : IN STD_LOGIC_VECTOR(0 DOWNTO 0); s_axis_cartesian_tlast : IN STD_LOGIC; s_axis_cartesian_tdata : IN STD_LOGIC_VECTOR(15 DOWNTO 0); m_axis_dout_tvalid : OUT STD_LOGIC; m_axis_dout_tready : IN STD_LOGIC; m_axis_dout_tuser : OUT STD_LOGIC_VECTOR(0 DOWNTO 0); m_axis_dout_tlast : OUT STD_LOGIC; m_axis_dout_tdata : OUT STD_LOGIC_VECTOR(15 DOWNTO 0) ); END COMPONENT cordic_v6_0_11; ATTRIBUTE X_INTERFACE_INFO : STRING; ATTRIBUTE X_INTERFACE_INFO OF aclk: SIGNAL IS "xilinx.com:signal:clock:1.0 aclk_intf CLK"; ATTRIBUTE X_INTERFACE_INFO OF s_axis_cartesian_tvalid: SIGNAL IS "xilinx.com:interface:axis:1.0 S_AXIS_CARTESIAN TVALID"; ATTRIBUTE X_INTERFACE_INFO OF s_axis_cartesian_tdata: SIGNAL IS "xilinx.com:interface:axis:1.0 S_AXIS_CARTESIAN TDATA"; ATTRIBUTE X_INTERFACE_INFO OF m_axis_dout_tvalid: SIGNAL IS "xilinx.com:interface:axis:1.0 M_AXIS_DOUT TVALID"; ATTRIBUTE X_INTERFACE_INFO OF m_axis_dout_tdata: SIGNAL IS "xilinx.com:interface:axis:1.0 M_AXIS_DOUT TDATA"; BEGIN U0 : cordic_v6_0_11 GENERIC MAP ( C_ARCHITECTURE => 2, C_CORDIC_FUNCTION => 6, C_COARSE_ROTATE => 0, C_DATA_FORMAT => 1, C_XDEVICEFAMILY => "zynq", C_HAS_ACLKEN => 0, C_HAS_ACLK => 1, C_HAS_S_AXIS_CARTESIAN => 1, C_HAS_S_AXIS_PHASE => 0, C_HAS_ARESETN => 0, C_INPUT_WIDTH => 16, C_ITERATIONS => 0, C_OUTPUT_WIDTH => 16, C_PHASE_FORMAT => 0, C_PIPELINE_MODE => -2, C_PRECISION => 0, C_ROUND_MODE => 0, C_SCALE_COMP => 0, C_THROTTLE_SCHEME => 3, C_TLAST_RESOLUTION => 0, C_HAS_S_AXIS_PHASE_TUSER => 0, C_HAS_S_AXIS_PHASE_TLAST => 0, C_S_AXIS_PHASE_TDATA_WIDTH => 16, C_S_AXIS_PHASE_TUSER_WIDTH => 1, C_HAS_S_AXIS_CARTESIAN_TUSER => 0, C_HAS_S_AXIS_CARTESIAN_TLAST => 0, C_S_AXIS_CARTESIAN_TDATA_WIDTH => 16, C_S_AXIS_CARTESIAN_TUSER_WIDTH => 1, C_M_AXIS_DOUT_TDATA_WIDTH => 16, C_M_AXIS_DOUT_TUSER_WIDTH => 1 ) PORT MAP ( aclk => aclk, aclken => '1', aresetn => '1', s_axis_phase_tvalid => '0', s_axis_phase_tuser => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)), s_axis_phase_tlast => '0', s_axis_phase_tdata => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 16)), s_axis_cartesian_tvalid => s_axis_cartesian_tvalid, s_axis_cartesian_tuser => STD_LOGIC_VECTOR(TO_UNSIGNED(0, 1)), s_axis_cartesian_tlast => '0', s_axis_cartesian_tdata => s_axis_cartesian_tdata, m_axis_dout_tvalid => m_axis_dout_tvalid, m_axis_dout_tready => '0', m_axis_dout_tdata => m_axis_dout_tdata ); END sqrt_arch;
-- ============================================================== -- File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC -- Version: 2014.1 -- Copyright (C) 2014 Xilinx Inc. All rights reserved. -- -- ============================================================== library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity indices_if is generic ( C_PLB_AWIDTH : integer := 32; C_PLB_DWIDTH : integer := 64; PLB_ADDR_SHIFT : integer := 3; USER_DATA_WIDTH : integer := 56; USER_DATA_WIDTH_2N : integer := 64; USER_ADDR_SHIFT : integer := 3; -- log2(byte_count_of_data_width) REMOTE_DESTINATION_ADDRESS : std_logic_vector(0 to 31):= X"00000000" ); port ( -- Bus protocol ports, do not add to or delete MPLB_Clk : in std_logic; MPLB_Rst : in std_logic; M_request : out std_logic; M_priority : out std_logic_vector(0 to 1); M_busLock : out std_logic; M_RNW : out std_logic; M_BE : out std_logic_vector(0 to C_PLB_DWIDTH/8-1); M_MSize : out std_logic_vector(0 to 1); M_size : out std_logic_vector(0 to 3); M_type : out std_logic_vector(0 to 2); M_TAttribute : out std_logic_vector(0 to 15); M_lockErr : out std_logic; M_abort : out std_logic; M_ABus : out std_logic_vector(0 to C_PLB_AWIDTH-1); M_UABus : out std_logic_vector(0 to 31); M_wrDBus : out std_logic_vector(0 to C_PLB_DWIDTH-1); M_wrBurst : out std_logic; M_rdBurst : out std_logic; PLB_MAddrAck : in std_logic; PLB_MSSize : in std_logic_vector(0 to 1); PLB_MRearbitrate : in std_logic; PLB_MTimeout : in std_logic; PLB_MBusy : in std_logic; PLB_MRdErr : in std_logic; PLB_MWrErr : in std_logic; PLB_MIRQ : in std_logic; PLB_MRdDBus : in std_logic_vector(0 to (C_PLB_DWIDTH-1)); PLB_MRdWdAddr : in std_logic_vector(0 to 3); PLB_MRdDAck : in std_logic; PLB_MRdBTerm : in std_logic; PLB_MWrDAck : in std_logic; PLB_MWrBTerm : in std_logic; -- signals from user logic USER_RdData : out std_logic_vector(USER_DATA_WIDTH - 1 downto 0); -- Bus read return data to user_logic USER_WrData : in std_logic_vector(USER_DATA_WIDTH - 1 downto 0); -- Bus write data USER_address : in std_logic_vector(31 downto 0); -- word offset from BASE_ADDRESS USER_size : in std_logic_vector(31 downto 0); -- burst size of word USER_req_nRW : in std_logic; -- req type 0: Read, 1: write USER_req_full_n : out std_logic; -- req Fifo full USER_req_push : in std_logic; -- req Fifo push (new request in) USER_rsp_empty_n : out std_logic; -- return data FIFO empty USER_rsp_pop : in std_logic -- return data FIFO pop ); attribute SIGIS : string; attribute SIGIS of MPLB_Clk : signal is "Clk"; attribute SIGIS of MPLB_Rst : signal is "Rst"; end entity; ------------------------------------------------------------------------------ -- Architecture section ------------------------------------------------------------------------------ architecture IMP of indices_if is component indices_if_ap_fifo is generic ( DATA_WIDTH : integer := 32; ADDR_WIDTH : integer := 4; DEPTH : integer := 16); port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; if_empty_n : OUT STD_LOGIC; if_read : IN STD_LOGIC; if_dout : OUT STD_LOGIC_VECTOR(DATA_WIDTH - 1 downto 0); if_full_n : OUT STD_LOGIC; if_write : IN STD_LOGIC; if_din : IN STD_LOGIC_VECTOR(DATA_WIDTH - 1 downto 0) ); end component; component indices_if_plb_master_if is generic ( C_PLB_AWIDTH : integer := 32; C_PLB_DWIDTH : integer := 64; PLB_ADDR_SHIFT : integer := 3); port ( -- Bus protocol ports, do not add to or delete PLB_Clk : in std_logic; PLB_Rst : in std_logic; M_abort : out std_logic; M_ABus : out std_logic_vector(0 to C_PLB_AWIDTH-1); M_BE : out std_logic_vector(0 to C_PLB_DWIDTH/8-1); M_busLock : out std_logic; M_lockErr : out std_logic; M_MSize : out std_logic_vector(0 to 1); M_priority : out std_logic_vector(0 to 1); M_rdBurst : out std_logic; M_request : out std_logic; M_RNW : out std_logic; M_size : out std_logic_vector(0 to 3); M_type : out std_logic_vector(0 to 2); M_wrBurst : out std_logic; M_wrDBus : out std_logic_vector(0 to C_PLB_DWIDTH-1); PLB_MBusy : in std_logic; PLB_MWrBTerm : in std_logic; PLB_MWrDAck : in std_logic; PLB_MAddrAck : in std_logic; PLB_MRdBTerm : in std_logic; PLB_MRdDAck : in std_logic; PLB_MRdDBus : in std_logic_vector(0 to (C_PLB_DWIDTH-1)); PLB_MRdWdAddr : in std_logic_vector(0 to 3); PLB_MRearbitrate : in std_logic; PLB_MSSize : in std_logic_vector(0 to 1); -- signals from user logic BUS_RdData : out std_logic_vector(C_PLB_DWIDTH-1 downto 0); -- Bus read return data to user_logic BUS_WrData : in std_logic_vector(C_PLB_DWIDTH-1 downto 0); -- Bus write data BUS_address : in std_logic_vector(31 downto 0); -- word offset from BASE_ADDRESS BUS_size : in std_logic_vector(31 downto 0); -- burst size of word BUS_req_nRW : in std_logic; -- req type 0: Read, 1: write BUS_req_BE : in std_logic_vector(C_PLB_DWIDTH/8 -1 downto 0); -- Bus write data byte enable BUS_req_full_n : out std_logic; -- req Fifo full BUS_req_push : in std_logic; -- req Fifo push (new request in) BUS_rsp_nRW : out std_logic; -- return data FIFO rsp type BUS_rsp_empty_n : out std_logic; -- return data FIFO empty BUS_rsp_pop : in std_logic -- return data FIFO pop ); end component; -- type state_type is (IDLE, ); -- signal cs, ns : st_type; constant PLB_BW : integer := C_PLB_DWIDTH; constant PLB_BYTE_COUNT : integer := C_PLB_DWIDTH/8; constant USER_DATA_BYTE_COUNT : integer := USER_DATA_WIDTH_2N/8; constant REQ_FIFO_DATA_WIDTH : integer := 1 + 32 + 32 + USER_DATA_WIDTH_2N; -- nRW + addr + size + wr_data constant REQ_FIFO_ADDR_WIDTH : integer := 5; constant REQ_FIFO_DEPTH : integer := 32; constant ALIGN_DATA_WIDTH : integer := USER_DATA_WIDTH_2N + PLB_BW; constant ALIGN_DATA_BE_WIDTH : integer := (USER_DATA_WIDTH_2N + PLB_BW)/8; signal user_phy_address : STD_LOGIC_VECTOR(31 downto 0); -- request FIFO signal req_fifo_empty_n : STD_LOGIC; signal req_fifo_pop : STD_LOGIC; signal req_fifo_dout : STD_LOGIC_VECTOR(REQ_FIFO_DATA_WIDTH - 1 downto 0); signal req_fifo_full_n : STD_LOGIC; signal req_fifo_push : STD_LOGIC; signal req_fifo_din : STD_LOGIC_VECTOR(REQ_FIFO_DATA_WIDTH - 1 downto 0); signal user_WrData_2N : STD_LOGIC_VECTOR(USER_DATA_WIDTH_2N-1 downto 0); signal req_fifo_dout_req_nRW : STD_LOGIC; signal req_fifo_dout_req_address : STD_LOGIC_VECTOR(31 downto 0); signal req_fifo_dout_req_size, req_fifo_dout_req_size_normalize : STD_LOGIC_VECTOR(31 downto 0); -- internal request information signal req_nRW : STD_LOGIC; signal req_address : STD_LOGIC_VECTOR(31 downto 0); signal req_size, burst_size : STD_LOGIC_VECTOR(31 downto 0); signal req_size_user : STD_LOGIC_VECTOR(31 downto 0); signal req_BE : STD_LOGIC_VECTOR(PLB_BYTE_COUNT-1 downto 0); signal req_WrData : STD_LOGIC_VECTOR(ALIGN_DATA_WIDTH -1 downto 0); signal req_WrData_BE : STD_LOGIC_VECTOR(ALIGN_DATA_BE_WIDTH -1 downto 0); signal req_WrData_byte_p : STD_LOGIC_VECTOR(PLB_ADDR_SHIFT-1 downto 0); signal req_valid, req_SOP, req_EOP_user, req_EOP : STD_LOGIC; signal req_burst_write_counter : STD_LOGIC_VECTOR(31 downto 0); signal req_burst_mode, req_last_burst: STD_LOGIC; -- interface to PLB_master_if module signal PLB_master_if_req_full_n : STD_LOGIC; signal PLB_master_if_req_push : STD_LOGIC; signal PLB_master_if_dataout : STD_LOGIC_VECTOR(PLB_BW-1 downto 0); signal PLB_master_if_rsp_nRW : STD_LOGIC; signal PLB_master_if_rsp_empty_n : STD_LOGIC; signal PLB_master_if_rsp_pop : STD_LOGIC; signal USER_size_local: STD_LOGIC_VECTOR(31 downto 0); -- rsp FIFO constant RSP_FIFO_DATA_WIDTH : integer := PLB_ADDR_SHIFT + 32; -- addr + size constant RSP_FIFO_ADDR_WIDTH : integer := 6; constant RSP_FIFO_DEPTH : integer := 64; signal rsp_fifo_empty_n : STD_LOGIC; signal rsp_fifo_pop : STD_LOGIC; signal rsp_fifo_dout : STD_LOGIC_VECTOR(RSP_FIFO_DATA_WIDTH -1 downto 0); signal rsp_fifo_full_n : STD_LOGIC; signal rsp_fifo_push : STD_LOGIC; signal rsp_fifo_din : STD_LOGIC_VECTOR(RSP_FIFO_DATA_WIDTH -1 downto 0); signal rsp_valid, rsp_SOP : STD_LOGIC; signal rsp_addr : STD_LOGIC_VECTOR(PLB_ADDR_SHIFT-1 downto 0); signal rsp_size : STD_LOGIC_VECTOR(31 downto 0); signal rsp_rd_data : STD_LOGIC_VECTOR(ALIGN_DATA_WIDTH -1 downto 0); signal rsp_rd_data_byte_count : STD_LOGIC_VECTOR(4 downto 0); -- rd data user FIFO signal rd_data_user_fifo_empty_n : STD_LOGIC; signal rd_data_user_fifo_pop : STD_LOGIC; signal rd_data_user_fifo_dout : STD_LOGIC_VECTOR(USER_DATA_WIDTH -1 downto 0); signal rd_data_user_fifo_full_n : STD_LOGIC; signal rd_data_user_fifo_push : STD_LOGIC; signal rd_data_user_fifo_din : STD_LOGIC_VECTOR(USER_DATA_WIDTH -1 downto 0); signal rd_data_user_fifo_din_2N : STD_LOGIC_VECTOR(USER_DATA_WIDTH_2N -1 downto 0); signal BE_ALL_ONE : STD_LOGIC_VECTOR(PLB_BYTE_COUNT -1 downto 0); begin BE_ALL_ONE <= (others => '1'); M_UABus <= (others => '0'); M_TAttribute <= (others => '0'); -- interface to user logic user_phy_address(31 downto USER_ADDR_SHIFT) <= REMOTE_DESTINATION_ADDRESS(0 to C_PLB_AWIDTH - USER_ADDR_SHIFT -1) + USER_address(31 -USER_ADDR_SHIFT downto 0); user_phy_address(USER_ADDR_SHIFT-1 downto 0) <= REMOTE_DESTINATION_ADDRESS(C_PLB_AWIDTH - USER_ADDR_SHIFT to C_PLB_AWIDTH -1); USER_size_local <= X"00000001" when conv_integer(USER_size(31 downto 1)) = 0 else USER_size; USER_req_full_n <= req_fifo_full_n; process(USER_WrData) variable i: integer; begin user_WrData_2N <= (others=> '0'); for i in 0 to USER_WrData'length -1 loop user_WrData_2N (USER_DATA_WIDTH_2N-1 -i) <= USER_WrData(i); end loop; end process; req_fifo_din(REQ_FIFO_DATA_WIDTH-1) <= USER_req_nRW; req_fifo_din(REQ_FIFO_DATA_WIDTH-1-1 downto REQ_FIFO_DATA_WIDTH -1-32) <= user_phy_address; req_fifo_din(REQ_FIFO_DATA_WIDTH-1-32-1 downto REQ_FIFO_DATA_WIDTH -1-32-32) <= USER_size_local; req_fifo_din(USER_DATA_WIDTH_2N -1 downto 0) <= user_WrData_2N(USER_DATA_WIDTH_2N-1 downto 0); req_fifo_push <= USER_req_push; U_indices_if_req_fifo: component indices_if_ap_fifo generic map( DATA_WIDTH => REQ_FIFO_DATA_WIDTH, ADDR_WIDTH => REQ_FIFO_ADDR_WIDTH, DEPTH => REQ_FIFO_DEPTH) port map( clk => MPLB_Clk, reset => MPLB_Rst, if_empty_n => req_fifo_empty_n, if_read => req_fifo_pop, if_dout => req_fifo_dout, if_full_n => req_fifo_full_n, if_write => req_fifo_push, if_din => req_fifo_din ); req_fifo_dout_req_nRW <= req_fifo_dout(REQ_FIFO_DATA_WIDTH -1); req_fifo_dout_req_size <= req_fifo_dout(REQ_FIFO_DATA_WIDTH-1-32-1 downto REQ_FIFO_DATA_WIDTH -1-32-32); req_fifo_dout_req_address <= req_fifo_dout(REQ_FIFO_DATA_WIDTH-1-1 downto REQ_FIFO_DATA_WIDTH -1-32); req_fifo_dout_req_size_normalize(31 downto USER_ADDR_SHIFT) <= req_fifo_dout_req_size(31-USER_ADDR_SHIFT downto 0); req_fifo_dout_req_size_normalize(USER_ADDR_SHIFT-1 downto 0) <= (others => '0'); process(req_fifo_empty_n, req_valid) begin req_fifo_pop <= '0'; if (req_fifo_empty_n = '1' and req_valid = '0') then -- lunch next request req_fifo_pop <= '1'; end if; end process; process (MPLB_Clk, MPLB_Rst) variable offset: integer; begin if (MPLB_Rst = '1') then req_nRW <= '0'; burst_size <= (others => '0'); req_size_user <= (others => '0'); req_address <= (others => '0'); req_WrData <= (others => '0'); -- set possible MSB to ZERO req_WrData_BE <= (others => '0'); -- set possible MSB to ZERO req_WrData_byte_p <= (others => '0'); -- set possible MSB to ZERO req_valid <= '0'; req_EOP <= '0'; req_burst_write_counter <= (others => '0'); req_burst_mode <= '0'; elsif (MPLB_Clk'event and MPLB_Clk = '1') then if (req_fifo_pop = '1') then -- lunch next request req_valid <= '1'; if (req_burst_mode = '0') then if (req_fifo_dout_req_nRW = '0') then if (req_fifo_dout_req_size_normalize(PLB_ADDR_SHIFT-1 downto 0) = CONV_STD_LOGIC_VECTOR(0,PLB_ADDR_SHIFT) and req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0) = CONV_STD_LOGIC_VECTOR(0,PLB_ADDR_SHIFT)) then burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT); elsif (('0'&req_fifo_dout_req_size_normalize(PLB_ADDR_SHIFT-1 downto 0)) + ('0'&req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0)) <= PLB_BYTE_COUNT) then burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT) + 1; else burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT) + 2; end if; else burst_size <= X"00000001"; -- single by default if (req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT+1) /= CONV_STD_LOGIC_VECTOR(0,31-PLB_ADDR_SHIFT)) then -- may burst burst_size(31 downto 32-PLB_ADDR_SHIFT) <= (others=>'0'); -- burst_size for write operation if (req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0) = CONV_STD_LOGIC_VECTOR(0, PLB_ADDR_SHIFT)) or (conv_integer(req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0)) + conv_integer(req_fifo_dout_req_size_normalize(PLB_ADDR_SHIFT-1 downto 0)) >= PLB_BYTE_COUNT) then burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT); else burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT)-1; end if; end if; end if; offset := conv_integer(req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0)); if (req_fifo_dout_req_nRW = '1') then req_WrData(USER_DATA_WIDTH_2N +offset*8 -1 downto offset*8) <= req_fifo_dout(USER_DATA_WIDTH_2N -1 downto 0); req_WrData_BE(USER_DATA_BYTE_COUNT+offset-1 downto offset) <= (others => '1'); end if; req_size_user <= req_fifo_dout_req_size; -- for read operation req_nRW <= req_fifo_dout_req_nRW; req_EOP <= '1'; req_address <= req_fifo_dout_req_address; req_burst_write_counter <= req_fifo_dout_req_size; req_WrData_byte_p <= req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0) + USER_DATA_BYTE_COUNT; if (req_fifo_dout_req_nRW = '1' and req_fifo_dout_req_size(31 downto 1) /= "0000000000000000000000000000000") then req_burst_mode <= '1'; req_EOP <= '0'; end if; else -- in a burst write process req_burst_write_counter <= req_burst_write_counter -1; offset := conv_integer(req_WrData_byte_p); req_WrData(USER_DATA_WIDTH_2N +offset*8 -1 downto offset*8) <= req_fifo_dout(USER_DATA_WIDTH_2N -1 downto 0); req_WrData_BE(USER_DATA_BYTE_COUNT+offset-1 downto offset) <= (others => '1'); req_WrData_byte_p <= req_WrData_byte_p + USER_DATA_BYTE_COUNT; if (req_last_burst = '1') then req_burst_mode <= '0'; req_EOP <= '1'; end if; end if; elsif (req_valid = '1') then if (req_nRW = '0' and PLB_master_if_req_push = '1') then req_valid <= '0'; elsif (req_nRW = '1') then if (req_EOP = '1' and PLB_master_if_req_push = '1') then -- last burst request if (req_WrData_BE(ALIGN_DATA_BE_WIDTH-1 downto PLB_BYTE_COUNT) = CONV_STD_LOGIC_VECTOR(0, ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT)) then req_valid <= '0'; req_EOP <= '0'; req_WrData <= (others=>'0'); req_WrData_BE <= (others => '0'); else req_WrData(USER_DATA_WIDTH_2N + PLB_BW -1 downto USER_DATA_WIDTH_2N) <= (others => '0'); req_WrData(USER_DATA_WIDTH_2N -1 downto 0) <= req_WrData(USER_DATA_WIDTH_2N +PLB_BW -1 downto PLB_BW); req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT) <= (others => '0'); req_WrData_BE(ALIGN_DATA_BE_WIDTH -PLB_BYTE_COUNT-1 downto 0) <= req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto PLB_BYTE_COUNT); req_address(31 downto PLB_ADDR_SHIFT) <= req_address(31 downto PLB_ADDR_SHIFT) +1; req_address(PLB_ADDR_SHIFT-1 downto 0) <= (others=>'0'); end if; elsif (req_EOP = '0') then if (req_WrData_BE(PLB_BYTE_COUNT-1) = '0') then req_valid <= '0'; elsif (req_WrData_BE(PLB_BYTE_COUNT-1) = '1' and PLB_master_if_req_push = '1') then req_WrData(USER_DATA_WIDTH_2N + PLB_BW -1 downto USER_DATA_WIDTH_2N) <= (others => '0'); req_WrData(USER_DATA_WIDTH_2N -1 downto 0) <= req_WrData(USER_DATA_WIDTH_2N +PLB_BW -1 downto PLB_BW); req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT) <= (others => '0'); req_WrData_BE(ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT-1 downto 0) <= req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto PLB_BYTE_COUNT); req_address(31 downto PLB_ADDR_SHIFT) <= req_address(31 downto PLB_ADDR_SHIFT) +1; req_address(PLB_ADDR_SHIFT-1 downto 0) <= (others=>'0'); end if; end if; end if; end if; end if; end process; req_last_burst <= '1' when (req_burst_mode = '1' and req_burst_write_counter(31 downto 0) = X"00000002") else '0'; process(req_nRW, req_WrData_BE, burst_size) begin req_size <= (others => '0'); if (req_nRW = '0') then req_size <= burst_size; elsif (req_WrData_BE(PLB_BYTE_COUNT-1 downto 0) = BE_ALL_ONE) then req_size <= burst_size; else req_size <= X"00000001"; end if; end process; process(req_valid, PLB_master_if_req_full_n, req_nRW, req_WrData_BE) begin PLB_master_if_req_push <= '0'; if (req_valid = '1' and PLB_master_if_req_full_n = '1') then if (req_nRW = '0') then PLB_master_if_req_push <= '1'; -- only push when the last byte been push elsif (req_WrData_BE(PLB_BYTE_COUNT-1) = '1' or (req_EOP = '1' and req_WrData_BE(PLB_BYTE_COUNT-1 downto 0) /= CONV_STD_LOGIC_VECTOR(0, PLB_BYTE_COUNT))) then PLB_master_if_req_push <= '1'; -- only push when the last byte been push end if; end if; end process; req_BE <= req_WrData_BE(PLB_BYTE_COUNT-1 downto 0) when req_nRW = '1' else (others => '1'); U_indices_if_plb_master_if: component indices_if_plb_master_if generic map( C_PLB_AWIDTH => C_PLB_AWIDTH, C_PLB_DWIDTH => C_PLB_DWIDTH, PLB_ADDR_SHIFT => PLB_ADDR_SHIFT) port map ( -- Bus protocol ports, do not add to or delete PLB_Clk => MPLB_Clk, PLB_Rst => MPLB_Rst, M_abort => M_abort, M_ABus => M_ABus, M_BE => M_BE, M_busLock => M_busLock, M_lockErr => M_lockErr, M_MSize => M_MSize, M_priority => M_priority, M_rdBurst => M_rdBurst, M_request => M_request, M_RNW => M_RNW, M_size => M_size, M_type => M_type, M_wrBurst => M_wrBurst, M_wrDBus => M_wrDBus, PLB_MBusy => PLB_MBusy, PLB_MWrBTerm => PLB_MWrBTerm, PLB_MWrDAck => PLB_MWrDAck, PLB_MAddrAck => PLB_MAddrAck, PLB_MRdBTerm => PLB_MRdBTerm, PLB_MRdDAck => PLB_MRdDAck, PLB_MRdDBus => PLB_MRdDBus, PLB_MRdWdAddr => PLB_MRdWdAddr, PLB_MRearbitrate => PLB_MRearbitrate, PLB_MSSize => PLB_MSSize, -- signals from user logic BUS_RdData => PLB_master_if_dataout, BUS_WrData => req_WrData(PLB_BW-1 downto 0), BUS_address => req_address, BUS_size => req_size, BUS_req_nRW => req_nRW, BUS_req_BE => req_BE, BUS_req_full_n => PLB_master_if_req_full_n, BUS_req_push => PLB_master_if_req_push, BUS_rsp_nRW => PLB_master_if_rsp_nRW, BUS_rsp_empty_n => PLB_master_if_rsp_empty_n, BUS_rsp_pop => PLB_master_if_rsp_pop ); -- below is the response (bus read data) part U_indices_if_rsp_fifo: component indices_if_ap_fifo generic map( DATA_WIDTH => RSP_FIFO_DATA_WIDTH, ADDR_WIDTH => RSP_FIFO_ADDR_WIDTH, DEPTH => RSP_FIFO_DEPTH) port map( clk => MPLB_Clk, reset => MPLB_Rst, if_empty_n => rsp_fifo_empty_n, if_read => rsp_fifo_pop, if_dout => rsp_fifo_dout, if_full_n => rsp_fifo_full_n, if_write => rsp_fifo_push, if_din => rsp_fifo_din ); rsp_fifo_din(32+PLB_ADDR_SHIFT-1 downto 32) <= req_address(PLB_ADDR_SHIFT-1 downto 0); rsp_fifo_din(31 downto 0) <= req_size_user; rsp_fifo_push <= PLB_master_if_req_push and (not req_nRW); process (rsp_valid, PLB_master_if_rsp_empty_n, rsp_rd_data_byte_count) begin PLB_master_if_rsp_pop <= '0'; -- fetch data to rsp_rd_data until enough bytes if (rsp_valid = '1' and PLB_master_if_rsp_empty_n = '1' and CONV_INTEGER(rsp_rd_data_byte_count) < USER_DATA_BYTE_COUNT) then PLB_master_if_rsp_pop <= '1'; end if; end process; process (MPLB_Clk, MPLB_Rst) begin if (MPLB_Rst = '1') then rsp_valid <= '0'; rsp_addr <= (others=> '0'); rsp_size <= (others=> '0'); rsp_SOP <= '1'; rsp_rd_data_byte_count <= (others => '0'); rsp_rd_data <= (others=>'0'); rsp_fifo_pop <= '0'; elsif (MPLB_Clk'event and MPLB_Clk = '1') then rsp_fifo_pop <= '0'; if (rsp_valid = '0' and rsp_fifo_empty_n = '1') then rsp_valid <= '1'; rsp_addr <= rsp_fifo_dout(32+PLB_ADDR_SHIFT-1 downto 32); rsp_size <= rsp_fifo_dout(31 downto 0); rsp_fifo_pop <= '1'; rsp_rd_data_byte_count <= (others=>'0'); rsp_SOP <= '1'; end if; -- fetch data to rsp_rd_data until enough bytes if (PLB_master_if_rsp_pop = '1') then rsp_rd_data(USER_DATA_WIDTH_2N-1 downto 0) <= rsp_rd_data(USER_DATA_WIDTH_2N + PLB_BW -1 downto PLB_BW); rsp_rd_data(USER_DATA_WIDTH_2N +PLB_BW -1 downto USER_DATA_WIDTH_2N) <= PLB_master_if_dataout; if (rsp_SOP = '1') then rsp_rd_data_byte_count <= rsp_rd_data_byte_count + PLB_BYTE_COUNT - rsp_addr; rsp_SOP <= '0'; else rsp_rd_data_byte_count <= rsp_rd_data_byte_count + PLB_BYTE_COUNT; end if; end if; -- write one unit of data to USER LOGIC if (rd_data_user_fifo_push = '1') then rsp_size <= rsp_size -1; rsp_rd_data_byte_count <= rsp_rd_data_byte_count - USER_DATA_BYTE_COUNT; rsp_addr <= rsp_addr + USER_DATA_BYTE_COUNT; if (rsp_size = X"00000001") then rsp_valid <= '0'; end if; end if; end if; end process; process(rsp_addr, rsp_rd_data,rsp_valid, rd_data_user_fifo_full_n, rsp_rd_data_byte_count, rd_data_user_fifo_din_2N) variable i: integer; begin case CONV_INTEGER(rsp_addr) is when 0 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +64 -1 downto 64); when 1 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +8 -1 downto 8); when 2 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +16 -1 downto 16); when 3 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +24 -1 downto 24); when 4 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +32 -1 downto 32); when 5 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +40 -1 downto 40); when 6 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +48 -1 downto 48); when 7 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +56 -1 downto 56); when others => null; end case; for i in 0 to USER_DATA_WIDTH -1 loop rd_data_user_fifo_din(i) <= rd_data_user_fifo_din_2N(USER_DATA_WIDTH_2N-1-i); end loop; rd_data_user_fifo_push <= '0'; if (rsp_valid = '1' and rd_data_user_fifo_full_n = '1' and CONV_INTEGER(rsp_rd_data_byte_count)>= USER_DATA_BYTE_COUNT) then rd_data_user_fifo_push <= '1'; end if; end process; U_indices_if_rd_data_user_fifo: component indices_if_ap_fifo generic map( DATA_WIDTH => USER_DATA_WIDTH, ADDR_WIDTH => 5, DEPTH => 32) port map( clk => MPLB_Clk, reset => MPLB_Rst, if_empty_n => rd_data_user_fifo_empty_n, if_read => USER_rsp_pop, if_dout => rd_data_user_fifo_dout, if_full_n => rd_data_user_fifo_full_n, if_write => rd_data_user_fifo_push, if_din => rd_data_user_fifo_din ); USER_RdData <= rd_data_user_fifo_dout; USER_rsp_empty_n <= rd_data_user_fifo_empty_n; end IMP;
-- ============================================================== -- File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC -- Version: 2014.1 -- Copyright (C) 2014 Xilinx Inc. All rights reserved. -- -- ============================================================== library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity indices_if is generic ( C_PLB_AWIDTH : integer := 32; C_PLB_DWIDTH : integer := 64; PLB_ADDR_SHIFT : integer := 3; USER_DATA_WIDTH : integer := 56; USER_DATA_WIDTH_2N : integer := 64; USER_ADDR_SHIFT : integer := 3; -- log2(byte_count_of_data_width) REMOTE_DESTINATION_ADDRESS : std_logic_vector(0 to 31):= X"00000000" ); port ( -- Bus protocol ports, do not add to or delete MPLB_Clk : in std_logic; MPLB_Rst : in std_logic; M_request : out std_logic; M_priority : out std_logic_vector(0 to 1); M_busLock : out std_logic; M_RNW : out std_logic; M_BE : out std_logic_vector(0 to C_PLB_DWIDTH/8-1); M_MSize : out std_logic_vector(0 to 1); M_size : out std_logic_vector(0 to 3); M_type : out std_logic_vector(0 to 2); M_TAttribute : out std_logic_vector(0 to 15); M_lockErr : out std_logic; M_abort : out std_logic; M_ABus : out std_logic_vector(0 to C_PLB_AWIDTH-1); M_UABus : out std_logic_vector(0 to 31); M_wrDBus : out std_logic_vector(0 to C_PLB_DWIDTH-1); M_wrBurst : out std_logic; M_rdBurst : out std_logic; PLB_MAddrAck : in std_logic; PLB_MSSize : in std_logic_vector(0 to 1); PLB_MRearbitrate : in std_logic; PLB_MTimeout : in std_logic; PLB_MBusy : in std_logic; PLB_MRdErr : in std_logic; PLB_MWrErr : in std_logic; PLB_MIRQ : in std_logic; PLB_MRdDBus : in std_logic_vector(0 to (C_PLB_DWIDTH-1)); PLB_MRdWdAddr : in std_logic_vector(0 to 3); PLB_MRdDAck : in std_logic; PLB_MRdBTerm : in std_logic; PLB_MWrDAck : in std_logic; PLB_MWrBTerm : in std_logic; -- signals from user logic USER_RdData : out std_logic_vector(USER_DATA_WIDTH - 1 downto 0); -- Bus read return data to user_logic USER_WrData : in std_logic_vector(USER_DATA_WIDTH - 1 downto 0); -- Bus write data USER_address : in std_logic_vector(31 downto 0); -- word offset from BASE_ADDRESS USER_size : in std_logic_vector(31 downto 0); -- burst size of word USER_req_nRW : in std_logic; -- req type 0: Read, 1: write USER_req_full_n : out std_logic; -- req Fifo full USER_req_push : in std_logic; -- req Fifo push (new request in) USER_rsp_empty_n : out std_logic; -- return data FIFO empty USER_rsp_pop : in std_logic -- return data FIFO pop ); attribute SIGIS : string; attribute SIGIS of MPLB_Clk : signal is "Clk"; attribute SIGIS of MPLB_Rst : signal is "Rst"; end entity; ------------------------------------------------------------------------------ -- Architecture section ------------------------------------------------------------------------------ architecture IMP of indices_if is component indices_if_ap_fifo is generic ( DATA_WIDTH : integer := 32; ADDR_WIDTH : integer := 4; DEPTH : integer := 16); port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; if_empty_n : OUT STD_LOGIC; if_read : IN STD_LOGIC; if_dout : OUT STD_LOGIC_VECTOR(DATA_WIDTH - 1 downto 0); if_full_n : OUT STD_LOGIC; if_write : IN STD_LOGIC; if_din : IN STD_LOGIC_VECTOR(DATA_WIDTH - 1 downto 0) ); end component; component indices_if_plb_master_if is generic ( C_PLB_AWIDTH : integer := 32; C_PLB_DWIDTH : integer := 64; PLB_ADDR_SHIFT : integer := 3); port ( -- Bus protocol ports, do not add to or delete PLB_Clk : in std_logic; PLB_Rst : in std_logic; M_abort : out std_logic; M_ABus : out std_logic_vector(0 to C_PLB_AWIDTH-1); M_BE : out std_logic_vector(0 to C_PLB_DWIDTH/8-1); M_busLock : out std_logic; M_lockErr : out std_logic; M_MSize : out std_logic_vector(0 to 1); M_priority : out std_logic_vector(0 to 1); M_rdBurst : out std_logic; M_request : out std_logic; M_RNW : out std_logic; M_size : out std_logic_vector(0 to 3); M_type : out std_logic_vector(0 to 2); M_wrBurst : out std_logic; M_wrDBus : out std_logic_vector(0 to C_PLB_DWIDTH-1); PLB_MBusy : in std_logic; PLB_MWrBTerm : in std_logic; PLB_MWrDAck : in std_logic; PLB_MAddrAck : in std_logic; PLB_MRdBTerm : in std_logic; PLB_MRdDAck : in std_logic; PLB_MRdDBus : in std_logic_vector(0 to (C_PLB_DWIDTH-1)); PLB_MRdWdAddr : in std_logic_vector(0 to 3); PLB_MRearbitrate : in std_logic; PLB_MSSize : in std_logic_vector(0 to 1); -- signals from user logic BUS_RdData : out std_logic_vector(C_PLB_DWIDTH-1 downto 0); -- Bus read return data to user_logic BUS_WrData : in std_logic_vector(C_PLB_DWIDTH-1 downto 0); -- Bus write data BUS_address : in std_logic_vector(31 downto 0); -- word offset from BASE_ADDRESS BUS_size : in std_logic_vector(31 downto 0); -- burst size of word BUS_req_nRW : in std_logic; -- req type 0: Read, 1: write BUS_req_BE : in std_logic_vector(C_PLB_DWIDTH/8 -1 downto 0); -- Bus write data byte enable BUS_req_full_n : out std_logic; -- req Fifo full BUS_req_push : in std_logic; -- req Fifo push (new request in) BUS_rsp_nRW : out std_logic; -- return data FIFO rsp type BUS_rsp_empty_n : out std_logic; -- return data FIFO empty BUS_rsp_pop : in std_logic -- return data FIFO pop ); end component; -- type state_type is (IDLE, ); -- signal cs, ns : st_type; constant PLB_BW : integer := C_PLB_DWIDTH; constant PLB_BYTE_COUNT : integer := C_PLB_DWIDTH/8; constant USER_DATA_BYTE_COUNT : integer := USER_DATA_WIDTH_2N/8; constant REQ_FIFO_DATA_WIDTH : integer := 1 + 32 + 32 + USER_DATA_WIDTH_2N; -- nRW + addr + size + wr_data constant REQ_FIFO_ADDR_WIDTH : integer := 5; constant REQ_FIFO_DEPTH : integer := 32; constant ALIGN_DATA_WIDTH : integer := USER_DATA_WIDTH_2N + PLB_BW; constant ALIGN_DATA_BE_WIDTH : integer := (USER_DATA_WIDTH_2N + PLB_BW)/8; signal user_phy_address : STD_LOGIC_VECTOR(31 downto 0); -- request FIFO signal req_fifo_empty_n : STD_LOGIC; signal req_fifo_pop : STD_LOGIC; signal req_fifo_dout : STD_LOGIC_VECTOR(REQ_FIFO_DATA_WIDTH - 1 downto 0); signal req_fifo_full_n : STD_LOGIC; signal req_fifo_push : STD_LOGIC; signal req_fifo_din : STD_LOGIC_VECTOR(REQ_FIFO_DATA_WIDTH - 1 downto 0); signal user_WrData_2N : STD_LOGIC_VECTOR(USER_DATA_WIDTH_2N-1 downto 0); signal req_fifo_dout_req_nRW : STD_LOGIC; signal req_fifo_dout_req_address : STD_LOGIC_VECTOR(31 downto 0); signal req_fifo_dout_req_size, req_fifo_dout_req_size_normalize : STD_LOGIC_VECTOR(31 downto 0); -- internal request information signal req_nRW : STD_LOGIC; signal req_address : STD_LOGIC_VECTOR(31 downto 0); signal req_size, burst_size : STD_LOGIC_VECTOR(31 downto 0); signal req_size_user : STD_LOGIC_VECTOR(31 downto 0); signal req_BE : STD_LOGIC_VECTOR(PLB_BYTE_COUNT-1 downto 0); signal req_WrData : STD_LOGIC_VECTOR(ALIGN_DATA_WIDTH -1 downto 0); signal req_WrData_BE : STD_LOGIC_VECTOR(ALIGN_DATA_BE_WIDTH -1 downto 0); signal req_WrData_byte_p : STD_LOGIC_VECTOR(PLB_ADDR_SHIFT-1 downto 0); signal req_valid, req_SOP, req_EOP_user, req_EOP : STD_LOGIC; signal req_burst_write_counter : STD_LOGIC_VECTOR(31 downto 0); signal req_burst_mode, req_last_burst: STD_LOGIC; -- interface to PLB_master_if module signal PLB_master_if_req_full_n : STD_LOGIC; signal PLB_master_if_req_push : STD_LOGIC; signal PLB_master_if_dataout : STD_LOGIC_VECTOR(PLB_BW-1 downto 0); signal PLB_master_if_rsp_nRW : STD_LOGIC; signal PLB_master_if_rsp_empty_n : STD_LOGIC; signal PLB_master_if_rsp_pop : STD_LOGIC; signal USER_size_local: STD_LOGIC_VECTOR(31 downto 0); -- rsp FIFO constant RSP_FIFO_DATA_WIDTH : integer := PLB_ADDR_SHIFT + 32; -- addr + size constant RSP_FIFO_ADDR_WIDTH : integer := 6; constant RSP_FIFO_DEPTH : integer := 64; signal rsp_fifo_empty_n : STD_LOGIC; signal rsp_fifo_pop : STD_LOGIC; signal rsp_fifo_dout : STD_LOGIC_VECTOR(RSP_FIFO_DATA_WIDTH -1 downto 0); signal rsp_fifo_full_n : STD_LOGIC; signal rsp_fifo_push : STD_LOGIC; signal rsp_fifo_din : STD_LOGIC_VECTOR(RSP_FIFO_DATA_WIDTH -1 downto 0); signal rsp_valid, rsp_SOP : STD_LOGIC; signal rsp_addr : STD_LOGIC_VECTOR(PLB_ADDR_SHIFT-1 downto 0); signal rsp_size : STD_LOGIC_VECTOR(31 downto 0); signal rsp_rd_data : STD_LOGIC_VECTOR(ALIGN_DATA_WIDTH -1 downto 0); signal rsp_rd_data_byte_count : STD_LOGIC_VECTOR(4 downto 0); -- rd data user FIFO signal rd_data_user_fifo_empty_n : STD_LOGIC; signal rd_data_user_fifo_pop : STD_LOGIC; signal rd_data_user_fifo_dout : STD_LOGIC_VECTOR(USER_DATA_WIDTH -1 downto 0); signal rd_data_user_fifo_full_n : STD_LOGIC; signal rd_data_user_fifo_push : STD_LOGIC; signal rd_data_user_fifo_din : STD_LOGIC_VECTOR(USER_DATA_WIDTH -1 downto 0); signal rd_data_user_fifo_din_2N : STD_LOGIC_VECTOR(USER_DATA_WIDTH_2N -1 downto 0); signal BE_ALL_ONE : STD_LOGIC_VECTOR(PLB_BYTE_COUNT -1 downto 0); begin BE_ALL_ONE <= (others => '1'); M_UABus <= (others => '0'); M_TAttribute <= (others => '0'); -- interface to user logic user_phy_address(31 downto USER_ADDR_SHIFT) <= REMOTE_DESTINATION_ADDRESS(0 to C_PLB_AWIDTH - USER_ADDR_SHIFT -1) + USER_address(31 -USER_ADDR_SHIFT downto 0); user_phy_address(USER_ADDR_SHIFT-1 downto 0) <= REMOTE_DESTINATION_ADDRESS(C_PLB_AWIDTH - USER_ADDR_SHIFT to C_PLB_AWIDTH -1); USER_size_local <= X"00000001" when conv_integer(USER_size(31 downto 1)) = 0 else USER_size; USER_req_full_n <= req_fifo_full_n; process(USER_WrData) variable i: integer; begin user_WrData_2N <= (others=> '0'); for i in 0 to USER_WrData'length -1 loop user_WrData_2N (USER_DATA_WIDTH_2N-1 -i) <= USER_WrData(i); end loop; end process; req_fifo_din(REQ_FIFO_DATA_WIDTH-1) <= USER_req_nRW; req_fifo_din(REQ_FIFO_DATA_WIDTH-1-1 downto REQ_FIFO_DATA_WIDTH -1-32) <= user_phy_address; req_fifo_din(REQ_FIFO_DATA_WIDTH-1-32-1 downto REQ_FIFO_DATA_WIDTH -1-32-32) <= USER_size_local; req_fifo_din(USER_DATA_WIDTH_2N -1 downto 0) <= user_WrData_2N(USER_DATA_WIDTH_2N-1 downto 0); req_fifo_push <= USER_req_push; U_indices_if_req_fifo: component indices_if_ap_fifo generic map( DATA_WIDTH => REQ_FIFO_DATA_WIDTH, ADDR_WIDTH => REQ_FIFO_ADDR_WIDTH, DEPTH => REQ_FIFO_DEPTH) port map( clk => MPLB_Clk, reset => MPLB_Rst, if_empty_n => req_fifo_empty_n, if_read => req_fifo_pop, if_dout => req_fifo_dout, if_full_n => req_fifo_full_n, if_write => req_fifo_push, if_din => req_fifo_din ); req_fifo_dout_req_nRW <= req_fifo_dout(REQ_FIFO_DATA_WIDTH -1); req_fifo_dout_req_size <= req_fifo_dout(REQ_FIFO_DATA_WIDTH-1-32-1 downto REQ_FIFO_DATA_WIDTH -1-32-32); req_fifo_dout_req_address <= req_fifo_dout(REQ_FIFO_DATA_WIDTH-1-1 downto REQ_FIFO_DATA_WIDTH -1-32); req_fifo_dout_req_size_normalize(31 downto USER_ADDR_SHIFT) <= req_fifo_dout_req_size(31-USER_ADDR_SHIFT downto 0); req_fifo_dout_req_size_normalize(USER_ADDR_SHIFT-1 downto 0) <= (others => '0'); process(req_fifo_empty_n, req_valid) begin req_fifo_pop <= '0'; if (req_fifo_empty_n = '1' and req_valid = '0') then -- lunch next request req_fifo_pop <= '1'; end if; end process; process (MPLB_Clk, MPLB_Rst) variable offset: integer; begin if (MPLB_Rst = '1') then req_nRW <= '0'; burst_size <= (others => '0'); req_size_user <= (others => '0'); req_address <= (others => '0'); req_WrData <= (others => '0'); -- set possible MSB to ZERO req_WrData_BE <= (others => '0'); -- set possible MSB to ZERO req_WrData_byte_p <= (others => '0'); -- set possible MSB to ZERO req_valid <= '0'; req_EOP <= '0'; req_burst_write_counter <= (others => '0'); req_burst_mode <= '0'; elsif (MPLB_Clk'event and MPLB_Clk = '1') then if (req_fifo_pop = '1') then -- lunch next request req_valid <= '1'; if (req_burst_mode = '0') then if (req_fifo_dout_req_nRW = '0') then if (req_fifo_dout_req_size_normalize(PLB_ADDR_SHIFT-1 downto 0) = CONV_STD_LOGIC_VECTOR(0,PLB_ADDR_SHIFT) and req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0) = CONV_STD_LOGIC_VECTOR(0,PLB_ADDR_SHIFT)) then burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT); elsif (('0'&req_fifo_dout_req_size_normalize(PLB_ADDR_SHIFT-1 downto 0)) + ('0'&req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0)) <= PLB_BYTE_COUNT) then burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT) + 1; else burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT) + 2; end if; else burst_size <= X"00000001"; -- single by default if (req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT+1) /= CONV_STD_LOGIC_VECTOR(0,31-PLB_ADDR_SHIFT)) then -- may burst burst_size(31 downto 32-PLB_ADDR_SHIFT) <= (others=>'0'); -- burst_size for write operation if (req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0) = CONV_STD_LOGIC_VECTOR(0, PLB_ADDR_SHIFT)) or (conv_integer(req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0)) + conv_integer(req_fifo_dout_req_size_normalize(PLB_ADDR_SHIFT-1 downto 0)) >= PLB_BYTE_COUNT) then burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT); else burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT)-1; end if; end if; end if; offset := conv_integer(req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0)); if (req_fifo_dout_req_nRW = '1') then req_WrData(USER_DATA_WIDTH_2N +offset*8 -1 downto offset*8) <= req_fifo_dout(USER_DATA_WIDTH_2N -1 downto 0); req_WrData_BE(USER_DATA_BYTE_COUNT+offset-1 downto offset) <= (others => '1'); end if; req_size_user <= req_fifo_dout_req_size; -- for read operation req_nRW <= req_fifo_dout_req_nRW; req_EOP <= '1'; req_address <= req_fifo_dout_req_address; req_burst_write_counter <= req_fifo_dout_req_size; req_WrData_byte_p <= req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0) + USER_DATA_BYTE_COUNT; if (req_fifo_dout_req_nRW = '1' and req_fifo_dout_req_size(31 downto 1) /= "0000000000000000000000000000000") then req_burst_mode <= '1'; req_EOP <= '0'; end if; else -- in a burst write process req_burst_write_counter <= req_burst_write_counter -1; offset := conv_integer(req_WrData_byte_p); req_WrData(USER_DATA_WIDTH_2N +offset*8 -1 downto offset*8) <= req_fifo_dout(USER_DATA_WIDTH_2N -1 downto 0); req_WrData_BE(USER_DATA_BYTE_COUNT+offset-1 downto offset) <= (others => '1'); req_WrData_byte_p <= req_WrData_byte_p + USER_DATA_BYTE_COUNT; if (req_last_burst = '1') then req_burst_mode <= '0'; req_EOP <= '1'; end if; end if; elsif (req_valid = '1') then if (req_nRW = '0' and PLB_master_if_req_push = '1') then req_valid <= '0'; elsif (req_nRW = '1') then if (req_EOP = '1' and PLB_master_if_req_push = '1') then -- last burst request if (req_WrData_BE(ALIGN_DATA_BE_WIDTH-1 downto PLB_BYTE_COUNT) = CONV_STD_LOGIC_VECTOR(0, ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT)) then req_valid <= '0'; req_EOP <= '0'; req_WrData <= (others=>'0'); req_WrData_BE <= (others => '0'); else req_WrData(USER_DATA_WIDTH_2N + PLB_BW -1 downto USER_DATA_WIDTH_2N) <= (others => '0'); req_WrData(USER_DATA_WIDTH_2N -1 downto 0) <= req_WrData(USER_DATA_WIDTH_2N +PLB_BW -1 downto PLB_BW); req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT) <= (others => '0'); req_WrData_BE(ALIGN_DATA_BE_WIDTH -PLB_BYTE_COUNT-1 downto 0) <= req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto PLB_BYTE_COUNT); req_address(31 downto PLB_ADDR_SHIFT) <= req_address(31 downto PLB_ADDR_SHIFT) +1; req_address(PLB_ADDR_SHIFT-1 downto 0) <= (others=>'0'); end if; elsif (req_EOP = '0') then if (req_WrData_BE(PLB_BYTE_COUNT-1) = '0') then req_valid <= '0'; elsif (req_WrData_BE(PLB_BYTE_COUNT-1) = '1' and PLB_master_if_req_push = '1') then req_WrData(USER_DATA_WIDTH_2N + PLB_BW -1 downto USER_DATA_WIDTH_2N) <= (others => '0'); req_WrData(USER_DATA_WIDTH_2N -1 downto 0) <= req_WrData(USER_DATA_WIDTH_2N +PLB_BW -1 downto PLB_BW); req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT) <= (others => '0'); req_WrData_BE(ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT-1 downto 0) <= req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto PLB_BYTE_COUNT); req_address(31 downto PLB_ADDR_SHIFT) <= req_address(31 downto PLB_ADDR_SHIFT) +1; req_address(PLB_ADDR_SHIFT-1 downto 0) <= (others=>'0'); end if; end if; end if; end if; end if; end process; req_last_burst <= '1' when (req_burst_mode = '1' and req_burst_write_counter(31 downto 0) = X"00000002") else '0'; process(req_nRW, req_WrData_BE, burst_size) begin req_size <= (others => '0'); if (req_nRW = '0') then req_size <= burst_size; elsif (req_WrData_BE(PLB_BYTE_COUNT-1 downto 0) = BE_ALL_ONE) then req_size <= burst_size; else req_size <= X"00000001"; end if; end process; process(req_valid, PLB_master_if_req_full_n, req_nRW, req_WrData_BE) begin PLB_master_if_req_push <= '0'; if (req_valid = '1' and PLB_master_if_req_full_n = '1') then if (req_nRW = '0') then PLB_master_if_req_push <= '1'; -- only push when the last byte been push elsif (req_WrData_BE(PLB_BYTE_COUNT-1) = '1' or (req_EOP = '1' and req_WrData_BE(PLB_BYTE_COUNT-1 downto 0) /= CONV_STD_LOGIC_VECTOR(0, PLB_BYTE_COUNT))) then PLB_master_if_req_push <= '1'; -- only push when the last byte been push end if; end if; end process; req_BE <= req_WrData_BE(PLB_BYTE_COUNT-1 downto 0) when req_nRW = '1' else (others => '1'); U_indices_if_plb_master_if: component indices_if_plb_master_if generic map( C_PLB_AWIDTH => C_PLB_AWIDTH, C_PLB_DWIDTH => C_PLB_DWIDTH, PLB_ADDR_SHIFT => PLB_ADDR_SHIFT) port map ( -- Bus protocol ports, do not add to or delete PLB_Clk => MPLB_Clk, PLB_Rst => MPLB_Rst, M_abort => M_abort, M_ABus => M_ABus, M_BE => M_BE, M_busLock => M_busLock, M_lockErr => M_lockErr, M_MSize => M_MSize, M_priority => M_priority, M_rdBurst => M_rdBurst, M_request => M_request, M_RNW => M_RNW, M_size => M_size, M_type => M_type, M_wrBurst => M_wrBurst, M_wrDBus => M_wrDBus, PLB_MBusy => PLB_MBusy, PLB_MWrBTerm => PLB_MWrBTerm, PLB_MWrDAck => PLB_MWrDAck, PLB_MAddrAck => PLB_MAddrAck, PLB_MRdBTerm => PLB_MRdBTerm, PLB_MRdDAck => PLB_MRdDAck, PLB_MRdDBus => PLB_MRdDBus, PLB_MRdWdAddr => PLB_MRdWdAddr, PLB_MRearbitrate => PLB_MRearbitrate, PLB_MSSize => PLB_MSSize, -- signals from user logic BUS_RdData => PLB_master_if_dataout, BUS_WrData => req_WrData(PLB_BW-1 downto 0), BUS_address => req_address, BUS_size => req_size, BUS_req_nRW => req_nRW, BUS_req_BE => req_BE, BUS_req_full_n => PLB_master_if_req_full_n, BUS_req_push => PLB_master_if_req_push, BUS_rsp_nRW => PLB_master_if_rsp_nRW, BUS_rsp_empty_n => PLB_master_if_rsp_empty_n, BUS_rsp_pop => PLB_master_if_rsp_pop ); -- below is the response (bus read data) part U_indices_if_rsp_fifo: component indices_if_ap_fifo generic map( DATA_WIDTH => RSP_FIFO_DATA_WIDTH, ADDR_WIDTH => RSP_FIFO_ADDR_WIDTH, DEPTH => RSP_FIFO_DEPTH) port map( clk => MPLB_Clk, reset => MPLB_Rst, if_empty_n => rsp_fifo_empty_n, if_read => rsp_fifo_pop, if_dout => rsp_fifo_dout, if_full_n => rsp_fifo_full_n, if_write => rsp_fifo_push, if_din => rsp_fifo_din ); rsp_fifo_din(32+PLB_ADDR_SHIFT-1 downto 32) <= req_address(PLB_ADDR_SHIFT-1 downto 0); rsp_fifo_din(31 downto 0) <= req_size_user; rsp_fifo_push <= PLB_master_if_req_push and (not req_nRW); process (rsp_valid, PLB_master_if_rsp_empty_n, rsp_rd_data_byte_count) begin PLB_master_if_rsp_pop <= '0'; -- fetch data to rsp_rd_data until enough bytes if (rsp_valid = '1' and PLB_master_if_rsp_empty_n = '1' and CONV_INTEGER(rsp_rd_data_byte_count) < USER_DATA_BYTE_COUNT) then PLB_master_if_rsp_pop <= '1'; end if; end process; process (MPLB_Clk, MPLB_Rst) begin if (MPLB_Rst = '1') then rsp_valid <= '0'; rsp_addr <= (others=> '0'); rsp_size <= (others=> '0'); rsp_SOP <= '1'; rsp_rd_data_byte_count <= (others => '0'); rsp_rd_data <= (others=>'0'); rsp_fifo_pop <= '0'; elsif (MPLB_Clk'event and MPLB_Clk = '1') then rsp_fifo_pop <= '0'; if (rsp_valid = '0' and rsp_fifo_empty_n = '1') then rsp_valid <= '1'; rsp_addr <= rsp_fifo_dout(32+PLB_ADDR_SHIFT-1 downto 32); rsp_size <= rsp_fifo_dout(31 downto 0); rsp_fifo_pop <= '1'; rsp_rd_data_byte_count <= (others=>'0'); rsp_SOP <= '1'; end if; -- fetch data to rsp_rd_data until enough bytes if (PLB_master_if_rsp_pop = '1') then rsp_rd_data(USER_DATA_WIDTH_2N-1 downto 0) <= rsp_rd_data(USER_DATA_WIDTH_2N + PLB_BW -1 downto PLB_BW); rsp_rd_data(USER_DATA_WIDTH_2N +PLB_BW -1 downto USER_DATA_WIDTH_2N) <= PLB_master_if_dataout; if (rsp_SOP = '1') then rsp_rd_data_byte_count <= rsp_rd_data_byte_count + PLB_BYTE_COUNT - rsp_addr; rsp_SOP <= '0'; else rsp_rd_data_byte_count <= rsp_rd_data_byte_count + PLB_BYTE_COUNT; end if; end if; -- write one unit of data to USER LOGIC if (rd_data_user_fifo_push = '1') then rsp_size <= rsp_size -1; rsp_rd_data_byte_count <= rsp_rd_data_byte_count - USER_DATA_BYTE_COUNT; rsp_addr <= rsp_addr + USER_DATA_BYTE_COUNT; if (rsp_size = X"00000001") then rsp_valid <= '0'; end if; end if; end if; end process; process(rsp_addr, rsp_rd_data,rsp_valid, rd_data_user_fifo_full_n, rsp_rd_data_byte_count, rd_data_user_fifo_din_2N) variable i: integer; begin case CONV_INTEGER(rsp_addr) is when 0 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +64 -1 downto 64); when 1 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +8 -1 downto 8); when 2 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +16 -1 downto 16); when 3 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +24 -1 downto 24); when 4 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +32 -1 downto 32); when 5 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +40 -1 downto 40); when 6 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +48 -1 downto 48); when 7 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +56 -1 downto 56); when others => null; end case; for i in 0 to USER_DATA_WIDTH -1 loop rd_data_user_fifo_din(i) <= rd_data_user_fifo_din_2N(USER_DATA_WIDTH_2N-1-i); end loop; rd_data_user_fifo_push <= '0'; if (rsp_valid = '1' and rd_data_user_fifo_full_n = '1' and CONV_INTEGER(rsp_rd_data_byte_count)>= USER_DATA_BYTE_COUNT) then rd_data_user_fifo_push <= '1'; end if; end process; U_indices_if_rd_data_user_fifo: component indices_if_ap_fifo generic map( DATA_WIDTH => USER_DATA_WIDTH, ADDR_WIDTH => 5, DEPTH => 32) port map( clk => MPLB_Clk, reset => MPLB_Rst, if_empty_n => rd_data_user_fifo_empty_n, if_read => USER_rsp_pop, if_dout => rd_data_user_fifo_dout, if_full_n => rd_data_user_fifo_full_n, if_write => rd_data_user_fifo_push, if_din => rd_data_user_fifo_din ); USER_RdData <= rd_data_user_fifo_dout; USER_rsp_empty_n <= rd_data_user_fifo_empty_n; end IMP;
-- ============================================================== -- File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC -- Version: 2014.1 -- Copyright (C) 2014 Xilinx Inc. All rights reserved. -- -- ============================================================== library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity indices_if is generic ( C_PLB_AWIDTH : integer := 32; C_PLB_DWIDTH : integer := 64; PLB_ADDR_SHIFT : integer := 3; USER_DATA_WIDTH : integer := 56; USER_DATA_WIDTH_2N : integer := 64; USER_ADDR_SHIFT : integer := 3; -- log2(byte_count_of_data_width) REMOTE_DESTINATION_ADDRESS : std_logic_vector(0 to 31):= X"00000000" ); port ( -- Bus protocol ports, do not add to or delete MPLB_Clk : in std_logic; MPLB_Rst : in std_logic; M_request : out std_logic; M_priority : out std_logic_vector(0 to 1); M_busLock : out std_logic; M_RNW : out std_logic; M_BE : out std_logic_vector(0 to C_PLB_DWIDTH/8-1); M_MSize : out std_logic_vector(0 to 1); M_size : out std_logic_vector(0 to 3); M_type : out std_logic_vector(0 to 2); M_TAttribute : out std_logic_vector(0 to 15); M_lockErr : out std_logic; M_abort : out std_logic; M_ABus : out std_logic_vector(0 to C_PLB_AWIDTH-1); M_UABus : out std_logic_vector(0 to 31); M_wrDBus : out std_logic_vector(0 to C_PLB_DWIDTH-1); M_wrBurst : out std_logic; M_rdBurst : out std_logic; PLB_MAddrAck : in std_logic; PLB_MSSize : in std_logic_vector(0 to 1); PLB_MRearbitrate : in std_logic; PLB_MTimeout : in std_logic; PLB_MBusy : in std_logic; PLB_MRdErr : in std_logic; PLB_MWrErr : in std_logic; PLB_MIRQ : in std_logic; PLB_MRdDBus : in std_logic_vector(0 to (C_PLB_DWIDTH-1)); PLB_MRdWdAddr : in std_logic_vector(0 to 3); PLB_MRdDAck : in std_logic; PLB_MRdBTerm : in std_logic; PLB_MWrDAck : in std_logic; PLB_MWrBTerm : in std_logic; -- signals from user logic USER_RdData : out std_logic_vector(USER_DATA_WIDTH - 1 downto 0); -- Bus read return data to user_logic USER_WrData : in std_logic_vector(USER_DATA_WIDTH - 1 downto 0); -- Bus write data USER_address : in std_logic_vector(31 downto 0); -- word offset from BASE_ADDRESS USER_size : in std_logic_vector(31 downto 0); -- burst size of word USER_req_nRW : in std_logic; -- req type 0: Read, 1: write USER_req_full_n : out std_logic; -- req Fifo full USER_req_push : in std_logic; -- req Fifo push (new request in) USER_rsp_empty_n : out std_logic; -- return data FIFO empty USER_rsp_pop : in std_logic -- return data FIFO pop ); attribute SIGIS : string; attribute SIGIS of MPLB_Clk : signal is "Clk"; attribute SIGIS of MPLB_Rst : signal is "Rst"; end entity; ------------------------------------------------------------------------------ -- Architecture section ------------------------------------------------------------------------------ architecture IMP of indices_if is component indices_if_ap_fifo is generic ( DATA_WIDTH : integer := 32; ADDR_WIDTH : integer := 4; DEPTH : integer := 16); port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; if_empty_n : OUT STD_LOGIC; if_read : IN STD_LOGIC; if_dout : OUT STD_LOGIC_VECTOR(DATA_WIDTH - 1 downto 0); if_full_n : OUT STD_LOGIC; if_write : IN STD_LOGIC; if_din : IN STD_LOGIC_VECTOR(DATA_WIDTH - 1 downto 0) ); end component; component indices_if_plb_master_if is generic ( C_PLB_AWIDTH : integer := 32; C_PLB_DWIDTH : integer := 64; PLB_ADDR_SHIFT : integer := 3); port ( -- Bus protocol ports, do not add to or delete PLB_Clk : in std_logic; PLB_Rst : in std_logic; M_abort : out std_logic; M_ABus : out std_logic_vector(0 to C_PLB_AWIDTH-1); M_BE : out std_logic_vector(0 to C_PLB_DWIDTH/8-1); M_busLock : out std_logic; M_lockErr : out std_logic; M_MSize : out std_logic_vector(0 to 1); M_priority : out std_logic_vector(0 to 1); M_rdBurst : out std_logic; M_request : out std_logic; M_RNW : out std_logic; M_size : out std_logic_vector(0 to 3); M_type : out std_logic_vector(0 to 2); M_wrBurst : out std_logic; M_wrDBus : out std_logic_vector(0 to C_PLB_DWIDTH-1); PLB_MBusy : in std_logic; PLB_MWrBTerm : in std_logic; PLB_MWrDAck : in std_logic; PLB_MAddrAck : in std_logic; PLB_MRdBTerm : in std_logic; PLB_MRdDAck : in std_logic; PLB_MRdDBus : in std_logic_vector(0 to (C_PLB_DWIDTH-1)); PLB_MRdWdAddr : in std_logic_vector(0 to 3); PLB_MRearbitrate : in std_logic; PLB_MSSize : in std_logic_vector(0 to 1); -- signals from user logic BUS_RdData : out std_logic_vector(C_PLB_DWIDTH-1 downto 0); -- Bus read return data to user_logic BUS_WrData : in std_logic_vector(C_PLB_DWIDTH-1 downto 0); -- Bus write data BUS_address : in std_logic_vector(31 downto 0); -- word offset from BASE_ADDRESS BUS_size : in std_logic_vector(31 downto 0); -- burst size of word BUS_req_nRW : in std_logic; -- req type 0: Read, 1: write BUS_req_BE : in std_logic_vector(C_PLB_DWIDTH/8 -1 downto 0); -- Bus write data byte enable BUS_req_full_n : out std_logic; -- req Fifo full BUS_req_push : in std_logic; -- req Fifo push (new request in) BUS_rsp_nRW : out std_logic; -- return data FIFO rsp type BUS_rsp_empty_n : out std_logic; -- return data FIFO empty BUS_rsp_pop : in std_logic -- return data FIFO pop ); end component; -- type state_type is (IDLE, ); -- signal cs, ns : st_type; constant PLB_BW : integer := C_PLB_DWIDTH; constant PLB_BYTE_COUNT : integer := C_PLB_DWIDTH/8; constant USER_DATA_BYTE_COUNT : integer := USER_DATA_WIDTH_2N/8; constant REQ_FIFO_DATA_WIDTH : integer := 1 + 32 + 32 + USER_DATA_WIDTH_2N; -- nRW + addr + size + wr_data constant REQ_FIFO_ADDR_WIDTH : integer := 5; constant REQ_FIFO_DEPTH : integer := 32; constant ALIGN_DATA_WIDTH : integer := USER_DATA_WIDTH_2N + PLB_BW; constant ALIGN_DATA_BE_WIDTH : integer := (USER_DATA_WIDTH_2N + PLB_BW)/8; signal user_phy_address : STD_LOGIC_VECTOR(31 downto 0); -- request FIFO signal req_fifo_empty_n : STD_LOGIC; signal req_fifo_pop : STD_LOGIC; signal req_fifo_dout : STD_LOGIC_VECTOR(REQ_FIFO_DATA_WIDTH - 1 downto 0); signal req_fifo_full_n : STD_LOGIC; signal req_fifo_push : STD_LOGIC; signal req_fifo_din : STD_LOGIC_VECTOR(REQ_FIFO_DATA_WIDTH - 1 downto 0); signal user_WrData_2N : STD_LOGIC_VECTOR(USER_DATA_WIDTH_2N-1 downto 0); signal req_fifo_dout_req_nRW : STD_LOGIC; signal req_fifo_dout_req_address : STD_LOGIC_VECTOR(31 downto 0); signal req_fifo_dout_req_size, req_fifo_dout_req_size_normalize : STD_LOGIC_VECTOR(31 downto 0); -- internal request information signal req_nRW : STD_LOGIC; signal req_address : STD_LOGIC_VECTOR(31 downto 0); signal req_size, burst_size : STD_LOGIC_VECTOR(31 downto 0); signal req_size_user : STD_LOGIC_VECTOR(31 downto 0); signal req_BE : STD_LOGIC_VECTOR(PLB_BYTE_COUNT-1 downto 0); signal req_WrData : STD_LOGIC_VECTOR(ALIGN_DATA_WIDTH -1 downto 0); signal req_WrData_BE : STD_LOGIC_VECTOR(ALIGN_DATA_BE_WIDTH -1 downto 0); signal req_WrData_byte_p : STD_LOGIC_VECTOR(PLB_ADDR_SHIFT-1 downto 0); signal req_valid, req_SOP, req_EOP_user, req_EOP : STD_LOGIC; signal req_burst_write_counter : STD_LOGIC_VECTOR(31 downto 0); signal req_burst_mode, req_last_burst: STD_LOGIC; -- interface to PLB_master_if module signal PLB_master_if_req_full_n : STD_LOGIC; signal PLB_master_if_req_push : STD_LOGIC; signal PLB_master_if_dataout : STD_LOGIC_VECTOR(PLB_BW-1 downto 0); signal PLB_master_if_rsp_nRW : STD_LOGIC; signal PLB_master_if_rsp_empty_n : STD_LOGIC; signal PLB_master_if_rsp_pop : STD_LOGIC; signal USER_size_local: STD_LOGIC_VECTOR(31 downto 0); -- rsp FIFO constant RSP_FIFO_DATA_WIDTH : integer := PLB_ADDR_SHIFT + 32; -- addr + size constant RSP_FIFO_ADDR_WIDTH : integer := 6; constant RSP_FIFO_DEPTH : integer := 64; signal rsp_fifo_empty_n : STD_LOGIC; signal rsp_fifo_pop : STD_LOGIC; signal rsp_fifo_dout : STD_LOGIC_VECTOR(RSP_FIFO_DATA_WIDTH -1 downto 0); signal rsp_fifo_full_n : STD_LOGIC; signal rsp_fifo_push : STD_LOGIC; signal rsp_fifo_din : STD_LOGIC_VECTOR(RSP_FIFO_DATA_WIDTH -1 downto 0); signal rsp_valid, rsp_SOP : STD_LOGIC; signal rsp_addr : STD_LOGIC_VECTOR(PLB_ADDR_SHIFT-1 downto 0); signal rsp_size : STD_LOGIC_VECTOR(31 downto 0); signal rsp_rd_data : STD_LOGIC_VECTOR(ALIGN_DATA_WIDTH -1 downto 0); signal rsp_rd_data_byte_count : STD_LOGIC_VECTOR(4 downto 0); -- rd data user FIFO signal rd_data_user_fifo_empty_n : STD_LOGIC; signal rd_data_user_fifo_pop : STD_LOGIC; signal rd_data_user_fifo_dout : STD_LOGIC_VECTOR(USER_DATA_WIDTH -1 downto 0); signal rd_data_user_fifo_full_n : STD_LOGIC; signal rd_data_user_fifo_push : STD_LOGIC; signal rd_data_user_fifo_din : STD_LOGIC_VECTOR(USER_DATA_WIDTH -1 downto 0); signal rd_data_user_fifo_din_2N : STD_LOGIC_VECTOR(USER_DATA_WIDTH_2N -1 downto 0); signal BE_ALL_ONE : STD_LOGIC_VECTOR(PLB_BYTE_COUNT -1 downto 0); begin BE_ALL_ONE <= (others => '1'); M_UABus <= (others => '0'); M_TAttribute <= (others => '0'); -- interface to user logic user_phy_address(31 downto USER_ADDR_SHIFT) <= REMOTE_DESTINATION_ADDRESS(0 to C_PLB_AWIDTH - USER_ADDR_SHIFT -1) + USER_address(31 -USER_ADDR_SHIFT downto 0); user_phy_address(USER_ADDR_SHIFT-1 downto 0) <= REMOTE_DESTINATION_ADDRESS(C_PLB_AWIDTH - USER_ADDR_SHIFT to C_PLB_AWIDTH -1); USER_size_local <= X"00000001" when conv_integer(USER_size(31 downto 1)) = 0 else USER_size; USER_req_full_n <= req_fifo_full_n; process(USER_WrData) variable i: integer; begin user_WrData_2N <= (others=> '0'); for i in 0 to USER_WrData'length -1 loop user_WrData_2N (USER_DATA_WIDTH_2N-1 -i) <= USER_WrData(i); end loop; end process; req_fifo_din(REQ_FIFO_DATA_WIDTH-1) <= USER_req_nRW; req_fifo_din(REQ_FIFO_DATA_WIDTH-1-1 downto REQ_FIFO_DATA_WIDTH -1-32) <= user_phy_address; req_fifo_din(REQ_FIFO_DATA_WIDTH-1-32-1 downto REQ_FIFO_DATA_WIDTH -1-32-32) <= USER_size_local; req_fifo_din(USER_DATA_WIDTH_2N -1 downto 0) <= user_WrData_2N(USER_DATA_WIDTH_2N-1 downto 0); req_fifo_push <= USER_req_push; U_indices_if_req_fifo: component indices_if_ap_fifo generic map( DATA_WIDTH => REQ_FIFO_DATA_WIDTH, ADDR_WIDTH => REQ_FIFO_ADDR_WIDTH, DEPTH => REQ_FIFO_DEPTH) port map( clk => MPLB_Clk, reset => MPLB_Rst, if_empty_n => req_fifo_empty_n, if_read => req_fifo_pop, if_dout => req_fifo_dout, if_full_n => req_fifo_full_n, if_write => req_fifo_push, if_din => req_fifo_din ); req_fifo_dout_req_nRW <= req_fifo_dout(REQ_FIFO_DATA_WIDTH -1); req_fifo_dout_req_size <= req_fifo_dout(REQ_FIFO_DATA_WIDTH-1-32-1 downto REQ_FIFO_DATA_WIDTH -1-32-32); req_fifo_dout_req_address <= req_fifo_dout(REQ_FIFO_DATA_WIDTH-1-1 downto REQ_FIFO_DATA_WIDTH -1-32); req_fifo_dout_req_size_normalize(31 downto USER_ADDR_SHIFT) <= req_fifo_dout_req_size(31-USER_ADDR_SHIFT downto 0); req_fifo_dout_req_size_normalize(USER_ADDR_SHIFT-1 downto 0) <= (others => '0'); process(req_fifo_empty_n, req_valid) begin req_fifo_pop <= '0'; if (req_fifo_empty_n = '1' and req_valid = '0') then -- lunch next request req_fifo_pop <= '1'; end if; end process; process (MPLB_Clk, MPLB_Rst) variable offset: integer; begin if (MPLB_Rst = '1') then req_nRW <= '0'; burst_size <= (others => '0'); req_size_user <= (others => '0'); req_address <= (others => '0'); req_WrData <= (others => '0'); -- set possible MSB to ZERO req_WrData_BE <= (others => '0'); -- set possible MSB to ZERO req_WrData_byte_p <= (others => '0'); -- set possible MSB to ZERO req_valid <= '0'; req_EOP <= '0'; req_burst_write_counter <= (others => '0'); req_burst_mode <= '0'; elsif (MPLB_Clk'event and MPLB_Clk = '1') then if (req_fifo_pop = '1') then -- lunch next request req_valid <= '1'; if (req_burst_mode = '0') then if (req_fifo_dout_req_nRW = '0') then if (req_fifo_dout_req_size_normalize(PLB_ADDR_SHIFT-1 downto 0) = CONV_STD_LOGIC_VECTOR(0,PLB_ADDR_SHIFT) and req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0) = CONV_STD_LOGIC_VECTOR(0,PLB_ADDR_SHIFT)) then burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT); elsif (('0'&req_fifo_dout_req_size_normalize(PLB_ADDR_SHIFT-1 downto 0)) + ('0'&req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0)) <= PLB_BYTE_COUNT) then burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT) + 1; else burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT) + 2; end if; else burst_size <= X"00000001"; -- single by default if (req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT+1) /= CONV_STD_LOGIC_VECTOR(0,31-PLB_ADDR_SHIFT)) then -- may burst burst_size(31 downto 32-PLB_ADDR_SHIFT) <= (others=>'0'); -- burst_size for write operation if (req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0) = CONV_STD_LOGIC_VECTOR(0, PLB_ADDR_SHIFT)) or (conv_integer(req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0)) + conv_integer(req_fifo_dout_req_size_normalize(PLB_ADDR_SHIFT-1 downto 0)) >= PLB_BYTE_COUNT) then burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT); else burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT)-1; end if; end if; end if; offset := conv_integer(req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0)); if (req_fifo_dout_req_nRW = '1') then req_WrData(USER_DATA_WIDTH_2N +offset*8 -1 downto offset*8) <= req_fifo_dout(USER_DATA_WIDTH_2N -1 downto 0); req_WrData_BE(USER_DATA_BYTE_COUNT+offset-1 downto offset) <= (others => '1'); end if; req_size_user <= req_fifo_dout_req_size; -- for read operation req_nRW <= req_fifo_dout_req_nRW; req_EOP <= '1'; req_address <= req_fifo_dout_req_address; req_burst_write_counter <= req_fifo_dout_req_size; req_WrData_byte_p <= req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0) + USER_DATA_BYTE_COUNT; if (req_fifo_dout_req_nRW = '1' and req_fifo_dout_req_size(31 downto 1) /= "0000000000000000000000000000000") then req_burst_mode <= '1'; req_EOP <= '0'; end if; else -- in a burst write process req_burst_write_counter <= req_burst_write_counter -1; offset := conv_integer(req_WrData_byte_p); req_WrData(USER_DATA_WIDTH_2N +offset*8 -1 downto offset*8) <= req_fifo_dout(USER_DATA_WIDTH_2N -1 downto 0); req_WrData_BE(USER_DATA_BYTE_COUNT+offset-1 downto offset) <= (others => '1'); req_WrData_byte_p <= req_WrData_byte_p + USER_DATA_BYTE_COUNT; if (req_last_burst = '1') then req_burst_mode <= '0'; req_EOP <= '1'; end if; end if; elsif (req_valid = '1') then if (req_nRW = '0' and PLB_master_if_req_push = '1') then req_valid <= '0'; elsif (req_nRW = '1') then if (req_EOP = '1' and PLB_master_if_req_push = '1') then -- last burst request if (req_WrData_BE(ALIGN_DATA_BE_WIDTH-1 downto PLB_BYTE_COUNT) = CONV_STD_LOGIC_VECTOR(0, ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT)) then req_valid <= '0'; req_EOP <= '0'; req_WrData <= (others=>'0'); req_WrData_BE <= (others => '0'); else req_WrData(USER_DATA_WIDTH_2N + PLB_BW -1 downto USER_DATA_WIDTH_2N) <= (others => '0'); req_WrData(USER_DATA_WIDTH_2N -1 downto 0) <= req_WrData(USER_DATA_WIDTH_2N +PLB_BW -1 downto PLB_BW); req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT) <= (others => '0'); req_WrData_BE(ALIGN_DATA_BE_WIDTH -PLB_BYTE_COUNT-1 downto 0) <= req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto PLB_BYTE_COUNT); req_address(31 downto PLB_ADDR_SHIFT) <= req_address(31 downto PLB_ADDR_SHIFT) +1; req_address(PLB_ADDR_SHIFT-1 downto 0) <= (others=>'0'); end if; elsif (req_EOP = '0') then if (req_WrData_BE(PLB_BYTE_COUNT-1) = '0') then req_valid <= '0'; elsif (req_WrData_BE(PLB_BYTE_COUNT-1) = '1' and PLB_master_if_req_push = '1') then req_WrData(USER_DATA_WIDTH_2N + PLB_BW -1 downto USER_DATA_WIDTH_2N) <= (others => '0'); req_WrData(USER_DATA_WIDTH_2N -1 downto 0) <= req_WrData(USER_DATA_WIDTH_2N +PLB_BW -1 downto PLB_BW); req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT) <= (others => '0'); req_WrData_BE(ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT-1 downto 0) <= req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto PLB_BYTE_COUNT); req_address(31 downto PLB_ADDR_SHIFT) <= req_address(31 downto PLB_ADDR_SHIFT) +1; req_address(PLB_ADDR_SHIFT-1 downto 0) <= (others=>'0'); end if; end if; end if; end if; end if; end process; req_last_burst <= '1' when (req_burst_mode = '1' and req_burst_write_counter(31 downto 0) = X"00000002") else '0'; process(req_nRW, req_WrData_BE, burst_size) begin req_size <= (others => '0'); if (req_nRW = '0') then req_size <= burst_size; elsif (req_WrData_BE(PLB_BYTE_COUNT-1 downto 0) = BE_ALL_ONE) then req_size <= burst_size; else req_size <= X"00000001"; end if; end process; process(req_valid, PLB_master_if_req_full_n, req_nRW, req_WrData_BE) begin PLB_master_if_req_push <= '0'; if (req_valid = '1' and PLB_master_if_req_full_n = '1') then if (req_nRW = '0') then PLB_master_if_req_push <= '1'; -- only push when the last byte been push elsif (req_WrData_BE(PLB_BYTE_COUNT-1) = '1' or (req_EOP = '1' and req_WrData_BE(PLB_BYTE_COUNT-1 downto 0) /= CONV_STD_LOGIC_VECTOR(0, PLB_BYTE_COUNT))) then PLB_master_if_req_push <= '1'; -- only push when the last byte been push end if; end if; end process; req_BE <= req_WrData_BE(PLB_BYTE_COUNT-1 downto 0) when req_nRW = '1' else (others => '1'); U_indices_if_plb_master_if: component indices_if_plb_master_if generic map( C_PLB_AWIDTH => C_PLB_AWIDTH, C_PLB_DWIDTH => C_PLB_DWIDTH, PLB_ADDR_SHIFT => PLB_ADDR_SHIFT) port map ( -- Bus protocol ports, do not add to or delete PLB_Clk => MPLB_Clk, PLB_Rst => MPLB_Rst, M_abort => M_abort, M_ABus => M_ABus, M_BE => M_BE, M_busLock => M_busLock, M_lockErr => M_lockErr, M_MSize => M_MSize, M_priority => M_priority, M_rdBurst => M_rdBurst, M_request => M_request, M_RNW => M_RNW, M_size => M_size, M_type => M_type, M_wrBurst => M_wrBurst, M_wrDBus => M_wrDBus, PLB_MBusy => PLB_MBusy, PLB_MWrBTerm => PLB_MWrBTerm, PLB_MWrDAck => PLB_MWrDAck, PLB_MAddrAck => PLB_MAddrAck, PLB_MRdBTerm => PLB_MRdBTerm, PLB_MRdDAck => PLB_MRdDAck, PLB_MRdDBus => PLB_MRdDBus, PLB_MRdWdAddr => PLB_MRdWdAddr, PLB_MRearbitrate => PLB_MRearbitrate, PLB_MSSize => PLB_MSSize, -- signals from user logic BUS_RdData => PLB_master_if_dataout, BUS_WrData => req_WrData(PLB_BW-1 downto 0), BUS_address => req_address, BUS_size => req_size, BUS_req_nRW => req_nRW, BUS_req_BE => req_BE, BUS_req_full_n => PLB_master_if_req_full_n, BUS_req_push => PLB_master_if_req_push, BUS_rsp_nRW => PLB_master_if_rsp_nRW, BUS_rsp_empty_n => PLB_master_if_rsp_empty_n, BUS_rsp_pop => PLB_master_if_rsp_pop ); -- below is the response (bus read data) part U_indices_if_rsp_fifo: component indices_if_ap_fifo generic map( DATA_WIDTH => RSP_FIFO_DATA_WIDTH, ADDR_WIDTH => RSP_FIFO_ADDR_WIDTH, DEPTH => RSP_FIFO_DEPTH) port map( clk => MPLB_Clk, reset => MPLB_Rst, if_empty_n => rsp_fifo_empty_n, if_read => rsp_fifo_pop, if_dout => rsp_fifo_dout, if_full_n => rsp_fifo_full_n, if_write => rsp_fifo_push, if_din => rsp_fifo_din ); rsp_fifo_din(32+PLB_ADDR_SHIFT-1 downto 32) <= req_address(PLB_ADDR_SHIFT-1 downto 0); rsp_fifo_din(31 downto 0) <= req_size_user; rsp_fifo_push <= PLB_master_if_req_push and (not req_nRW); process (rsp_valid, PLB_master_if_rsp_empty_n, rsp_rd_data_byte_count) begin PLB_master_if_rsp_pop <= '0'; -- fetch data to rsp_rd_data until enough bytes if (rsp_valid = '1' and PLB_master_if_rsp_empty_n = '1' and CONV_INTEGER(rsp_rd_data_byte_count) < USER_DATA_BYTE_COUNT) then PLB_master_if_rsp_pop <= '1'; end if; end process; process (MPLB_Clk, MPLB_Rst) begin if (MPLB_Rst = '1') then rsp_valid <= '0'; rsp_addr <= (others=> '0'); rsp_size <= (others=> '0'); rsp_SOP <= '1'; rsp_rd_data_byte_count <= (others => '0'); rsp_rd_data <= (others=>'0'); rsp_fifo_pop <= '0'; elsif (MPLB_Clk'event and MPLB_Clk = '1') then rsp_fifo_pop <= '0'; if (rsp_valid = '0' and rsp_fifo_empty_n = '1') then rsp_valid <= '1'; rsp_addr <= rsp_fifo_dout(32+PLB_ADDR_SHIFT-1 downto 32); rsp_size <= rsp_fifo_dout(31 downto 0); rsp_fifo_pop <= '1'; rsp_rd_data_byte_count <= (others=>'0'); rsp_SOP <= '1'; end if; -- fetch data to rsp_rd_data until enough bytes if (PLB_master_if_rsp_pop = '1') then rsp_rd_data(USER_DATA_WIDTH_2N-1 downto 0) <= rsp_rd_data(USER_DATA_WIDTH_2N + PLB_BW -1 downto PLB_BW); rsp_rd_data(USER_DATA_WIDTH_2N +PLB_BW -1 downto USER_DATA_WIDTH_2N) <= PLB_master_if_dataout; if (rsp_SOP = '1') then rsp_rd_data_byte_count <= rsp_rd_data_byte_count + PLB_BYTE_COUNT - rsp_addr; rsp_SOP <= '0'; else rsp_rd_data_byte_count <= rsp_rd_data_byte_count + PLB_BYTE_COUNT; end if; end if; -- write one unit of data to USER LOGIC if (rd_data_user_fifo_push = '1') then rsp_size <= rsp_size -1; rsp_rd_data_byte_count <= rsp_rd_data_byte_count - USER_DATA_BYTE_COUNT; rsp_addr <= rsp_addr + USER_DATA_BYTE_COUNT; if (rsp_size = X"00000001") then rsp_valid <= '0'; end if; end if; end if; end process; process(rsp_addr, rsp_rd_data,rsp_valid, rd_data_user_fifo_full_n, rsp_rd_data_byte_count, rd_data_user_fifo_din_2N) variable i: integer; begin case CONV_INTEGER(rsp_addr) is when 0 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +64 -1 downto 64); when 1 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +8 -1 downto 8); when 2 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +16 -1 downto 16); when 3 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +24 -1 downto 24); when 4 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +32 -1 downto 32); when 5 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +40 -1 downto 40); when 6 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +48 -1 downto 48); when 7 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +56 -1 downto 56); when others => null; end case; for i in 0 to USER_DATA_WIDTH -1 loop rd_data_user_fifo_din(i) <= rd_data_user_fifo_din_2N(USER_DATA_WIDTH_2N-1-i); end loop; rd_data_user_fifo_push <= '0'; if (rsp_valid = '1' and rd_data_user_fifo_full_n = '1' and CONV_INTEGER(rsp_rd_data_byte_count)>= USER_DATA_BYTE_COUNT) then rd_data_user_fifo_push <= '1'; end if; end process; U_indices_if_rd_data_user_fifo: component indices_if_ap_fifo generic map( DATA_WIDTH => USER_DATA_WIDTH, ADDR_WIDTH => 5, DEPTH => 32) port map( clk => MPLB_Clk, reset => MPLB_Rst, if_empty_n => rd_data_user_fifo_empty_n, if_read => USER_rsp_pop, if_dout => rd_data_user_fifo_dout, if_full_n => rd_data_user_fifo_full_n, if_write => rd_data_user_fifo_push, if_din => rd_data_user_fifo_din ); USER_RdData <= rd_data_user_fifo_dout; USER_rsp_empty_n <= rd_data_user_fifo_empty_n; end IMP;
-- ============================================================== -- File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC -- Version: 2014.1 -- Copyright (C) 2014 Xilinx Inc. All rights reserved. -- -- ============================================================== library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity indices_if is generic ( C_PLB_AWIDTH : integer := 32; C_PLB_DWIDTH : integer := 64; PLB_ADDR_SHIFT : integer := 3; USER_DATA_WIDTH : integer := 56; USER_DATA_WIDTH_2N : integer := 64; USER_ADDR_SHIFT : integer := 3; -- log2(byte_count_of_data_width) REMOTE_DESTINATION_ADDRESS : std_logic_vector(0 to 31):= X"00000000" ); port ( -- Bus protocol ports, do not add to or delete MPLB_Clk : in std_logic; MPLB_Rst : in std_logic; M_request : out std_logic; M_priority : out std_logic_vector(0 to 1); M_busLock : out std_logic; M_RNW : out std_logic; M_BE : out std_logic_vector(0 to C_PLB_DWIDTH/8-1); M_MSize : out std_logic_vector(0 to 1); M_size : out std_logic_vector(0 to 3); M_type : out std_logic_vector(0 to 2); M_TAttribute : out std_logic_vector(0 to 15); M_lockErr : out std_logic; M_abort : out std_logic; M_ABus : out std_logic_vector(0 to C_PLB_AWIDTH-1); M_UABus : out std_logic_vector(0 to 31); M_wrDBus : out std_logic_vector(0 to C_PLB_DWIDTH-1); M_wrBurst : out std_logic; M_rdBurst : out std_logic; PLB_MAddrAck : in std_logic; PLB_MSSize : in std_logic_vector(0 to 1); PLB_MRearbitrate : in std_logic; PLB_MTimeout : in std_logic; PLB_MBusy : in std_logic; PLB_MRdErr : in std_logic; PLB_MWrErr : in std_logic; PLB_MIRQ : in std_logic; PLB_MRdDBus : in std_logic_vector(0 to (C_PLB_DWIDTH-1)); PLB_MRdWdAddr : in std_logic_vector(0 to 3); PLB_MRdDAck : in std_logic; PLB_MRdBTerm : in std_logic; PLB_MWrDAck : in std_logic; PLB_MWrBTerm : in std_logic; -- signals from user logic USER_RdData : out std_logic_vector(USER_DATA_WIDTH - 1 downto 0); -- Bus read return data to user_logic USER_WrData : in std_logic_vector(USER_DATA_WIDTH - 1 downto 0); -- Bus write data USER_address : in std_logic_vector(31 downto 0); -- word offset from BASE_ADDRESS USER_size : in std_logic_vector(31 downto 0); -- burst size of word USER_req_nRW : in std_logic; -- req type 0: Read, 1: write USER_req_full_n : out std_logic; -- req Fifo full USER_req_push : in std_logic; -- req Fifo push (new request in) USER_rsp_empty_n : out std_logic; -- return data FIFO empty USER_rsp_pop : in std_logic -- return data FIFO pop ); attribute SIGIS : string; attribute SIGIS of MPLB_Clk : signal is "Clk"; attribute SIGIS of MPLB_Rst : signal is "Rst"; end entity; ------------------------------------------------------------------------------ -- Architecture section ------------------------------------------------------------------------------ architecture IMP of indices_if is component indices_if_ap_fifo is generic ( DATA_WIDTH : integer := 32; ADDR_WIDTH : integer := 4; DEPTH : integer := 16); port ( clk : IN STD_LOGIC; reset : IN STD_LOGIC; if_empty_n : OUT STD_LOGIC; if_read : IN STD_LOGIC; if_dout : OUT STD_LOGIC_VECTOR(DATA_WIDTH - 1 downto 0); if_full_n : OUT STD_LOGIC; if_write : IN STD_LOGIC; if_din : IN STD_LOGIC_VECTOR(DATA_WIDTH - 1 downto 0) ); end component; component indices_if_plb_master_if is generic ( C_PLB_AWIDTH : integer := 32; C_PLB_DWIDTH : integer := 64; PLB_ADDR_SHIFT : integer := 3); port ( -- Bus protocol ports, do not add to or delete PLB_Clk : in std_logic; PLB_Rst : in std_logic; M_abort : out std_logic; M_ABus : out std_logic_vector(0 to C_PLB_AWIDTH-1); M_BE : out std_logic_vector(0 to C_PLB_DWIDTH/8-1); M_busLock : out std_logic; M_lockErr : out std_logic; M_MSize : out std_logic_vector(0 to 1); M_priority : out std_logic_vector(0 to 1); M_rdBurst : out std_logic; M_request : out std_logic; M_RNW : out std_logic; M_size : out std_logic_vector(0 to 3); M_type : out std_logic_vector(0 to 2); M_wrBurst : out std_logic; M_wrDBus : out std_logic_vector(0 to C_PLB_DWIDTH-1); PLB_MBusy : in std_logic; PLB_MWrBTerm : in std_logic; PLB_MWrDAck : in std_logic; PLB_MAddrAck : in std_logic; PLB_MRdBTerm : in std_logic; PLB_MRdDAck : in std_logic; PLB_MRdDBus : in std_logic_vector(0 to (C_PLB_DWIDTH-1)); PLB_MRdWdAddr : in std_logic_vector(0 to 3); PLB_MRearbitrate : in std_logic; PLB_MSSize : in std_logic_vector(0 to 1); -- signals from user logic BUS_RdData : out std_logic_vector(C_PLB_DWIDTH-1 downto 0); -- Bus read return data to user_logic BUS_WrData : in std_logic_vector(C_PLB_DWIDTH-1 downto 0); -- Bus write data BUS_address : in std_logic_vector(31 downto 0); -- word offset from BASE_ADDRESS BUS_size : in std_logic_vector(31 downto 0); -- burst size of word BUS_req_nRW : in std_logic; -- req type 0: Read, 1: write BUS_req_BE : in std_logic_vector(C_PLB_DWIDTH/8 -1 downto 0); -- Bus write data byte enable BUS_req_full_n : out std_logic; -- req Fifo full BUS_req_push : in std_logic; -- req Fifo push (new request in) BUS_rsp_nRW : out std_logic; -- return data FIFO rsp type BUS_rsp_empty_n : out std_logic; -- return data FIFO empty BUS_rsp_pop : in std_logic -- return data FIFO pop ); end component; -- type state_type is (IDLE, ); -- signal cs, ns : st_type; constant PLB_BW : integer := C_PLB_DWIDTH; constant PLB_BYTE_COUNT : integer := C_PLB_DWIDTH/8; constant USER_DATA_BYTE_COUNT : integer := USER_DATA_WIDTH_2N/8; constant REQ_FIFO_DATA_WIDTH : integer := 1 + 32 + 32 + USER_DATA_WIDTH_2N; -- nRW + addr + size + wr_data constant REQ_FIFO_ADDR_WIDTH : integer := 5; constant REQ_FIFO_DEPTH : integer := 32; constant ALIGN_DATA_WIDTH : integer := USER_DATA_WIDTH_2N + PLB_BW; constant ALIGN_DATA_BE_WIDTH : integer := (USER_DATA_WIDTH_2N + PLB_BW)/8; signal user_phy_address : STD_LOGIC_VECTOR(31 downto 0); -- request FIFO signal req_fifo_empty_n : STD_LOGIC; signal req_fifo_pop : STD_LOGIC; signal req_fifo_dout : STD_LOGIC_VECTOR(REQ_FIFO_DATA_WIDTH - 1 downto 0); signal req_fifo_full_n : STD_LOGIC; signal req_fifo_push : STD_LOGIC; signal req_fifo_din : STD_LOGIC_VECTOR(REQ_FIFO_DATA_WIDTH - 1 downto 0); signal user_WrData_2N : STD_LOGIC_VECTOR(USER_DATA_WIDTH_2N-1 downto 0); signal req_fifo_dout_req_nRW : STD_LOGIC; signal req_fifo_dout_req_address : STD_LOGIC_VECTOR(31 downto 0); signal req_fifo_dout_req_size, req_fifo_dout_req_size_normalize : STD_LOGIC_VECTOR(31 downto 0); -- internal request information signal req_nRW : STD_LOGIC; signal req_address : STD_LOGIC_VECTOR(31 downto 0); signal req_size, burst_size : STD_LOGIC_VECTOR(31 downto 0); signal req_size_user : STD_LOGIC_VECTOR(31 downto 0); signal req_BE : STD_LOGIC_VECTOR(PLB_BYTE_COUNT-1 downto 0); signal req_WrData : STD_LOGIC_VECTOR(ALIGN_DATA_WIDTH -1 downto 0); signal req_WrData_BE : STD_LOGIC_VECTOR(ALIGN_DATA_BE_WIDTH -1 downto 0); signal req_WrData_byte_p : STD_LOGIC_VECTOR(PLB_ADDR_SHIFT-1 downto 0); signal req_valid, req_SOP, req_EOP_user, req_EOP : STD_LOGIC; signal req_burst_write_counter : STD_LOGIC_VECTOR(31 downto 0); signal req_burst_mode, req_last_burst: STD_LOGIC; -- interface to PLB_master_if module signal PLB_master_if_req_full_n : STD_LOGIC; signal PLB_master_if_req_push : STD_LOGIC; signal PLB_master_if_dataout : STD_LOGIC_VECTOR(PLB_BW-1 downto 0); signal PLB_master_if_rsp_nRW : STD_LOGIC; signal PLB_master_if_rsp_empty_n : STD_LOGIC; signal PLB_master_if_rsp_pop : STD_LOGIC; signal USER_size_local: STD_LOGIC_VECTOR(31 downto 0); -- rsp FIFO constant RSP_FIFO_DATA_WIDTH : integer := PLB_ADDR_SHIFT + 32; -- addr + size constant RSP_FIFO_ADDR_WIDTH : integer := 6; constant RSP_FIFO_DEPTH : integer := 64; signal rsp_fifo_empty_n : STD_LOGIC; signal rsp_fifo_pop : STD_LOGIC; signal rsp_fifo_dout : STD_LOGIC_VECTOR(RSP_FIFO_DATA_WIDTH -1 downto 0); signal rsp_fifo_full_n : STD_LOGIC; signal rsp_fifo_push : STD_LOGIC; signal rsp_fifo_din : STD_LOGIC_VECTOR(RSP_FIFO_DATA_WIDTH -1 downto 0); signal rsp_valid, rsp_SOP : STD_LOGIC; signal rsp_addr : STD_LOGIC_VECTOR(PLB_ADDR_SHIFT-1 downto 0); signal rsp_size : STD_LOGIC_VECTOR(31 downto 0); signal rsp_rd_data : STD_LOGIC_VECTOR(ALIGN_DATA_WIDTH -1 downto 0); signal rsp_rd_data_byte_count : STD_LOGIC_VECTOR(4 downto 0); -- rd data user FIFO signal rd_data_user_fifo_empty_n : STD_LOGIC; signal rd_data_user_fifo_pop : STD_LOGIC; signal rd_data_user_fifo_dout : STD_LOGIC_VECTOR(USER_DATA_WIDTH -1 downto 0); signal rd_data_user_fifo_full_n : STD_LOGIC; signal rd_data_user_fifo_push : STD_LOGIC; signal rd_data_user_fifo_din : STD_LOGIC_VECTOR(USER_DATA_WIDTH -1 downto 0); signal rd_data_user_fifo_din_2N : STD_LOGIC_VECTOR(USER_DATA_WIDTH_2N -1 downto 0); signal BE_ALL_ONE : STD_LOGIC_VECTOR(PLB_BYTE_COUNT -1 downto 0); begin BE_ALL_ONE <= (others => '1'); M_UABus <= (others => '0'); M_TAttribute <= (others => '0'); -- interface to user logic user_phy_address(31 downto USER_ADDR_SHIFT) <= REMOTE_DESTINATION_ADDRESS(0 to C_PLB_AWIDTH - USER_ADDR_SHIFT -1) + USER_address(31 -USER_ADDR_SHIFT downto 0); user_phy_address(USER_ADDR_SHIFT-1 downto 0) <= REMOTE_DESTINATION_ADDRESS(C_PLB_AWIDTH - USER_ADDR_SHIFT to C_PLB_AWIDTH -1); USER_size_local <= X"00000001" when conv_integer(USER_size(31 downto 1)) = 0 else USER_size; USER_req_full_n <= req_fifo_full_n; process(USER_WrData) variable i: integer; begin user_WrData_2N <= (others=> '0'); for i in 0 to USER_WrData'length -1 loop user_WrData_2N (USER_DATA_WIDTH_2N-1 -i) <= USER_WrData(i); end loop; end process; req_fifo_din(REQ_FIFO_DATA_WIDTH-1) <= USER_req_nRW; req_fifo_din(REQ_FIFO_DATA_WIDTH-1-1 downto REQ_FIFO_DATA_WIDTH -1-32) <= user_phy_address; req_fifo_din(REQ_FIFO_DATA_WIDTH-1-32-1 downto REQ_FIFO_DATA_WIDTH -1-32-32) <= USER_size_local; req_fifo_din(USER_DATA_WIDTH_2N -1 downto 0) <= user_WrData_2N(USER_DATA_WIDTH_2N-1 downto 0); req_fifo_push <= USER_req_push; U_indices_if_req_fifo: component indices_if_ap_fifo generic map( DATA_WIDTH => REQ_FIFO_DATA_WIDTH, ADDR_WIDTH => REQ_FIFO_ADDR_WIDTH, DEPTH => REQ_FIFO_DEPTH) port map( clk => MPLB_Clk, reset => MPLB_Rst, if_empty_n => req_fifo_empty_n, if_read => req_fifo_pop, if_dout => req_fifo_dout, if_full_n => req_fifo_full_n, if_write => req_fifo_push, if_din => req_fifo_din ); req_fifo_dout_req_nRW <= req_fifo_dout(REQ_FIFO_DATA_WIDTH -1); req_fifo_dout_req_size <= req_fifo_dout(REQ_FIFO_DATA_WIDTH-1-32-1 downto REQ_FIFO_DATA_WIDTH -1-32-32); req_fifo_dout_req_address <= req_fifo_dout(REQ_FIFO_DATA_WIDTH-1-1 downto REQ_FIFO_DATA_WIDTH -1-32); req_fifo_dout_req_size_normalize(31 downto USER_ADDR_SHIFT) <= req_fifo_dout_req_size(31-USER_ADDR_SHIFT downto 0); req_fifo_dout_req_size_normalize(USER_ADDR_SHIFT-1 downto 0) <= (others => '0'); process(req_fifo_empty_n, req_valid) begin req_fifo_pop <= '0'; if (req_fifo_empty_n = '1' and req_valid = '0') then -- lunch next request req_fifo_pop <= '1'; end if; end process; process (MPLB_Clk, MPLB_Rst) variable offset: integer; begin if (MPLB_Rst = '1') then req_nRW <= '0'; burst_size <= (others => '0'); req_size_user <= (others => '0'); req_address <= (others => '0'); req_WrData <= (others => '0'); -- set possible MSB to ZERO req_WrData_BE <= (others => '0'); -- set possible MSB to ZERO req_WrData_byte_p <= (others => '0'); -- set possible MSB to ZERO req_valid <= '0'; req_EOP <= '0'; req_burst_write_counter <= (others => '0'); req_burst_mode <= '0'; elsif (MPLB_Clk'event and MPLB_Clk = '1') then if (req_fifo_pop = '1') then -- lunch next request req_valid <= '1'; if (req_burst_mode = '0') then if (req_fifo_dout_req_nRW = '0') then if (req_fifo_dout_req_size_normalize(PLB_ADDR_SHIFT-1 downto 0) = CONV_STD_LOGIC_VECTOR(0,PLB_ADDR_SHIFT) and req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0) = CONV_STD_LOGIC_VECTOR(0,PLB_ADDR_SHIFT)) then burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT); elsif (('0'&req_fifo_dout_req_size_normalize(PLB_ADDR_SHIFT-1 downto 0)) + ('0'&req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0)) <= PLB_BYTE_COUNT) then burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT) + 1; else burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT) + 2; end if; else burst_size <= X"00000001"; -- single by default if (req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT+1) /= CONV_STD_LOGIC_VECTOR(0,31-PLB_ADDR_SHIFT)) then -- may burst burst_size(31 downto 32-PLB_ADDR_SHIFT) <= (others=>'0'); -- burst_size for write operation if (req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0) = CONV_STD_LOGIC_VECTOR(0, PLB_ADDR_SHIFT)) or (conv_integer(req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0)) + conv_integer(req_fifo_dout_req_size_normalize(PLB_ADDR_SHIFT-1 downto 0)) >= PLB_BYTE_COUNT) then burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT); else burst_size(31-PLB_ADDR_SHIFT downto 0) <= req_fifo_dout_req_size_normalize(31 downto PLB_ADDR_SHIFT)-1; end if; end if; end if; offset := conv_integer(req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0)); if (req_fifo_dout_req_nRW = '1') then req_WrData(USER_DATA_WIDTH_2N +offset*8 -1 downto offset*8) <= req_fifo_dout(USER_DATA_WIDTH_2N -1 downto 0); req_WrData_BE(USER_DATA_BYTE_COUNT+offset-1 downto offset) <= (others => '1'); end if; req_size_user <= req_fifo_dout_req_size; -- for read operation req_nRW <= req_fifo_dout_req_nRW; req_EOP <= '1'; req_address <= req_fifo_dout_req_address; req_burst_write_counter <= req_fifo_dout_req_size; req_WrData_byte_p <= req_fifo_dout_req_address(PLB_ADDR_SHIFT-1 downto 0) + USER_DATA_BYTE_COUNT; if (req_fifo_dout_req_nRW = '1' and req_fifo_dout_req_size(31 downto 1) /= "0000000000000000000000000000000") then req_burst_mode <= '1'; req_EOP <= '0'; end if; else -- in a burst write process req_burst_write_counter <= req_burst_write_counter -1; offset := conv_integer(req_WrData_byte_p); req_WrData(USER_DATA_WIDTH_2N +offset*8 -1 downto offset*8) <= req_fifo_dout(USER_DATA_WIDTH_2N -1 downto 0); req_WrData_BE(USER_DATA_BYTE_COUNT+offset-1 downto offset) <= (others => '1'); req_WrData_byte_p <= req_WrData_byte_p + USER_DATA_BYTE_COUNT; if (req_last_burst = '1') then req_burst_mode <= '0'; req_EOP <= '1'; end if; end if; elsif (req_valid = '1') then if (req_nRW = '0' and PLB_master_if_req_push = '1') then req_valid <= '0'; elsif (req_nRW = '1') then if (req_EOP = '1' and PLB_master_if_req_push = '1') then -- last burst request if (req_WrData_BE(ALIGN_DATA_BE_WIDTH-1 downto PLB_BYTE_COUNT) = CONV_STD_LOGIC_VECTOR(0, ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT)) then req_valid <= '0'; req_EOP <= '0'; req_WrData <= (others=>'0'); req_WrData_BE <= (others => '0'); else req_WrData(USER_DATA_WIDTH_2N + PLB_BW -1 downto USER_DATA_WIDTH_2N) <= (others => '0'); req_WrData(USER_DATA_WIDTH_2N -1 downto 0) <= req_WrData(USER_DATA_WIDTH_2N +PLB_BW -1 downto PLB_BW); req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT) <= (others => '0'); req_WrData_BE(ALIGN_DATA_BE_WIDTH -PLB_BYTE_COUNT-1 downto 0) <= req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto PLB_BYTE_COUNT); req_address(31 downto PLB_ADDR_SHIFT) <= req_address(31 downto PLB_ADDR_SHIFT) +1; req_address(PLB_ADDR_SHIFT-1 downto 0) <= (others=>'0'); end if; elsif (req_EOP = '0') then if (req_WrData_BE(PLB_BYTE_COUNT-1) = '0') then req_valid <= '0'; elsif (req_WrData_BE(PLB_BYTE_COUNT-1) = '1' and PLB_master_if_req_push = '1') then req_WrData(USER_DATA_WIDTH_2N + PLB_BW -1 downto USER_DATA_WIDTH_2N) <= (others => '0'); req_WrData(USER_DATA_WIDTH_2N -1 downto 0) <= req_WrData(USER_DATA_WIDTH_2N +PLB_BW -1 downto PLB_BW); req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT) <= (others => '0'); req_WrData_BE(ALIGN_DATA_BE_WIDTH-PLB_BYTE_COUNT-1 downto 0) <= req_WrData_BE(ALIGN_DATA_BE_WIDTH -1 downto PLB_BYTE_COUNT); req_address(31 downto PLB_ADDR_SHIFT) <= req_address(31 downto PLB_ADDR_SHIFT) +1; req_address(PLB_ADDR_SHIFT-1 downto 0) <= (others=>'0'); end if; end if; end if; end if; end if; end process; req_last_burst <= '1' when (req_burst_mode = '1' and req_burst_write_counter(31 downto 0) = X"00000002") else '0'; process(req_nRW, req_WrData_BE, burst_size) begin req_size <= (others => '0'); if (req_nRW = '0') then req_size <= burst_size; elsif (req_WrData_BE(PLB_BYTE_COUNT-1 downto 0) = BE_ALL_ONE) then req_size <= burst_size; else req_size <= X"00000001"; end if; end process; process(req_valid, PLB_master_if_req_full_n, req_nRW, req_WrData_BE) begin PLB_master_if_req_push <= '0'; if (req_valid = '1' and PLB_master_if_req_full_n = '1') then if (req_nRW = '0') then PLB_master_if_req_push <= '1'; -- only push when the last byte been push elsif (req_WrData_BE(PLB_BYTE_COUNT-1) = '1' or (req_EOP = '1' and req_WrData_BE(PLB_BYTE_COUNT-1 downto 0) /= CONV_STD_LOGIC_VECTOR(0, PLB_BYTE_COUNT))) then PLB_master_if_req_push <= '1'; -- only push when the last byte been push end if; end if; end process; req_BE <= req_WrData_BE(PLB_BYTE_COUNT-1 downto 0) when req_nRW = '1' else (others => '1'); U_indices_if_plb_master_if: component indices_if_plb_master_if generic map( C_PLB_AWIDTH => C_PLB_AWIDTH, C_PLB_DWIDTH => C_PLB_DWIDTH, PLB_ADDR_SHIFT => PLB_ADDR_SHIFT) port map ( -- Bus protocol ports, do not add to or delete PLB_Clk => MPLB_Clk, PLB_Rst => MPLB_Rst, M_abort => M_abort, M_ABus => M_ABus, M_BE => M_BE, M_busLock => M_busLock, M_lockErr => M_lockErr, M_MSize => M_MSize, M_priority => M_priority, M_rdBurst => M_rdBurst, M_request => M_request, M_RNW => M_RNW, M_size => M_size, M_type => M_type, M_wrBurst => M_wrBurst, M_wrDBus => M_wrDBus, PLB_MBusy => PLB_MBusy, PLB_MWrBTerm => PLB_MWrBTerm, PLB_MWrDAck => PLB_MWrDAck, PLB_MAddrAck => PLB_MAddrAck, PLB_MRdBTerm => PLB_MRdBTerm, PLB_MRdDAck => PLB_MRdDAck, PLB_MRdDBus => PLB_MRdDBus, PLB_MRdWdAddr => PLB_MRdWdAddr, PLB_MRearbitrate => PLB_MRearbitrate, PLB_MSSize => PLB_MSSize, -- signals from user logic BUS_RdData => PLB_master_if_dataout, BUS_WrData => req_WrData(PLB_BW-1 downto 0), BUS_address => req_address, BUS_size => req_size, BUS_req_nRW => req_nRW, BUS_req_BE => req_BE, BUS_req_full_n => PLB_master_if_req_full_n, BUS_req_push => PLB_master_if_req_push, BUS_rsp_nRW => PLB_master_if_rsp_nRW, BUS_rsp_empty_n => PLB_master_if_rsp_empty_n, BUS_rsp_pop => PLB_master_if_rsp_pop ); -- below is the response (bus read data) part U_indices_if_rsp_fifo: component indices_if_ap_fifo generic map( DATA_WIDTH => RSP_FIFO_DATA_WIDTH, ADDR_WIDTH => RSP_FIFO_ADDR_WIDTH, DEPTH => RSP_FIFO_DEPTH) port map( clk => MPLB_Clk, reset => MPLB_Rst, if_empty_n => rsp_fifo_empty_n, if_read => rsp_fifo_pop, if_dout => rsp_fifo_dout, if_full_n => rsp_fifo_full_n, if_write => rsp_fifo_push, if_din => rsp_fifo_din ); rsp_fifo_din(32+PLB_ADDR_SHIFT-1 downto 32) <= req_address(PLB_ADDR_SHIFT-1 downto 0); rsp_fifo_din(31 downto 0) <= req_size_user; rsp_fifo_push <= PLB_master_if_req_push and (not req_nRW); process (rsp_valid, PLB_master_if_rsp_empty_n, rsp_rd_data_byte_count) begin PLB_master_if_rsp_pop <= '0'; -- fetch data to rsp_rd_data until enough bytes if (rsp_valid = '1' and PLB_master_if_rsp_empty_n = '1' and CONV_INTEGER(rsp_rd_data_byte_count) < USER_DATA_BYTE_COUNT) then PLB_master_if_rsp_pop <= '1'; end if; end process; process (MPLB_Clk, MPLB_Rst) begin if (MPLB_Rst = '1') then rsp_valid <= '0'; rsp_addr <= (others=> '0'); rsp_size <= (others=> '0'); rsp_SOP <= '1'; rsp_rd_data_byte_count <= (others => '0'); rsp_rd_data <= (others=>'0'); rsp_fifo_pop <= '0'; elsif (MPLB_Clk'event and MPLB_Clk = '1') then rsp_fifo_pop <= '0'; if (rsp_valid = '0' and rsp_fifo_empty_n = '1') then rsp_valid <= '1'; rsp_addr <= rsp_fifo_dout(32+PLB_ADDR_SHIFT-1 downto 32); rsp_size <= rsp_fifo_dout(31 downto 0); rsp_fifo_pop <= '1'; rsp_rd_data_byte_count <= (others=>'0'); rsp_SOP <= '1'; end if; -- fetch data to rsp_rd_data until enough bytes if (PLB_master_if_rsp_pop = '1') then rsp_rd_data(USER_DATA_WIDTH_2N-1 downto 0) <= rsp_rd_data(USER_DATA_WIDTH_2N + PLB_BW -1 downto PLB_BW); rsp_rd_data(USER_DATA_WIDTH_2N +PLB_BW -1 downto USER_DATA_WIDTH_2N) <= PLB_master_if_dataout; if (rsp_SOP = '1') then rsp_rd_data_byte_count <= rsp_rd_data_byte_count + PLB_BYTE_COUNT - rsp_addr; rsp_SOP <= '0'; else rsp_rd_data_byte_count <= rsp_rd_data_byte_count + PLB_BYTE_COUNT; end if; end if; -- write one unit of data to USER LOGIC if (rd_data_user_fifo_push = '1') then rsp_size <= rsp_size -1; rsp_rd_data_byte_count <= rsp_rd_data_byte_count - USER_DATA_BYTE_COUNT; rsp_addr <= rsp_addr + USER_DATA_BYTE_COUNT; if (rsp_size = X"00000001") then rsp_valid <= '0'; end if; end if; end if; end process; process(rsp_addr, rsp_rd_data,rsp_valid, rd_data_user_fifo_full_n, rsp_rd_data_byte_count, rd_data_user_fifo_din_2N) variable i: integer; begin case CONV_INTEGER(rsp_addr) is when 0 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +64 -1 downto 64); when 1 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +8 -1 downto 8); when 2 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +16 -1 downto 16); when 3 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +24 -1 downto 24); when 4 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +32 -1 downto 32); when 5 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +40 -1 downto 40); when 6 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +48 -1 downto 48); when 7 => rd_data_user_fifo_din_2N <= rsp_rd_data(USER_DATA_WIDTH_2N +56 -1 downto 56); when others => null; end case; for i in 0 to USER_DATA_WIDTH -1 loop rd_data_user_fifo_din(i) <= rd_data_user_fifo_din_2N(USER_DATA_WIDTH_2N-1-i); end loop; rd_data_user_fifo_push <= '0'; if (rsp_valid = '1' and rd_data_user_fifo_full_n = '1' and CONV_INTEGER(rsp_rd_data_byte_count)>= USER_DATA_BYTE_COUNT) then rd_data_user_fifo_push <= '1'; end if; end process; U_indices_if_rd_data_user_fifo: component indices_if_ap_fifo generic map( DATA_WIDTH => USER_DATA_WIDTH, ADDR_WIDTH => 5, DEPTH => 32) port map( clk => MPLB_Clk, reset => MPLB_Rst, if_empty_n => rd_data_user_fifo_empty_n, if_read => USER_rsp_pop, if_dout => rd_data_user_fifo_dout, if_full_n => rd_data_user_fifo_full_n, if_write => rd_data_user_fifo_push, if_din => rd_data_user_fifo_din ); USER_RdData <= rd_data_user_fifo_dout; USER_rsp_empty_n <= rd_data_user_fifo_empty_n; end IMP;
`protect begin_protected `protect version = 1 `protect encrypt_agent = "XILINX" `protect encrypt_agent_info = "Xilinx Encryption Tool 2014" `protect key_keyowner = "Cadence Design Systems.", key_keyname= "cds_rsa_key", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 64) `protect key_block W9ikAzfkNAB9r6UjwYkkLbO7xSa6Pa5uk+WdU1HnuyZEhmVth9jtplxOjM44FNqSQvXccO8yxQi/ NOIWOqyRuQ== `protect key_keyowner = "Mentor Graphics Corporation", key_keyname= "MGC-VERIF-SIM-RSA-1", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 128) `protect key_block hEuem1/oUd4/OEXkW2OvYqIxpyUbHGfY7GOC6MYHG11DUK95IJjyjs7VGLCJVTSk7aMQu8m0Up8B V7A2i5Ur1C/MGpffEfJZxWT9TmFVFogk48CVrfRqfUf+EY/RnTok8AxbPM/CybW1sngqZ0CjEdAR WFwF2WmA9kANp7DyS9Y= `protect key_keyowner = "Xilinx", key_keyname= "xilinx_2014_03", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 256) `protect key_block YvMHbfeLoNrrdjK8MzZ3wyAsEds/aUUU1qihbPDmGwW2kx85UhHj3XK9rxLVtguq6gNEFC6HhSRq ElvLoh05rPkMnw6WFsbKYG4H4bGxyS47kd8q3QuXnE6sCz6iwiKIv3dpxTb7XlMwEgrVo5qwxGVL s9GGRvYTehzL7krjc0uS4aFXrE0IozDVS75JoLN8e6buKPj0LqKxI7eJDZG7nEfNSuwPJgV9jjsn hBN7sE/TpmRuBxik41OE9HAXgcn8nnK+V1lhlH0VRFNNoFpqAT/MO7xuOSQjqp+eRafuukS3cAC0 2Sj1JyG5X2zzvgGRtR4WAzC70VggYtvYSDr4fA== `protect key_keyowner = "Synopsys", key_keyname= "SNPS-VCS-RSA-1", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 128) `protect key_block odYDbVugJa4zsNoidrU3zfx00EVw1f1F4ZM7PMiUD5vBKIyGujE3/2kpootoEODrHYYL5BLfkUxF BOQX5PSqpPgaDdiSWs2KCidYq7PHZN3L6Rfg3lupSDrgIHrKR+n/0uxrr/QGDaV+/KOkCbB4EmF3 NyOLBbCEbB/cyic67Z4= `protect key_keyowner = "Aldec", key_keyname= "ALDEC08_001", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 256) `protect key_block eIzvt2wVqO3FcBIgfe/d1GrO8xAJyZ1wgW6um6UoZcItt2tjAa8e4PowdMaz78drHioWBIt7t7sB imWtFcP0XMZDfFZ2wKw3JJinSToIdJDnmZ+SigbxdzjvPvdZmXqc/soqccpjzaBwx0DzDM+jpCRD sdcRaQP44+rEYmGdQzUtkX5LMZ/ySPHZt7L2ejRcX1NR7tjsbb6iftGBFtOOKIolJXES4o+D0lFM w4plD0zfXEeIpYzOx/B+7FZQ8lYPkEeG3Q4nhVL4OPIVDrnnmCTdbedEddsMjHf/oddTYPxyD/Ra iW41N9W4EeySOPEdcOEovPgHrZ+ZDykNGAE4tg== `protect data_method = "AES128-CBC" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 11024) `protect data_block wCi1EGWEcepbgW5uOEPN0evgYS9XZMSzJsF/EcLsBFhCvSD1oOzqmP8fJeDLmEdNQF/7YfTTGwOG s/wOi78uIdGAW8EknbP1v8GZ5t6AckJ+EAbHX2Fw5Pv9eiMTrctGH8sk1YlZDCuPnfV55Q2O0zud +0ZgXnZlrc7F/yyZf/0sL5RdhKarwiOYPkVaXJQy9vCiCznzitdbynS2yKkF1aLC3vIZhryEd2L6 6bsXkgm7ee4SOk169T8++p+1X37L+DO43l3b6H/OI1+62kC4OMfxcvL1jRl+vSBIkdl3HUEXQrCw BmWHZcuGnpe/iwZc1V6oVxIxWi4cGY3ejnO6+VJ5a4rzjl4OlufiZr9qpgclLk1fxBa6TbGihHi9 RDMs4KeyGEvpcjzh6tGhCG/gvV3VK3M7wp9uT7YEPNHxQO3EM7PlrsX/DYSZ9PzM4RJjzCocSe/3 XiNKaR345NJXRC+Wex8XcPYAGljr9J9w5GUwlC2iu4yMn3fsLiDyiN15qNEGr0Tl4Xth4CG1sfYc glnF3CpxdEWH4FnY86Et46HYGX+ezVvSVjzWPfQII4x4TuqPCdxM4hq53UY9L8QnDPjkJidKkAYJ A9SVIQVaSdUJb/fJsTc5rdQBFybAaNUc3RWW//Q/aegz6j9UZTB4EY+Fq0UzFmtB/D263K+5m5R2 k1jVDCHI37Mw5Q3mIzezR7HEVX5NJGQP30WUpwf5n0QmslBWheGmAaBdXi1VQAj2oDgSvzK4Roj1 oqpd3mMkX30De+pToc2HoY/rZUV73JMlIMw0KCIskkPCTA7ip+VF1+MO5EsiF0xIZ8p/FkZhkGPo Gi5RbLu1rEg2F05pIat444Nyyr3Pej93fE8aJc67F+/NYr9AVk21O3C5g7oFX+l2Nce1AuajhKwK 0zB93kklzSo7mCDRBC8q7PEMADV7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IMKWTFHr123Q hzzevdPgq+PLETWVpuqWVwABs2Zry5Cn8/1bY1ycLn979JIAWPZ+CWFYFNlN25pN+EsX/RHG6R5S KJiTZkoSVqcMgA0DpqLox75PBFPyJ7i1cvjK8YtTujok8e4VVhXsI/lNXWMTC/UbijxZwtH267Ce I4fMGbQQIMESXMd6WE9C3YnZ5MH6x2UpDFIkzWsQJQA7KZolxExV1s5ks4RNysoYkXVDzvo/mCmX k4oR9apqKxMCecmDlaBiNOoZiwzn5hqEyIJKPLKsH9nSDyj+JnoZMyQQvyMZlh+vPrf8rCFqY6hi RkbrD+u1Mq9vMeE7pidNai1Srz9yGef2OGgIq/L53Utc6vbDnICqYFW5f1xEB75dcUvzqG4rdo+T 5CggBverDRcHd0mfv6/cuCDA50UKoXchT7um7hrHO8Bpg+5LcmfN/Ih2pHLF3ljBEhcB0vXfOlcK Iy4D241vvk6g27GzhLpE8ygbJd5gdgAf46O7SwseHXBhsP9j8KWZt5BXtsTED+LI3kePgYlW+5RF uE2dDRAmi02Ick7uqMtVEvW0iPsXfaZBD4uIyTkVxJEl4PuvxkRMzxk9UpXqxzBED4LKQu9Xx0mO TDZWT/WXqCembv4/MjB+VKBed6NZzUIVa5hoa/RHKhjwueQLtiOCFeBXMECrtjcv66lhe7vfb9z6 +5/p/1CVftcsyrdAPnK0cRwNJDf1EAaYh7BPwK6H30ueXZtm0tsVo7VdSz/sYtSzIdG72vXqeyCt kntpF3Ak8hJmnt883z/0Lav6YRbzEKfW90EuPMm4AiewTM/zdWNHdUN23cJOcLrF77qEGEYDe8Sb Ridq1vEgTVRnwCYMu4+7sDFYg6jXRfk= `protect end_protected
`protect begin_protected `protect version = 1 `protect encrypt_agent = "XILINX" `protect encrypt_agent_info = "Xilinx Encryption Tool 2014" `protect key_keyowner = "Cadence Design Systems.", key_keyname= "cds_rsa_key", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 64) `protect key_block W9ikAzfkNAB9r6UjwYkkLbO7xSa6Pa5uk+WdU1HnuyZEhmVth9jtplxOjM44FNqSQvXccO8yxQi/ NOIWOqyRuQ== `protect key_keyowner = "Mentor Graphics Corporation", key_keyname= "MGC-VERIF-SIM-RSA-1", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 128) `protect key_block hEuem1/oUd4/OEXkW2OvYqIxpyUbHGfY7GOC6MYHG11DUK95IJjyjs7VGLCJVTSk7aMQu8m0Up8B V7A2i5Ur1C/MGpffEfJZxWT9TmFVFogk48CVrfRqfUf+EY/RnTok8AxbPM/CybW1sngqZ0CjEdAR WFwF2WmA9kANp7DyS9Y= `protect key_keyowner = "Xilinx", key_keyname= "xilinx_2014_03", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 256) `protect key_block YvMHbfeLoNrrdjK8MzZ3wyAsEds/aUUU1qihbPDmGwW2kx85UhHj3XK9rxLVtguq6gNEFC6HhSRq ElvLoh05rPkMnw6WFsbKYG4H4bGxyS47kd8q3QuXnE6sCz6iwiKIv3dpxTb7XlMwEgrVo5qwxGVL s9GGRvYTehzL7krjc0uS4aFXrE0IozDVS75JoLN8e6buKPj0LqKxI7eJDZG7nEfNSuwPJgV9jjsn hBN7sE/TpmRuBxik41OE9HAXgcn8nnK+V1lhlH0VRFNNoFpqAT/MO7xuOSQjqp+eRafuukS3cAC0 2Sj1JyG5X2zzvgGRtR4WAzC70VggYtvYSDr4fA== `protect key_keyowner = "Synopsys", key_keyname= "SNPS-VCS-RSA-1", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 128) `protect key_block odYDbVugJa4zsNoidrU3zfx00EVw1f1F4ZM7PMiUD5vBKIyGujE3/2kpootoEODrHYYL5BLfkUxF BOQX5PSqpPgaDdiSWs2KCidYq7PHZN3L6Rfg3lupSDrgIHrKR+n/0uxrr/QGDaV+/KOkCbB4EmF3 NyOLBbCEbB/cyic67Z4= `protect key_keyowner = "Aldec", key_keyname= "ALDEC08_001", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 256) `protect key_block eIzvt2wVqO3FcBIgfe/d1GrO8xAJyZ1wgW6um6UoZcItt2tjAa8e4PowdMaz78drHioWBIt7t7sB imWtFcP0XMZDfFZ2wKw3JJinSToIdJDnmZ+SigbxdzjvPvdZmXqc/soqccpjzaBwx0DzDM+jpCRD sdcRaQP44+rEYmGdQzUtkX5LMZ/ySPHZt7L2ejRcX1NR7tjsbb6iftGBFtOOKIolJXES4o+D0lFM w4plD0zfXEeIpYzOx/B+7FZQ8lYPkEeG3Q4nhVL4OPIVDrnnmCTdbedEddsMjHf/oddTYPxyD/Ra iW41N9W4EeySOPEdcOEovPgHrZ+ZDykNGAE4tg== `protect data_method = "AES128-CBC" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 11024) `protect data_block wCi1EGWEcepbgW5uOEPN0evgYS9XZMSzJsF/EcLsBFhCvSD1oOzqmP8fJeDLmEdNQF/7YfTTGwOG s/wOi78uIdGAW8EknbP1v8GZ5t6AckJ+EAbHX2Fw5Pv9eiMTrctGH8sk1YlZDCuPnfV55Q2O0zud +0ZgXnZlrc7F/yyZf/0sL5RdhKarwiOYPkVaXJQy9vCiCznzitdbynS2yKkF1aLC3vIZhryEd2L6 6bsXkgm7ee4SOk169T8++p+1X37L+DO43l3b6H/OI1+62kC4OMfxcvL1jRl+vSBIkdl3HUEXQrCw BmWHZcuGnpe/iwZc1V6oVxIxWi4cGY3ejnO6+VJ5a4rzjl4OlufiZr9qpgclLk1fxBa6TbGihHi9 RDMs4KeyGEvpcjzh6tGhCG/gvV3VK3M7wp9uT7YEPNHxQO3EM7PlrsX/DYSZ9PzM4RJjzCocSe/3 XiNKaR345NJXRC+Wex8XcPYAGljr9J9w5GUwlC2iu4yMn3fsLiDyiN15qNEGr0Tl4Xth4CG1sfYc glnF3CpxdEWH4FnY86Et46HYGX+ezVvSVjzWPfQII4x4TuqPCdxM4hq53UY9L8QnDPjkJidKkAYJ A9SVIQVaSdUJb/fJsTc5r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qeyCt kntpF3Ak8hJmnt883z/0Lav6YRbzEKfW90EuPMm4AiewTM/zdWNHdUN23cJOcLrF77qEGEYDe8Sb Ridq1vEgTVRnwCYMu4+7sDFYg6jXRfk= `protect end_protected
`protect begin_protected `protect version = 1 `protect encrypt_agent = "XILINX" `protect encrypt_agent_info = "Xilinx Encryption Tool 2014" `protect key_keyowner = "Cadence Design Systems.", key_keyname= "cds_rsa_key", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 64) `protect key_block W9ikAzfkNAB9r6UjwYkkLbO7xSa6Pa5uk+WdU1HnuyZEhmVth9jtplxOjM44FNqSQvXccO8yxQi/ NOIWOqyRuQ== `protect key_keyowner = "Mentor Graphics Corporation", key_keyname= "MGC-VERIF-SIM-RSA-1", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 128) `protect key_block hEuem1/oUd4/OEXkW2OvYqIxpyUbHGfY7GOC6MYHG11DUK95IJjyjs7VGLCJVTSk7aMQu8m0Up8B V7A2i5Ur1C/MGpffEfJZxWT9TmFVFogk48CVrfRqfUf+EY/RnTok8AxbPM/CybW1sngqZ0CjEdAR WFwF2WmA9kANp7DyS9Y= `protect key_keyowner = "Xilinx", key_keyname= "xilinx_2014_03", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 256) `protect key_block YvMHbfeLoNrrdjK8MzZ3wyAsEds/aUUU1qihbPDmGwW2kx85UhHj3XK9rxLVtguq6gNEFC6HhSRq ElvLoh05rPkMnw6WFsbKYG4H4bGxyS47kd8q3QuXnE6sCz6iwiKIv3dpxTb7XlMwEgrVo5qwxGVL s9GGRvYTehzL7krjc0uS4aFXrE0IozDVS75JoLN8e6buKPj0LqKxI7eJDZG7nEfNSuwPJgV9jjsn hBN7sE/TpmRuBxik41OE9HAXgcn8nnK+V1lhlH0VRFNNoFpqAT/MO7xuOSQjqp+eRafuukS3cAC0 2Sj1JyG5X2zzvgGRtR4WAzC70VggYtvYSDr4fA== `protect key_keyowner = "Synopsys", key_keyname= "SNPS-VCS-RSA-1", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 128) `protect key_block odYDbVugJa4zsNoidrU3zfx00EVw1f1F4ZM7PMiUD5vBKIyGujE3/2kpootoEODrHYYL5BLfkUxF BOQX5PSqpPgaDdiSWs2KCidYq7PHZN3L6Rfg3lupSDrgIHrKR+n/0uxrr/QGDaV+/KOkCbB4EmF3 NyOLBbCEbB/cyic67Z4= `protect key_keyowner = "Aldec", key_keyname= "ALDEC08_001", key_method = "rsa" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 256) `protect key_block eIzvt2wVqO3FcBIgfe/d1GrO8xAJyZ1wgW6um6UoZcItt2tjAa8e4PowdMaz78drHioWBIt7t7sB imWtFcP0XMZDfFZ2wKw3JJinSToIdJDnmZ+SigbxdzjvPvdZmXqc/soqccpjzaBwx0DzDM+jpCRD sdcRaQP44+rEYmGdQzUtkX5LMZ/ySPHZt7L2ejRcX1NR7tjsbb6iftGBFtOOKIolJXES4o+D0lFM w4plD0zfXEeIpYzOx/B+7FZQ8lYPkEeG3Q4nhVL4OPIVDrnnmCTdbedEddsMjHf/oddTYPxyD/Ra iW41N9W4EeySOPEdcOEovPgHrZ+ZDykNGAE4tg== `protect data_method = "AES128-CBC" `protect encoding = (enctype = "BASE64", line_length = 76, bytes = 11024) `protect data_block wCi1EGWEcepbgW5uOEPN0evgYS9XZMSzJsF/EcLsBFhCvSD1oOzqmP8fJeDLmEdNQF/7YfTTGwOG s/wOi78uIdGAW8EknbP1v8GZ5t6AckJ+EAbHX2Fw5Pv9eiMTrctGH8sk1YlZDCuPnfV55Q2O0zud +0ZgXnZlrc7F/yyZf/0sL5RdhKarwiOYPkVaXJQy9vCiCznzitdbynS2yKkF1aLC3vIZhryEd2L6 6bsXkgm7ee4SOk169T8++p+1X37L+DO43l3b6H/OI1+62kC4OMfxcvL1jRl+vSBIkdl3HUEXQrCw BmWHZcuGnpe/iwZc1V6oVx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