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_processor/] [new_lm32/] [rtl/] [jtag_cores.v] - Blame information for rev 48

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 alirezamon
/*
2
 * LatticeMico32
3
 * JTAG Registers
4
 *
5
 * Copyright (C) 2010 Michael Walle
6
 * All rights reserved.
7
 *
8
 * Redistribution and use in source and binary forms, with or without
9
 * modification, are permitted provided that the following conditions
10
 * are met:
11
 * 1. Redistributions of source code must retain the above copyright
12
 *    notice, this list of conditions and the following disclaimer.
13
 * 2. Redistributions in binary form must reproduce the above copyright
14
 *    notice, this list of conditions and the following disclaimer in the
15
 *    documentation and/or other materials provided with the distribution.
16
 * 3. The name of the author may not be used to endorse or promote products
17
 *    derived from this software without specific prior written permission.
18
 *
19
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
 
31
module jtag_cores (
32
    input [7:0] reg_d,
33
    input [2:0] reg_addr_d,
34
    output reg_update,
35
    output [7:0] reg_q,
36
    output [2:0] reg_addr_q,
37
    output jtck,
38
    output jrstn
39
);
40
 
41
wire tck;
42
wire tdi;
43
wire tdo;
44
wire shift;
45
wire update;
46
wire reset;
47
 
48
jtag_tap jtag_tap (
49
        .tck(tck),
50
        .tdi(tdi),
51
        .tdo(tdo),
52
        .shift(shift),
53
        .update(update),
54
        .reset(reset)
55
);
56
 
57
reg [10:0] jtag_shift;
58
reg [10:0] jtag_latched;
59
 
60
always @(posedge tck or posedge reset)
61
begin
62
        if(reset)
63
                jtag_shift <= 11'b0;
64
        else begin
65
                if(shift)
66
                        jtag_shift <= {tdi, jtag_shift[10:1]};
67
                else
68
                        jtag_shift <= {reg_d, reg_addr_d};
69
        end
70
end
71
 
72
assign tdo = jtag_shift[0];
73
 
74
always @(posedge reg_update or posedge reset)
75
begin
76
        if(reset)
77
                jtag_latched <= 11'b0;
78
        else
79
                jtag_latched <= jtag_shift;
80
end
81
 
82
assign reg_update = update;
83
assign reg_q = jtag_latched[10:3];
84
assign reg_addr_q = jtag_latched[2:0];
85
assign jtck = tck;
86
assign jrstn = ~reset;
87
 
88
endmodule

powered by: WebSVN 2.1.0

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