| 
      1
     | 
    
      --- Title:IndustrialIO_top.vhd
 
     | 
  
  
    | 
      2
     | 
    
      --- Description: 
 
     | 
  
  
    | 
      3
     | 
    
      ---
 
     | 
  
  
    | 
      4
     | 
    
      ---     o  0
 
     | 
  
  
    | 
      5
     | 
    
      ---     | /       Copyright (c) 2010
 
     | 
  
  
    | 
      6
     | 
    
      ---    (CL)---o   Critical Link, LLC
 
     | 
  
  
    | 
      7
     | 
    
      ---      \
 
     | 
  
  
    | 
      8
     | 
    
      ---       O
 
     | 
  
  
    | 
      9
     | 
    
      ---
 
     | 
  
  
    | 
      10
     | 
    
      --- Company: Critical Link, LLC.
 
     | 
  
  
    | 
      11
     | 
    
      --- Date: 03/7/2010
 
     | 
  
  
    | 
      12
     | 
    
      --- Version: 1.00
 
     | 
  
  
    | 
      13
     | 
    
      ---
 
     | 
  
  
    | 
      14
     | 
    
      --- Revision History
 
     | 
  
  
    | 
      15
     | 
    
      ---   1.00 - Initial revision
 
     | 
  
  
    | 
      16
     | 
    
      ---   1.10 - REVISION TO AGREE WITH CUSTOM BOARD ANALOG1
 
     | 
  
  
    | 
      17
     | 
    
      
 
     | 
  
  
    | 
      18
     | 
    
      library WORK;
 
     | 
  
  
    | 
      19
     | 
    
      library IEEE;
 
     | 
  
  
    | 
      20
     | 
    
      library UNISIM;
 
     | 
  
  
    | 
      21
     | 
    
      use IEEE.STD_LOGIC_1164.ALL;
 
     | 
  
  
    | 
      22
     | 
    
      use IEEE.STD_LOGIC_ARITH.ALL;
 
     | 
  
  
    | 
      23
     | 
    
      use IEEE.STD_LOGIC_UNSIGNED.ALL;
 
     | 
  
  
    | 
      24
     | 
    
      use UNISIM.VCOMPONENTS.ALL;
 
     | 
  
  
    | 
      25
     | 
    
      use WORK.MityDSP_L138_pkg.ALL;
 
     | 
  
  
    | 
      26
     | 
    
      
 
     | 
  
  
    | 
      27
     | 
    
      entity IndustrialIO_top is
 
     | 
  
  
    | 
      28
     | 
    
         generic ( BOARD_REV     : string := "C"; -- "A", "B", or "C"
 
     | 
  
  
    | 
      29
     | 
    
                   DECODE_BITS   : integer range 1 to 9 := 9;
 
     | 
  
  
    | 
      30
     | 
    
                   CAMERA_CONFIG : string := "NONE"; -- "RAW" - route camera I/O hack to RAW Video input interface 
 
     | 
  
  
    | 
      31
     | 
    
                   DISP_CONFIG   : string := "LCD"; -- "LCD", "DVI" or "NONE"
 
     | 
  
  
    | 
      32
     | 
    
                   LCD_TYPE      : string := "SHARP"  -- "SHARP" or "NEC"
 
     | 
  
  
    | 
      33
     | 
    
         );
 
     | 
  
  
    | 
      34
     | 
    
         port (
 
     | 
  
  
    | 
      35
     | 
    
            i_ema_clk	      : in std_logic; -- 100 MHz EMIF clock
 
     | 
  
  
    | 
      36
     | 
    
      
 
     | 
  
  
    | 
      37
     | 
    
            -- DSP EMIFA BUS Interface
 
     | 
  
  
    | 
      38
     | 
    
            i_ema_cs0_n   : in std_logic; -- RESERVED for SDRAM Controller
 
     | 
  
  
    | 
      39
     | 
    
            i_ema_cs2_n   : in std_logic; -- ARM core CE space
 
     | 
  
  
    | 
      40
     | 
    
            i_ema_cs3_n   : in std_logic; -- NAND FLASH space, not used
 
     | 
  
  
    | 
      41
     | 
    
            i_ema_cs4_n   : in std_logic; -- DSP core CE space
 
     | 
  
  
    | 
      42
     | 
    
            i_ema_cs5_n   : in std_logic; -- Reserved core space, not used
 
     | 
  
  
    | 
      43
     | 
    
            i_ema_oe_n    : in std_logic;
 
     | 
  
  
    | 
      44
     | 
    
            i_ema_we_n    : in std_logic;
 
     | 
  
  
    | 
      45
     | 
    
            io_ema_wait_n : inout std_logic_vector(1 downto 0);
 
     | 
  
  
    | 
      46
     | 
    
            io_ema_d      : inout std_logic_vector(15 downto 0);
 
     | 
  
  
    | 
      47
     | 
    
            i_ema_a       : in std_logic_vector(13 downto 0);
 
     | 
  
  
    | 
      48
     | 
    
            i_ema_ba      : in std_logic_vector(1 downto 0);
 
     | 
  
  
    | 
      49
     | 
    
            i_ema_wen_dqm : in std_logic_vector(1 downto 0); 
 
     | 
  
  
    | 
      50
     | 
    
            i_ema_cas     : in std_logic; -- reserved for SDRAM controller, not used
 
     | 
  
  
    | 
      51
     | 
    
            i_ema_ras     : in std_logic; -- reserved for SDRAM controller, not used
 
     | 
  
  
    | 
      52
     | 
    
            i_ema_sdcke   : in std_logic; -- reserved for SDRAM controller, not used
 
     | 
  
  
    | 
      53
     | 
    
            i_ema_rnw     : in std_logic; -- reserved for SDRAM controller, not used
 
     | 
  
  
    | 
      54
     | 
    
            
 
     | 
  
  
    | 
      55
     | 
    
      --      -- DSP LCD Interface
 
     | 
  
  
    | 
      56
     | 
    
      --      i_lcd_d       : in std_logic_vector(15 downto 0);
 
     | 
  
  
    | 
      57
     | 
    
      --      i_lcd_hsync   : in std_logic;
 
     | 
  
  
    | 
      58
     | 
    
      --      i_lcd_vsync   : in std_logic;
 
     | 
  
  
    | 
      59
     | 
    
      --      i_lcd_mclk    : in std_logic;
 
     | 
  
  
    | 
      60
     | 
    
      --      i_lcd_pclk    : in std_logic;
 
     | 
  
  
    | 
      61
     | 
    
      --      i_lcd_enb     : in std_logic;
 
     | 
  
  
    | 
      62
     | 
    
            
 
     | 
  
  
    | 
      63
     | 
    
      --      -- LCD Differential Serializer Interface
 
     | 
  
  
    | 
      64
     | 
    
      --      o_disp_a0_p   : out std_logic;
 
     | 
  
  
    | 
      65
     | 
    
      --      o_disp_a0_n   : out std_logic;
 
     | 
  
  
    | 
      66
     | 
    
      --      o_disp_a1_p   : out std_logic;
 
     | 
  
  
    | 
      67
     | 
    
      --      o_disp_a1_n   : out std_logic;
 
     | 
  
  
    | 
      68
     | 
    
      --      o_disp_a2_p   : out std_logic;
 
     | 
  
  
    | 
      69
     | 
    
      --      o_disp_a2_n   : out std_logic;
 
     | 
  
  
    | 
      70
     | 
    
      --      o_disp_a3_p   : out std_logic;
 
     | 
  
  
    | 
      71
     | 
    
      --      o_disp_a3_n   : out std_logic;
 
     | 
  
  
    | 
      72
     | 
    
      --      o_disp_clkin_p: out std_logic;
 
     | 
  
  
    | 
      73
     | 
    
      --      o_disp_clkin_n: out std_logic;
 
     | 
  
  
    | 
      74
     | 
    
            
 
     | 
  
  
    | 
      75
     | 
    
      --      -- Touch screen interface
 
     | 
  
  
    | 
      76
     | 
    
      --      o_ts_cs_n      : out std_logic;
 
     | 
  
  
    | 
      77
     | 
    
      --      o_ts_clk       : out std_logic;
 
     | 
  
  
    | 
      78
     | 
    
      --      o_ts_din       : out std_logic;
 
     | 
  
  
    | 
      79
     | 
    
      --      i_ts_dout      : in  std_logic;
 
     | 
  
  
    | 
      80
     | 
    
      --      i_ts_busy      : in  std_logic;
 
     | 
  
  
    | 
      81
     | 
    
      --      io_ts_PenIRQ_n : inout  std_logic;
 
     | 
  
  
    | 
      82
     | 
    
      --      o_disp_cs_n    : out std_logic;
 
     | 
  
  
    | 
      83
     | 
    
      --      
 
     | 
  
  
    | 
      84
     | 
    
      --      -- DVI controller interface
 
     | 
  
  
    | 
      85
     | 
    
      --      io_sda         : inout std_logic;
 
     | 
  
  
    | 
      86
     | 
    
      --      o_scl          : out std_logic;
 
     | 
  
  
    | 
      87
     | 
    
      --      
 
     | 
  
  
    | 
      88
     | 
    
      --      o_dvi_data     : out std_logic_vector(15 downto 0);
 
     | 
  
  
    | 
      89
     | 
    
      --      o_dvi_clk      : out std_logic;
 
     | 
  
  
    | 
      90
     | 
    
      --      o_dvi_hsync    : out std_logic;
 
     | 
  
  
    | 
      91
     | 
    
      --      o_dvi_vsync    : out std_logic;
 
     | 
  
  
    | 
      92
     | 
    
      --      o_dvi_de       : out std_logic;
 
     | 
  
  
    | 
      93
     | 
    
      
 
     | 
  
  
    | 
      94
     | 
    
            -- DSP IRQ lines
 
     | 
  
  
    | 
      95
     | 
    
            o_nmi_n       : out std_logic;
 
     | 
  
  
    | 
      96
     | 
    
            o_int         : out std_logic_vector(1 downto 0);
 
     | 
  
  
    | 
      97
     | 
    
            
 
     | 
  
  
    | 
      98
     | 
    
      --      -- CAMERA input interface (for camera demo)
 
     | 
  
  
    | 
      99
     | 
    
      --      i_cam_data    : in std_logic_vector(9 downto 0);
 
     | 
  
  
    | 
      100
     | 
    
      --      i_cam_lv      : in std_logic;
 
     | 
  
  
    | 
      101
     | 
    
      --      i_cam_fv      : in std_logic;
 
     | 
  
  
    | 
      102
     | 
    
      --      i_cam_pclk    : in std_logic;
 
     | 
  
  
    | 
      103
     | 
    
      --      
 
     | 
  
  
    | 
      104
     | 
    
      --      -- Raw Video Interface (for camera demo)
 
     | 
  
  
    | 
      105
     | 
    
      --      o_vp_clkin     : out std_logic_vector(1 downto 0);
 
     | 
  
  
    | 
      106
     | 
    
      --      o_vp_hsync      : out std_logic;
 
     | 
  
  
    | 
      107
     | 
    
      --      o_vp_vsync      : out std_logic;
 
     | 
  
  
    | 
      108
     | 
    
      --		o_vp_field      : out std_logic;
 
     | 
  
  
    | 
      109
     | 
    
      --      o_vp_din        : out std_logic_vector(12 downto 0);
 
     | 
  
  
    | 
      110
     | 
    
      --		
 
     | 
  
  
    | 
      111
     | 
    
      --		-- camera demo misc signals
 
     | 
  
  
    | 
      112
     | 
    
      --		o_pwm           : out std_logic_vector(1 downto 0);
 
     | 
  
  
    | 
      113
     | 
    
      --		o_diode         : out std_logic_vector(1 downto 0);
 
     | 
  
  
    | 
      114
     | 
    
      		
 
     | 
  
  
    | 
      115
     | 
    
      		-- dac cal&offset control signals 
 
     | 
  
  
    | 
      116
     | 
    
      		o_dac_cal_ctrl: out std_logic_vector(5 downto 0);
 
     | 
  
  
    | 
      117
     | 
    
      		
 
     | 
  
  
    | 
      118
     | 
    
      		-- ext gpio control signals
 
     | 
  
  
    | 
      119
     | 
    
      		o_ext_gpio: out std_logic_vector(1 downto 0);
 
     | 
  
  
    | 
      120
     | 
    
      		
 
     | 
  
  
    | 
      121
     | 
    
      		-- ia write enable signals
 
     | 
  
  
    | 
      122
     | 
    
      		o_ia_wr: out std_logic_vector(3 downto 0);
 
     | 
  
  
    | 
      123
     | 
    
      		
 
     | 
  
  
    | 
      124
     | 
    
      		-- channel configuration control signals
 
     | 
  
  
    | 
      125
     | 
    
      		o_chann_config: out std_logic_vector(2 downto 0);
 
     | 
  
  
    | 
      126
     | 
    
      		
 
     | 
  
  
    | 
      127
     | 
    
      		-- FSPI_1 signals
 
     | 
  
  
    | 
      128
     | 
    
      		o_fspi1_mosi: out std_logic;
 
     | 
  
  
    | 
      129
     | 
    
      		i_fspi1_miso: in std_logic;
 
     | 
  
  
    | 
      130
     | 
    
      		o_fspi1_clk: out std_logic;
 
     | 
  
  
    | 
      131
     | 
    
      		o_fspi1_cs: out std_logic_vector (7 downto 0);
 
     | 
  
  
    | 
      132
     | 
    
      		
 
     | 
  
  
    | 
      133
     | 
    
      		
 
     | 
  
  
    | 
      134
     | 
    
      		-- FSPI_2 signals
 
     | 
  
  
    | 
      135
     | 
    
      		o_fspi2_mosi: out std_logic;
 
     | 
  
  
    | 
      136
     | 
    
      		i_fspi2_miso: in std_logic;
 
     | 
  
  
    | 
      137
     | 
    
      		o_fspi2_clk: out std_logic;
 
     | 
  
  
    | 
      138
     | 
    
      		o_fspi2_cs: out std_logic_vector (7 downto 0);
 
     | 
  
  
    | 
      139
     | 
    
      		
 
     | 
  
  
    | 
      140
     | 
    
      --		-- FIFO1 signals		
 
     | 
  
  
    | 
      141
     | 
    
      --		o_fifo1_full: out std_logic;
 
     | 
  
  
    | 
      142
     | 
    
      --		o_fifo1_mid: out std_logic;
 
     | 
  
  
    | 
      143
     | 
    
      --		o_fifo1_low: out std_logic;
 
     | 
  
  
    | 
      144
     | 
    
      --		o_fifo1_empty: out std_logic;
 
     | 
  
  
    | 
      145
     | 
    
      --		
 
     | 
  
  
    | 
      146
     | 
    
      --		-- FIFO2 signals		
 
     | 
  
  
    | 
      147
     | 
    
      --		o_fifo2_full: out std_logic;
 
     | 
  
  
    | 
      148
     | 
    
      --		o_fifo2_mid: out std_logic;
 
     | 
  
  
    | 
      149
     | 
    
      --		o_fifo2_low: out std_logic;
 
     | 
  
  
    | 
      150
     | 
    
      --		o_fifo2_empty: out std_logic;
 
     | 
  
  
    | 
      151
     | 
    
      		
 
     | 
  
  
    | 
      152
     | 
    
      		-- sampling clock manager
 
     | 
  
  
    | 
      153
     | 
    
      		i_from_out_conv: in std_logic;
 
     | 
  
  
    | 
      154
     | 
    
      		o_to_in_conv: out std_logic
 
     | 
  
  
    | 
      155
     | 
    
        );
 
     | 
  
  
    | 
      156
     | 
    
      end IndustrialIO_top;
 
     | 
  
  
    | 
      157
     | 
    
      
 
     | 
  
  
    | 
      158
     | 
    
      --------------------------------------------------------------------------
 
     | 
  
  
    | 
      159
     | 
    
      -- ARCHITECTURE
 
     | 
  
  
    | 
      160
     | 
    
      --------------------------------------------------------------------------
 
     | 
  
  
    | 
      161
     | 
    
      architecture rtl of IndustrialIO_top is
 
     | 
  
  
    | 
      162
     | 
    
      
 
     | 
  
  
    | 
      163
     | 
    
      constant FPGA_APPLICATION_ID: std_logic_vector(7 downto 0) := CONV_STD_LOGIC_VECTOR( 00, 8);
 
     | 
  
  
    | 
      164
     | 
    
      constant FPGA_VERSION_MAJOR:  std_logic_vector(3 downto 0) := CONV_STD_LOGIC_VECTOR( 01, 4);
 
     | 
  
  
    | 
      165
     | 
    
      constant FPGA_VERSION_MINOR:  std_logic_vector(3 downto 0) := CONV_STD_LOGIC_VECTOR( 00, 4);
 
     | 
  
  
    | 
      166
     | 
    
      constant FPGA_YEAR:           std_logic_vector(4 downto 0) := CONV_STD_LOGIC_VECTOR( 10, 5);
 
     | 
  
  
    | 
      167
     | 
    
      constant FPGA_MONTH:          std_logic_vector(3 downto 0) := CONV_STD_LOGIC_VECTOR( 04, 4);
 
     | 
  
  
    | 
      168
     | 
    
      constant FPGA_DAY:            std_logic_vector(4 downto 0) := CONV_STD_LOGIC_VECTOR( 20, 5);
 
     | 
  
  
    | 
      169
     | 
    
      
 
     | 
  
  
    | 
      170
     | 
    
      constant CORE_BASE_MODULE: integer := 0;
 
     | 
  
  
    | 
      171
     | 
    
      constant CORE_DAC_CAL_CTRL_MODULE: integer:= 1;
 
     | 
  
  
    | 
      172
     | 
    
      constant CORE_EXT_GPIO_MODULE: integer:= 2;
 
     | 
  
  
    | 
      173
     | 
    
      constant CORE_IA_WR_MODULE: integer:= 3;
 
     | 
  
  
    | 
      174
     | 
    
      constant CORE_CHANN_CONFIG_MODULE:integer:= 4;
 
     | 
  
  
    | 
      175
     | 
    
      constant CORE_SPI1_MODULE: integer:= 5;
 
     | 
  
  
    | 
      176
     | 
    
      constant CORE_SPI2_MODULE: integer:= 6;
 
     | 
  
  
    | 
      177
     | 
    
      
 
     | 
  
  
    | 
      178
     | 
    
      constant CORE_DAC_CAL_CTRL_IRQ_LEVEL : integer := 0;
 
     | 
  
  
    | 
      179
     | 
    
      constant CORE_DAC_CAL_CTRL_IRQ_VECTOR: integer := 0;
 
     | 
  
  
    | 
      180
     | 
    
      
 
     | 
  
  
    | 
      181
     | 
    
      constant CORE_EXT_GPIO_IRQ_LEVEL: integer := 0;
 
     | 
  
  
    | 
      182
     | 
    
      constant CORE_EXT_GPIO_IRQ_VECTOR: integer := 1;
 
     | 
  
  
    | 
      183
     | 
    
      
 
     | 
  
  
    | 
      184
     | 
    
      constant CORE_IA_WR_IRQ_LEVEL: integer := 0;
 
     | 
  
  
    | 
      185
     | 
    
      constant CORE_IA_WR_IRQ_VECTOR: integer := 2;
 
     | 
  
  
    | 
      186
     | 
    
      
 
     | 
  
  
    | 
      187
     | 
    
      constant CORE_CHANN_CONFIG_IRQ_LEVEL: integer:= 0;
 
     | 
  
  
    | 
      188
     | 
    
      constant CORE_CHANN_CONFIG_IRQ_VECTOR: integer:= 3;
 
     | 
  
  
    | 
      189
     | 
    
      
 
     | 
  
  
    | 
      190
     | 
    
      constant CORE_SPI1_IRQ_LEVEL: integer :=1;
 
     | 
  
  
    | 
      191
     | 
    
      constant CORE_SPI1_IRQ_VECTOR: integer :=1;
 
     | 
  
  
    | 
      192
     | 
    
      
 
     | 
  
  
    | 
      193
     | 
    
      constant CORE_SPI2_IRQ_LEVEL: integer :=1;
 
     | 
  
  
    | 
      194
     | 
    
      constant CORE_SPI2_IRQ_VECTOR: integer :=2;
 
     | 
  
  
    | 
      195
     | 
    
      
 
     | 
  
  
    | 
      196
     | 
    
      --constant CORE_TS_MODULE     : integer := 1;
 
     | 
  
  
    | 
      197
     | 
    
      --constant CORE_I2C_MODULE    : integer := 2;
 
     | 
  
  
    | 
      198
     | 
    
      --constant CORE_LCD_MODULE    : integer := 3;
 
     | 
  
  
    | 
      199
     | 
    
      --constant CORE_DVI_MODULE    : integer := 4;
 
     | 
  
  
    | 
      200
     | 
    
      --constant CORE_GPIO_MODULE   : integer := 5;
 
     | 
  
  
    | 
      201
     | 
    
      --constant CORE_PWM_MODULE    : integer := 6;
 
     | 
  
  
    | 
      202
     | 
    
      
 
     | 
  
  
    | 
      203
     | 
    
      --constant CORE_TS_IRQ_LEVEL  : integer := 0;
 
     | 
  
  
    | 
      204
     | 
    
      --constant CORE_TS_IRQ_VECTOR : integer := 0;
 
     | 
  
  
    | 
      205
     | 
    
      --constant CORE_I2C_IRQ_LEVEL  : integer := 0;
 
     | 
  
  
    | 
      206
     | 
    
      --constant CORE_I2C_IRQ_VECTOR : integer := 1;
 
     | 
  
  
    | 
      207
     | 
    
      --constant CORE_LCD_IRQ_LEVEL  : integer := 0;
 
     | 
  
  
    | 
      208
     | 
    
      --constant CORE_LCD_IRQ_VECTOR : integer := 2;
 
     | 
  
  
    | 
      209
     | 
    
      --constant CORE_DVI_IRQ_LEVEL  : integer := 0;
 
     | 
  
  
    | 
      210
     | 
    
      --constant CORE_DVI_IRQ_VECTOR : integer := 3;
 
     | 
  
  
    | 
      211
     | 
    
      --constant CORE_GPIO_IRQ_LEVEL : integer := 1;
 
     | 
  
  
    | 
      212
     | 
    
      --constant CORE_GPIO_IRQ_VECTOR : integer := 0;
 
     | 
  
  
    | 
      213
     | 
    
      --constant CORE_PWM_IRQ_LEVEL     : integer := 1;
 
     | 
  
  
    | 
      214
     | 
    
      --constant CORE_PWM_IRQ_VECTOR    : integer := 1;
 
     | 
  
  
    | 
      215
     | 
    
      
 
     | 
  
  
    | 
      216
     | 
    
      -- FIFO DPRAM 64x32 BUFFER FOR SPI
 
     | 
  
  
    | 
      217
     | 
    
      -- THIS COMPONENT HAS BEEN PROGRAMMED TO HAVE 4 THRESHOLD
 
     | 
  
  
    | 
      218
     | 
    
      -- USING CORE GENERATOR fifo_dpram64x32.xco
 
     | 
  
  
    | 
      219
     | 
    
      -- FIFO BUFFER DOES NOT HOOK TO EMIF, ONLY EMIF VIA SPI CORE
 
     | 
  
  
    | 
      220
     | 
    
      
 
     | 
  
  
    | 
      221
     | 
    
      -- FULL: 64 BLOCKS
 
     | 
  
  
    | 
      222
     | 
    
      -- MID : 48 BLOCKS
 
     | 
  
  
    | 
      223
     | 
    
      -- LOW : 16 BLOCKS
 
     | 
  
  
    | 
      224
     | 
    
      -- EMPTY : 0 BLOCKS
 
     | 
  
  
    | 
      225
     | 
    
      
 
     | 
  
  
    | 
      226
     | 
    
      component fifo_dpram64x32
 
     | 
  
  
    | 
      227
     | 
    
      	port (
 
     | 
  
  
    | 
      228
     | 
    
      	clk: in std_logic;
 
     | 
  
  
    | 
      229
     | 
    
      	rst: in std_logic;
 
     | 
  
  
    | 
      230
     | 
    
      	din: in std_logic_vector(31 downto 0);
 
     | 
  
  
    | 
      231
     | 
    
      	wr_en: in std_logic;
 
     | 
  
  
    | 
      232
     | 
    
      	rd_en: in std_logic;
 
     | 
  
  
    | 
      233
     | 
    
      	dout: out std_logic_vector(31 downto 0);
 
     | 
  
  
    | 
      234
     | 
    
      	full: out std_logic;
 
     | 
  
  
    | 
      235
     | 
    
      	empty: out std_logic;
 
     | 
  
  
    | 
      236
     | 
    
      	data_count: out std_logic_vector(5 downto 0);
 
     | 
  
  
    | 
      237
     | 
    
      	prog_full: out std_logic;
 
     | 
  
  
    | 
      238
     | 
    
      	prog_empty: out std_logic);
 
     | 
  
  
    | 
      239
     | 
    
      end component;
 
     | 
  
  
    | 
      240
     | 
    
      
 
     | 
  
  
    | 
      241
     | 
    
      -- clock/reset related signals
 
     | 
  
  
    | 
      242
     | 
    
      signal clk25mhz: std_logic;
 
     | 
  
  
    | 
      243
     | 
    
      signal ema_clk: std_logic;
 
     | 
  
  
    | 
      244
     | 
    
      signal dcm_lock: std_logic;
 
     | 
  
  
    | 
      245
     | 
    
      signal dcm_reset: std_logic;
 
     | 
  
  
    | 
      246
     | 
    
      signal dcm_status: std_logic_vector(2 downto 0);
 
     | 
  
  
    | 
      247
     | 
    
      signal wd_rst: std_logic;
 
     | 
  
  
    | 
      248
     | 
    
      
 
     | 
  
  
    | 
      249
     | 
    
      -- EMIFA interface signals
 
     | 
  
  
    | 
      250
     | 
    
      signal ema_d : std_logic_vector(15 downto 0);
 
     | 
  
  
    | 
      251
     | 
    
      signal ema_wait_n : std_logic_vector(1 downto 0) := "11";
 
     | 
  
  
    | 
      252
     | 
    
      signal t_ema_wait : std_logic;
 
     | 
  
  
    | 
      253
     | 
    
      signal t_ema_d : std_logic;
 
     | 
  
  
    | 
      254
     | 
    
      signal be_r : std_logic_vector(1 downto 0);
 
     | 
  
  
    | 
      255
     | 
    
      signal addr_r : std_logic_vector(5 downto 0);
 
     | 
  
  
    | 
      256
     | 
    
      signal arm_cs5_r : std_logic_vector((2**DECODE_BITS)-1 downto 0);
 
     | 
  
  
    | 
      257
     | 
    
      signal dsp_cs4_r : std_logic_vector((2**DECODE_BITS)-1 downto 0);
 
     | 
  
  
    | 
      258
     | 
    
      signal edi_r : std_logic_vector(15 downto 0);
 
     | 
  
  
    | 
      259
     | 
    
      signal edo_arm : bus16_vector((2**DECODE_BITS)-1 downto 0);
 
     | 
  
  
    | 
      260
     | 
    
      signal edo_dsp : bus16_vector((2**DECODE_BITS)-1 downto 0);
 
     | 
  
  
    | 
      261
     | 
    
      signal rd_r : std_logic;
 
     | 
  
  
    | 
      262
     | 
    
      signal wr_r : std_logic;
 
     | 
  
  
    | 
      263
     | 
    
      signal irq_map  : bus16_vector(1 downto 0) := (others=>(others=>'0')); 
 
     | 
  
  
    | 
      264
     | 
    
      
 
     | 
  
  
    | 
      265
     | 
    
      -- Hook up signals for SPI cores (SPI to BUFFER FIFO) SPI CORE 1
 
     | 
  
  
    | 
      266
     | 
    
      
 
     | 
  
  
    | 
      267
     | 
    
      signal mosi1_din : std_logic_VECTOR(31 downto 0);
 
     | 
  
  
    | 
      268
     | 
    
      signal mosi1_wr_en : std_logic;
 
     | 
  
  
    | 
      269
     | 
    
      signal mosi1_rd_en : std_logic;
 
     | 
  
  
    | 
      270
     | 
    
      signal mosi1_dout : std_logic_VECTOR(31 downto 0);
 
     | 
  
  
    | 
      271
     | 
    
      signal mosi1_full : std_logic;
 
     | 
  
  
    | 
      272
     | 
    
      signal mosi1_empty : std_logic;
 
     | 
  
  
    | 
      273
     | 
    
      signal mosi1_wr_data_count : std_logic_VECTOR(11 downto 0) := (others=>'0');
 
     | 
  
  
    | 
      274
     | 
    
      signal spi1_fifo_rst : std_logic := '0';
 
     | 
  
  
    | 
      275
     | 
    
      
 
     | 
  
  
    | 
      276
     | 
    
      signal miso1_wr_clk : std_logic;
 
     | 
  
  
    | 
      277
     | 
    
      signal miso1_rd_clk : std_logic;
 
     | 
  
  
    | 
      278
     | 
    
      signal miso1_din : std_logic_VECTOR(31 downto 0);
 
     | 
  
  
    | 
      279
     | 
    
      signal miso1_wr_en : std_logic;
 
     | 
  
  
    | 
      280
     | 
    
      signal miso1_rd_en : std_logic;
 
     | 
  
  
    | 
      281
     | 
    
      signal miso1_dout : std_logic_VECTOR(31 downto 0);
 
     | 
  
  
    | 
      282
     | 
    
      signal miso1_empty : std_logic;
 
     | 
  
  
    | 
      283
     | 
    
      signal miso1_rd_data_count : std_logic_VECTOR(11 downto 0) := (others=>'0');
 
     | 
  
  
    | 
      284
     | 
    
      signal spi1_cs : std_logic_vector(7 downto 0) := (others=>'1');
 
     | 
  
  
    | 
      285
     | 
    
      signal spi1_clk, spi1_mosi : std_logic := '0';
 
     | 
  
  
    | 
      286
     | 
    
      
 
     | 
  
  
    | 
      287
     | 
    
      -- Hook up signals for SPI cores (SPI to BUFFER FIFO) SPI CORE 2
 
     | 
  
  
    | 
      288
     | 
    
      signal mosi2_din : std_logic_VECTOR(31 downto 0);
 
     | 
  
  
    | 
      289
     | 
    
      signal mosi2_wr_en : std_logic;
 
     | 
  
  
    | 
      290
     | 
    
      signal mosi2_rd_en : std_logic;
 
     | 
  
  
    | 
      291
     | 
    
      signal mosi2_dout : std_logic_VECTOR(31 downto 0);
 
     | 
  
  
    | 
      292
     | 
    
      signal mosi2_full : std_logic;
 
     | 
  
  
    | 
      293
     | 
    
      signal mosi2_empty : std_logic;
 
     | 
  
  
    | 
      294
     | 
    
      signal mosi2_wr_data_count : std_logic_VECTOR(11 downto 0) := (others=>'0');
 
     | 
  
  
    | 
      295
     | 
    
      signal spi2_fifo_rst : std_logic := '0';
 
     | 
  
  
    | 
      296
     | 
    
      
 
     | 
  
  
    | 
      297
     | 
    
      signal miso2_wr_clk : std_logic;
 
     | 
  
  
    | 
      298
     | 
    
      signal miso2_rd_clk : std_logic;
 
     | 
  
  
    | 
      299
     | 
    
      signal miso2_din : std_logic_VECTOR(31 downto 0);
 
     | 
  
  
    | 
      300
     | 
    
      signal miso2_wr_en : std_logic;
 
     | 
  
  
    | 
      301
     | 
    
      signal miso2_rd_en : std_logic;
 
     | 
  
  
    | 
      302
     | 
    
      signal miso2_dout : std_logic_VECTOR(31 downto 0);
 
     | 
  
  
    | 
      303
     | 
    
      signal miso2_empty : std_logic;
 
     | 
  
  
    | 
      304
     | 
    
      signal miso2_rd_data_count : std_logic_VECTOR(11 downto 0) := (others=>'0');
 
     | 
  
  
    | 
      305
     | 
    
      signal spi2_cs : std_logic_vector(7 downto 0) := (others=>'1');
 
     | 
  
  
    | 
      306
     | 
    
      signal spi2_clk, spi2_mosi : std_logic := '0';
 
     | 
  
  
    | 
      307
     | 
    
      
 
     | 
  
  
    | 
      308
     | 
    
      ---- LCD Signals
 
     | 
  
  
    | 
      309
     | 
    
      --signal serdes_clk : std_logic;
 
     | 
  
  
    | 
      310
     | 
    
      --signal serdes_ctl : std_logic;
 
     | 
  
  
    | 
      311
     | 
    
      --signal serdes_b : std_logic;
 
     | 
  
  
    | 
      312
     | 
    
      --signal serdes_g : std_logic;
 
     | 
  
  
    | 
      313
     | 
    
      --signal serdes_r : std_logic; 
 
     | 
  
  
    | 
      314
     | 
    
      --signal serdes_debug : std_logic_vector(7 downto 0);
 
     | 
  
  
    | 
      315
     | 
    
      --signal lcd_pclk : std_logic;
 
     | 
  
  
    | 
      316
     | 
    
      --signal ts_PenIRQ_n : std_logic;
 
     | 
  
  
    | 
      317
     | 
    
      --signal t_ts_PenIRQ_n : std_logic;
 
     | 
  
  
    | 
      318
     | 
    
      --signal lcd_hrev : std_logic;
 
     | 
  
  
    | 
      319
     | 
    
      --signal lcd_dim_pwm : std_logic;
 
     | 
  
  
    | 
      320
     | 
    
      --signal lcd_pwr : std_logic;
 
     | 
  
  
    | 
      321
     | 
    
      --signal lcd_backlit : std_logic;
 
     | 
  
  
    | 
      322
     | 
    
      --signal lcd_vrev : std_logic;
 
     | 
  
  
    | 
      323
     | 
    
      --signal lcd_en : std_logic;
 
     | 
  
  
    | 
      324
     | 
    
      --
 
     | 
  
  
    | 
      325
     | 
    
      ---- DVI signals
 
     | 
  
  
    | 
      326
     | 
    
      --signal sda, t_sda : std_logic;
 
     | 
  
  
    | 
      327
     | 
    
      --signal dvi_data_c0 : std_logic_vector(11 downto 0);
 
     | 
  
  
    | 
      328
     | 
    
      --signal dvi_data_c1 : std_logic_vector(11 downto 0);
 
     | 
  
  
    | 
      329
     | 
    
      --signal dvi_clk : std_logic;
 
     | 
  
  
    | 
      330
     | 
    
      --
 
     | 
  
  
    | 
      331
     | 
    
      ---- camera interface
 
     | 
  
  
    | 
      332
     | 
    
      --signal cam_lv : std_logic := '0';
 
     | 
  
  
    | 
      333
     | 
    
      --signal cam_fv : std_logic := '0';
 
     | 
  
  
    | 
      334
     | 
    
      --signal cam_data : std_logic_vector(9 downto 0) := (others=>'0');
 
     | 
  
  
    | 
      335
     | 
    
      --signal cam_pclk : std_logic := '0';
 
     | 
  
  
    | 
      336
     | 
    
      --signal t_cam_sdat : std_logic := '1';
 
     | 
  
  
    | 
      337
     | 
    
      --signal cam_sdat : std_logic := '0';
 
     | 
  
  
    | 
      338
     | 
    
      --signal h_cnt : std_logic_vector(9 downto 0) := (others=>'0');
 
     | 
  
  
    | 
      339
     | 
    
      --signal l_cnt : std_logic_vector(8 downto 0) := (others=>'0');
 
     | 
  
  
    | 
      340
     | 
    
      --signal ema_clk_div : std_logic_vector(1 downto 0) := (others=>'0');
 
     | 
  
  
    | 
      341
     | 
    
      --signal temp_clk : std_logic;
 
     | 
  
  
    | 
      342
     | 
    
      
 
     | 
  
  
    | 
      343
     | 
    
      begin -- architecture: rtl
 
     | 
  
  
    | 
      344
     | 
    
      
 
     | 
  
  
    | 
      345
     | 
    
      --------------------------------------------------------------------------
 
     | 
  
  
    | 
      346
     | 
    
      -- System DCM Instantiation
 
     | 
  
  
    | 
      347
     | 
    
      --------------------------------------------------------------------------
 
     | 
  
  
    | 
      348
     | 
    
      --------------------------------------------------------------------------
 
     | 
  
  
    | 
      349
     | 
    
      -- Clock Buffer Instantiation
 
     | 
  
  
    | 
      350
     | 
    
      --------------------------------------------------------------------------
 
     | 
  
  
    | 
      351
     | 
    
      -- TODO -- DCM???
 
     | 
  
  
    | 
      352
     | 
    
      emaclkbuf : bufg port map (O => ema_clk, I => i_ema_clk);
 
     | 
  
  
    | 
      353
     | 
    
      --pclkbuf : bufg port map (O => lcd_pclk, I=> i_lcd_pclk);
 
     | 
  
  
    | 
      354
     | 
    
      -- ema_clk <= i_ema_clk;
 
     | 
  
  
    | 
      355
     | 
    
      o_to_in_conv <= i_from_out_conv;
 
     | 
  
  
    | 
      356
     | 
    
      ------------------------------------------------------------------------------
 
     | 
  
  
    | 
      357
     | 
    
      -- EMIF Interface Module: 
 
     | 
  
  
    | 
      358
     | 
    
      ------------------------------------------------------------------------------
 
     | 
  
  
    | 
      359
     | 
    
      emififace : EMIFA_iface
 
     | 
  
  
    | 
      360
     | 
    
          generic map ( 
 
     | 
  
  
    | 
      361
     | 
    
              DECODE_BITS       => DECODE_BITS, 
 
     | 
  
  
    | 
      362
     | 
    
              CONFIG            => "MityDSP_L138" 
 
     | 
  
  
    | 
      363
     | 
    
          )
 
     | 
  
  
    | 
      364
     | 
    
          port map ( ema_clk   => ema_clk, 
 
     | 
  
  
    | 
      365
     | 
    
                 -- EMIFA signals
 
     | 
  
  
    | 
      366
     | 
    
                 i_ema_cs0_n   => i_ema_cs0_n, 
 
     | 
  
  
    | 
      367
     | 
    
                 i_ema_cs2_n   => i_ema_cs2_n, 
 
     | 
  
  
    | 
      368
     | 
    
                 i_ema_cs3_n   => i_ema_cs3_n, 
 
     | 
  
  
    | 
      369
     | 
    
                 i_ema_cs4_n   => i_ema_cs4_n, 
 
     | 
  
  
    | 
      370
     | 
    
                 i_ema_cs5_n   => i_ema_cs5_n, 
 
     | 
  
  
    | 
      371
     | 
    
                 i_ema_oe_n    => i_ema_oe_n, 
 
     | 
  
  
    | 
      372
     | 
    
                 i_ema_we_n    => i_ema_we_n, 
 
     | 
  
  
    | 
      373
     | 
    
                 o_ema_wait_n  => ema_wait_n, 
 
     | 
  
  
    | 
      374
     | 
    
                 t_ema_wait    => t_ema_wait, 
 
     | 
  
  
    | 
      375
     | 
    
                 i_ema_d       => io_ema_d, 
 
     | 
  
  
    | 
      376
     | 
    
                 o_ema_d       => ema_d, 
 
     | 
  
  
    | 
      377
     | 
    
                 t_ema_d       => t_ema_d, 
 
     | 
  
  
    | 
      378
     | 
    
                 i_ema_a       => i_ema_a, 
 
     | 
  
  
    | 
      379
     | 
    
                 i_ema_ba      => i_ema_ba, 
 
     | 
  
  
    | 
      380
     | 
    
                 i_ema_wen_dqm => i_ema_wen_dqm,  
 
     | 
  
  
    | 
      381
     | 
    
                 i_ema_cas     => i_ema_cas,  
 
     | 
  
  
    | 
      382
     | 
    
                 i_ema_ras     => i_ema_ras,  
 
     | 
  
  
    | 
      383
     | 
    
                 i_ema_sdcke   => i_ema_sdcke,  
 
     | 
  
  
    | 
      384
     | 
    
                 i_ema_rnw     => i_ema_rnw,  
 
     | 
  
  
    | 
      385
     | 
    
                            
 
     | 
  
  
    | 
      386
     | 
    
                 -- FPGA fabric signals
 
     | 
  
  
    | 
      387
     | 
    
                 o_core_be      => be_r,  
 
     | 
  
  
    | 
      388
     | 
    
                 o_core_addr    => addr_r,  
 
     | 
  
  
    | 
      389
     | 
    
                 o_core_cs5     => arm_cs5_r,  
 
     | 
  
  
    | 
      390
     | 
    
                 o_core_cs4     => dsp_cs4_r,  
 
     | 
  
  
    | 
      391
     | 
    
                 o_core_edi     => edi_r,  
 
     | 
  
  
    | 
      392
     | 
    
                 i_core_edo5    => edo_arm,  
 
     | 
  
  
    | 
      393
     | 
    
                 i_core_edo4    => edo_dsp,  
 
     | 
  
  
    | 
      394
     | 
    
                 o_core_rd      => rd_r,  
 
     | 
  
  
    | 
      395
     | 
    
                 o_core_wr      => wr_r  
 
     | 
  
  
    | 
      396
     | 
    
          );
 
     | 
  
  
    | 
      397
     | 
    
      
 
     | 
  
  
    | 
      398
     | 
    
      ------------------------------------------------------------------------------
 
     | 
  
  
    | 
      399
     | 
    
      -- Base Module
 
     | 
  
  
    | 
      400
     | 
    
      ------------------------------------------------------------------------------
 
     | 
  
  
    | 
      401
     | 
    
      bm : base_module
 
     | 
  
  
    | 
      402
     | 
    
         generic map (
 
     | 
  
  
    | 
      403
     | 
    
            CONFIG => "MityDSP_L138"
 
     | 
  
  
    | 
      404
     | 
    
            )
 
     | 
  
  
    | 
      405
     | 
    
         port map (
 
     | 
  
  
    | 
      406
     | 
    
            ema_clk         => ema_clk, 
 
     | 
  
  
    | 
      407
     | 
    
            i_cs            => arm_cs5_r(CORE_BASE_MODULE),
 
     | 
  
  
    | 
      408
     | 
    
            i_ID            => FPGA_APPLICATION_ID,
 
     | 
  
  
    | 
      409
     | 
    
            i_version_major => FPGA_VERSION_MAJOR,
 
     | 
  
  
    | 
      410
     | 
    
            i_version_minor => FPGA_VERSION_MINOR,
 
     | 
  
  
    | 
      411
     | 
    
            i_year          => FPGA_YEAR,
 
     | 
  
  
    | 
      412
     | 
    
            i_month         => FPGA_MONTH,
 
     | 
  
  
    | 
      413
     | 
    
            i_day           => FPGA_DAY,
 
     | 
  
  
    | 
      414
     | 
    
            i_ABus          => addr_r,
 
     | 
  
  
    | 
      415
     | 
    
            i_DBus          => edi_r,
 
     | 
  
  
    | 
      416
     | 
    
            o_DBus          => edo_arm(CORE_BASE_MODULE),
 
     | 
  
  
    | 
      417
     | 
    
            i_wr_en         => wr_r,
 
     | 
  
  
    | 
      418
     | 
    
            i_rd_en         => rd_r,
 
     | 
  
  
    | 
      419
     | 
    
            i_be_r          => be_r,
 
     | 
  
  
    | 
      420
     | 
    
                  
 
     | 
  
  
    | 
      421
     | 
    
            o_dcm_reset  => open,
 
     | 
  
  
    | 
      422
     | 
    
            i_dcm_status => dcm_status,
 
     | 
  
  
    | 
      423
     | 
    
            i_dcm_lock   => dcm_lock,
 
     | 
  
  
    | 
      424
     | 
    
      
 
     | 
  
  
    | 
      425
     | 
    
            i_irq_map    => irq_map,
 
     | 
  
  
    | 
      426
     | 
    
            o_irq_output => o_int                  
 
     | 
  
  
    | 
      427
     | 
    
            
 
     | 
  
  
    | 
      428
     | 
    
            );
 
     | 
  
  
    | 
      429
     | 
    
      -------------------------------------------------------------------------
 
     | 
  
  
    | 
      430
     | 
    
      -- DAC CALIBRATION CONTROL GPIO CORE
 
     | 
  
  
    | 
      431
     | 
    
      -------------------------------------------------------------------------
 
     | 
  
  
    | 
      432
     | 
    
      dac_cal_ctrl_inst: gpio 
 
     | 
  
  
    | 
      433
     | 
    
      generic map(
 
     | 
  
  
    | 
      434
     | 
    
      NUM_BANKS => 1,
 
     | 
  
  
    | 
      435
     | 
    
      NUM_IO_PER_BANK =>6
 
     | 
  
  
    | 
      436
     | 
    
      )
 
     | 
  
  
    | 
      437
     | 
    
      
 
     | 
  
  
    | 
      438
     | 
    
      port map(
 
     | 
  
  
    | 
      439
     | 
    
            clk             => ema_clk,
 
     | 
  
  
    | 
      440
     | 
    
            i_ABus          => addr_r,
 
     | 
  
  
    | 
      441
     | 
    
            i_DBus          => edi_r,
 
     | 
  
  
    | 
      442
     | 
    
            o_DBus          => edo_arm(CORE_DAC_CAL_CTRL_MODULE),
 
     | 
  
  
    | 
      443
     | 
    
            i_wr_en         => wr_r,
 
     | 
  
  
    | 
      444
     | 
    
            i_rd_en         => rd_r,
 
     | 
  
  
    | 
      445
     | 
    
            i_cs            => arm_cs5_r(CORE_DAC_CAL_CTRL_MODULE),
 
     | 
  
  
    | 
      446
     | 
    
            o_irq           => irq_map(CORE_DAC_CAL_CTRL_IRQ_LEVEL)(CORE_DAC_CAL_CTRL_IRQ_VECTOR),
 
     | 
  
  
    | 
      447
     | 
    
            i_ilevel        => conv_std_logic_vector(CORE_DAC_CAL_CTRL_IRQ_LEVEL, 2),     
 
     | 
  
  
    | 
      448
     | 
    
            i_ivector       => conv_std_logic_vector(CORE_DAC_CAL_CTRL_IRQ_VECTOR, 4),   
 
     | 
  
  
    | 
      449
     | 
    
            i_io            => "000000",
 
     | 
  
  
    | 
      450
     | 
    
            t_io            => open,
 
     | 
  
  
    | 
      451
     | 
    
            o_io            => o_dac_cal_ctrl,
 
     | 
  
  
    | 
      452
     | 
    
            i_initdir       => "111111",
 
     | 
  
  
    | 
      453
     | 
    
            i_initoutval    => "111111"	
 
     | 
  
  
    | 
      454
     | 
    
      );
 
     | 
  
  
    | 
      455
     | 
    
      
 
     | 
  
  
    | 
      456
     | 
    
      --------------------------------------------------------------------------
 
     | 
  
  
    | 
      457
     | 
    
      --EXTERNAL GPIO CONTROL CORE
 
     | 
  
  
    | 
      458
     | 
    
      --------------------------------------------------------------------------
 
     | 
  
  
    | 
      459
     | 
    
      ext_gpio_inst: gpio 
 
     | 
  
  
    | 
      460
     | 
    
      generic map(
 
     | 
  
  
    | 
      461
     | 
    
      NUM_BANKS => 1,
 
     | 
  
  
    | 
      462
     | 
    
      NUM_IO_PER_BANK =>2
 
     | 
  
  
    | 
      463
     | 
    
      )
 
     | 
  
  
    | 
      464
     | 
    
      
 
     | 
  
  
    | 
      465
     | 
    
      port map(
 
     | 
  
  
    | 
      466
     | 
    
            clk             => ema_clk,
 
     | 
  
  
    | 
      467
     | 
    
            i_ABus          => addr_r,
 
     | 
  
  
    | 
      468
     | 
    
            i_DBus          => edi_r,
 
     | 
  
  
    | 
      469
     | 
    
            o_DBus          => edo_arm(CORE_EXT_GPIO_MODULE),
 
     | 
  
  
    | 
      470
     | 
    
            i_wr_en         => wr_r,
 
     | 
  
  
    | 
      471
     | 
    
            i_rd_en         => rd_r,
 
     | 
  
  
    | 
      472
     | 
    
            i_cs            => arm_cs5_r(CORE_EXT_GPIO_MODULE),
 
     | 
  
  
    | 
      473
     | 
    
            o_irq           => irq_map(CORE_EXT_GPIO_IRQ_LEVEL)(CORE_EXT_GPIO_IRQ_VECTOR),
 
     | 
  
  
    | 
      474
     | 
    
            i_ilevel        => conv_std_logic_vector(CORE_EXT_GPIO_IRQ_LEVEL, 2),     
 
     | 
  
  
    | 
      475
     | 
    
            i_ivector       => conv_std_logic_vector(CORE_EXT_GPIO_IRQ_VECTOR, 4),   
 
     | 
  
  
    | 
      476
     | 
    
            i_io            => "00",
 
     | 
  
  
    | 
      477
     | 
    
            t_io            => open,
 
     | 
  
  
    | 
      478
     | 
    
            o_io            => o_ext_gpio,
 
     | 
  
  
    | 
      479
     | 
    
            i_initdir       => "11",
 
     | 
  
  
    | 
      480
     | 
    
            i_initoutval    => "11"	
 
     | 
  
  
    | 
      481
     | 
    
      );
 
     | 
  
  
    | 
      482
     | 
    
      -----------------------------------------------------------------------------
 
     | 
  
  
    | 
      483
     | 
    
      --INSTRUMENTATION AMPLIFIER ENABLE CONTROL
 
     | 
  
  
    | 
      484
     | 
    
      -----------------------------------------------------------------------------
 
     | 
  
  
    | 
      485
     | 
    
      
 
     | 
  
  
    | 
      486
     | 
    
      ia_wr_inst: gpio 
 
     | 
  
  
    | 
      487
     | 
    
      generic map(
 
     | 
  
  
    | 
      488
     | 
    
      NUM_BANKS => 1,
 
     | 
  
  
    | 
      489
     | 
    
      NUM_IO_PER_BANK =>4
 
     | 
  
  
    | 
      490
     | 
    
      )
 
     | 
  
  
    | 
      491
     | 
    
      
 
     | 
  
  
    | 
      492
     | 
    
      port map(
 
     | 
  
  
    | 
      493
     | 
    
            clk             => ema_clk,
 
     | 
  
  
    | 
      494
     | 
    
            i_ABus          => addr_r,
 
     | 
  
  
    | 
      495
     | 
    
            i_DBus          => edi_r,
 
     | 
  
  
    | 
      496
     | 
    
            o_DBus          => edo_arm(CORE_IA_WR_MODULE),
 
     | 
  
  
    | 
      497
     | 
    
            i_wr_en         => wr_r,
 
     | 
  
  
    | 
      498
     | 
    
            i_rd_en         => rd_r,
 
     | 
  
  
    | 
      499
     | 
    
            i_cs            => arm_cs5_r(CORE_IA_WR_MODULE),
 
     | 
  
  
    | 
      500
     | 
    
            o_irq           => irq_map(CORE_IA_WR_IRQ_LEVEL)(CORE_IA_WR_IRQ_VECTOR),
 
     | 
  
  
    | 
      501
     | 
    
            i_ilevel        => conv_std_logic_vector(CORE_IA_WR_IRQ_LEVEL, 2),     
 
     | 
  
  
    | 
      502
     | 
    
            i_ivector       => conv_std_logic_vector(CORE_IA_WR_IRQ_VECTOR, 4),   
 
     | 
  
  
    | 
      503
     | 
    
            i_io            => "0000",
 
     | 
  
  
    | 
      504
     | 
    
            t_io            => open,
 
     | 
  
  
    | 
      505
     | 
    
            o_io            => o_ia_wr,
 
     | 
  
  
    | 
      506
     | 
    
            i_initdir       => "1111",
 
     | 
  
  
    | 
      507
     | 
    
            i_initoutval    => "1111"	
 
     | 
  
  
    | 
      508
     | 
    
      );
 
     | 
  
  
    | 
      509
     | 
    
      --------------------------------------------------------------------------------
 
     | 
  
  
    | 
      510
     | 
    
      --CHANNEL CONFIGURATION CONTROL GPIO CORE
 
     | 
  
  
    | 
      511
     | 
    
      --------------------------------------------------------------------------------
 
     | 
  
  
    | 
      512
     | 
    
      chann_config_inst: gpio 
 
     | 
  
  
    | 
      513
     | 
    
      generic map(
 
     | 
  
  
    | 
      514
     | 
    
      NUM_BANKS => 1,
 
     | 
  
  
    | 
      515
     | 
    
      NUM_IO_PER_BANK =>3
 
     | 
  
  
    | 
      516
     | 
    
      )
 
     | 
  
  
    | 
      517
     | 
    
      
 
     | 
  
  
    | 
      518
     | 
    
      port map(
 
     | 
  
  
    | 
      519
     | 
    
            clk             => ema_clk,
 
     | 
  
  
    | 
      520
     | 
    
            i_ABus          => addr_r,
 
     | 
  
  
    | 
      521
     | 
    
            i_DBus          => edi_r,
 
     | 
  
  
    | 
      522
     | 
    
            o_DBus          => edo_arm(CORE_CHANN_CONFIG_MODULE),
 
     | 
  
  
    | 
      523
     | 
    
            i_wr_en         => wr_r,
 
     | 
  
  
    | 
      524
     | 
    
            i_rd_en         => rd_r,
 
     | 
  
  
    | 
      525
     | 
    
            i_cs            => arm_cs5_r(CORE_CHANN_CONFIG_MODULE),
 
     | 
  
  
    | 
      526
     | 
    
            o_irq           => irq_map(CORE_CHANN_CONFIG_IRQ_LEVEL)(CORE_CHANN_CONFIG_IRQ_VECTOR),
 
     | 
  
  
    | 
      527
     | 
    
            i_ilevel        => conv_std_logic_vector(CORE_CHANN_CONFIG_IRQ_LEVEL, 2),     
 
     | 
  
  
    | 
      528
     | 
    
            i_ivector       => conv_std_logic_vector(CORE_CHANN_CONFIG_IRQ_VECTOR, 4),   
 
     | 
  
  
    | 
      529
     | 
    
            i_io            => "000",
 
     | 
  
  
    | 
      530
     | 
    
            t_io            => open,
 
     | 
  
  
    | 
      531
     | 
    
            o_io            => o_chann_config,
 
     | 
  
  
    | 
      532
     | 
    
            i_initdir       => "111",
 
     | 
  
  
    | 
      533
     | 
    
            i_initoutval    => "111"	
 
     | 
  
  
    | 
      534
     | 
    
      );
 
     | 
  
  
    | 
      535
     | 
    
      
 
     | 
  
  
    | 
      536
     | 
    
      ----------------------------------------------------------------
 
     | 
  
  
    | 
      537
     | 
    
      -- SPI CORE N.1
 
     | 
  
  
    | 
      538
     | 
    
      ----------------------------------------------------------------
 
     | 
  
  
    | 
      539
     | 
    
      spi1_core : spi
 
     | 
  
  
    | 
      540
     | 
    
      Port Map ( 
 
     | 
  
  
    | 
      541
     | 
    
      emif_clk => ema_clk, 
 
     | 
  
  
    | 
      542
     | 
    
      i_ABus => addr_r,
 
     | 
  
  
    | 
      543
     | 
    
      i_DBus => edi_r,
 
     | 
  
  
    | 
      544
     | 
    
      o_DBus => edo_dsp(CORE_SPI1_MODULE),
 
     | 
  
  
    | 
      545
     | 
    
      i_wr_en => wr_r,
 
     | 
  
  
    | 
      546
     | 
    
      i_rd_en => rd_r,
 
     | 
  
  
    | 
      547
     | 
    
      i_cs => dsp_cs4_r(CORE_SPI1_MODULE),
 
     | 
  
  
    | 
      548
     | 
    
      o_irq => irq_map(CORE_SPI1_IRQ_LEVEL)(CORE_SPI1_IRQ_VECTOR),
 
     | 
  
  
    | 
      549
     | 
    
      i_ilevel => CONV_STD_LOGIC_VECTOR(CORE_SPI1_IRQ_LEVEL,2),
 
     | 
  
  
    | 
      550
     | 
    
      i_ivector => CONV_STD_LOGIC_VECTOR(CORE_SPI1_IRQ_VECTOR,4),
 
     | 
  
  
    | 
      551
     | 
    
      -- SPI interface signals 
 
     | 
  
  
    | 
      552
     | 
    
      o_sclk => o_fspi1_clk,
 
     | 
  
  
    | 
      553
     | 
    
      o_cs_n => o_fspi1_cs,
 
     | 
  
  
    | 
      554
     | 
    
      o_mosi => o_fspi1_mosi,
 
     | 
  
  
    | 
      555
     | 
    
      i_miso => i_fspi1_miso,
 
     | 
  
  
    | 
      556
     | 
    
      -- In/Out FIFO interfaces (NO FIRST WORD FALLTHROUGH)
 
     | 
  
  
    | 
      557
     | 
    
      -- Synchronous on emif_clock
 
     | 
  
  
    | 
      558
     | 
    
      i_fifo_depth => "010",
 
     | 
  
  
    | 
      559
     | 
    
      o_mosi_fifo_wr => mosi1_wr_en,
 
     | 
  
  
    | 
      560
     | 
    
      o_mosi_fifo_rd => mosi1_rd_en,
 
     | 
  
  
    | 
      561
     | 
    
      o_mosi_fifo_in => mosi1_din, -- fifo data input
 
     | 
  
  
    | 
      562
     | 
    
      i_mosi_fifo_out => mosi1_dout,
 
     | 
  
  
    | 
      563
     | 
    
      i_mosi_write_cnt => mosi1_wr_data_count,
 
     | 
  
  
    | 
      564
     | 
    
      i_mosi_empty => mosi1_empty,
 
     | 
  
  
    | 
      565
     | 
    
      o_miso_fifo_wr => miso1_wr_en,
 
     | 
  
  
    | 
      566
     | 
    
      o_miso_fifo_rd => miso1_rd_en,
 
     | 
  
  
    | 
      567
     | 
    
      o_miso_fifo_in => miso1_din,
 
     | 
  
  
    | 
      568
     | 
    
      i_miso_fifo_out => miso1_dout,
 
     | 
  
  
    | 
      569
     | 
    
      i_miso_read_cnt => miso1_rd_data_count,
 
     | 
  
  
    | 
      570
     | 
    
      i_miso_empty => miso1_empty,
 
     | 
  
  
    | 
      571
     | 
    
      o_fifo_rst => spi1_fifo_rst
 
     | 
  
  
    | 
      572
     | 
    
      );
 
     | 
  
  
    | 
      573
     | 
    
      
 
     | 
  
  
    | 
      574
     | 
    
      --o_cs_n <= o_fspi1_cs(0);
 
     | 
  
  
    | 
      575
     | 
    
      --o_sdi <= spi_mosi;
 
     | 
  
  
    | 
      576
     | 
    
      
 
     | 
  
  
    | 
      577
     | 
    
      
 
     | 
  
  
    | 
      578
     | 
    
      mosi1_fifo : fifo_dpram64x32
 
     | 
  
  
    | 
      579
     | 
    
      port map (
 
     | 
  
  
    | 
      580
     | 
    
      clk => ema_clk,
 
     | 
  
  
    | 
      581
     | 
    
      rst => spi1_fifo_rst,
 
     | 
  
  
    | 
      582
     | 
    
      din => mosi1_din,
 
     | 
  
  
    | 
      583
     | 
    
      wr_en => mosi1_wr_en,
 
     | 
  
  
    | 
      584
     | 
    
      rd_en => mosi1_rd_en,
 
     | 
  
  
    | 
      585
     | 
    
      dout => mosi1_dout,
 
     | 
  
  
    | 
      586
     | 
    
      full => open,
 
     | 
  
  
    | 
      587
     | 
    
      empty => mosi1_empty,
 
     | 
  
  
    | 
      588
     | 
    
      data_count => mosi1_wr_data_count(5 downto 0),
 
     | 
  
  
    | 
      589
     | 
    
      prog_full => open,
 
     | 
  
  
    | 
      590
     | 
    
      prog_empty => open
 
     | 
  
  
    | 
      591
     | 
    
      ); 
 
     | 
  
  
    | 
      592
     | 
    
      
 
     | 
  
  
    | 
      593
     | 
    
      miso1_fifo : fifo_dpram64x32
 
     | 
  
  
    | 
      594
     | 
    
      port map (
 
     | 
  
  
    | 
      595
     | 
    
      clk => ema_clk,
 
     | 
  
  
    | 
      596
     | 
    
      rst => spi1_fifo_rst,
 
     | 
  
  
    | 
      597
     | 
    
      din => miso1_din,
 
     | 
  
  
    | 
      598
     | 
    
      wr_en => miso1_wr_en,
 
     | 
  
  
    | 
      599
     | 
    
      rd_en => miso1_rd_en,
 
     | 
  
  
    | 
      600
     | 
    
      dout => miso1_dout,
 
     | 
  
  
    | 
      601
     | 
    
      full => open,
 
     | 
  
  
    | 
      602
     | 
    
      empty => miso1_empty,
 
     | 
  
  
    | 
      603
     | 
    
      data_count => miso1_rd_data_count(5 downto 0),
 
     | 
  
  
    | 
      604
     | 
    
      prog_full => open,
 
     | 
  
  
    | 
      605
     | 
    
      prog_empty => open
 
     | 
  
  
    | 
      606
     | 
    
      
 
     | 
  
  
    | 
      607
     | 
    
      );
 
     | 
  
  
    | 
      608
     | 
    
      
 
     | 
  
  
    | 
      609
     | 
    
      ----------------------------------------------------------------
 
     | 
  
  
    | 
      610
     | 
    
      -- SPI CORE N.2
 
     | 
  
  
    | 
      611
     | 
    
      ----------------------------------------------------------------
 
     | 
  
  
    | 
      612
     | 
    
      spi2_core : spi
 
     | 
  
  
    | 
      613
     | 
    
      Port Map ( 
 
     | 
  
  
    | 
      614
     | 
    
      emif_clk => ema_clk, 
 
     | 
  
  
    | 
      615
     | 
    
      i_ABus => addr_r,
 
     | 
  
  
    | 
      616
     | 
    
      i_DBus => edi_r,
 
     | 
  
  
    | 
      617
     | 
    
      o_DBus => edo_dsp(CORE_SPI2_MODULE),
 
     | 
  
  
    | 
      618
     | 
    
      i_wr_en => wr_r,
 
     | 
  
  
    | 
      619
     | 
    
      i_rd_en => rd_r,
 
     | 
  
  
    | 
      620
     | 
    
      i_cs => dsp_cs4_r(CORE_SPI2_MODULE),
 
     | 
  
  
    | 
      621
     | 
    
      o_irq => irq_map(CORE_SPI2_IRQ_LEVEL)(CORE_SPI2_IRQ_VECTOR),
 
     | 
  
  
    | 
      622
     | 
    
      i_ilevel => CONV_STD_LOGIC_VECTOR(CORE_SPI2_IRQ_LEVEL,2),
 
     | 
  
  
    | 
      623
     | 
    
      i_ivector => CONV_STD_LOGIC_VECTOR(CORE_SPI2_IRQ_VECTOR,4),
 
     | 
  
  
    | 
      624
     | 
    
      -- SPI interface signals 
 
     | 
  
  
    | 
      625
     | 
    
      o_sclk => o_fspi2_clk,
 
     | 
  
  
    | 
      626
     | 
    
      o_cs_n => o_fspi2_cs,
 
     | 
  
  
    | 
      627
     | 
    
      o_mosi => o_fspi2_mosi,
 
     | 
  
  
    | 
      628
     | 
    
      i_miso => i_fspi2_miso,
 
     | 
  
  
    | 
      629
     | 
    
      -- In/Out FIFO interfaces (NO FIRST WORD FALLTHROUGH)
 
     | 
  
  
    | 
      630
     | 
    
      -- Synchronous on emif_clock
 
     | 
  
  
    | 
      631
     | 
    
      i_fifo_depth => "010",
 
     | 
  
  
    | 
      632
     | 
    
      o_mosi_fifo_wr => mosi2_wr_en,
 
     | 
  
  
    | 
      633
     | 
    
      o_mosi_fifo_rd => mosi2_rd_en,
 
     | 
  
  
    | 
      634
     | 
    
      o_mosi_fifo_in => mosi2_din, -- fifo data input
 
     | 
  
  
    | 
      635
     | 
    
      i_mosi_fifo_out => mosi2_dout,
 
     | 
  
  
    | 
      636
     | 
    
      i_mosi_write_cnt => mosi2_wr_data_count,
 
     | 
  
  
    | 
      637
     | 
    
      i_mosi_empty => mosi2_empty,
 
     | 
  
  
    | 
      638
     | 
    
      o_miso_fifo_wr => miso2_wr_en,
 
     | 
  
  
    | 
      639
     | 
    
      o_miso_fifo_rd => miso2_rd_en,
 
     | 
  
  
    | 
      640
     | 
    
      o_miso_fifo_in => miso2_din,
 
     | 
  
  
    | 
      641
     | 
    
      i_miso_fifo_out => miso2_dout,
 
     | 
  
  
    | 
      642
     | 
    
      i_miso_read_cnt => miso2_rd_data_count,
 
     | 
  
  
    | 
      643
     | 
    
      i_miso_empty => miso2_empty,
 
     | 
  
  
    | 
      644
     | 
    
      o_fifo_rst => spi2_fifo_rst
 
     | 
  
  
    | 
      645
     | 
    
      );
 
     | 
  
  
    | 
      646
     | 
    
      
 
     | 
  
  
    | 
      647
     | 
    
      --o_cs_n <= o_fspi2_cs(0);
 
     | 
  
  
    | 
      648
     | 
    
      --o_sdi <= spi_mosi;
 
     | 
  
  
    | 
      649
     | 
    
      
 
     | 
  
  
    | 
      650
     | 
    
      
 
     | 
  
  
    | 
      651
     | 
    
      mosi2_fifo : fifo_dpram64x32
 
     | 
  
  
    | 
      652
     | 
    
      port map (
 
     | 
  
  
    | 
      653
     | 
    
      clk => ema_clk,
 
     | 
  
  
    | 
      654
     | 
    
      rst => spi2_fifo_rst,
 
     | 
  
  
    | 
      655
     | 
    
      din => mosi2_din,
 
     | 
  
  
    | 
      656
     | 
    
      wr_en => mosi2_wr_en,
 
     | 
  
  
    | 
      657
     | 
    
      rd_en => mosi2_rd_en,
 
     | 
  
  
    | 
      658
     | 
    
      dout => mosi2_dout,
 
     | 
  
  
    | 
      659
     | 
    
      full => open,
 
     | 
  
  
    | 
      660
     | 
    
      empty => mosi2_empty,
 
     | 
  
  
    | 
      661
     | 
    
      data_count => mosi2_wr_data_count(5 downto 0),
 
     | 
  
  
    | 
      662
     | 
    
      prog_full => open,
 
     | 
  
  
    | 
      663
     | 
    
      prog_empty => open
 
     | 
  
  
    | 
      664
     | 
    
      ); 
 
     | 
  
  
    | 
      665
     | 
    
      
 
     | 
  
  
    | 
      666
     | 
    
      miso2_fifo : fifo_dpram64x32
 
     | 
  
  
    | 
      667
     | 
    
      port map (
 
     | 
  
  
    | 
      668
     | 
    
      clk => ema_clk,
 
     | 
  
  
    | 
      669
     | 
    
      rst => spi2_fifo_rst,
 
     | 
  
  
    | 
      670
     | 
    
      din => miso2_din,
 
     | 
  
  
    | 
      671
     | 
    
      wr_en => miso2_wr_en,
 
     | 
  
  
    | 
      672
     | 
    
      rd_en => miso2_rd_en,
 
     | 
  
  
    | 
      673
     | 
    
      dout => miso2_dout,
 
     | 
  
  
    | 
      674
     | 
    
      full => open,
 
     | 
  
  
    | 
      675
     | 
    
      empty => miso2_empty,
 
     | 
  
  
    | 
      676
     | 
    
      data_count => miso2_rd_data_count(5 downto 0),
 
     | 
  
  
    | 
      677
     | 
    
      prog_full => open,
 
     | 
  
  
    | 
      678
     | 
    
      prog_empty => open
 
     | 
  
  
    | 
      679
     | 
    
      
 
     | 
  
  
    | 
      680
     | 
    
      );
 
     | 
  
  
    | 
      681
     | 
    
      
 
     | 
  
  
    | 
      682
     | 
    
      
 
     | 
  
  
    | 
      683
     | 
    
      
 
     | 
  
  
    | 
      684
     | 
    
      
 
     | 
  
  
    | 
      685
     | 
    
      
 
     | 
  
  
    | 
      686
     | 
    
      
 
     | 
  
  
    | 
      687
     | 
    
      
 
     | 
  
  
    | 
      688
     | 
    
      --gen_disp : if DISP_CONFIG = "LCD" generate 
 
     | 
  
  
    | 
      689
     | 
    
      --begin
 
     | 
  
  
    | 
      690
     | 
    
      --
 
     | 
  
  
    | 
      691
     | 
    
      --lcd_control : lcd_ctlr
 
     | 
  
  
    | 
      692
     | 
    
      --   port map (
 
     | 
  
  
    | 
      693
     | 
    
      --      ema_clk        => ema_clk,
 
     | 
  
  
    | 
      694
     | 
    
      --      i_ABus         => addr_r,
 
     | 
  
  
    | 
      695
     | 
    
      --      i_DBus         => edi_r,
 
     | 
  
  
    | 
      696
     | 
    
      --      o_DBus         => edo_arm(CORE_LCD_MODULE),
 
     | 
  
  
    | 
      697
     | 
    
      --      i_wr_en        => wr_r,
 
     | 
  
  
    | 
      698
     | 
    
      --      i_rd_en        => rd_r,
 
     | 
  
  
    | 
      699
     | 
    
      --      i_cs           => arm_cs5_r(CORE_LCD_MODULE),
 
     | 
  
  
    | 
      700
     | 
    
      --      o_irq          => irq_map(CORE_LCD_IRQ_LEVEL)(CORE_LCD_IRQ_VECTOR),
 
     | 
  
  
    | 
      701
     | 
    
      --      i_ilevel       => conv_std_logic_vector(CORE_LCD_IRQ_LEVEL, 2),
 
     | 
  
  
    | 
      702
     | 
    
      --      i_ivector      => conv_std_logic_vector(CORE_LCD_IRQ_VECTOR, 4),
 
     | 
  
  
    | 
      703
     | 
    
      --      
 
     | 
  
  
    | 
      704
     | 
    
      --      o_lcd_hrev     => lcd_hrev,
 
     | 
  
  
    | 
      705
     | 
    
      --      o_lcd_dim_pwm  => lcd_dim_pwm,
 
     | 
  
  
    | 
      706
     | 
    
      --      o_lcd_pwr      => lcd_pwr,
 
     | 
  
  
    | 
      707
     | 
    
      --      o_lcd_backlit  => lcd_backlit,
 
     | 
  
  
    | 
      708
     | 
    
      --      o_lcd_vrev     => lcd_vrev,
 
     | 
  
  
    | 
      709
     | 
    
      --      o_lcd_en       => lcd_en
 
     | 
  
  
    | 
      710
     | 
    
      --                  
 
     | 
  
  
    | 
      711
     | 
    
      --      );
 
     | 
  
  
    | 
      712
     | 
    
      --
 
     | 
  
  
    | 
      713
     | 
    
      --gen_sharp : if LCD_TYPE = "SHARP" generate
 
     | 
  
  
    | 
      714
     | 
    
      --begin
 
     | 
  
  
    | 
      715
     | 
    
      --
 
     | 
  
  
    | 
      716
     | 
    
      --serdes :  lcd_serdes_cl000099
 
     | 
  
  
    | 
      717
     | 
    
      --   port map (
 
     | 
  
  
    | 
      718
     | 
    
      --      
 
     | 
  
  
    | 
      719
     | 
    
      --      -- LCD Controller interface (from OMAP-L138)
 
     | 
  
  
    | 
      720
     | 
    
      --      i_lcd_d       => i_lcd_d,
 
     | 
  
  
    | 
      721
     | 
    
      --      i_lcd_hsync   => i_lcd_hsync,
 
     | 
  
  
    | 
      722
     | 
    
      --      i_lcd_vsync   => i_lcd_vsync,
 
     | 
  
  
    | 
      723
     | 
    
      --      i_lcd_mclk    => i_lcd_mclk,
 
     | 
  
  
    | 
      724
     | 
    
      --      i_lcd_pclk    => lcd_pclk,
 
     | 
  
  
    | 
      725
     | 
    
      --      i_lcd_enb     => i_lcd_enb,
 
     | 
  
  
    | 
      726
     | 
    
      --      
 
     | 
  
  
    | 
      727
     | 
    
      --      -- LCD control signals (from core???)
 
     | 
  
  
    | 
      728
     | 
    
      --      i_lcd_hrev    => lcd_hrev,
 
     | 
  
  
    | 
      729
     | 
    
      --      i_lcd_dim_pwm => lcd_dim_pwm,
 
     | 
  
  
    | 
      730
     | 
    
      --      i_lcd_pwr     => lcd_pwr,
 
     | 
  
  
    | 
      731
     | 
    
      --      i_lcd_backlit => lcd_backlit,
 
     | 
  
  
    | 
      732
     | 
    
      --      i_lcd_vrev    => lcd_vrev,
 
     | 
  
  
    | 
      733
     | 
    
      --      i_lcd_en      => '1', -- TODO
 
     | 
  
  
    | 
      734
     | 
    
      --      
 
     | 
  
  
    | 
      735
     | 
    
      --      -- LvDS I/O pins for LCD and some control signals
 
     | 
  
  
    | 
      736
     | 
    
      --      o_serdes_clk  => serdes_clk,
 
     | 
  
  
    | 
      737
     | 
    
      --      o_serdes_ctl  => serdes_ctl,
 
     | 
  
  
    | 
      738
     | 
    
      --      o_serdes_b    => serdes_b,
 
     | 
  
  
    | 
      739
     | 
    
      --      o_serdes_g    => serdes_g,
 
     | 
  
  
    | 
      740
     | 
    
      --      o_serdes_r    => serdes_r,
 
     | 
  
  
    | 
      741
     | 
    
      --      
 
     | 
  
  
    | 
      742
     | 
    
      --      o_debug        => serdes_debug
 
     | 
  
  
    | 
      743
     | 
    
      --   );
 
     | 
  
  
    | 
      744
     | 
    
      --end generate gen_sharp;
 
     | 
  
  
    | 
      745
     | 
    
      --
 
     | 
  
  
    | 
      746
     | 
    
      --gen_nec : if LCD_TYPE = "NEC" generate
 
     | 
  
  
    | 
      747
     | 
    
      --begin
 
     | 
  
  
    | 
      748
     | 
    
      --
 
     | 
  
  
    | 
      749
     | 
    
      --serdes :  lcd_serdes_cl000119
 
     | 
  
  
    | 
      750
     | 
    
      --   port map (
 
     | 
  
  
    | 
      751
     | 
    
      --      
 
     | 
  
  
    | 
      752
     | 
    
      --      -- LCD Controller interface (from OMAP-L138)
 
     | 
  
  
    | 
      753
     | 
    
      --      i_lcd_d       => i_lcd_d,
 
     | 
  
  
    | 
      754
     | 
    
      --      i_lcd_hsync   => i_lcd_hsync,
 
     | 
  
  
    | 
      755
     | 
    
      --      i_lcd_vsync   => i_lcd_vsync,
 
     | 
  
  
    | 
      756
     | 
    
      --      i_lcd_mclk    => i_lcd_mclk,
 
     | 
  
  
    | 
      757
     | 
    
      --      i_lcd_pclk    => lcd_pclk,
 
     | 
  
  
    | 
      758
     | 
    
      --      i_lcd_enb     => i_lcd_enb,
 
     | 
  
  
    | 
      759
     | 
    
      --      
 
     | 
  
  
    | 
      760
     | 
    
      --      -- LCD control signals (from core)
 
     | 
  
  
    | 
      761
     | 
    
      --      i_lcd_backlit => lcd_backlit,
 
     | 
  
  
    | 
      762
     | 
    
      --      i_lcd_en      => '1', -- TODO
 
     | 
  
  
    | 
      763
     | 
    
      --      i_lcd_dim_pwm => lcd_dim_pwm,
 
     | 
  
  
    | 
      764
     | 
    
      --      i_lcd_pwr     => lcd_pwr,
 
     | 
  
  
    | 
      765
     | 
    
      --      i_lcd_reset   => '0',
 
     | 
  
  
    | 
      766
     | 
    
      --      
 
     | 
  
  
    | 
      767
     | 
    
      --      -- LvDS I/O pins for LCD and some control signals
 
     | 
  
  
    | 
      768
     | 
    
      --      o_serdes_clk  => serdes_clk,
 
     | 
  
  
    | 
      769
     | 
    
      --      o_serdes_ctl  => serdes_ctl,
 
     | 
  
  
    | 
      770
     | 
    
      --      o_serdes_b    => serdes_b,
 
     | 
  
  
    | 
      771
     | 
    
      --      o_serdes_g    => serdes_g,
 
     | 
  
  
    | 
      772
     | 
    
      --      o_serdes_r    => serdes_r
 
     | 
  
  
    | 
      773
     | 
    
      --   );
 
     | 
  
  
    | 
      774
     | 
    
      --   
 
     | 
  
  
    | 
      775
     | 
    
      --end generate gen_nec;
 
     | 
  
  
    | 
      776
     | 
    
      --
 
     | 
  
  
    | 
      777
     | 
    
      --tsctrl : ads7843
 
     | 
  
  
    | 
      778
     | 
    
      --   port map (
 
     | 
  
  
    | 
      779
     | 
    
      --      emif_clk       => ema_clk,
 
     | 
  
  
    | 
      780
     | 
    
      --      i_ABus         => addr_r,
 
     | 
  
  
    | 
      781
     | 
    
      --      i_DBus         => edi_r,
 
     | 
  
  
    | 
      782
     | 
    
      --      o_DBus         => edo_arm(CORE_TS_MODULE),
 
     | 
  
  
    | 
      783
     | 
    
      --      i_wr_en        => wr_r,
 
     | 
  
  
    | 
      784
     | 
    
      --      i_rd_en        => rd_r,
 
     | 
  
  
    | 
      785
     | 
    
      --      i_cs           => arm_cs5_r(CORE_TS_MODULE),
 
     | 
  
  
    | 
      786
     | 
    
      --      o_irq          => irq_map(CORE_TS_IRQ_LEVEL)(CORE_TS_IRQ_VECTOR),
 
     | 
  
  
    | 
      787
     | 
    
      --      i_ilevel       => conv_std_logic_vector(CORE_TS_IRQ_LEVEL, 2),
 
     | 
  
  
    | 
      788
     | 
    
      --      i_ivector      => conv_std_logic_vector(CORE_TS_IRQ_VECTOR, 4),
 
     | 
  
  
    | 
      789
     | 
    
      --
 
     | 
  
  
    | 
      790
     | 
    
      --      o_ts_cs_n      => o_ts_cs_n,
 
     | 
  
  
    | 
      791
     | 
    
      --      o_ts_clk       => o_ts_clk,
 
     | 
  
  
    | 
      792
     | 
    
      --      o_ts_din       => o_ts_din,
 
     | 
  
  
    | 
      793
     | 
    
      --      i_ts_dout      => i_ts_dout,
 
     | 
  
  
    | 
      794
     | 
    
      --      i_ts_busy      => i_ts_busy,
 
     | 
  
  
    | 
      795
     | 
    
      --      i_ts_PenIRQ_n  => io_ts_PenIRQ_n,
 
     | 
  
  
    | 
      796
     | 
    
      --      o_ts_PenIRQ_n  => ts_PenIRQ_n,
 
     | 
  
  
    | 
      797
     | 
    
      --      t_ts_PenIRQ_n  => t_ts_PenIRQ_n,
 
     | 
  
  
    | 
      798
     | 
    
      --      o_disp_cs_n    => o_disp_cs_n,
 
     | 
  
  
    | 
      799
     | 
    
      --      o_gpio_out     => open
 
     | 
  
  
    | 
      800
     | 
    
      --   );
 
     | 
  
  
    | 
      801
     | 
    
      --
 
     | 
  
  
    | 
      802
     | 
    
      --io_ts_PenIRQ_n <= 'Z' when t_ts_PenIRQ_n='1' else ts_PenIRQ_n;
 
     | 
  
  
    | 
      803
     | 
    
      --
 
     | 
  
  
    | 
      804
     | 
    
      --lcd_red: OBUFDS
 
     | 
  
  
    | 
      805
     | 
    
      --   generic map (
 
     | 
  
  
    | 
      806
     | 
    
      --      IOSTANDARD => "DEFAULT")
 
     | 
  
  
    | 
      807
     | 
    
      --   port map (
 
     | 
  
  
    | 
      808
     | 
    
      --      o  => o_disp_a0_p,
 
     | 
  
  
    | 
      809
     | 
    
      --      ob => o_disp_a0_n,
 
     | 
  
  
    | 
      810
     | 
    
      --      i  => serdes_r );
 
     | 
  
  
    | 
      811
     | 
    
      --
 
     | 
  
  
    | 
      812
     | 
    
      --lcd_green: OBUFDS
 
     | 
  
  
    | 
      813
     | 
    
      --   generic map (
 
     | 
  
  
    | 
      814
     | 
    
      --      IOSTANDARD => "DEFAULT")
 
     | 
  
  
    | 
      815
     | 
    
      --   port map (
 
     | 
  
  
    | 
      816
     | 
    
      --      o  => o_disp_a1_p,
 
     | 
  
  
    | 
      817
     | 
    
      --      ob => o_disp_a1_n,
 
     | 
  
  
    | 
      818
     | 
    
      --      i  => serdes_g );
 
     | 
  
  
    | 
      819
     | 
    
      --
 
     | 
  
  
    | 
      820
     | 
    
      --lcd_blue: OBUFDS
 
     | 
  
  
    | 
      821
     | 
    
      --   generic map (
 
     | 
  
  
    | 
      822
     | 
    
      --      IOSTANDARD => "DEFAULT")
 
     | 
  
  
    | 
      823
     | 
    
      --   port map (
 
     | 
  
  
    | 
      824
     | 
    
      --      o  => o_disp_a2_p,
 
     | 
  
  
    | 
      825
     | 
    
      --      ob => o_disp_a2_n,
 
     | 
  
  
    | 
      826
     | 
    
      --      i  => serdes_b );
 
     | 
  
  
    | 
      827
     | 
    
      --
 
     | 
  
  
    | 
      828
     | 
    
      --lcd_ctl: OBUFDS
 
     | 
  
  
    | 
      829
     | 
    
      --   generic map (
 
     | 
  
  
    | 
      830
     | 
    
      --      IOSTANDARD => "DEFAULT")
 
     | 
  
  
    | 
      831
     | 
    
      --   port map (
 
     | 
  
  
    | 
      832
     | 
    
      --      o  => o_disp_a3_p,
 
     | 
  
  
    | 
      833
     | 
    
      --      ob => o_disp_a3_n,
 
     | 
  
  
    | 
      834
     | 
    
      --      i  => serdes_ctl );
 
     | 
  
  
    | 
      835
     | 
    
      --
 
     | 
  
  
    | 
      836
     | 
    
      --lcd_shclk: OBUFDS
 
     | 
  
  
    | 
      837
     | 
    
      --   generic map (
 
     | 
  
  
    | 
      838
     | 
    
      --      IOSTANDARD => "DEFAULT")
 
     | 
  
  
    | 
      839
     | 
    
      --   port map (
 
     | 
  
  
    | 
      840
     | 
    
      --      o  => o_disp_clkin_p,
 
     | 
  
  
    | 
      841
     | 
    
      --      ob => o_disp_clkin_n,
 
     | 
  
  
    | 
      842
     | 
    
      --      i  => serdes_clk );
 
     | 
  
  
    | 
      843
     | 
    
      --
 
     | 
  
  
    | 
      844
     | 
    
      --io_sda <= 'Z';
 
     | 
  
  
    | 
      845
     | 
    
      --o_scl  <= 'Z';
 
     | 
  
  
    | 
      846
     | 
    
      --o_dvi_hsync <= 'Z';
 
     | 
  
  
    | 
      847
     | 
    
      --o_dvi_vsync <= 'Z';
 
     | 
  
  
    | 
      848
     | 
    
      --o_dvi_de <= 'Z';
 
     | 
  
  
    | 
      849
     | 
    
      --o_dvi_clk <= 'Z';
 
     | 
  
  
    | 
      850
     | 
    
      --
 
     | 
  
  
    | 
      851
     | 
    
      --DDR2_NULL : for i in 0 to 15 generate
 
     | 
  
  
    | 
      852
     | 
    
      --begin
 
     | 
  
  
    | 
      853
     | 
    
      --    o_dvi_data(i) <= 'Z';
 
     | 
  
  
    | 
      854
     | 
    
      --end generate DDR2_NULL;
 
     | 
  
  
    | 
      855
     | 
    
      --
 
     | 
  
  
    | 
      856
     | 
    
      --end generate gen_disp;
 
     | 
  
  
    | 
      857
     | 
    
      --
 
     | 
  
  
    | 
      858
     | 
    
      --gen_dvi : if DISP_CONFIG = "DVI" generate 
 
     | 
  
  
    | 
      859
     | 
    
      --begin
 
     | 
  
  
    | 
      860
     | 
    
      --
 
     | 
  
  
    | 
      861
     | 
    
      --rev_ab : if BOARD_REV = "A" or BOARD_REV = "B" generate
 
     | 
  
  
    | 
      862
     | 
    
      --begin
 
     | 
  
  
    | 
      863
     | 
    
      --i2cctrl : i2c 
 
     | 
  
  
    | 
      864
     | 
    
      --   generic map (
 
     | 
  
  
    | 
      865
     | 
    
      --      CLK_DIVIDE => 256,
 
     | 
  
  
    | 
      866
     | 
    
      --      BYTES_PER_PAGE => 32,
 
     | 
  
  
    | 
      867
     | 
    
      --      WRITE_DLY_CNT_BIT => 10
 
     | 
  
  
    | 
      868
     | 
    
      --   )
 
     | 
  
  
    | 
      869
     | 
    
      --   Port Map ( 
 
     | 
  
  
    | 
      870
     | 
    
      --      clk            => ema_clk,
 
     | 
  
  
    | 
      871
     | 
    
      --      i_ABus         => addr_r,
 
     | 
  
  
    | 
      872
     | 
    
      --      i_DBus         => edi_r,
 
     | 
  
  
    | 
      873
     | 
    
      --      o_DBus         => edo_arm(CORE_I2C_MODULE),
 
     | 
  
  
    | 
      874
     | 
    
      --      i_wr_en        => wr_r,
 
     | 
  
  
    | 
      875
     | 
    
      --      i_rd_en        => rd_r,
 
     | 
  
  
    | 
      876
     | 
    
      --      i_cs           => arm_cs5_r(CORE_I2C_MODULE),
 
     | 
  
  
    | 
      877
     | 
    
      --      o_irq          => irq_map(CORE_I2C_IRQ_LEVEL)(CORE_I2C_IRQ_VECTOR),
 
     | 
  
  
    | 
      878
     | 
    
      --      i_ilevel       => conv_std_logic_vector(CORE_I2C_IRQ_LEVEL, 2),
 
     | 
  
  
    | 
      879
     | 
    
      --      i_ivector      => conv_std_logic_vector(CORE_I2C_IRQ_VECTOR, 4),
 
     | 
  
  
    | 
      880
     | 
    
      --      i_sda          => io_sda,
 
     | 
  
  
    | 
      881
     | 
    
      --      o_sda          => sda,
 
     | 
  
  
    | 
      882
     | 
    
      --      o_sdt          => t_sda,
 
     | 
  
  
    | 
      883
     | 
    
      --      o_scl          => o_scl
 
     | 
  
  
    | 
      884
     | 
    
      --   );
 
     | 
  
  
    | 
      885
     | 
    
      --   
 
     | 
  
  
    | 
      886
     | 
    
      --io_sda <= 'Z' when t_sda = '1' else sda;
 
     | 
  
  
    | 
      887
     | 
    
      --
 
     | 
  
  
    | 
      888
     | 
    
      --dvi :  tfp410 
 
     | 
  
  
    | 
      889
     | 
    
      --   port map (
 
     | 
  
  
    | 
      890
     | 
    
      --      ema_clk        => ema_clk,
 
     | 
  
  
    | 
      891
     | 
    
      --      i_ABus         => addr_r,
 
     | 
  
  
    | 
      892
     | 
    
      --      i_DBus         => edi_r,
 
     | 
  
  
    | 
      893
     | 
    
      --      o_DBus         => edo_arm(CORE_DVI_MODULE),
 
     | 
  
  
    | 
      894
     | 
    
      --      i_wr_en        => wr_r,
 
     | 
  
  
    | 
      895
     | 
    
      --      i_rd_en        => rd_r,
 
     | 
  
  
    | 
      896
     | 
    
      --      i_cs           => arm_cs5_r(CORE_DVI_MODULE),
 
     | 
  
  
    | 
      897
     | 
    
      --      o_irq          => irq_map(CORE_DVI_IRQ_LEVEL)(CORE_DVI_IRQ_VECTOR),
 
     | 
  
  
    | 
      898
     | 
    
      --      i_ilevel       => conv_std_logic_vector(CORE_DVI_IRQ_LEVEL, 2),
 
     | 
  
  
    | 
      899
     | 
    
      --      i_ivector      => conv_std_logic_vector(CORE_DVI_IRQ_VECTOR, 4),
 
     | 
  
  
    | 
      900
     | 
    
      --
 
     | 
  
  
    | 
      901
     | 
    
      --      -- LCD Controller interface (from OMAP-L138)
 
     | 
  
  
    | 
      902
     | 
    
      --      i_lcd_d       => i_lcd_d,
 
     | 
  
  
    | 
      903
     | 
    
      --      i_lcd_hsync   => i_lcd_hsync,
 
     | 
  
  
    | 
      904
     | 
    
      --      i_lcd_vsync   => i_lcd_vsync,
 
     | 
  
  
    | 
      905
     | 
    
      --      i_lcd_mclk    => i_lcd_mclk,
 
     | 
  
  
    | 
      906
     | 
    
      --      i_lcd_pclk    => lcd_pclk,
 
     | 
  
  
    | 
      907
     | 
    
      --      i_lcd_enb     => i_lcd_enb,
 
     | 
  
  
    | 
      908
     | 
    
      --            
 
     | 
  
  
    | 
      909
     | 
    
      --      -- DVI video interface (we assume double data rate interface for pin reduction)
 
     | 
  
  
    | 
      910
     | 
    
      --      -- these should be hooked up to the ODDR2 macro...
 
     | 
  
  
    | 
      911
     | 
    
      --      o_dvi_data_c0 => dvi_data_c0,
 
     | 
  
  
    | 
      912
     | 
    
      --      o_dvi_data_c1 => dvi_data_c1,
 
     | 
  
  
    | 
      913
     | 
    
      --      o_dvi_clk     => dvi_clk,
 
     | 
  
  
    | 
      914
     | 
    
      --      o_dvi_hsync   => o_dvi_hsync,
 
     | 
  
  
    | 
      915
     | 
    
      --      o_dvi_vsync   => o_dvi_vsync,
 
     | 
  
  
    | 
      916
     | 
    
      --      o_dvi_de      => o_dvi_de
 
     | 
  
  
    | 
      917
     | 
    
      --            
 
     | 
  
  
    | 
      918
     | 
    
      --      );
 
     | 
  
  
    | 
      919
     | 
    
      --
 
     | 
  
  
    | 
      920
     | 
    
      --DDR2 : for i in 0 to 11 generate
 
     | 
  
  
    | 
      921
     | 
    
      --begin
 
     | 
  
  
    | 
      922
     | 
    
      --
 
     | 
  
  
    | 
      923
     | 
    
      --ODDR2_inst : ODDR2
 
     | 
  
  
    | 
      924
     | 
    
      --   generic map (
 
     | 
  
  
    | 
      925
     | 
    
      --      DDR_ALIGNMENT => "NONE",
 
     | 
  
  
    | 
      926
     | 
    
      --      INIT => '0',
 
     | 
  
  
    | 
      927
     | 
    
      --      SRTYPE => "SYNC" )
 
     | 
  
  
    | 
      928
     | 
    
      --   port map (
 
     | 
  
  
    | 
      929
     | 
    
      --      Q  => o_dvi_data(i),
 
     | 
  
  
    | 
      930
     | 
    
      --      C0 => dvi_clk,
 
     | 
  
  
    | 
      931
     | 
    
      --      C1 => not dvi_clk,
 
     | 
  
  
    | 
      932
     | 
    
      --      CE => '1',
 
     | 
  
  
    | 
      933
     | 
    
      --      D0 => dvi_data_c0(i),
 
     | 
  
  
    | 
      934
     | 
    
      --      D1 => dvi_data_c1(i),
 
     | 
  
  
    | 
      935
     | 
    
      --      R  => '0',
 
     | 
  
  
    | 
      936
     | 
    
      --      S  => '0' );
 
     | 
  
  
    | 
      937
     | 
    
      --
 
     | 
  
  
    | 
      938
     | 
    
      --end generate DDR2;
 
     | 
  
  
    | 
      939
     | 
    
      --
 
     | 
  
  
    | 
      940
     | 
    
      --ODDR2_inst_clk : ODDR2
 
     | 
  
  
    | 
      941
     | 
    
      --   generic map (
 
     | 
  
  
    | 
      942
     | 
    
      --      DDR_ALIGNMENT => "NONE",
 
     | 
  
  
    | 
      943
     | 
    
      --      INIT => '0',
 
     | 
  
  
    | 
      944
     | 
    
      --      SRTYPE => "SYNC" )
 
     | 
  
  
    | 
      945
     | 
    
      --   port map (
 
     | 
  
  
    | 
      946
     | 
    
      --      Q  => o_dvi_clk,
 
     | 
  
  
    | 
      947
     | 
    
      --      C0 => dvi_clk,
 
     | 
  
  
    | 
      948
     | 
    
      --      C1 => not dvi_clk,
 
     | 
  
  
    | 
      949
     | 
    
      --      CE => '1',
 
     | 
  
  
    | 
      950
     | 
    
      --      D0 => '1',
 
     | 
  
  
    | 
      951
     | 
    
      --      D1 => '0',
 
     | 
  
  
    | 
      952
     | 
    
      --      R  => '0',
 
     | 
  
  
    | 
      953
     | 
    
      --      S  => '0' );
 
     | 
  
  
    | 
      954
     | 
    
      --
 
     | 
  
  
    | 
      955
     | 
    
      --end generate rev_ab;
 
     | 
  
  
    | 
      956
     | 
    
      --
 
     | 
  
  
    | 
      957
     | 
    
      --rev_c : if BOARD_REV = "C" generate
 
     | 
  
  
    | 
      958
     | 
    
      --begin
 
     | 
  
  
    | 
      959
     | 
    
      --
 
     | 
  
  
    | 
      960
     | 
    
      --latch_proc : process(lcd_pclk)
 
     | 
  
  
    | 
      961
     | 
    
      --begin
 
     | 
  
  
    | 
      962
     | 
    
      --    if rising_edge(lcd_pclk) then
 
     | 
  
  
    | 
      963
     | 
    
      --      o_dvi_data     <= i_lcd_d;
 
     | 
  
  
    | 
      964
     | 
    
      --      o_dvi_hsync    <= i_lcd_hsync;
 
     | 
  
  
    | 
      965
     | 
    
      --      o_dvi_vsync    <= i_lcd_vsync;
 
     | 
  
  
    | 
      966
     | 
    
      --      o_dvi_de       <= i_lcd_enb;
 
     | 
  
  
    | 
      967
     | 
    
      --    end if;
 
     | 
  
  
    | 
      968
     | 
    
      --end process latch_proc;
 
     | 
  
  
    | 
      969
     | 
    
      --
 
     | 
  
  
    | 
      970
     | 
    
      --o_dvi_clk <= not lcd_pclk;
 
     | 
  
  
    | 
      971
     | 
    
      --io_sda <= 'Z';
 
     | 
  
  
    | 
      972
     | 
    
      --o_scl  <= 'Z';
 
     | 
  
  
    | 
      973
     | 
    
      --
 
     | 
  
  
    | 
      974
     | 
    
      --end generate rev_c;
 
     | 
  
  
    | 
      975
     | 
    
      --
 
     | 
  
  
    | 
      976
     | 
    
      --o_ts_cs_n     <= 'Z';
 
     | 
  
  
    | 
      977
     | 
    
      --o_ts_clk      <= 'Z';
 
     | 
  
  
    | 
      978
     | 
    
      --o_ts_din      <= 'Z';
 
     | 
  
  
    | 
      979
     | 
    
      --io_ts_PenIRQ_n <= 'Z';
 
     | 
  
  
    | 
      980
     | 
    
      --o_disp_cs_n   <= 'Z';
 
     | 
  
  
    | 
      981
     | 
    
      --o_disp_a0_p   <= 'Z';
 
     | 
  
  
    | 
      982
     | 
    
      --o_disp_a0_n   <= 'Z';
 
     | 
  
  
    | 
      983
     | 
    
      --o_disp_a1_p   <= 'Z';
 
     | 
  
  
    | 
      984
     | 
    
      --o_disp_a1_n   <= 'Z';
 
     | 
  
  
    | 
      985
     | 
    
      --o_disp_a2_p   <= 'Z';
 
     | 
  
  
    | 
      986
     | 
    
      --o_disp_a2_n   <= 'Z';
 
     | 
  
  
    | 
      987
     | 
    
      --o_disp_a3_p   <= 'Z';
 
     | 
  
  
    | 
      988
     | 
    
      --o_disp_a3_n   <= 'Z';
 
     | 
  
  
    | 
      989
     | 
    
      --o_disp_clkin_p   <= 'Z';
 
     | 
  
  
    | 
      990
     | 
    
      --o_disp_clkin_n   <= 'Z';
 
     | 
  
  
    | 
      991
     | 
    
      --
 
     | 
  
  
    | 
      992
     | 
    
      --end generate gen_dvi;
 
     | 
  
  
    | 
      993
     | 
    
      --
 
     | 
  
  
    | 
      994
     | 
    
      --gen_camera : if CAMERA_CONFIG = "RAW" generate
 
     | 
  
  
    | 
      995
     | 
    
      --begin
 
     | 
  
  
    | 
      996
     | 
    
      --
 
     | 
  
  
    | 
      997
     | 
    
      --cam_clk_bufg : bufg Port Map (I => i_cam_pclk, O => cam_pclk);
 
     | 
  
  
    | 
      998
     | 
    
      --
 
     | 
  
  
    | 
      999
     | 
    
      --latch_cam_data : process(cam_pclk)
 
     | 
  
  
    | 
      1000
     | 
    
      --begin
 
     | 
  
  
    | 
      1001
     | 
    
      --    if rising_edge(cam_pclk) then
 
     | 
  
  
    | 
      1002
     | 
    
      --        cam_data <= i_cam_data;
 
     | 
  
  
    | 
      1003
     | 
    
      --        cam_lv   <= i_cam_lv;
 
     | 
  
  
    | 
      1004
     | 
    
      --        cam_fv   <= i_cam_fv;
 
     | 
  
  
    | 
      1005
     | 
    
      --    end if;
 
     | 
  
  
    | 
      1006
     | 
    
      --end process;
 
     | 
  
  
    | 
      1007
     | 
    
      --
 
     | 
  
  
    | 
      1008
     | 
    
      --o_vp_clkin(0)   <= cam_pclk;
 
     | 
  
  
    | 
      1009
     | 
    
      --o_vp_clkin(1)   <= cam_pclk;
 
     | 
  
  
    | 
      1010
     | 
    
      --o_vp_hsync    <= cam_lv;
 
     | 
  
  
    | 
      1011
     | 
    
      --o_vp_vsync    <= cam_fv;
 
     | 
  
  
    | 
      1012
     | 
    
      --o_vp_field    <= '0';
 
     | 
  
  
    | 
      1013
     | 
    
      --o_vp_din      <= "000" & cam_data;
 
     | 
  
  
    | 
      1014
     | 
    
      --
 
     | 
  
  
    | 
      1015
     | 
    
      --pwm1 : pwm 
 
     | 
  
  
    | 
      1016
     | 
    
      --	generic map (
 
     | 
  
  
    | 
      1017
     | 
    
      --	    NUM_OUTPUTS => 2
 
     | 
  
  
    | 
      1018
     | 
    
      --	)
 
     | 
  
  
    | 
      1019
     | 
    
      --	Port Map (
 
     | 
  
  
    | 
      1020
     | 
    
      --      emif_clk       => ema_clk,
 
     | 
  
  
    | 
      1021
     | 
    
      --      i_ABus         => addr_r,
 
     | 
  
  
    | 
      1022
     | 
    
      --      i_DBus         => edi_r,
 
     | 
  
  
    | 
      1023
     | 
    
      --      o_DBus         => edo_arm(CORE_PWM_MODULE),
 
     | 
  
  
    | 
      1024
     | 
    
      --      i_wr_en        => wr_r,
 
     | 
  
  
    | 
      1025
     | 
    
      --      i_rd_en        => rd_r,
 
     | 
  
  
    | 
      1026
     | 
    
      --      i_cs           => arm_cs5_r(CORE_PWM_MODULE),
 
     | 
  
  
    | 
      1027
     | 
    
      --      o_irq          => irq_map(CORE_PWM_IRQ_LEVEL)(CORE_PWM_IRQ_VECTOR),
 
     | 
  
  
    | 
      1028
     | 
    
      --      i_ilevel       => conv_std_logic_vector(CORE_PWM_IRQ_LEVEL, 2),
 
     | 
  
  
    | 
      1029
     | 
    
      --      i_ivector      => conv_std_logic_vector(CORE_PWM_IRQ_VECTOR, 4),
 
     | 
  
  
    | 
      1030
     | 
    
      --	   o_pwm(1 downto 0) => o_pwm,
 
     | 
  
  
    | 
      1031
     | 
    
      --		o_sync         => open,
 
     | 
  
  
    | 
      1032
     | 
    
      --		i_sync         => '0'
 
     | 
  
  
    | 
      1033
     | 
    
      --	);
 
     | 
  
  
    | 
      1034
     | 
    
      --
 
     | 
  
  
    | 
      1035
     | 
    
      --gpio1 : gpio
 
     | 
  
  
    | 
      1036
     | 
    
      --    generic map (
 
     | 
  
  
    | 
      1037
     | 
    
      --      NUM_BANKS       => 1,
 
     | 
  
  
    | 
      1038
     | 
    
      --      NUM_IO_PER_BANK => 2
 
     | 
  
  
    | 
      1039
     | 
    
      --	 )
 
     | 
  
  
    | 
      1040
     | 
    
      --	 Port Map (
 
     | 
  
  
    | 
      1041
     | 
    
      --      clk             => ema_clk,
 
     | 
  
  
    | 
      1042
     | 
    
      --      i_ABus          => addr_r,
 
     | 
  
  
    | 
      1043
     | 
    
      --      i_DBus          => edi_r,
 
     | 
  
  
    | 
      1044
     | 
    
      --      o_DBus          => edo_arm(CORE_GPIO_MODULE),
 
     | 
  
  
    | 
      1045
     | 
    
      --      i_wr_en         => wr_r,
 
     | 
  
  
    | 
      1046
     | 
    
      --      i_rd_en         => rd_r,
 
     | 
  
  
    | 
      1047
     | 
    
      --      i_cs            => arm_cs5_r(CORE_GPIO_MODULE),
 
     | 
  
  
    | 
      1048
     | 
    
      --      o_irq           => irq_map(CORE_GPIO_IRQ_LEVEL)(CORE_GPIO_IRQ_VECTOR),
 
     | 
  
  
    | 
      1049
     | 
    
      --      i_ilevel        => conv_std_logic_vector(CORE_GPIO_IRQ_LEVEL, 2),     
 
     | 
  
  
    | 
      1050
     | 
    
      --      i_ivector       => conv_std_logic_vector(CORE_GPIO_IRQ_VECTOR, 4),   
 
     | 
  
  
    | 
      1051
     | 
    
      --      i_io            => "00",
 
     | 
  
  
    | 
      1052
     | 
    
      --      t_io            => open,
 
     | 
  
  
    | 
      1053
     | 
    
      --      o_io            => o_diode,
 
     | 
  
  
    | 
      1054
     | 
    
      --      i_initdir       => "11",
 
     | 
  
  
    | 
      1055
     | 
    
      --      i_initoutval    => "11"	   
 
     | 
  
  
    | 
      1056
     | 
    
      --	 );
 
     | 
  
  
    | 
      1057
     | 
    
      --
 
     | 
  
  
    | 
      1058
     | 
    
      ----o_diode <= "11";
 
     | 
  
  
    | 
      1059
     | 
    
      --
 
     | 
  
  
    | 
      1060
     | 
    
      --end generate gen_camera;
 
     | 
  
  
    | 
      1061
     | 
    
      --
 
     | 
  
  
    | 
      1062
     | 
    
      --gen_no_camera : if CAMERA_CONFIG /= "RAW" generate
 
     | 
  
  
    | 
      1063
     | 
    
      --begin
 
     | 
  
  
    | 
      1064
     | 
    
      --
 
     | 
  
  
    | 
      1065
     | 
    
      --o_vp_clkin(0)   <= 'Z';
 
     | 
  
  
    | 
      1066
     | 
    
      --o_vp_clkin(1)   <= 'Z';
 
     | 
  
  
    | 
      1067
     | 
    
      --o_vp_hsync    <= 'Z';
 
     | 
  
  
    | 
      1068
     | 
    
      --o_vp_vsync    <= 'Z';
 
     | 
  
  
    | 
      1069
     | 
    
      --o_vp_field    <= 'Z';
 
     | 
  
  
    | 
      1070
     | 
    
      --o_vp_din      <= (others=>'Z');
 
     | 
  
  
    | 
      1071
     | 
    
      --o_diode       <= (others=>'Z');
 
     | 
  
  
    | 
      1072
     | 
    
      --o_pwm         <= (others=>'Z');
 
     | 
  
  
    | 
      1073
     | 
    
      --
 
     | 
  
  
    | 
      1074
     | 
    
      --end generate gen_no_camera;
 
     | 
  
  
    | 
      1075
     | 
    
      
 
     | 
  
  
    | 
      1076
     | 
    
      ------------------------------------------------------------------------------
 
     | 
  
  
    | 
      1077
     | 
    
      -- Base Port Assignments
 
     | 
  
  
    | 
      1078
     | 
    
      ------------------------------------------------------------------------------
 
     | 
  
  
    | 
      1079
     | 
    
      o_nmi_n <= '1';
 
     | 
  
  
    | 
      1080
     | 
    
      io_ema_d <= ema_d when t_ema_d = '0' else (others=>'Z');
 
     | 
  
  
    | 
      1081
     | 
    
      io_ema_wait_n <= ema_wait_n when t_ema_wait = '0' else (others=>'Z');
 
     | 
  
  
    | 
      1082
     | 
    
      
 
     | 
  
  
    | 
      1083
     | 
    
      end rtl;
 
     |