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

Subversion Repositories dbg_interface

[/] [dbg_interface/] [tags/] [rel_21/] [rtl/] [verilog/] [dbg_top.v] - Diff between revs 95 and 99

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

Rev 95 Rev 99
Line 41... Line 41...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.35  2004/01/14 22:59:16  mohor
 
// Temp version.
 
//
// Revision 1.34  2003/12/23 15:07:34  mohor
// Revision 1.34  2003/12/23 15:07:34  mohor
// New directory structure. New version of the debug interface.
// New directory structure. New version of the debug interface.
// Files that are not needed removed.
// Files that are not needed removed.
//
//
// Revision 1.33  2003/10/23 16:17:01  mohor
// Revision 1.33  2003/10/23 16:17:01  mohor
Line 233... Line 236...
reg [`CRC_CNT -1:0]         crc_cnt;
reg [`CRC_CNT -1:0]         crc_cnt;
reg [`STATUS_CNT -1:0]      status_cnt;
reg [`STATUS_CNT -1:0]      status_cnt;
reg [`CHAIN_DATA_LEN -1:0]  chain_dr;
reg [`CHAIN_DATA_LEN -1:0]  chain_dr;
reg [`CHAIN_ID_LENGTH -1:0] chain;
reg [`CHAIN_ID_LENGTH -1:0] chain;
 
 
 
wire chain_latch_en;
wire data_cnt_end;
wire data_cnt_end;
wire crc_cnt_end;
wire crc_cnt_end;
wire status_cnt_end;
wire status_cnt_end;
reg  crc_cnt_end_q;
reg  crc_cnt_end_q;
reg  crc_cnt_end_q2;
reg  crc_cnt_end_q2;
Line 244... Line 248...
reg  chain_select;
reg  chain_select;
reg  chain_select_error;
reg  chain_select_error;
wire crc_out;
wire crc_out;
wire crc_match;
wire crc_match;
wire crc_en_wb;
wire crc_en_wb;
 
wire crc_en_cpu;
wire shift_crc_wb;
wire shift_crc_wb;
 
wire shift_crc_cpu;
 
 
wire data_shift_en;
wire data_shift_en;
wire selecting_command;
wire selecting_command;
 
 
reg tdo_o;
reg tdo_o;
reg wishbone_ce;
reg wishbone_ce;
 
reg cpu_ce;
 
 
 
wire tdi_wb;
 
wire tdi_cpu;
 
 
 
wire tdo_wb;
 
wire tdo_cpu;
 
 
 
wire shift_crc;
 
 
// data counter
// data counter
always @ (posedge tck_i or posedge wb_rst_i)
always @ (posedge tck_i or posedge wb_rst_i)
begin
begin
  if (wb_rst_i)
  if (wb_rst_i)
Line 331... Line 346...
    default               :   chain_select_error    <= #1 1'b1;
    default               :   chain_select_error    <= #1 1'b1;
  endcase
  endcase
end
end
 
 
 
 
 
assign chain_latch_en = chain_select & crc_cnt_end & (~crc_cnt_end_q);
 
 
 
 
always @ (posedge tck_i or posedge wb_rst_i)
always @ (posedge tck_i or posedge wb_rst_i)
begin
begin
  if (wb_rst_i)
  if (wb_rst_i)
    chain <= `CHAIN_ID_LENGTH'b111;
    chain <= `CHAIN_ID_LENGTH'b111;
  else if(chain_select & crc_cnt_end & (~crc_cnt_end_q) & crc_match)
  else if(chain_latch_en & crc_match)
    chain <= #1 chain_dr[`CHAIN_DATA_LEN -1:1];
    chain <= #1 chain_dr[`CHAIN_DATA_LEN -1:1];
end
end
 
 
 
 
assign data_shift_en = shift_dr_i & (~data_cnt_end);
assign data_shift_en = shift_dr_i & (~data_cnt_end);
Line 368... Line 386...
 
 
reg tdo_chain_select;
reg tdo_chain_select;
wire crc_en;
wire crc_en;
wire crc_en_dbg;
wire crc_en_dbg;
reg crc_started;
reg crc_started;
assign crc_en = crc_en_dbg | crc_en_wb;
assign crc_en = crc_en_dbg | crc_en_wb | crc_en_cpu;
assign crc_en_dbg = shift_dr_i & crc_cnt_end & (~status_cnt_end);
assign crc_en_dbg = shift_dr_i & crc_cnt_end & (~status_cnt_end);
 
 
always @ (posedge tck_i)
always @ (posedge tck_i)
begin
begin
  if (crc_en)
  if (crc_en)
Line 433... Line 451...
                      end
                      end
  endcase
  endcase
end
end
 
 
 
 
wire tdi_wb;
 
wire tdo_wb;
 
 
 
always @ (shift_crc_wb or crc_out or wishbone_ce or tdo_wb or tdo_chain_select)
 
 
assign shift_crc = shift_crc_wb | shift_crc_cpu;
 
 
 
always @ (shift_crc or crc_out or wishbone_ce or tdo_wb  or tdo_cpu or tdo_chain_select)
begin
begin
  if (shift_crc_wb)       // shifting crc
  if (shift_crc)          // shifting crc
    tdo_tmp = crc_out;
    tdo_tmp = crc_out;
  else if (wishbone_ce)   //  shifting data from wb
  else if (wishbone_ce)   //  shifting data from wb
    tdo_tmp = tdo_wb;
    tdo_tmp = tdo_wb;
 
  else if (cpu_ce)        // shifting data from cpu
 
    tdo_tmp = tdo_cpu;
  else
  else
    tdo_tmp = tdo_chain_select;
    tdo_tmp = tdo_chain_select;
end
end
 
 
 
 
Line 461... Line 482...
 
 
 
 
always @ (posedge tck_i or posedge wb_rst_i)
always @ (posedge tck_i or posedge wb_rst_i)
begin
begin
  if (wb_rst_i)
  if (wb_rst_i)
 
    begin
    wishbone_ce <= #1 1'b0;
    wishbone_ce <= #1 1'b0;
  else if(selecting_command & (~tdi_i) & wishbone_scan_chain) // wishbone CE
      cpu_ce <= #1 1'b0;
 
    end
 
  else if(selecting_command & (~tdi_i))
 
    begin
 
      if (wishbone_scan_chain)      // wishbone CE
    wishbone_ce <= #1 1'b1;
    wishbone_ce <= #1 1'b1;
 
      if (cpu_debug_scan_chain)     // CPU CE
 
        cpu_ce <= #1 1'b1;
 
    end
  else if (update_dr_i)   // igor !!! This needs to be changed?
  else if (update_dr_i)   // igor !!! This needs to be changed?
 
    begin
    wishbone_ce <= #1 1'b0;
    wishbone_ce <= #1 1'b0;
 
      cpu_ce <= #1 1'b0;
 
    end
end
end
 
 
 
 
assign tdi_wb = wishbone_ce & tdi_i;
assign tdi_wb = wishbone_ce & tdi_i;
 
assign tdi_cpu = cpu_ce & tdi_i;
 
 
 
 
// Connecting wishbone module
// Connecting wishbone module
dbg_wb i_dbg_wb (
dbg_wb i_dbg_wb (
                  // JTAG signals
                  // JTAG signals
                  .tck_i         (tck_i),
                  .tck_i         (tck_i),
Line 505... Line 539...
                  .wb_ack_i      (wb_ack_i),
                  .wb_ack_i      (wb_ack_i),
                  .wb_cab_o      (wb_cab_o),
                  .wb_cab_o      (wb_cab_o),
                  .wb_err_i      (wb_err_i),
                  .wb_err_i      (wb_err_i),
                  .wb_cti_o      (wb_cti_o),
                  .wb_cti_o      (wb_cti_o),
                  .wb_bte_o      (wb_bte_o)
                  .wb_bte_o      (wb_bte_o)
 
            );
 
 
 
 
 
// Connecting cpu module
 
dbg_cpu i_dbg_cpu (
 
                  // JTAG signals
 
                  .tck_i         (tck_i),
 
                  .tdi_i         (tdi_cpu),
 
                  .tdo_o         (tdo_cpu),
 
 
 
                  // TAP states
 
                  .shift_dr_i    (shift_dr_i),
 
                  .pause_dr_i    (pause_dr_i),
 
                  .update_dr_i   (update_dr_i),
 
 
 
                  .cpu_ce_i      (cpu_ce),
 
                  .crc_match_i   (crc_match),
 
                  .crc_en_o      (crc_en_cpu),
 
                  .shift_crc_o   (shift_crc_cpu),
 
                  .rst_i         (wb_rst_i),
 
                  .clk_i         (wb_clk_i)
            );
            );
 
 
 
 
endmodule
endmodule
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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