OpenCores
URL https://opencores.org/ocsvn/yac/yac/trunk

Subversion Repositories yac

[/] [yac/] [trunk/] [test_sys/] [rtl/] [vhdl/] [test_sys_top.vhd] - Blame information for rev 10

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 10 feddischso
library IEEE;
2
use IEEE.STD_LOGIC_1164.ALL;
3
Library UNISIM;
4
use UNISIM.vcomponents.all;
5
 
6
entity test_sys_top is
7
    Port ( CLK_50M   : in  STD_LOGIC;
8
           BTN_NORTH : in  STD_LOGIC;
9
           BTN_EAST  : in  STD_LOGIC;
10
           BTN_SOUTH : in  STD_LOGIC;
11
           BTN_WEST  : in  STD_LOGIC;
12
           SW        : in  STD_LOGIC_VECTOR( 4-1 downto 0 );
13
           LED       : out STD_LOGIC_VECTOR( 8-1 downto 0 );
14
           RS232_DCE_RXD  : in STD_LOGIC;
15
           RS232_DCE_TXD  : out STD_LOGIC
16
           );
17
end test_sys_top;
18
 
19
architecture Behavioral of test_sys_top is
20
 
21
constant VPI_TAP : boolean := false;
22
 
23
 
24
component dbg_comm_vpi is
25
   Port(
26
      SYS_CLK    : out STD_LOGIC;
27
      SYS_RST    : out STD_LOGIC;
28
      P_TMS      : out STD_LOGIC;
29
      P_TCK      : out STD_LOGIC;
30
      P_TRST     : out STD_LOGIC;
31
      P_TDI      : out STD_LOGIC;
32
      P_TDO      : in  STD_LOGIC
33
      );
34
end component;
35
signal P_TMS      : STD_LOGIC;
36
signal P_TCK      : STD_LOGIC;
37
signal P_TRST     : STD_LOGIC;
38
signal P_TDI      : STD_LOGIC;
39
signal P_TDO      : STD_LOGIC;
40
 
41
 
42
 
43
component yac_test_soc is
44
port(
45
clk_i :  in  std_logic ;
46
rst_i :  in  std_logic ;
47
tck_i :  in  std_logic ;
48
tdi_i :  in  std_logic ;
49
tdo_o :  out  std_logic ;
50
debug_rst_i :  in  std_logic ;
51
shift_dr_i :  in  std_logic ;
52
pause_dr_i :  in  std_logic ;
53
update_dr_i :  in  std_logic ;
54
capture_dr_i :  in  std_logic ;
55
debug_select_i :  in  std_logic;
56
stx_pad_o :  out  std_logic ;
57
srx_pad_i :  in  std_logic ;
58
rts_pad_o :  out  std_logic ;
59
cts_pad_i :  in  std_logic ;
60
dtr_pad_o :  out  std_logic ;
61
dsr_pad_i :  in  std_logic ;
62
ri_pad_i :  in  std_logic ;
63
dcd_pad_i :  in  std_logic
64
 );
65
end component yac_test_soc;
66
 
67
component tap_top is
68
 port (
69
 
70
   -- JTAG pads
71
   signal tms_pad_i                 :  in std_logic;
72
   signal tck_pad_i                 :  in std_logic;
73
   signal trstn_pad_i               :  in std_logic;
74
   signal tdi_pad_i                 :  in std_logic;
75
   signal tdo_pad_o                 :  out std_logic;
76
   signal tdo_padoe_o               :  out std_logic;
77
 
78
   -- TAP states
79
   signal test_logic_reset_o        :  out std_logic;
80
   signal run_test_idle_o           :  out std_logic;
81
   signal shift_dr_o                :  out std_logic;
82
   signal pause_dr_o                :  out std_logic;
83
   signal update_dr_o               :  out std_logic;
84
   signal capture_dr_o              :  out std_logic;
85
 
86
   -- Select signals for boundary scan or mbist
87
   signal extest_select_o           : out std_logic;
88
   signal sample_preload_select_o   : out std_logic;
89
   signal mbist_select_o            : out std_logic;
90
   signal debug_select_o            : out std_logic;
91
 
92
   -- TDO signal that is connected to TDI of sub-modules.
93
   signal tdi_o                     : out std_logic;
94
 
95
   -- TDI signals from sub-modules
96
   signal debug_tdo_i               : in std_logic;     -- from debug module
97
   signal bs_chain_tdo_i            : in std_logic;  -- from Boundary Scan Chain
98
   signal mbist_tdo_i               : in std_logic      -- from Mbist Chain
99
);
100
end component;
101
 
102
component xilinx_internal_jtag is
103
port(
104
   signal tck_o                  : out std_logic;
105
   signal debug_tdo_i            : in  std_logic;
106
   signal tdi_o                  : out std_logic;
107
   signal test_logic_reset_o     : out std_logic;
108
   signal run_test_idle_o        : out std_logic;
109
   signal shift_dr_o             : out std_logic;
110
   signal capture_dr_o           : out std_logic;
111
   signal pause_dr_o             : out std_logic;
112
   signal update_dr_o            : out std_logic;
113
   signal debug_select_o         : out std_logic
114
);
115
end component;
116
 
117
 
118
 
119
signal clk_i :  std_logic ;
120
signal rst_i :  std_logic ;
121
signal n_rst_i :  std_logic ;
122
signal tck_i :  std_logic ;
123
signal tdi_i :  std_logic ;
124
signal tdo_o :  std_logic ;
125
signal shift_dr_i :  std_logic ;
126
signal pause_dr_i :  std_logic ;
127
signal update_dr_i :  std_logic ;
128
signal capture_dr_i :  std_logic ;
129
signal debug_select_i :  std_logic ;
130
signal debug_rst_i  :  std_logic ;
131
signal stx_pad_o :    std_logic ;
132
signal srx_pad_i :   std_logic ;
133
signal rts_pad_o :    std_logic ;
134
signal cts_pad_i :   std_logic ;
135
signal dtr_pad_o :    std_logic ;
136
signal dsr_pad_i :   std_logic ;
137
signal ri_pad_i :  std_logic ;
138
signal dcd_pad_i :   std_logic ;
139
signal gnd : std_logic;
140
 
141
 
142
signal VPI_CLK       : std_logic;
143
 
144
begin
145
 
146
gnd <= '0';
147
srx_pad_i <= RS232_DCE_RXD;
148
RS232_DCE_TXD <= stx_pad_o;
149
cts_pad_i <= '0';
150
dsr_pad_i <= '0';
151
dcd_pad_i <= '0';
152
ri_pad_i  <= '0';
153
 
154
 
155
-- led_p : process( clk_i )
156
-- begin
157
--   if clk_i'event and clk_i='1' then
158
--     LED <= SW & BTN_NORTH & BTN_EAST & BTN_SOUTH & BTN_WEST;
159
--   end if;
160
-- end process;
161
 
162
--LED <= SW & BTN_NORTH & BTN_EAST & BTN_SOUTH & BTN_WEST;
163
LED <= "10101100";
164
 
165
 
166
 
167
 
168
 
169
--
170
-- Simulation Part:
171
-- The VPI and Standard JTAG TAP is used
172
--
173
VPI_SEL : if  VPI_TAP = true generate
174
 
175
 
176
-- clk_i    <= CLK_50M;
177
rst_i    <= BTN_SOUTH;
178
n_rst_i  <= not rst_i;
179
 
180
--
181
-- Debug VPI
182
--
183
vpi : dbg_comm_vpi
184
   port map(
185
     SYS_CLK  => clk_i,
186
     P_TMS    => P_TMS  ,
187
     P_TCK    => P_TCK  ,
188
     P_TRST   => P_TRST ,
189
     P_TDI    => P_TDI  ,
190
     P_TDO    => P_TDO );
191
 
192
--
193
-- Standard JTAG TAP
194
--
195
tap_inst : tap_top
196
 port map(
197
 
198
   -- JTAG pads: this 6 signals simulates
199
   -- the physical connection to the tap
200
   tms_pad_i                 =>  P_TMS,
201
   tck_pad_i                 =>  P_TCK,
202
   trstn_pad_i               =>  n_rst_i,
203
   tdi_pad_i                 =>  P_TDI,
204
   tdo_pad_o                 =>  P_TDO,
205
   tdo_padoe_o               =>  open,
206
 
207
   -- TAP states
208
   test_logic_reset_o        =>  debug_rst_i,
209
   run_test_idle_o           =>  open,
210
   shift_dr_o                =>  shift_dr_i,
211
   pause_dr_o                =>  pause_dr_i,
212
   update_dr_o               =>  update_dr_i,
213
   capture_dr_o              =>  capture_dr_i,
214
 
215
   -- Select signals for boundary scan or mbist
216
   extest_select_o           =>  open,
217
   sample_preload_select_o   =>  open,
218
   mbist_select_o            =>  open,
219
   debug_select_o            =>  debug_select_i,
220
 
221
   -- TDO signal that is connected to TDI of sub-modules.
222
   tdi_o                     =>  tdi_i,
223
 
224
   -- TDI signals from sub-modules
225
   debug_tdo_i               =>  tdo_o,
226
   bs_chain_tdo_i            =>  gnd,
227
   mbist_tdo_i               =>  gnd
228
);
229
 
230
tck_i <= P_TCK;
231
 
232
 
233
 
234
end generate VPI_SEL;
235
 
236
--
237
-- Synthesis Part:
238
-- The FPGA internal Xilinx TAP is used
239
--
240
NO_VPI_SEL : if  VPI_TAP  = false generate
241
 
242
   clk_i    <= CLK_50M;
243
   rst_i    <= BTN_SOUTH;
244
   n_rst_i  <= not rst_i;
245
 
246
   tap_inst_xilinx : xilinx_internal_jtag
247
   port map(
248
      tck_o                => tck_i,
249
      debug_tdo_i          => tdo_o,
250
      tdi_o                => tdi_i,
251
      test_logic_reset_o   => debug_rst_i,
252
      run_test_idle_o      => open,
253
      shift_dr_o           => shift_dr_i,
254
      capture_dr_o         => capture_dr_i,
255
      pause_dr_o           => pause_dr_i,
256
      update_dr_o          => update_dr_i,
257
      debug_select_o       => debug_select_i
258
   );
259
 
260
end generate NO_VPI_SEL;
261
 
262
 
263
--
264
-- The SOC instance
265
--
266
top : yac_test_soc
267
port map(
268
clk_i          => clk_i         ,
269
rst_i          => rst_i         ,
270
tck_i          => tck_i         ,
271
tdi_i          => tdi_i         ,
272
tdo_o          => tdo_o         ,
273
debug_rst_i    => debug_rst_i     ,
274
shift_dr_i     => shift_dr_i    ,
275
pause_dr_i     => pause_dr_i    ,
276
update_dr_i    => update_dr_i   ,
277
capture_dr_i   => capture_dr_i  ,
278
debug_select_i => debug_select_i ,
279
stx_pad_o   => stx_pad_o  ,
280
srx_pad_i   => srx_pad_i ,
281
rts_pad_o   => rts_pad_o ,
282
cts_pad_i   => cts_pad_i ,
283
dtr_pad_o   => dtr_pad_o ,
284
dsr_pad_i   => dsr_pad_i ,
285
ri_pad_i    => ri_pad_i  ,
286
dcd_pad_i   => dcd_pad_i
287
);
288
 
289
 
290
end Behavioral;
291
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.