OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [rtl/] [src_peripheral/] [jtag/] [jtag_wb/] [jtag_source_probe.v] - Blame information for rev 48

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 alirezamon
 
2
/**********************************************************************
3
**      File:  jtag_source_probe.v
4
**
5
**
6
**      Copyright (C) 2014-2017  Alireza Monemi
7
**
8
**      This file is part of ProNoC
9
**
10
**      ProNoC ( stands for Prototype Network-on-chip)  is free software:
11
**      you can redistribute it and/or modify it under the terms of the GNU
12
**      Lesser General Public License as published by the Free Software Foundation,
13
**      either version 2 of the License, or (at your option) any later version.
14
**
15
**      ProNoC is distributed in the hope that it will be useful, but WITHOUT
16
**      ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17
**      or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
18
**      Public License for more details.
19
**
20
**      You should have received a copy of the GNU Lesser General Public
21
**      License along with ProNoC. If not, see <http:**www.gnu.org/licenses/>.
22
**
23
**
24
**      Description:
25
**      Jtag source probe which can be read/write using host PC
26
**      C-based software located in src_c/jtag
27
**              .
28
**
29
*******************************************************************/
30
 
31
// synthesis translate_off
32
`timescale 1ns / 1ps
33
// synthesis translate_on
34
 
35
module jtag_source_probe #(
36
        parameter VJTAG_INDEX=127,
37
         parameter Dw=2 //probe/probe width in bits     
38
 
39
)(
40
        source,
41
        probe
42
);
43
 
44
 
45
        input           [Dw-1   :0]  probe;
46
        output  reg [Dw-1       :0]  source;
47
 
48
 
49
 
50
        //vjtag vjtag signals declaration
51
        wire    [2:0]  ir_out ,  ir_in;
52
        wire      tdo, tck,       tdi;
53
        wire      cdr ,cir,e1dr,e2dr,pdr,sdr,udr,uir;
54
 
55
 
56
        vjtag   #(
57
         .VJTAG_INDEX(VJTAG_INDEX)
58
        )
59
        vjtag_inst (
60
        .ir_out ( ir_out ),
61
        .tdo ( tdo ),
62
        .ir_in ( ir_in ),
63
        .tck ( tck ),
64
        .tdi ( tdi ),
65
        .virtual_state_cdr      ( cdr ),
66
        .virtual_state_cir      ( cir ),
67
        .virtual_state_e1dr     ( e1dr ),
68
        .virtual_state_e2dr     ( e2dr ),
69
        .virtual_state_pdr      ( pdr ),
70
        .virtual_state_sdr      ( sdr ),
71
        .virtual_state_udr      ( udr ),
72
        .virtual_state_uir      ( uir )
73
        );
74
 
75
 
76
        // IR states
77
 
78
 
79
 
80
        reg [2:0] ir;
81
        reg bypass_reg;
82
        reg [Dw-1       :       0] shift_buffer,shift_buffer_next;
83
        reg cdr_delayed,sdr_delayed;
84
        reg [Dw-1       :       0] source_next;//,status_next;
85
 
86
        localparam BYPAS_ST= 3'b000,
87
                                  SOURCE_ST=3'b001,
88
                                  PROBE_ST =3'b010;
89
 
90
 
91
 
92
        assign ir_out = ir_in;  // Just pass the IR out
93
        assign tdo = (ir == BYPAS_ST) ? bypass_reg : shift_buffer[0];
94
 
95
 
96
 
97
 
98
 
99
        always @(posedge tck )
100
        begin
101
                        if( uir ) ir <= ir_in; // Capture the instruction provided
102
                        bypass_reg <= tdi;
103
                        shift_buffer<=shift_buffer_next;
104
                        source<=source_next;
105
 
106
        end
107
 
108
generate
109
        if(Dw==1)begin :DW1
110
                always @ (*)begin
111
                        shift_buffer_next=shift_buffer;
112
                        source_next = source;
113
                        if( sdr ) shift_buffer_next= tdi; //,shift_buffer[DW-1:1]};// shift buffer
114
                        case(ir)
115
                        SOURCE_ST:begin
116
                                if (cdr ) shift_buffer_next  = source;
117
                                if (udr ) source_next = shift_buffer;
118
                        end
119
                        PROBE_ST:begin
120
                                if (cdr ) shift_buffer_next  = probe;
121
                        end
122
                        default begin
123
                                shift_buffer_next=shift_buffer;
124
                                source_next = source;
125
                        end
126
                        endcase
127
 
128
                end
129
        end
130
        else begin :DWB
131
                always @ (*)begin
132
                        shift_buffer_next=shift_buffer;
133
                        source_next = source;
134
                        if( sdr ) shift_buffer_next= {tdi, shift_buffer[Dw-1:1]};// shift buffer
135
                        case(ir)
136
                        SOURCE_ST:begin
137
                                if (cdr ) shift_buffer_next  = source;
138
                                if (udr ) source_next = shift_buffer ;
139
                        end
140
                        PROBE_ST:begin
141
                                if (cdr ) shift_buffer_next  = probe;
142
                        end
143
                        default begin
144
                                shift_buffer_next=shift_buffer;
145
                                source_next = source;
146
                        end
147
                        endcase
148
                end
149
 
150
        end
151
endgenerate
152
 
153
 
154
endmodule
155
 

powered by: WebSVN 2.1.0

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