OpenCores
URL https://opencores.org/ocsvn/dbg_interface/dbg_interface/trunk

Subversion Repositories dbg_interface

[/] [dbg_interface/] [tags/] [rel_15/] [rtl/] [verilog/] [dbg_wb.v] - Diff between revs 83 and 86

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 83 Rev 86
Line 41... Line 41...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.2  2003/12/23 15:26:26  mohor
 
// Small fix.
 
//
// Revision 1.1  2003/12/23 15:09:04  mohor
// Revision 1.1  2003/12/23 15:09:04  mohor
// New directory structure. New version of the debug interface.
// New directory structure. New version of the debug interface.
//
//
//
//
//
//
Line 191... Line 194...
reg address_unaligned;
reg address_unaligned;
 
 
reg wb_error, wb_error_sync, wb_error_tck;
reg wb_error, wb_error_sync, wb_error_tck;
reg wb_timeout, wb_timeout_sync, wb_timeout_tck;
reg wb_timeout, wb_timeout_sync, wb_timeout_tck;
 
 
 
reg busy_wb;
 
reg busy_tck;
 
reg wb_end;
 
reg wb_end_rst;
 
reg wb_end_rst_sync;
 
reg wb_end_sync;
 
reg wb_end_tck;
 
reg busy_sync;
 
reg [799:0] TDO_WISHBONE;
 
 
always @ (posedge tck_i or posedge trst_i)
always @ (posedge tck_i or posedge trst_i)
begin
begin
  if (trst_i)
  if (trst_i)
    status <= #1 'h0;
    status <= #1 'h0;
  else if(crc_cnt_end & (~crc_cnt_end_q))
  else if(crc_cnt_end & (~crc_cnt_end_q))
    begin
    begin
      if (dr[2:0] == `WB_STATUS)
      if (dr[2:0] == `WB_STATUS)
        status <= #1 {crc_match_i, wb_error_tck, wb_timeout_tck, address_unaligned};
        status <= #1 {crc_match_i, wb_error_tck, wb_timeout_tck, busy_tck};
      else                          // Status is not updated when status read is requested
      else
        status <= #1 {crc_match_i, 2'b10, address_unaligned};
        status <= #1 {crc_match_i, 2'b10, address_unaligned};
    end
    end
  else if (shift_dr_i & (~status_cnt_end))
  else if (shift_dr_i & (~status_cnt_end))
    status <= #1 {status[0], status[`STATUS_LEN -1:1]};
    status <= #1 {status[0], status[`STATUS_LEN -1:1]};
end
end
// Following status is shifted out: 
// Following status is shifted out after each command except WB_STATUS: 
// 1. bit:          1 if crc is OK, else 0
// 1. bit:          1 if crc is OK, else 0
// 2. bit:          1 if address is unaligned, else 0
// 2. bit:          1 if address is unaligned, else 0
// 3. bit:          always 0
// 3. bit:          always 0
// 4. bit:          always 1
// 4. bit:          always 1
 
 
// Following status is shifted out: 
// Following status is shifted out after WB_STATUS: 
// 1. bit:          1 if crc is OK, else 0
// 1. bit:          1 if crc is OK, else 0
// 2. bit:          1 if address is unaligned, else 0
// 2. bit:          1 while WB access is in progress (busy_tck), else 0
// 3. bit:          1 if WB timeout occured, else 0
// 3. bit:          1 if WB timeout occured, else 0
// 4. bit:          1 if WB error occured, else 0
// 4. bit:          1 if WB error occured, else 0
 
 
reg busy_wb;
 
reg busy_tck;
 
reg wb_ack_latched;
 
reg wb_ack_latched_rst;
 
reg wb_ack_latched_rst_sync;
 
reg tck_ack_sync;
 
reg tck_ack;
 
reg busy_sync;
 
reg [799:0] TDO_WISHBONE;
 
 
 
always @ (crc_cnt_end or crc_cnt_end_q or crc_match_i or status or pause_dr_i or busy_tck)
always @ (crc_cnt_end or crc_cnt_end_q or crc_match_i or status or pause_dr_i or busy_tck)
begin
begin
  if (pause_dr_i)
  if (pause_dr_i)
  begin
  begin
Line 360... Line 363...
assign wb_cab_o = 1'b0;
assign wb_cab_o = 1'b0;
assign wb_stb_o = wb_cyc_o;
assign wb_stb_o = wb_cyc_o;
assign wb_cti_o = 3'h0;     // always performing single access
assign wb_cti_o = 3'h0;     // always performing single access
assign wb_bte_o = 2'h0;     // always performing single access
assign wb_bte_o = 2'h0;     // always performing single access
 
 
reg [31:0] input_storage;
reg [31:0] input_data;
 
 
always @ (posedge wb_clk_i)
always @ (posedge wb_clk_i)
begin
begin
  if(wb_ack_i)
  if(wb_ack_i)
    input_storage <= #1 wb_dat_i;
    input_data <= #1 wb_dat_i;
end
end
 
 
 
 
 
 
always @ (posedge wb_clk_i or posedge wb_rst_i)
always @ (posedge wb_clk_i or posedge wb_rst_i)
begin
begin
  if (wb_rst_i)
  if (wb_rst_i)
    wb_ack_latched <= #1 1'b0;
    wb_end <= #1 1'b0;
  else if (wb_ack_i)
  else if (wb_ack_i | wb_err_i | acc_cnt_limit)
    wb_ack_latched <= #1 1'b1;
    wb_end <= #1 1'b1;
  else if (wb_ack_latched_rst)
  else if (wb_end_rst)
    wb_ack_latched <= #1 1'b0;
    wb_end <= #1 1'b0;
end
end
 
 
 
 
always @ (posedge tck_i or posedge trst_i)
always @ (posedge tck_i or posedge trst_i)
begin
begin
  if (trst_i)
  if (trst_i)
    begin
    begin
      tck_ack_sync <= #1 1'b0;
      wb_end_sync <= #1 1'b0;
      tck_ack  <= #1 1'b0;
      wb_end_tck  <= #1 1'b0;
    end
    end
  else
  else
    begin
    begin
      tck_ack_sync <= #1 wb_ack_latched;
      wb_end_sync <= #1 wb_end;
      tck_ack  <= #1 tck_ack_sync;
      wb_end_tck  <= #1 wb_end_sync;
    end
    end
end
end
 
 
 
 
always @ (posedge wb_clk_i or posedge wb_rst_i)
always @ (posedge wb_clk_i or posedge wb_rst_i)
begin
begin
  if (wb_rst_i)
  if (wb_rst_i)
    busy_wb <= #1 1'b0;
    busy_wb <= #1 1'b0;
  else if (wb_ack_latched_rst | wb_err_i | acc_cnt_limit)
  else if (wb_end_rst)
    busy_wb <= #1 1'b0;
    busy_wb <= #1 1'b0;
  else if (wb_cyc_o)
  else if (wb_cyc_o)
    busy_wb <= #1 1'b1;
    busy_wb <= #1 1'b1;
end
end
 
 
Line 424... Line 427...
end
end
 
 
 
 
always @ (posedge wb_clk_i)
always @ (posedge wb_clk_i)
begin
begin
  wb_ack_latched_rst_sync <= #1 tck_ack;
  wb_end_rst_sync <= #1 wb_end_tck;
  wb_ack_latched_rst  <= #1 wb_ack_latched_rst_sync;
  wb_end_rst  <= #1 wb_end_rst_sync;
end
end
 
 
 
 
always @ (posedge wb_clk_i or posedge wb_rst_i)
always @ (posedge wb_clk_i or posedge wb_rst_i)
begin
begin

powered by: WebSVN 2.1.0

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