Line 43... |
Line 43... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.11 2001/11/14 10:10:41 mohor
|
|
// Wishbone data latched on wb_clk_i instead of risc_clk.
|
|
//
|
// Revision 1.10 2001/11/12 01:11:27 mohor
|
// Revision 1.10 2001/11/12 01:11:27 mohor
|
// Reset signals are not combined any more.
|
// Reset signals are not combined any more.
|
//
|
//
|
// Revision 1.9 2001/10/19 11:40:01 mohor
|
// Revision 1.9 2001/10/19 11:40:01 mohor
|
// dbg_timescale.v changed to timescale.v This is done for the simulation of
|
// dbg_timescale.v changed to timescale.v This is done for the simulation of
|
Line 87... |
Line 90... |
// Revision 1.1.1.1 2001/05/18 06:35:02 mohor
|
// Revision 1.1.1.1 2001/05/18 06:35:02 mohor
|
// Initial release
|
// Initial release
|
//
|
//
|
//
|
//
|
|
|
|
// synopsys translate_off
|
`include "timescale.v"
|
`include "timescale.v"
|
|
// synopsys translate_on
|
`include "dbg_defines.v"
|
`include "dbg_defines.v"
|
|
|
// Top module
|
// Top module
|
module dbg_top(
|
module dbg_top(
|
// JTAG pins
|
// JTAG pins
|
Line 160... |
Line 165... |
output wb_we_o;
|
output wb_we_o;
|
input wb_ack_i;
|
input wb_ack_i;
|
output wb_cab_o;
|
output wb_cab_o;
|
input wb_err_i;
|
input wb_err_i;
|
|
|
reg [31:0] wb_adr_o;
|
|
reg [31:0] wb_dat_o;
|
|
reg wb_we_o;
|
|
reg wb_cyc_o;
|
reg wb_cyc_o;
|
|
|
// TAP states
|
// TAP states
|
reg TestLogicReset;
|
reg TestLogicReset;
|
reg RunTestIdle;
|
reg RunTestIdle;
|
Line 634... |
Line 636... |
wire [72:0] RISC_Data;
|
wire [72:0] RISC_Data;
|
wire [45:0] Register_Data;
|
wire [45:0] Register_Data;
|
wire [72:0] WISHBONE_Data;
|
wire [72:0] WISHBONE_Data;
|
wire wb_Access_wbClk;
|
wire wb_Access_wbClk;
|
|
|
assign RISC_Data = {CalculatedCrcOut, RISC_DATAINLatch, 33'h0};
|
// assign RISC_Data = {CalculatedCrcOut, RISC_DATAINLatch, 33'h0};
|
assign Register_Data = {CalculatedCrcOut, RegisterReadLatch, 6'h0};
|
// assign Register_Data = {CalculatedCrcOut, RegisterReadLatch, 6'h0};
|
assign WISHBONE_Data = {CalculatedCrcOut, WBReadLatch, 32'h0, WBErrorLatch};
|
// assign WISHBONE_Data = {CalculatedCrcOut, WBReadLatch, 32'h0, WBErrorLatch};
|
|
|
|
wire select_crc_out;
|
|
assign select_crc_out = RegisterScanChain & JTAG_DR_IN[5] | // Calculated CRC is returned when read operation is
|
|
RiscDebugScanChain & JTAG_DR_IN[32] | // performed, else received crc is returned (loopback).
|
|
WishboneScanChain & JTAG_DR_IN[32] ;
|
|
|
|
wire [8:0] send_crc;
|
|
|
|
assign send_crc = select_crc_out? {9{JTAG_DR_IN[BitCounter-1]}} : // Calculated CRC is returned when read operation is
|
|
{1'b0, CalculatedCrcOut} ; // performed, else received crc is returned (loopback).
|
|
|
|
assign RISC_Data = {send_crc, RISC_DATAINLatch, 33'h0};
|
|
assign Register_Data = {send_crc, RegisterReadLatch, 6'h0};
|
|
assign WISHBONE_Data = {send_crc, WBReadLatch, 32'h0, WBErrorLatch};
|
|
|
|
|
`ifdef TRACE_ENABLED
|
`ifdef TRACE_ENABLED
|
assign Trace_Data = {CalculatedCrcOut, TraceChain};
|
assign Trace_Data = {CalculatedCrcOut, TraceChain};
|
`endif
|
`endif
|
Line 738... |
Line 754... |
ADDR[31:0] <=#Tp 32'h0;
|
ADDR[31:0] <=#Tp 32'h0;
|
DataOut[31:0] <=#Tp 32'h0;
|
DataOut[31:0] <=#Tp 32'h0;
|
RW <=#Tp 1'b0;
|
RW <=#Tp 1'b0;
|
RegAccessTck <=#Tp 1'b0;
|
RegAccessTck <=#Tp 1'b0;
|
RISCAccessTck <=#Tp 1'b0;
|
RISCAccessTck <=#Tp 1'b0;
|
wb_adr_o <=#Tp 32'h0;
|
|
wb_we_o <=#Tp 1'h0;
|
|
wb_dat_o <=#Tp 32'h0;
|
|
wb_AccessTck <=#Tp 1'h0;
|
wb_AccessTck <=#Tp 1'h0;
|
end
|
end
|
else
|
else
|
if(UpdateDR & DEBUGSelected & CrcMatch)
|
if(UpdateDR & DEBUGSelected & CrcMatch)
|
begin
|
begin
|
Line 764... |
Line 777... |
RISCAccessTck <=#Tp 1'b1;
|
RISCAccessTck <=#Tp 1'b1;
|
end
|
end
|
else
|
else
|
if(WishboneScanChain)
|
if(WishboneScanChain)
|
begin
|
begin
|
wb_adr_o <=#Tp JTAG_DR_IN[31:0]; // Latching address for WISHBONE slave access
|
ADDR <=#Tp JTAG_DR_IN[31:0]; // Latching address for WISHBONE slave access
|
wb_we_o <=#Tp JTAG_DR_IN[32]; // latch R/W bit
|
RW <=#Tp JTAG_DR_IN[32]; // latch R/W bit
|
wb_dat_o <=#Tp JTAG_DR_IN[64:33]; // latch data for write
|
DataOut <=#Tp JTAG_DR_IN[64:33]; // latch data for write
|
wb_AccessTck <=#Tp 1'b1; //
|
wb_AccessTck <=#Tp 1'b1; //
|
end
|
end
|
end
|
end
|
else
|
else
|
begin
|
begin
|
Line 778... |
Line 791... |
RISCAccessTck <=#Tp 1'b0;
|
RISCAccessTck <=#Tp 1'b0;
|
wb_AccessTck <=#Tp 1'b0;
|
wb_AccessTck <=#Tp 1'b0;
|
end
|
end
|
end
|
end
|
|
|
|
|
|
assign wb_adr_o = ADDR;
|
|
assign wb_we_o = RW;
|
|
assign wb_dat_o = DataOut;
|
assign wb_sel_o[3:0] = 4'hf;
|
assign wb_sel_o[3:0] = 4'hf;
|
assign wb_cab_o = 1'b0;
|
assign wb_cab_o = 1'b0;
|
|
|
|
|
// Synchronizing the RegAccess signal to risc_clk_i clock
|
// Synchronizing the RegAccess signal to risc_clk_i clock
|
Line 882... |
Line 899... |
if(wb_rst_i)
|
if(wb_rst_i)
|
WBErrorLatch<=#Tp 1'b0;
|
WBErrorLatch<=#Tp 1'b0;
|
else
|
else
|
if(wb_err_i)
|
if(wb_err_i)
|
WBErrorLatch<=#Tp 1'b1; // Latching wb_err_i while performing WISHBONE access
|
WBErrorLatch<=#Tp 1'b1; // Latching wb_err_i while performing WISHBONE access
|
|
else
|
if(wb_ack_i)
|
if(wb_ack_i)
|
WBErrorLatch<=#Tp 1'b0; // Clearing status
|
WBErrorLatch<=#Tp 1'b0; // Clearing status
|
end
|
end
|
|
|
|
|