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

Subversion Repositories dbg_interface

[/] [dbg_interface/] [trunk/] [rtl/] [verilog/] [dbg_top.v] - Diff between revs 47 and 51

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

Rev 47 Rev 51
Line 43... Line 43...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.26  2002/05/07 14:43:59  mohor
 
// mon_cntl_o signals that controls monitor mux added.
 
//
// Revision 1.25  2002/04/22 12:54:11  mohor
// Revision 1.25  2002/04/22 12:54:11  mohor
// Signal names changed to lower case.
// Signal names changed to lower case.
//
//
// Revision 1.24  2002/04/17 13:17:01  mohor
// Revision 1.24  2002/04/17 13:17:01  mohor
// Intentional error removed.
// Intentional error removed.
Line 246... Line 249...
reg           RISCAccess_q2;                // Delayed signals used for accessing the RISC
reg           RISCAccess_q2;                // Delayed signals used for accessing the RISC
 
 
reg           wb_AccessTck;                 // Indicates access to the WISHBONE
reg           wb_AccessTck;                 // Indicates access to the WISHBONE
reg [31:0]    WBReadLatch;                  // Data latched during WISHBONE read
reg [31:0]    WBReadLatch;                  // Data latched during WISHBONE read
reg           WBErrorLatch;                 // Error latched during WISHBONE read
reg           WBErrorLatch;                 // Error latched during WISHBONE read
 
reg           WBInProgress;                 // WISHBONE access is in progress
 
reg [7:0]     WBAccessCounter;              // Counting access cycles. WBInProgress is cleared to 0 after counter exceeds 0xff
 
wire          WBAccessCounterExceed;        // Marks when the WBAccessCounter exceeds max value (oxff)
 
reg           WBInProgress_sync1;           // Synchronizing WBInProgress
 
reg           WBInProgress_tck;             // Synchronizing WBInProgress to tck clock signal
 
 
wire trst;
wire trst;
 
 
 
 
wire [31:0]             RegDataIn;        // Data from registers (read data)
wire [31:0]             RegDataIn;        // Data from registers (read data)
Line 409... Line 417...
assign send_crc = select_crc_out? {9{BypassRegister}}    :    // Calculated CRC is returned when read operation is
assign send_crc = select_crc_out? {9{BypassRegister}}    :    // Calculated CRC is returned when read operation is
                                  {CalculatedCrcOut, 1'b0} ;  // performed, else received crc is returned (loopback).
                                  {CalculatedCrcOut, 1'b0} ;  // performed, else received crc is returned (loopback).
 
 
assign RISC_Data      = {send_crc, DataReadLatch, 33'h0};
assign RISC_Data      = {send_crc, DataReadLatch, 33'h0};
assign Register_Data  = {send_crc, DataReadLatch, 6'h0};
assign Register_Data  = {send_crc, DataReadLatch, 6'h0};
assign WISHBONE_Data  = {send_crc, WBReadLatch, 32'h0, WBErrorLatch};
assign WISHBONE_Data  = {send_crc, WBReadLatch, 31'h0, WBInProgress, WBErrorLatch};
assign chain_sel_data = {send_crc, 4'h0};
assign chain_sel_data = {send_crc, 4'h0};
 
 
 
 
`ifdef TRACE_ENABLED
`ifdef TRACE_ENABLED
  assign Trace_Data     = {CalculatedCrcOut, TraceChain};
  assign Trace_Data     = {CalculatedCrcOut, TraceChain};
Line 581... Line 589...
          RW                <=#Tp JTAG_DR_IN[32];     // latch R/W bit
          RW                <=#Tp JTAG_DR_IN[32];     // latch R/W bit
          DataOut[31:0]     <=#Tp JTAG_DR_IN[64:33];  // latch data for write
          DataOut[31:0]     <=#Tp JTAG_DR_IN[64:33];  // latch data for write
          RISCAccessTck     <=#Tp 1'b1;
          RISCAccessTck     <=#Tp 1'b1;
        end
        end
      else
      else
      if(WishboneScanChain)
      if(WishboneScanChain & (!WBInProgress_tck))
        begin
        begin
          ADDR              <=#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
          RW                <=#Tp JTAG_DR_IN[32];     // latch R/W bit
          RW                <=#Tp JTAG_DR_IN[32];     // latch R/W bit
          DataOut           <=#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;               // 
Line 665... Line 673...
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_cyc_o <=#Tp 1'b0;
    wb_cyc_o <=#Tp 1'b0;
  else
  else
  if(wb_Access_wbClk & ~wb_Access_wbClk_q & ~(wb_ack_i | wb_err_i))
  if(wb_Access_wbClk & ~wb_Access_wbClk_q)
    wb_cyc_o <=#Tp 1'b1;
    wb_cyc_o <=#Tp 1'b1;
  else
  else
  if(wb_ack_i | wb_err_i)
  if(wb_ack_i | wb_err_i | WBAccessCounterExceed)
    wb_cyc_o <=#Tp 1'b0;
    wb_cyc_o <=#Tp 1'b0;
end
end
 
 
assign wb_stb_o = wb_cyc_o;
assign wb_stb_o = wb_cyc_o;
 
 
Line 699... Line 707...
  if(wb_ack_i)
  if(wb_ack_i)
    WBErrorLatch<=#Tp 1'b0;     // Clearing status
    WBErrorLatch<=#Tp 1'b0;     // Clearing status
end
end
 
 
 
 
 
// WBInProgress is set at the beginning of the access and cleared when wb_ack_i or wb_err_i is set
 
always @ (posedge wb_clk_i or posedge wb_rst_i)
 
begin
 
  if(wb_rst_i)
 
    WBInProgress<=#Tp 1'b0;
 
  else
 
  if(wb_Access_wbClk & ~wb_Access_wbClk_q)
 
    WBInProgress<=#Tp 1'b1;
 
  else
 
  if(wb_ack_i | wb_err_i | WBAccessCounterExceed)
 
    WBInProgress<=#Tp 1'b0;
 
end
 
 
 
 
 
// Synchronizing WBInProgress
 
always @ (posedge wb_clk_i or posedge wb_rst_i)
 
begin
 
  if(wb_rst_i)
 
    WBAccessCounter<=#Tp 8'h0;
 
  else
 
  if(wb_ack_i | wb_err_i | WBAccessCounterExceed)
 
    WBAccessCounter<=#Tp 8'h0;
 
  else
 
  if(wb_cyc_o)
 
    WBAccessCounter<=#Tp WBAccessCounter + 1'b1;
 
end
 
 
 
assign WBAccessCounterExceed = WBAccessCounter==8'hff;
 
 
 
 
 
// Synchronizing WBInProgress
 
always @ (posedge tck)
 
begin
 
    WBInProgress_sync1<=#Tp WBInProgress;
 
    WBInProgress_tck<=#Tp WBInProgress_sync1;
 
end
 
 
 
 
// Whan enabled, TRACE stalls RISC while saving data to the trace buffer.
// Whan enabled, TRACE stalls RISC while saving data to the trace buffer.
`ifdef TRACE_ENABLED
`ifdef TRACE_ENABLED
  assign  risc_stall_o = RiscStall_access | RiscStall_reg | RiscStall_trace ;
  assign  risc_stall_o = RiscStall_access | RiscStall_reg | RiscStall_trace ;
`else
`else
  assign  risc_stall_o = RiscStall_access | RiscStall_reg;
  assign  risc_stall_o = RiscStall_access | RiscStall_reg;

powered by: WebSVN 2.1.0

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