| 1 |
5 |
ktt1 |
--------------------------------------------------------------------------------
|
| 2 |
|
|
-- _ _ __ ____ --
|
| 3 |
|
|
-- / / | | / _| | __| --
|
| 4 |
|
|
-- | |_| | _ _ / / | |_ --
|
| 5 |
|
|
-- | _ | | | | | | | | _| --
|
| 6 |
|
|
-- | | | | | |_| | \ \_ | |__ --
|
| 7 |
|
|
-- |_| |_| \_____| \__| |____| microLab --
|
| 8 |
|
|
-- --
|
| 9 |
|
|
-- Bern University of Applied Sciences (BFH) --
|
| 10 |
|
|
-- Quellgasse 21 --
|
| 11 |
|
|
-- Room HG 4.33 --
|
| 12 |
|
|
-- 2501 Biel/Bienne --
|
| 13 |
|
|
-- Switzerland --
|
| 14 |
|
|
-- --
|
| 15 |
|
|
-- http://www.microlab.ch --
|
| 16 |
|
|
--------------------------------------------------------------------------------
|
| 17 |
|
|
-- GECKO4com
|
| 18 |
|
|
--
|
| 19 |
|
|
-- 2010/2011 Dr. Theo Kluter
|
| 20 |
|
|
--
|
| 21 |
|
|
-- This VHDL code is free code: you can redistribute it and/or modify
|
| 22 |
|
|
-- it under the terms of the GNU General Public License as published by
|
| 23 |
|
|
-- the Free Software Foundation, either version 3 of the License, or
|
| 24 |
|
|
-- (at your option) any later version.
|
| 25 |
|
|
--
|
| 26 |
|
|
-- This VHDL code is distributed in the hope that it will be useful,
|
| 27 |
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 28 |
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 29 |
|
|
-- GNU General Public License for more details.
|
| 30 |
|
|
-- You should have received a copy of the GNU General Public License
|
| 31 |
|
|
-- along with these sources. If not, see <http://www.gnu.org/licenses/>.
|
| 32 |
|
|
--
|
| 33 |
|
|
|
| 34 |
|
|
LIBRARY ieee;
|
| 35 |
|
|
USE ieee.std_logic_1164.all;
|
| 36 |
|
|
USE ieee.std_logic_arith.all;
|
| 37 |
|
|
|
| 38 |
|
|
-- fpga_type:
|
| 39 |
|
|
-- 000 => XC3S1000
|
| 40 |
|
|
-- 001 => XC3S1500
|
| 41 |
|
|
-- 010 => XC3S2000
|
| 42 |
|
|
-- 011 => XC3S4000
|
| 43 |
|
|
-- 100 => XC3S5000
|
| 44 |
|
|
-- rest => Unknown FPGA or no FPGA mounted
|
| 45 |
|
|
|
| 46 |
|
|
ENTITY fpga_if IS
|
| 47 |
|
|
PORT ( clock : IN std_logic;
|
| 48 |
|
|
reset : IN std_logic;
|
| 49 |
|
|
|
| 50 |
|
|
-- Here the FPGA info is provided
|
| 51 |
|
|
fpga_idle : OUT std_logic;
|
| 52 |
|
|
fpga_revision : OUT std_logic_vector( 3 DOWNTO 0 );
|
| 53 |
|
|
fpga_type : OUT std_logic_vector( 2 DOWNTO 0 );
|
| 54 |
|
|
fpga_configured : OUT std_logic;
|
| 55 |
|
|
fpga_crc_error : OUT std_logic;
|
| 56 |
|
|
|
| 57 |
|
|
-- Here the bitfile fifo if is defined
|
| 58 |
|
|
push : IN std_logic;
|
| 59 |
|
|
push_data : IN std_logic_vector( 7 DOWNTO 0 );
|
| 60 |
|
|
last_byte : IN std_logic;
|
| 61 |
|
|
fifo_full : OUT std_logic;
|
| 62 |
|
|
|
| 63 |
|
|
-- Here the select map pins are defined
|
| 64 |
|
|
fpga_done : IN std_logic;
|
| 65 |
|
|
fpga_busy : IN std_logic;
|
| 66 |
|
|
fpga_n_init : IN std_logic;
|
| 67 |
|
|
fpga_n_prog : OUT std_logic;
|
| 68 |
|
|
fpga_rd_n_wr : OUT std_logic;
|
| 69 |
|
|
fpga_n_cs : OUT std_logic;
|
| 70 |
|
|
fpga_cclk : OUT std_logic;
|
| 71 |
|
|
|
| 72 |
|
|
fpga_data_in : IN std_logic_vector( 7 DOWNTO 0 );
|
| 73 |
|
|
fpga_data_out : OUT std_logic_vector( 7 DOWNTO 0 );
|
| 74 |
|
|
fpga_n_tri : OUT std_logic_vector( 7 DOWNTO 0 );
|
| 75 |
|
|
fpga_data_in_ena : OUT std_logic;
|
| 76 |
|
|
fpga_data_out_ena : OUT std_logic);
|
| 77 |
|
|
END fpga_if;
|
| 78 |
|
|
|