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

Subversion Repositories adv_debug_sys

[/] [adv_debug_sys/] [tags/] [ADS_RELEASE_1_0_0/] [Hardware/] [altera_virtual_jtag/] [rtl/] [vhdl/] [altera_virtual_jtag.vhd] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 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) 2003-2008 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
//
47
// CVS Revision History
48
//
49
// $Log: altera_virtual_jtag.vhd,v $
50
// Revision 1.2  2009/05/17 20:54:47  Nathan
51
// Changed email address to opencores.org
52
//
53
// Revision 1.1  2008/07/18 20:09:31  Nathan
54
// Changed directory structure to match existing projects.
55
//
56
// Revision 1.2  2008/05/22 19:55:20  Nathan
57
// Added added copyright, CVS log, and brief description.
58
//
59
 
60
 
61
LIBRARY ieee;
62
USE ieee.std_logic_1164.all;
63
 
64
LIBRARY altera_mf;
65
USE altera_mf.all;
66
 
67
ENTITY altera_virtual_jtag IS
68
        PORT
69
        (
70
                tck_o              : OUT STD_LOGIC;
71
                debug_tdi_i        :  IN STD_LOGIC;
72
                tdo_o              : OUT STD_LOGIC;
73
                test_logic_reset_o : OUT STD_LOGIC;
74
                run_test_idle_o    : OUT STD_LOGIC;
75
                shift_dr_o         : OUT STD_LOGIC;
76
                capture_dr_o       : OUT STD_LOGIC;
77
                pause_dr_o         : OUT STD_LOGIC;
78
                update_dr_o        : OUT STD_LOGIC;
79
                debug_select_o     : OUT STD_LOGIC
80
        );
81
END altera_virtual_jtag;
82
 
83
 
84
ARCHITECTURE OC OF altera_virtual_jtag IS
85
 
86
        CONSTANT CMD_DEBUG : STD_LOGIC_VECTOR (3 downto 0) := "1000";
87
 
88
        SIGNAL ir_value : STD_LOGIC_VECTOR (3 DOWNTO 0);
89
        SIGNAL exit1_dr : STD_LOGIC;
90
        SIGNAL exit2_dr : STD_LOGIC;
91
        SIGNAL capture_ir       : STD_LOGIC;
92
        SIGNAL update_ir        : STD_LOGIC;
93
 
94
        COMPONENT sld_virtual_jtag
95
        GENERIC (
96
                sld_auto_instance_index : STRING;
97
                sld_instance_index      : NATURAL;
98
                sld_ir_width            : NATURAL;
99
                sld_sim_action          : STRING;
100
                sld_sim_n_scan          : NATURAL;
101
                sld_sim_total_length    : NATURAL;
102
                lpm_type                : STRING
103
        );
104
        PORT (
105
                        tdi     : OUT STD_LOGIC ;
106
                        jtag_state_rti  : OUT STD_LOGIC ;
107
                        jtag_state_e1dr : OUT STD_LOGIC ;
108
                        jtag_state_e2dr : OUT STD_LOGIC ;
109
                        tms     : OUT STD_LOGIC ;
110
                        jtag_state_pir  : OUT STD_LOGIC ;
111
                        jtag_state_tlr  : OUT STD_LOGIC ;
112
                        tck     : OUT STD_LOGIC ;
113
                        jtag_state_sir  : OUT STD_LOGIC ;
114
                        ir_in   : OUT STD_LOGIC_VECTOR (3 DOWNTO 0);
115
                        virtual_state_cir       : OUT STD_LOGIC ;
116
                        virtual_state_pdr       : OUT STD_LOGIC ;
117
                        ir_out  : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
118
                        virtual_state_uir       : OUT STD_LOGIC ;
119
                        jtag_state_cir  : OUT STD_LOGIC ;
120
                        jtag_state_uir  : OUT STD_LOGIC ;
121
                        jtag_state_pdr  : OUT STD_LOGIC ;
122
                        tdo     : IN STD_LOGIC ;
123
                        jtag_state_sdrs : OUT STD_LOGIC ;
124
                        virtual_state_sdr       : OUT STD_LOGIC ;
125
                        virtual_state_cdr       : OUT STD_LOGIC ;
126
                        jtag_state_sdr  : OUT STD_LOGIC ;
127
                        jtag_state_cdr  : OUT STD_LOGIC ;
128
                        virtual_state_udr       : OUT STD_LOGIC ;
129
                        jtag_state_udr  : OUT STD_LOGIC ;
130
                        jtag_state_sirs : OUT STD_LOGIC ;
131
                        jtag_state_e1ir : OUT STD_LOGIC ;
132
                        jtag_state_e2ir : OUT STD_LOGIC ;
133
                        virtual_state_e1dr      : OUT STD_LOGIC ;
134
                        virtual_state_e2dr      : OUT STD_LOGIC
135
        );
136
        END COMPONENT;
137
 
138
BEGIN
139
 
140
 
141
 
142
        sld_virtual_jtag_component : sld_virtual_jtag
143
        GENERIC MAP (
144
                sld_auto_instance_index => "YES",
145
                sld_instance_index => 0,
146
                sld_ir_width => 4,
147
                sld_sim_action => "",
148
                sld_sim_n_scan => 0,
149
                sld_sim_total_length => 0,
150
                lpm_type => "sld_virtual_jtag"
151
        )
152
        PORT MAP (
153
                ir_out => ir_value,
154
                tdo => debug_tdi_i,
155
                tdi => tdo_o,
156
                jtag_state_rti => run_test_idle_o,
157
                tck => tck_o,
158
                ir_in => ir_value,
159
                jtag_state_tlr => test_logic_reset_o,
160
                virtual_state_cir => capture_ir,
161
                virtual_state_pdr => pause_dr_o,
162
                virtual_state_uir => update_ir,
163
                virtual_state_sdr => shift_dr_o,
164
                virtual_state_cdr => capture_dr_o,
165
                virtual_state_udr => update_dr_o,
166
                virtual_state_e1dr => exit1_dr,
167
                virtual_state_e2dr => exit2_dr
168
        );
169
 
170
        debug_select_o <= '1' when (ir_value = CMD_DEBUG) else '0';
171
 
172
END OC;

powered by: WebSVN 2.1.0

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