OpenCores
URL https://opencores.org/ocsvn/bustap-jtag/bustap-jtag/trunk

Subversion Repositories bustap-jtag

[/] [bustap-jtag/] [trunk/] [rtl/] [xilinx/] [pcores/] [bustap_jtag_v1_00_a/] [hdl/] [verilog/] [bustap_jtag.v] - Blame information for rev 20

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 18 ash_riple
//**************************************************************
2
// Module             : bustap_jtag.v
3
// Platform           : Ubuntu 10.04 
4
// Simulator          : Modelsim 6.5b
5
// Synthesizer        : PlanAhead 14.2
6
// Place and Route    : PlanAhead 14.2
7
// Targets device     : Zynq 7000
8
// Author             : Bibo Yang  (ash_riple@hotmail.com)
9
// Organization       : www.opencores.org
10
// Revision           : 2.3 
11
// Date               : 2012/11/19
12
// Description        : axi interface to pipelined access
13
//                      interface converter.
14
//                      @Note: AXI-Lite is supported.
15
//**************************************************************
16
 
17
`timescale 1ns/1ns
18
 
19
module bustap_jtag (
20
  // Global Signals
21
  ACLK,
22
  ARESETN,
23
 
24
  // Write Address Channel
25
  AWADDR,
26
  AWPROT,
27
  AWVALID,
28
  AWREADY,
29
 
30
  // Write Channel
31
  WDATA,
32
  WSTRB,
33
  WVALID,
34
  WREADY,
35
 
36
  // Write Response Channel
37
  BRESP,
38
  BVALID,
39
  BREADY,
40
 
41
  // Read Address Channel
42
  ARADDR,
43
  ARPROT,
44
  ARVALID,
45
  ARREADY,
46
 
47
  // Read Channel
48
  RDATA,
49
  RRESP,
50
  RVALID,
51
  RREADY,
52
 
53
  CHIPSCOPE_ICON_CONTROL0,
54
  CHIPSCOPE_ICON_CONTROL1,
55
  CHIPSCOPE_ICON_CONTROL2
56
);
57
 
58
  // Set C_DATA_WIDTH to the data-bus width required
59
  parameter C_DATA_WIDTH = 32;        // data bus width, default = 32-bit
60
  // Set C_ADDR_WIDTH to the address-bus width required
61
  parameter C_ADDR_WIDTH = 32;        // address bus width, default = 32-bit
62
 
63
  localparam DATA_MAX   = C_DATA_WIDTH-1;              // data max index
64
  localparam ADDR_MAX   = C_ADDR_WIDTH-1;              // address max index
65
  localparam STRB_WIDTH = C_DATA_WIDTH/8;              // WSTRB width
66
  localparam STRB_MAX   = STRB_WIDTH-1;              // WSTRB max index
67
 
68
  // - Global Signals
69
  input                ACLK;        // AXI Clock
70
  input                ARESETN;     // AXI Reset
71
 
72
  // - Write Address Channel
73
  input   [ADDR_MAX:0] AWADDR;  // M -> S
74
  input          [2:0] AWPROT;  // M -> S
75
  input                AWVALID;  // M -> S
76
  input                AWREADY;  // S -> M
77
 
78
  // - Write Data Channel
79
  input                WVALID;  // M -> S
80
  input                WREADY;  // S -> M
81
  input   [DATA_MAX:0] WDATA;  // M -> S
82
  input   [STRB_MAX:0] WSTRB;  // M -> S
83
 
84
  // - Write Response Channel
85
  input          [1:0] BRESP;  // S -> M
86
  input                BVALID;  // S -> M
87
  input                BREADY;  // M -> S
88
 
89
  // - Read Address Channel
90
  input   [ADDR_MAX:0] ARADDR;  // M -> S
91
  input          [2:0] ARPROT;  // M -> S
92
  input                ARVALID;  // M -> S
93
  input                ARREADY;  // S -> M
94
 
95
  // - Read Data Channel
96
  input   [DATA_MAX:0] RDATA;  // S -> M
97
  input          [1:0] RRESP;  // S -> M
98
  input                RVALID;  // S -> M
99
  input                RREADY;  // M -> S
100
 
101
  input [35:0] CHIPSCOPE_ICON_CONTROL0, CHIPSCOPE_ICON_CONTROL1, CHIPSCOPE_ICON_CONTROL2;
102
 
103
// latch address and data
104
reg [ADDR_MAX:0] addr_latch;
105
always @(posedge ACLK) begin
106
  if      (AWVALID && AWREADY)
107
    addr_latch <= AWADDR;
108
  else if (ARVALID && ARREADY)
109
    addr_latch <= ARADDR;
110
  else
111
    addr_latch <= addr_latch;
112
end
113
 
114
reg [DATA_MAX:0] data_latch;
115
always @(posedge ACLK) begin
116
  if      (WVALID && WREADY)
117
    data_latch <= WDATA;
118
  else if (RVALID && RREADY)
119
    data_latch <= RDATA;
120
  else
121
    data_latch <= data_latch;
122
end
123
 
124
// generate wr/rd pulse
125
reg wr_pulse;
126
always @(posedge ACLK or negedge ARESETN) begin
127
  if (!ARESETN)
128
    wr_pulse <= 1'b0;
129
  else if (WVALID && WREADY)
130
    wr_pulse <= 1'b1;
131
  else
132
    wr_pulse <= 1'b0;
133
end
134
 
135
reg rd_pulse;
136
always @(posedge ACLK or negedge ARESETN) begin
137
  if (!ARESETN)
138
    rd_pulse <= 1'b0;
139
  else if (RVALID && RREADY)
140
    rd_pulse <= 1'b1;
141
  else
142
    rd_pulse <= 1'b0;
143
end
144
 
145
// map to pipelined access interface
146
wire        clk     = ACLK;
147
wire        wr_en   = wr_pulse;
148
wire        rd_en   = rd_pulse;
149 20 ash_riple
wire [31:0] addr_in = addr_latch[31:0];
150 18 ash_riple
wire [31:0] data_in = data_latch;
151
 
152
up_monitor inst (
153
        .clk(clk),
154
        .wr_en(wr_en),
155
        .rd_en(rd_en),
156
        .addr_in(addr_in),
157
        .data_in(data_in),
158
        .icontrol0(CHIPSCOPE_ICON_CONTROL0),
159
        .icontrol1(CHIPSCOPE_ICON_CONTROL1),
160
        .icontrol2(CHIPSCOPE_ICON_CONTROL2)
161
);
162
 
163
endmodule

powered by: WebSVN 2.1.0

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