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.20
|
13
|
---
|
14
|
--- Revision History
|
15
|
--- 1.00 - Initial revision
|
16
|
--- 1.10 - REVISION TO AGREE WITH CUSTOM BOARD ANALOG1
|
17
|
--- 1.20 - REVISION FOLLOWING GREGORY GLUSZEK (CL) SUGGESTIONS about GPIOS.
|
18
|
|
19
|
library WORK;
|
20
|
library IEEE;
|
21
|
library UNISIM;
|
22
|
use IEEE.STD_LOGIC_1164.ALL;
|
23
|
use IEEE.STD_LOGIC_ARITH.ALL;
|
24
|
use IEEE.STD_LOGIC_UNSIGNED.ALL;
|
25
|
use UNISIM.VCOMPONENTS.ALL;
|
26
|
use WORK.MityDSP_L138_pkg.ALL;
|
27
|
|
28
|
entity PQMUIO_top is
|
29
|
generic ( BOARD_REV : string := "C"; -- "A", "B", or "C"
|
30
|
DECODE_BITS : integer range 1 to 9 := 9;
|
31
|
CAMERA_CONFIG : string := "NONE"; -- "RAW" - route camera I/O hack to RAW Video input interface
|
32
|
DISP_CONFIG : string := "LCD"; -- "LCD", "DVI" or "NONE"
|
33
|
LCD_TYPE : string := "SHARP" -- "SHARP" or "NEC"
|
34
|
);
|
35
|
port (
|
36
|
i_ema_clk : in std_logic; -- 100 MHz EMIF clock
|
37
|
|
38
|
-- DSP EMIFA BUS Interface
|
39
|
i_ema_cs0_n : in std_logic; -- RESERVED for SDRAM Controller
|
40
|
i_ema_cs2_n : in std_logic; -- ARM core CE space
|
41
|
i_ema_cs3_n : in std_logic; -- NAND FLASH space, not used
|
42
|
i_ema_cs4_n : in std_logic; -- DSP core CE space
|
43
|
i_ema_cs5_n : in std_logic; -- Reserved core space, not used
|
44
|
i_ema_oe_n : in std_logic;
|
45
|
i_ema_we_n : in std_logic;
|
46
|
io_ema_wait_n : inout std_logic_vector(1 downto 0);
|
47
|
io_ema_d : inout std_logic_vector(15 downto 0);
|
48
|
i_ema_a : in std_logic_vector(13 downto 0);
|
49
|
i_ema_ba : in std_logic_vector(1 downto 0);
|
50
|
i_ema_wen_dqm : in std_logic_vector(1 downto 0);
|
51
|
i_ema_cas : in std_logic; -- reserved for SDRAM controller, not used
|
52
|
i_ema_ras : in std_logic; -- reserved for SDRAM controller, not used
|
53
|
i_ema_sdcke : in std_logic; -- reserved for SDRAM controller, not used
|
54
|
i_ema_rnw : in std_logic; -- reserved for SDRAM controller, not used
|
55
|
|
56
|
-- DSP IRQ lines
|
57
|
o_nmi_n : out std_logic;
|
58
|
o_int : out std_logic_vector(1 downto 0);
|
59
|
|
60
|
-- dac cal&offset control signals
|
61
|
o_dac_cal_ctrl: out std_logic_vector(5 downto 0);
|
62
|
|
63
|
-- ext gpio control signals
|
64
|
o_ext_gpio: out std_logic_vector(1 downto 0);
|
65
|
|
66
|
-- ia write enable signals
|
67
|
o_ia_wr: out std_logic_vector(3 downto 0);
|
68
|
|
69
|
-- channel configuration control signals
|
70
|
o_chann_config: out std_logic_vector(2 downto 0);
|
71
|
|
72
|
-- FSPI_1 signals
|
73
|
o_fspi1_mosi: out std_logic;
|
74
|
i_fspi1_miso: in std_logic;
|
75
|
o_fspi1_clk: out std_logic;
|
76
|
o_fspi1_cs: out std_logic_vector (7 downto 0);
|
77
|
|
78
|
-- FSPI_2 signals
|
79
|
o_fspi2_mosi: out std_logic;
|
80
|
i_fspi2_miso: in std_logic;
|
81
|
o_fspi2_clk: out std_logic;
|
82
|
o_fspi2_cs: out std_logic_vector (7 downto 0);
|
83
|
|
84
|
-- sampling clock manager
|
85
|
i_from_out_conv: in std_logic;
|
86
|
o_to_in_conv: out std_logic
|
87
|
);
|
88
|
end PQMUIO_top;
|
89
|
|
90
|
architecture rtl of PQMUIO_top is
|
91
|
|
92
|
...
|
93
|
|
94
|
...
|
95
|
|
96
|
--NEW SIGNALS I ADDED
|
97
|
|
98
|
signal s_dac_cal_ctrl : std_logic_vector(5 downto 0);
|
99
|
signal s_ext_gpio : std_logic_vector(1 downto 0);
|
100
|
signal s_ia_wr : std_logic_vector(3 downto 0);
|
101
|
signal s_chann_config : std_logic_vector(2 downto 0);
|
102
|
|
103
|
begin -- architecture: rtl
|
104
|
|
105
|
-------------------------------------------------------------------------
|
106
|
-- DAC CALIBRATION CONTROL GPIO CORE
|
107
|
-------------------------------------------------------------------------
|
108
|
dac_cal_ctrl_inst: gpio
|
109
|
generic map(
|
110
|
NUM_BANKS => 1,
|
111
|
NUM_IO_PER_BANK =>6
|
112
|
)
|
113
|
|
114
|
port map(
|
115
|
clk => ema_clk,
|
116
|
i_ABus => addr_r,
|
117
|
i_DBus => edi_r,
|
118
|
o_DBus => edo_arm(CORE_DAC_CAL_CTRL_MODULE),
|
119
|
i_wr_en => wr_r,
|
120
|
i_rd_en => rd_r,
|
121
|
i_cs => arm_cs5_r(CORE_DAC_CAL_CTRL_MODULE),
|
122
|
o_irq => irq_map(CORE_DAC_CAL_CTRL_IRQ_LEVEL)(CORE_DAC_CAL_CTRL_IRQ_VECTOR),
|
123
|
i_ilevel => conv_std_logic_vector(CORE_DAC_CAL_CTRL_IRQ_LEVEL, 2),
|
124
|
i_ivector => conv_std_logic_vector(CORE_DAC_CAL_CTRL_IRQ_VECTOR, 4),
|
125
|
i_io => s_dac_cal_ctrl, -- GPIO read values. Loop back output values so they can be read from software.
|
126
|
t_io => open,-- Do not care about direction of GPIOs
|
127
|
o_io => s_dac_cal_ctrl,-- GPIO write value
|
128
|
i_initdir => "111111",
|
129
|
i_initoutval => "000000"
|
130
|
);
|
131
|
|
132
|
o_dac_cal_ctrl <= s_dac_cal_ctrl;
|
133
|
|
134
|
...
|
135
|
...
|
136
|
|
137
|
|
138
|
end rtl;
|