Line 2... |
Line 2... |
//// ////
|
//// ////
|
//// dbg_defines.v ////
|
//// dbg_defines.v ////
|
//// ////
|
//// ////
|
//// ////
|
//// ////
|
//// This file is part of the SoC/OpenRISC Development Interface ////
|
//// This file is part of the SoC/OpenRISC Development Interface ////
|
//// http://www.opencores.org/cores/DebugInterface/ ////
|
//// http://www.opencores.org/projects/DebugInterface/ ////
|
//// ////
|
|
//// ////
|
//// ////
|
//// Author(s): ////
|
//// Author(s): ////
|
//// Igor Mohor ////
|
//// Igor Mohor (igorm@opencores.org) ////
|
//// igorm@opencores.org ////
|
|
//// ////
|
//// ////
|
//// ////
|
//// ////
|
//// All additional information is avaliable in the README.txt ////
|
//// All additional information is avaliable in the README.txt ////
|
//// file. ////
|
//// file. ////
|
//// ////
|
//// ////
|
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// Copyright (C) 2000,2001 Authors ////
|
//// Copyright (C) 2000 - 2003 Authors ////
|
//// ////
|
//// ////
|
//// This source file may be used and distributed without ////
|
//// This source file may be used and distributed without ////
|
//// restriction provided that this copyright statement is not ////
|
//// restriction provided that this copyright statement is not ////
|
//// removed from the file and that any derivative work contains ////
|
//// removed from the file and that any derivative work contains ////
|
//// the original copyright notice and the associated disclaimer. ////
|
//// the original copyright notice and the associated disclaimer. ////
|
Line 43... |
Line 41... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.14 2003/10/23 16:17:00 mohor
|
|
// CRC logic changed.
|
|
//
|
// Revision 1.13 2003/10/21 09:48:31 simons
|
// Revision 1.13 2003/10/21 09:48:31 simons
|
// Mbist support added.
|
// Mbist support added.
|
//
|
//
|
// Revision 1.12 2003/09/17 14:38:57 simons
|
// Revision 1.12 2003/09/17 14:38:57 simons
|
// WB_CNTL register added, some syncronization fixes.
|
// WB_CNTL register added, some syncronization fixes.
|
Line 96... |
Line 97... |
// Initial release
|
// Initial release
|
//
|
//
|
//
|
//
|
|
|
|
|
|
|
// Enable TRACE
|
|
//`define TRACE_ENABLED // Uncomment this define to activate the trace
|
|
|
|
// Define number of cpus supported by the dbg interface
|
|
`define CPU_NUM 2
|
|
|
|
// Define IDCODE Value
|
|
`define IDCODE_VALUE 32'h14951185
|
|
|
|
// Define master clock (CPU clock)
|
|
//`define CPU_CLOCK 50 // Half period = 50 ns => MCLK = 10 Mhz
|
|
`define CPU_CLOCK 2.5 // Half period = 5 ns => MCLK = 200 Mhz
|
|
|
|
// Length of the Instruction register
|
|
`define IR_LENGTH 4
|
|
|
|
// Length of the Data register (must be equal to the longest scan chain for shifting the data in)
|
|
`define DR_LENGTH 74
|
|
|
|
// Length of the CHAIN ID register
|
// Length of the CHAIN ID register
|
`define CHAIN_ID_LENGTH 4
|
`define CHAIN_ID_LENGTH 3
|
|
|
// Length of the CRC
|
// Length of data
|
`define CRC_LENGTH 8
|
`define CHAIN_DATA_LEN `CHAIN_ID_LENGTH + 1
|
|
`define DATA_CNT 3
|
|
|
|
// Length of status
|
|
`define STATUS_LEN 4
|
|
`define STATUS_CNT 3
|
|
|
// Trace buffer size and counter and write/read pointer width. This can be expanded when more RAM is avaliable
|
// Length of the CRC
|
`define TRACECOUNTERWIDTH 5
|
`define CRC_LEN 32
|
`define TRACEBUFFERLENGTH 32 // 2^5
|
`define CRC_CNT 6
|
|
|
`define TRACESAMPLEWIDTH 36
|
|
|
|
// OpSelect width
|
|
`define OPSELECTWIDTH 3
|
|
`define OPSELECTIONCOUNTER 8 //2^3
|
|
|
|
// OpSelect (dbg_op_i) signal meaning
|
|
`define DEBUG_READ_0 0
|
|
`define DEBUG_WRITE_0 1
|
|
`define DEBUG_READ_1 2
|
|
`define DEBUG_WRITE_1 3
|
|
`define DEBUG_READ_2 4
|
|
`define DEBUG_WRITE_2 5
|
|
`define DEBUG_READ_3 6
|
|
`define DEBUG_WRITE_3 7
|
|
|
|
// Supported Instructions
|
|
`define EXTEST 4'b0000
|
|
`define SAMPLE_PRELOAD 4'b0001
|
|
`define IDCODE 4'b0010
|
|
`define CHAIN_SELECT 4'b0011
|
|
`define INTEST 4'b0100
|
|
`define CLAMP 4'b0101
|
|
`define CLAMPZ 4'b0110
|
|
`define HIGHZ 4'b0111
|
|
`define DEBUG 4'b1000
|
|
`define MBIST 4'b1001
|
|
`define BYPASS 4'b1111
|
|
|
|
// Chains
|
// Chains
|
`define GLOBAL_BS_CHAIN 4'b0000
|
`define CPU_DEBUG_CHAIN 3'b000
|
`define CPU_DEBUG_CHAIN_2 4'b0001
|
`define WISHBONE_SCAN_CHAIN 3'b001
|
`define CPU_TEST_CHAIN 4'b0010
|
|
`define TRACE_TEST_CHAIN 4'b0011
|
|
`define REGISTER_SCAN_CHAIN 4'b0100
|
|
`define WISHBONE_SCAN_CHAIN 4'b0101
|
|
`define CPU_DEBUG_CHAIN_0 4'b0110
|
|
`define CPU_DEBUG_CHAIN_1 4'b0111
|
|
`define CPU_DEBUG_CHAIN_3 4'b1000
|
|
|
|
// Registers addresses
|
|
`define MODER_ADR 5'h00
|
|
`define TSEL_ADR 5'h01
|
|
`define QSEL_ADR 5'h02
|
|
`define SSEL_ADR 5'h03
|
|
`define CPUOP_ADR 5'h04
|
|
`define CPUSEL_ADR 5'h05
|
|
`define RECSEL_ADR 5'h10
|
|
`define MON_CNTL_ADR 5'h11
|
|
`define WB_CNTL_ADR 5'h12
|
|
|
|
|
|
// Registers default values (after reset)
|
|
`define MODER_DEF 2'h0
|
|
`define TSEL_DEF 32'h00000000
|
|
`define QSEL_DEF 32'h00000000
|
|
`define SSEL_DEF 32'h00000000
|
|
`define CPUOP_DEF 2'h0
|
|
`define RECSEL_DEF 7'h0
|
|
`define MON_CNTL_DEF 4'h0
|
|
|
|
No newline at end of file
|
No newline at end of file
|