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

Subversion Repositories bustap-jtag

[/] [bustap-jtag/] [trunk/] [rtl/] [xilinx/] [chipscope_vio_adda_fifo.v] - Blame information for rev 18

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 18 ash_riple
//**************************************************************
2
// Module             : chipscope_vio_adda_fifo.v
3
// Platform           : Ubuntu addr_width.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        : addr/data capture output to debug host
13
//                      via Virtual JTAG.
14
//**************************************************************
15
 
16
`timescale 1ns/1ns
17
 
18
module chipscope_vio_adda_fifo(clk,wr_in,data_in,rd_in,icon_ctrl);
19
 
20
parameter data_width  = 82,
21
          addr_width  = 10,
22
          al_full_val = 511;
23
 
24
input clk;
25
input wr_in, rd_in;
26
input [data_width-1:0] data_in;
27
inout [35:0] icon_ctrl;
28
 
29
wire [2-1:0] ctrl_vi;
30
wire [addr_width+data_width-1:0] usedw_data_vo;
31
 
32
reg rst_d1, rst_d2;
33
reg rd_d1 , rd_d2;
34
 
35
always @(posedge clk) begin
36
  rst_d1 <= ctrl_vi[1];
37
  rst_d2 <= rst_d1;
38
 
39
  rd_d1 <= ctrl_vi[0];
40
  rd_d2 <= rd_d1;
41
end
42
 
43
wire rst_vi = rst_d1 & !rst_d2;
44
wire rd_vi  = rd_d1  & !rd_d2;
45
 
46
wire reset = rst_vi;
47
wire [addr_width-1:0] usedw;
48
wire [data_width-1:0] data_out;
49
wire al_full = (usedw==al_full_val)? 1'b1: 1'b0;
50
wire wr_en = wr_in & !al_full;
51
wire rd_en = rd_in | rd_vi;
52
 
53
assign usedw_data_vo = {usedw, data_out};
54
 
55
scfifo jtag_fifo(
56
  .clk(clk),
57
  .rst(reset),
58
  .din(data_in),
59
  .wr_en(wr_en),
60
  .rd_en(rd_en),
61
  .dout(data_out),
62
  .full(),
63
  .empty(),
64
  .data_count(usedw)
65
);
66
 
67
chipscope_vio_fifo VIO_inst (
68
  .CONTROL(icon_ctrl), // INOUT BUS [35:0]
69
  .CLK(clk), // IN
70
  .SYNC_OUT(ctrl_vi), // OUT BUS [1:0]
71
  .SYNC_IN(usedw_data_vo) // IN BUS [91:0]
72
);
73
 
74
endmodule

powered by: WebSVN 2.1.0

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