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/] [src_c/] [jtag/] [test_rtl/] [jtag_ram_test/] [src_verilog/] [lib/] [jtag_wb/] [jtag_system_en.v] - Blame information for rev 38

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 alirezamon
/**********************************************************************
2
**      File:  jtag_system_en.v
3
**
4
**
5
**      Copyright (C) 2014-2017  Alireza Monemi
6
**
7
**      This file is part of ProNoC
8
**
9
**      ProNoC ( stands for Prototype Network-on-chip)  is free software:
10
**      you can redistribute it and/or modify it under the terms of the GNU
11
**      Lesser General Public License as published by the Free Software Foundation,
12
**      either version 2 of the License, or (at your option) any later version.
13
**
14
**      ProNoC is distributed in the hope that it will be useful, but WITHOUT
15
**      ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
**      or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
17
**      Public License for more details.
18
**
19
**      You should have received a copy of the GNU Lesser General Public
20
**      License along with ProNoC. If not, see <http:**www.gnu.org/licenses/>.
21
**
22
**
23
**      Description:
24
**      each system single core or many core must have one jtag_system_en module in order
25
**      to allow mmeory programming.
26
**      This module has two output ports which can be programed using jtag interface:
27
**      cpu_en: which can enable/disable the cpu cores. This port must be connected to all
28
**              cpus enable port in order tio deactiavte them during memory programming
29
**      system_reset: This pin must be ored by sytem global reset pin. The jtag memory
30
**              programmer will reset the system before and after perogramming the memories.
31
**
32
*******************************************************************/
33
 
34
 
35
// synthesis translate_off
36
`timescale 1ns / 1ps
37
// synthesis translate_on
38
 
39
 
40
module jtag_system_en (
41
        cpu_en,
42
        system_reset
43
 
44
);
45
        output cpu_en,  system_reset;
46
        wire [1 :       0] jtag_out;
47
 
48
        jtag_control_port #(
49
                .VJTAG_INDEX(127),
50
                .DW(2)
51
 
52
        )enable(
53
                .jtag_out(jtag_out)
54
        );
55
 
56
        assign system_reset=jtag_out[0];
57
        assign cpu_en=~jtag_out[1];
58
 
59
endmodule
60
 
61
 
62
 
63
module jtag_control_port #(
64
        parameter VJTAG_INDEX=127,
65
        parameter DW=2
66
 
67
)(
68
        jtag_out
69
);
70
 
71
 
72
        output [DW-1    :       0] jtag_out;
73
 
74
 
75
 
76
        //vjtag vjtag signals declaration
77
        wire    [2:0]  ir_out ,  ir_in;
78
        wire      tdo, tck,       tdi;
79
        wire      cdr ,cir,e1dr,e2dr,pdr,sdr,udr,uir;
80
 
81
 
82
        vjtag   #(
83
         .VJTAG_INDEX(VJTAG_INDEX)
84
        )
85
        vjtag_inst (
86
        .ir_out ( ir_out ),
87
        .tdo ( tdo ),
88
        .ir_in ( ir_in ),
89
        .tck ( tck ),
90
        .tdi ( tdi ),
91
        .virtual_state_cdr      ( cdr ),
92
        .virtual_state_cir      ( cir ),
93
        .virtual_state_e1dr     ( e1dr ),
94
        .virtual_state_e2dr     ( e2dr ),
95
        .virtual_state_pdr      ( pdr ),
96
        .virtual_state_sdr      ( sdr ),
97
        .virtual_state_udr      ( udr ),
98
        .virtual_state_uir      ( uir )
99
        );
100
 
101
 
102
        // IR states
103
 
104
 
105
 
106
        reg [2:0] ir;
107
        reg bypass_reg;
108
        reg [DW-1       :       0] shift_buffer,shift_buffer_next;
109
        reg cdr_delayed,sdr_delayed;
110
        reg [DW-1       :       0] status,status_next;
111
 
112
        assign jtag_out = status ;
113
 /*
114
        always @(negedge tck)
115
        begin
116
                //  Delay the CDR signal by one half clock cycle
117
                cdr_delayed = cdr;
118
                sdr_delayed = sdr;
119
        end
120
        */
121
 
122
        assign ir_out = ir_in;  // Just pass the IR out
123
        assign tdo = (ir == 3'b000) ? bypass_reg : shift_buffer[0];
124
 
125
 
126
 
127
 
128
 
129
        always @(posedge tck )
130
        begin
131
                        if( uir ) ir <= ir_in; // Capture the instruction provided
132
                        bypass_reg <= tdi;
133
                        shift_buffer<=shift_buffer_next;
134
                        status<=status_next;
135
 
136
        end
137
 
138
generate
139
        if(DW==1)begin :DW1
140
                always @ (*)begin
141
                        shift_buffer_next=shift_buffer;
142
                        status_next = status;
143
                        if( sdr ) shift_buffer_next= tdi; //,shift_buffer[DW-1:1]};// shift buffer
144
                        if((ir == 3'b001) &  cdr ) shift_buffer_next  = status;
145
                        if((ir == 3'b001) &  udr ) status_next = shift_buffer;
146
                end
147
        end
148
        else begin :DWB
149
                always @ (*)begin
150
                        shift_buffer_next=shift_buffer;
151
                        status_next = status;
152
                        if( sdr ) shift_buffer_next= {tdi, shift_buffer[DW-1:1]};// shift buffer
153
                        if((ir == 3'b001) &  cdr ) shift_buffer_next  = status;
154
                        if((ir == 3'b001) &  udr ) status_next = shift_buffer;
155
                end
156
 
157
        end
158
endgenerate
159
 
160
 
161
endmodule
162
 
163
 

powered by: WebSVN 2.1.0

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