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

Subversion Repositories adv_debug_sys

[/] [adv_debug_sys/] [trunk/] [Hardware/] [altera_virtual_jtag/] [rtl/] [vhdl/] [altera_virtual_jtag.vhd] - Blame information for rev 57

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 34 nyawn
----------------------------------------------------------------------
2
----                                                              ----
3
----  altera_virtual_jtag.vhd                                     ----
4
----                                                              ----
5
----                                                              ----
6
----                                                              ----
7
----  Author(s):                                                  ----
8
----       Nathan Yawn (nathan.yawn@opencores.org)                ----
9
----                                                              ----
10
----                                                              ----
11
----                                                              ----
12
---------------------------------------------------------------------
13
----                                                              ----
14
---- Copyright (C) 2008-2010 Authors                              ----
15
----                                                              ----
16
---- This source file may be used and distributed without         ----
17
---- restriction provided that this copyright statement is not    ----
18
---- removed from the file and that any derivative work contains  ----
19
---- the original copyright notice and the associated disclaimer. ----
20
----                                                              ----
21
---- This source file is free software; you can redistribute it   ----
22
---- and/or modify it under the terms of the GNU Lesser General   ----
23
---- Public License as published by the Free Software Foundation; ----
24
---- either version 2.1 of the License, or (at your option) any   ----
25
---- later version.                                               ----
26
----                                                              ----
27
---- This source is distributed in the hope that it will be       ----
28
---- useful, but WITHOUT ANY WARRANTY; without even the implied   ----
29
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ----
30
---- PURPOSE.  See the GNU Lesser General Public License for more ----
31
---- details.                                                     ----
32
----                                                              ----
33
---- You should have received a copy of the GNU Lesser General    ----
34
---- Public License along with this source; if not, download it   ----
35
---- from http://www.opencores.org/lgpl.shtml                     ----
36
----                                                              ----
37
----------------------------------------------------------------------
38
--                                                                  --
39
-- This file is a wrapper for the Altera Virtual JTAG device.       --
40
-- It is designed to take the place of a separate TAP               --
41
-- controller in Altera systems, to allow a user to access a CPU    --
42
-- debug module (such as that of the OR1200) through the FPGA's     --
43
-- dedicated JTAG / configuration port.                             --
44
--                                                                  --
45
----------------------------------------------------------------------
46 3 nyawn
 
47
LIBRARY ieee;
48
USE ieee.std_logic_1164.all;
49
 
50
LIBRARY altera_mf;
51
USE altera_mf.all;
52
 
53
ENTITY altera_virtual_jtag IS
54
        PORT
55
        (
56
                tck_o              : OUT STD_LOGIC;
57 34 nyawn
                debug_tdo_i        :  IN STD_LOGIC;
58 14 nyawn
                tdi_o              : OUT STD_LOGIC;
59 3 nyawn
                test_logic_reset_o : OUT STD_LOGIC;
60
                run_test_idle_o    : OUT STD_LOGIC;
61
                shift_dr_o         : OUT STD_LOGIC;
62
                capture_dr_o       : OUT STD_LOGIC;
63
                pause_dr_o         : OUT STD_LOGIC;
64
                update_dr_o        : OUT STD_LOGIC;
65
                debug_select_o     : OUT STD_LOGIC
66
        );
67
END altera_virtual_jtag;
68
 
69
 
70
ARCHITECTURE OC OF altera_virtual_jtag IS
71
 
72
        CONSTANT CMD_DEBUG : STD_LOGIC_VECTOR (3 downto 0) := "1000";
73
 
74
        SIGNAL ir_value : STD_LOGIC_VECTOR (3 DOWNTO 0);
75
        SIGNAL exit1_dr : STD_LOGIC;
76
        SIGNAL exit2_dr : STD_LOGIC;
77
        SIGNAL capture_ir       : STD_LOGIC;
78
        SIGNAL update_ir        : STD_LOGIC;
79
 
80
        COMPONENT sld_virtual_jtag
81
        GENERIC (
82
                sld_auto_instance_index : STRING;
83
                sld_instance_index      : NATURAL;
84
                sld_ir_width            : NATURAL;
85
                sld_sim_action          : STRING;
86
                sld_sim_n_scan          : NATURAL;
87
                sld_sim_total_length    : NATURAL;
88
                lpm_type                : STRING
89
        );
90
        PORT (
91
                        tdi     : OUT STD_LOGIC ;
92
                        jtag_state_rti  : OUT STD_LOGIC ;
93
                        jtag_state_e1dr : OUT STD_LOGIC ;
94
                        jtag_state_e2dr : OUT STD_LOGIC ;
95
                        tms     : OUT STD_LOGIC ;
96
                        jtag_state_pir  : OUT STD_LOGIC ;
97
                        jtag_state_tlr  : OUT STD_LOGIC ;
98
                        tck     : OUT STD_LOGIC ;
99
                        jtag_state_sir  : OUT STD_LOGIC ;
100
                        ir_in   : OUT STD_LOGIC_VECTOR (3 DOWNTO 0);
101
                        virtual_state_cir       : OUT STD_LOGIC ;
102
                        virtual_state_pdr       : OUT STD_LOGIC ;
103
                        ir_out  : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
104
                        virtual_state_uir       : OUT STD_LOGIC ;
105
                        jtag_state_cir  : OUT STD_LOGIC ;
106
                        jtag_state_uir  : OUT STD_LOGIC ;
107
                        jtag_state_pdr  : OUT STD_LOGIC ;
108
                        tdo     : IN STD_LOGIC ;
109
                        jtag_state_sdrs : OUT STD_LOGIC ;
110
                        virtual_state_sdr       : OUT STD_LOGIC ;
111
                        virtual_state_cdr       : OUT STD_LOGIC ;
112
                        jtag_state_sdr  : OUT STD_LOGIC ;
113
                        jtag_state_cdr  : OUT STD_LOGIC ;
114
                        virtual_state_udr       : OUT STD_LOGIC ;
115
                        jtag_state_udr  : OUT STD_LOGIC ;
116
                        jtag_state_sirs : OUT STD_LOGIC ;
117
                        jtag_state_e1ir : OUT STD_LOGIC ;
118
                        jtag_state_e2ir : OUT STD_LOGIC ;
119
                        virtual_state_e1dr      : OUT STD_LOGIC ;
120
                        virtual_state_e2dr      : OUT STD_LOGIC
121
        );
122
        END COMPONENT;
123
 
124
BEGIN
125
 
126
 
127
 
128
        sld_virtual_jtag_component : sld_virtual_jtag
129
        GENERIC MAP (
130
                sld_auto_instance_index => "YES",
131
                sld_instance_index => 0,
132
                sld_ir_width => 4,
133
                sld_sim_action => "",
134
                sld_sim_n_scan => 0,
135
                sld_sim_total_length => 0,
136
                lpm_type => "sld_virtual_jtag"
137
        )
138
        PORT MAP (
139
                ir_out => ir_value,
140 34 nyawn
                tdo => debug_tdo_i,
141 14 nyawn
                tdi => tdi_o,
142 3 nyawn
                jtag_state_rti => run_test_idle_o,
143
                tck => tck_o,
144
                ir_in => ir_value,
145
                jtag_state_tlr => test_logic_reset_o,
146
                virtual_state_cir => capture_ir,
147
                virtual_state_pdr => pause_dr_o,
148
                virtual_state_uir => update_ir,
149
                virtual_state_sdr => shift_dr_o,
150
                virtual_state_cdr => capture_dr_o,
151
                virtual_state_udr => update_dr_o,
152
                virtual_state_e1dr => exit1_dr,
153
                virtual_state_e2dr => exit2_dr
154
        );
155
 
156
        debug_select_o <= '1' when (ir_value = CMD_DEBUG) else '0';
157
 
158
END OC;

powered by: WebSVN 2.1.0

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