//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// OR1200's Debug Unit ////
|
//// OR1200's Debug Unit ////
|
//// ////
|
//// ////
|
//// This file is part of the OpenRISC 1200 project ////
|
//// This file is part of the OpenRISC 1200 project ////
|
//// http://www.opencores.org/cores/or1k/ ////
|
//// http://www.opencores.org/cores/or1k/ ////
|
//// ////
|
//// ////
|
//// Description ////
|
//// Description ////
|
//// Basic OR1200 debug unit. ////
|
//// Basic OR1200 debug unit. ////
|
//// ////
|
//// ////
|
//// To Do: ////
|
//// To Do: ////
|
//// - make it smaller and faster ////
|
//// - make it smaller and faster ////
|
//// ////
|
//// ////
|
//// Author(s): ////
|
//// Author(s): ////
|
//// - Damjan Lampret, lampret@opencores.org ////
|
//// - Damjan Lampret, lampret@opencores.org ////
|
//// ////
|
//// ////
|
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//// ////
|
//// ////
|
//// Copyright (C) 2000 Authors and OPENCORES.ORG ////
|
//// Copyright (C) 2000 Authors and OPENCORES.ORG ////
|
//// ////
|
//// ////
|
//// 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. ////
|
//// ////
|
//// ////
|
//// This source file is free software; you can redistribute it ////
|
//// This source file is free software; you can redistribute it ////
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
//// Public License as published by the Free Software Foundation; ////
|
//// Public License as published by the Free Software Foundation; ////
|
//// either version 2.1 of the License, or (at your option) any ////
|
//// either version 2.1 of the License, or (at your option) any ////
|
//// later version. ////
|
//// later version. ////
|
//// ////
|
//// ////
|
//// This source is distributed in the hope that it will be ////
|
//// This source is distributed in the hope that it will be ////
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
//// details. ////
|
//// details. ////
|
//// ////
|
//// ////
|
//// You should have received a copy of the GNU Lesser General ////
|
//// You should have received a copy of the GNU Lesser General ////
|
//// Public License along with this source; if not, download it ////
|
//// Public License along with this source; if not, download it ////
|
//// from http://www.opencores.org/lgpl.shtml ////
|
//// from http://www.opencores.org/lgpl.shtml ////
|
//// ////
|
//// ////
|
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.10 2004/04/05 08:29:57 lampret
|
|
// Merged branch_qmem into main tree.
|
|
//
|
// Revision 1.9.4.4 2004/02/11 01:40:11 lampret
|
// Revision 1.9.4.4 2004/02/11 01:40:11 lampret
|
// preliminary HW breakpoints support in debug unit (by default disabled). To enable define OR1200_DU_HWBKPTS.
|
// preliminary HW breakpoints support in debug unit (by default disabled). To enable define OR1200_DU_HWBKPTS.
|
//
|
//
|
// Revision 1.9.4.3 2004/01/18 10:08:00 simons
|
// Revision 1.9.4.3 2004/01/18 10:08:00 simons
|
// Error fixed.
|
// Error fixed.
|
//
|
//
|
// Revision 1.9.4.2 2004/01/17 21:14:14 simons
|
// Revision 1.9.4.2 2004/01/17 21:14:14 simons
|
// Errors fixed.
|
// Errors fixed.
|
//
|
//
|
// Revision 1.9.4.1 2004/01/15 06:46:38 markom
|
// Revision 1.9.4.1 2004/01/15 06:46:38 markom
|
// interface to debug changed; no more opselect; stb-ack protocol
|
// interface to debug changed; no more opselect; stb-ack protocol
|
//
|
//
|
// Revision 1.9 2003/01/22 03:23:47 lampret
|
// Revision 1.9 2003/01/22 03:23:47 lampret
|
// Updated sensitivity list for trace buffer [only relevant for Xilinx FPGAs]
|
// Updated sensitivity list for trace buffer [only relevant for Xilinx FPGAs]
|
//
|
//
|
// Revision 1.8 2002/09/08 19:31:52 lampret
|
// Revision 1.8 2002/09/08 19:31:52 lampret
|
// Fixed a typo, reported by Taylor Su.
|
// Fixed a typo, reported by Taylor Su.
|
//
|
//
|
// Revision 1.7 2002/07/14 22:17:17 lampret
|
// Revision 1.7 2002/07/14 22:17:17 lampret
|
// Added simple trace buffer [only for Xilinx Virtex target]. Fixed instruction fetch abort when new exception is recognized.
|
// Added simple trace buffer [only for Xilinx Virtex target]. Fixed instruction fetch abort when new exception is recognized.
|
//
|
//
|
// Revision 1.6 2002/03/14 00:30:24 lampret
|
// Revision 1.6 2002/03/14 00:30:24 lampret
|
// Added alternative for critical path in DU.
|
// Added alternative for critical path in DU.
|
//
|
//
|
// Revision 1.5 2002/02/11 04:33:17 lampret
|
// Revision 1.5 2002/02/11 04:33:17 lampret
|
// Speed optimizations (removed duplicate _cyc_ and _stb_). Fixed D/IMMU cache-inhibit attr.
|
// Speed optimizations (removed duplicate _cyc_ and _stb_). Fixed D/IMMU cache-inhibit attr.
|
//
|
//
|
// Revision 1.4 2002/01/28 01:16:00 lampret
|
// Revision 1.4 2002/01/28 01:16:00 lampret
|
// Changed 'void' nop-ops instead of insn[0] to use insn[16]. Debug unit stalls the tick timer. Prepared new flag generation for add and and insns. Blocked DC/IC while they are turned off. Fixed I/D MMU SPRs layout except WAYs. TODO: smart IC invalidate, l.j 2 and TLB ways.
|
// Changed 'void' nop-ops instead of insn[0] to use insn[16]. Debug unit stalls the tick timer. Prepared new flag generation for add and and insns. Blocked DC/IC while they are turned off. Fixed I/D MMU SPRs layout except WAYs. TODO: smart IC invalidate, l.j 2 and TLB ways.
|
//
|
//
|
// Revision 1.3 2002/01/18 07:56:00 lampret
|
// Revision 1.3 2002/01/18 07:56:00 lampret
|
// No more low/high priority interrupts (PICPR removed). Added tick timer exception. Added exception prefix (SR[EPH]). Fixed single-step bug whenreading NPC.
|
// No more low/high priority interrupts (PICPR removed). Added tick timer exception. Added exception prefix (SR[EPH]). Fixed single-step bug whenreading NPC.
|
//
|
//
|
// Revision 1.2 2002/01/14 06:18:22 lampret
|
// Revision 1.2 2002/01/14 06:18:22 lampret
|
// Fixed mem2reg bug in FAST implementation. Updated debug unit to work with new genpc/if.
|
// Fixed mem2reg bug in FAST implementation. Updated debug unit to work with new genpc/if.
|
//
|
//
|
// Revision 1.1 2002/01/03 08:16:15 lampret
|
// Revision 1.1 2002/01/03 08:16:15 lampret
|
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
|
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
|
//
|
//
|
// Revision 1.12 2001/11/30 18:58:00 simons
|
// Revision 1.12 2001/11/30 18:58:00 simons
|
// Trap insn couses break after exits ex_insn.
|
// Trap insn couses break after exits ex_insn.
|
//
|
//
|
// Revision 1.11 2001/11/23 08:38:51 lampret
|
// Revision 1.11 2001/11/23 08:38:51 lampret
|
// Changed DSR/DRR behavior and exception detection.
|
// Changed DSR/DRR behavior and exception detection.
|
//
|
//
|
// Revision 1.10 2001/11/20 21:25:44 lampret
|
// Revision 1.10 2001/11/20 21:25:44 lampret
|
// Fixed dbg_is_o assignment width.
|
// Fixed dbg_is_o assignment width.
|
//
|
//
|
// Revision 1.9 2001/11/20 18:46:14 simons
|
// Revision 1.9 2001/11/20 18:46:14 simons
|
// Break point bug fixed
|
// Break point bug fixed
|
//
|
//
|
// Revision 1.8 2001/11/18 08:36:28 lampret
|
// Revision 1.8 2001/11/18 08:36:28 lampret
|
// For GDB changed single stepping and disabled trap exception.
|
// For GDB changed single stepping and disabled trap exception.
|
//
|
//
|
// Revision 1.7 2001/10/21 18:09:53 lampret
|
// Revision 1.7 2001/10/21 18:09:53 lampret
|
// Fixed sensitivity list.
|
// Fixed sensitivity list.
|
//
|
//
|
// Revision 1.6 2001/10/14 13:12:09 lampret
|
// Revision 1.6 2001/10/14 13:12:09 lampret
|
// MP3 version.
|
// MP3 version.
|
//
|
//
|
//
|
//
|
|
|
// synopsys translate_off
|
// synopsys translate_off
|
`include "timescale.v"
|
`include "timescale.v"
|
// synopsys translate_on
|
// synopsys translate_on
|
`include "or1200_defines.v"
|
`include "or1200_defines.v"
|
|
|
//
|
//
|
// Debug unit
|
// Debug unit
|
//
|
//
|
|
|
module or1200_du(
|
module or1200_du(
|
// RISC Internal Interface
|
// RISC Internal Interface
|
clk, rst,
|
clk, rst,
|
dcpu_cycstb_i, dcpu_we_i, dcpu_adr_i, dcpu_dat_lsu,
|
dcpu_cycstb_i, dcpu_we_i, dcpu_adr_i, dcpu_dat_lsu,
|
dcpu_dat_dc, icpu_cycstb_i,
|
dcpu_dat_dc, icpu_cycstb_i,
|
ex_freeze, branch_op, ex_insn, id_pc,
|
ex_freeze, branch_op, ex_insn, id_pc,
|
spr_dat_npc, rf_dataw,
|
spr_dat_npc, rf_dataw,
|
du_dsr, du_stall, du_addr, du_dat_i, du_dat_o,
|
du_dsr, du_stall, du_addr, du_dat_i, du_dat_o,
|
du_read, du_write, du_except, du_hwbkpt,
|
du_read, du_write, du_except, du_hwbkpt,
|
spr_cs, spr_write, spr_addr, spr_dat_i, spr_dat_o,
|
spr_cs, spr_write, spr_addr, spr_dat_i, spr_dat_o,
|
|
|
// External Debug Interface
|
// External Debug Interface
|
dbg_stall_i, dbg_ewt_i, dbg_lss_o, dbg_is_o, dbg_wp_o, dbg_bp_o,
|
dbg_stall_i, dbg_ewt_i, dbg_lss_o, dbg_is_o, dbg_wp_o, dbg_bp_o,
|
dbg_stb_i, dbg_we_i, dbg_adr_i, dbg_dat_i, dbg_dat_o, dbg_ack_o
|
dbg_stb_i, dbg_we_i, dbg_adr_i, dbg_dat_i, dbg_dat_o, dbg_ack_o
|
);
|
);
|
|
|
parameter dw = `OR1200_OPERAND_WIDTH;
|
parameter dw = `OR1200_OPERAND_WIDTH;
|
parameter aw = `OR1200_OPERAND_WIDTH;
|
parameter aw = `OR1200_OPERAND_WIDTH;
|
|
|
//
|
//
|
// I/O
|
// I/O
|
//
|
//
|
|
|
//
|
//
|
// RISC Internal Interface
|
// RISC Internal Interface
|
//
|
//
|
input clk; // Clock
|
input clk; // Clock
|
input rst; // Reset
|
input rst; // Reset
|
input dcpu_cycstb_i; // LSU status
|
input dcpu_cycstb_i; // LSU status
|
input dcpu_we_i; // LSU status
|
input dcpu_we_i; // LSU status
|
input [31:0] dcpu_adr_i; // LSU addr
|
input [31:0] dcpu_adr_i; // LSU addr
|
input [31:0] dcpu_dat_lsu; // LSU store data
|
input [31:0] dcpu_dat_lsu; // LSU store data
|
input [31:0] dcpu_dat_dc; // LSU load data
|
input [31:0] dcpu_dat_dc; // LSU load data
|
input [`OR1200_FETCHOP_WIDTH-1:0] icpu_cycstb_i; // IFETCH unit status
|
input [`OR1200_FETCHOP_WIDTH-1:0] icpu_cycstb_i; // IFETCH unit status
|
input ex_freeze; // EX stage freeze
|
input ex_freeze; // EX stage freeze
|
input [`OR1200_BRANCHOP_WIDTH-1:0] branch_op; // Branch op
|
input [`OR1200_BRANCHOP_WIDTH-1:0] branch_op; // Branch op
|
input [dw-1:0] ex_insn; // EX insn
|
input [dw-1:0] ex_insn; // EX insn
|
input [31:0] id_pc; // insn fetch EA
|
input [31:0] id_pc; // insn fetch EA
|
input [31:0] spr_dat_npc; // Next PC (for trace)
|
input [31:0] spr_dat_npc; // Next PC (for trace)
|
input [31:0] rf_dataw; // ALU result (for trace)
|
input [31:0] rf_dataw; // ALU result (for trace)
|
output [`OR1200_DU_DSR_WIDTH-1:0] du_dsr; // DSR
|
output [`OR1200_DU_DSR_WIDTH-1:0] du_dsr; // DSR
|
output du_stall; // Debug Unit Stall
|
output du_stall; // Debug Unit Stall
|
output [aw-1:0] du_addr; // Debug Unit Address
|
output [aw-1:0] du_addr; // Debug Unit Address
|
input [dw-1:0] du_dat_i; // Debug Unit Data In
|
input [dw-1:0] du_dat_i; // Debug Unit Data In
|
output [dw-1:0] du_dat_o; // Debug Unit Data Out
|
output [dw-1:0] du_dat_o; // Debug Unit Data Out
|
output du_read; // Debug Unit Read Enable
|
output du_read; // Debug Unit Read Enable
|
output du_write; // Debug Unit Write Enable
|
output du_write; // Debug Unit Write Enable
|
input [12:0] du_except; // Exception masked by DSR
|
input [12:0] du_except; // Exception masked by DSR
|
output du_hwbkpt; // Cause trap exception (HW Breakpoints)
|
output du_hwbkpt; // Cause trap exception (HW Breakpoints)
|
input spr_cs; // SPR Chip Select
|
input spr_cs; // SPR Chip Select
|
input spr_write; // SPR Read/Write
|
input spr_write; // SPR Read/Write
|
input [aw-1:0] spr_addr; // SPR Address
|
input [aw-1:0] spr_addr; // SPR Address
|
input [dw-1:0] spr_dat_i; // SPR Data Input
|
input [dw-1:0] spr_dat_i; // SPR Data Input
|
output [dw-1:0] spr_dat_o; // SPR Data Output
|
output [dw-1:0] spr_dat_o; // SPR Data Output
|
|
|
//
|
//
|
// External Debug Interface
|
// External Debug Interface
|
//
|
//
|
input dbg_stall_i; // External Stall Input
|
input dbg_stall_i; // External Stall Input
|
input dbg_ewt_i; // External Watchpoint Trigger Input
|
input dbg_ewt_i; // External Watchpoint Trigger Input
|
output [3:0] dbg_lss_o; // External Load/Store Unit Status
|
output [3:0] dbg_lss_o; // External Load/Store Unit Status
|
output [1:0] dbg_is_o; // External Insn Fetch Status
|
output [1:0] dbg_is_o; // External Insn Fetch Status
|
output [10:0] dbg_wp_o; // Watchpoints Outputs
|
output [10:0] dbg_wp_o; // Watchpoints Outputs
|
output dbg_bp_o; // Breakpoint Output
|
output dbg_bp_o; // Breakpoint Output
|
input dbg_stb_i; // External Address/Data Strobe
|
input dbg_stb_i; // External Address/Data Strobe
|
input dbg_we_i; // External Write Enable
|
input dbg_we_i; // External Write Enable
|
input [aw-1:0] dbg_adr_i; // External Address Input
|
input [aw-1:0] dbg_adr_i; // External Address Input
|
input [dw-1:0] dbg_dat_i; // External Data Input
|
input [dw-1:0] dbg_dat_i; // External Data Input
|
output [dw-1:0] dbg_dat_o; // External Data Output
|
output [dw-1:0] dbg_dat_o; // External Data Output
|
output dbg_ack_o; // External Data Acknowledge (not WB compatible)
|
output dbg_ack_o; // External Data Acknowledge (not WB compatible)
|
|
|
|
|
//
|
//
|
// Some connections go directly from the CPU through DU to Debug I/F
|
// Some connections go directly from the CPU through DU to Debug I/F
|
//
|
//
|
`ifdef OR1200_DU_STATUS_UNIMPLEMENTED
|
`ifdef OR1200_DU_STATUS_UNIMPLEMENTED
|
assign dbg_lss_o = 4'b0000;
|
assign dbg_lss_o = 4'b0000;
|
|
|
reg [1:0] dbg_is_o;
|
reg [1:0] dbg_is_o;
|
//
|
//
|
// Show insn activity (temp, must be removed)
|
// Show insn activity (temp, must be removed)
|
//
|
//
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dbg_is_o <= #1 2'b00;
|
dbg_is_o <= #1 2'b00;
|
else if (!ex_freeze &
|
else if (!ex_freeze &
|
~((ex_insn[31:26] == `OR1200_OR32_NOP) & ex_insn[16]))
|
~((ex_insn[31:26] == `OR1200_OR32_NOP) & ex_insn[16]))
|
dbg_is_o <= #1 ~dbg_is_o;
|
dbg_is_o <= #1 ~dbg_is_o;
|
`ifdef UNUSED
|
`ifdef UNUSED
|
assign dbg_is_o = 2'b00;
|
assign dbg_is_o = 2'b00;
|
`endif
|
`endif
|
`else
|
`else
|
assign dbg_lss_o = dcpu_cycstb_i ? {dcpu_we_i, 3'b000} : 4'b0000;
|
assign dbg_lss_o = dcpu_cycstb_i ? {dcpu_we_i, 3'b000} : 4'b0000;
|
assign dbg_is_o = {1'b0, icpu_cycstb_i};
|
assign dbg_is_o = {1'b0, icpu_cycstb_i};
|
`endif
|
`endif
|
assign dbg_wp_o = 11'b000_0000_0000;
|
assign dbg_wp_o = 11'b000_0000_0000;
|
assign dbg_dat_o = du_dat_i;
|
assign dbg_dat_o = du_dat_i;
|
|
|
//
|
//
|
// Some connections go directly from Debug I/F through DU to the CPU
|
// Some connections go directly from Debug I/F through DU to the CPU
|
//
|
//
|
assign du_stall = dbg_stall_i;
|
assign du_stall = dbg_stall_i;
|
assign du_addr = dbg_adr_i;
|
assign du_addr = dbg_adr_i;
|
assign du_dat_o = dbg_dat_i;
|
assign du_dat_o = dbg_dat_i;
|
assign du_read = dbg_stb_i && !dbg_we_i;
|
assign du_read = dbg_stb_i && !dbg_we_i;
|
assign du_write = dbg_stb_i && dbg_we_i;
|
assign du_write = dbg_stb_i && dbg_we_i;
|
|
|
//
|
//
|
// Generate acknowledge -- just delay stb signal
|
// Generate acknowledge -- just delay stb signal
|
//
|
//
|
reg dbg_ack_o;
|
reg dbg_ack_o;
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dbg_ack_o <= #1 1'b0;
|
dbg_ack_o <= #1 1'b0;
|
else
|
else
|
dbg_ack_o <= #1 dbg_stb_i;
|
dbg_ack_o <= #1 dbg_stb_i;
|
|
|
`ifdef OR1200_DU_IMPLEMENTED
|
`ifdef OR1200_DU_IMPLEMENTED
|
|
|
//
|
//
|
// Debug Mode Register 1
|
// Debug Mode Register 1
|
//
|
//
|
`ifdef OR1200_DU_DMR1
|
`ifdef OR1200_DU_DMR1
|
reg [24:0] dmr1; // DMR1 implemented
|
reg [24:0] dmr1; // DMR1 implemented
|
`else
|
`else
|
wire [24:0] dmr1; // DMR1 not implemented
|
wire [24:0] dmr1; // DMR1 not implemented
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Mode Register 2
|
// Debug Mode Register 2
|
//
|
//
|
`ifdef OR1200_DU_DMR2
|
`ifdef OR1200_DU_DMR2
|
reg [23:0] dmr2; // DMR2 implemented
|
reg [23:0] dmr2; // DMR2 implemented
|
`else
|
`else
|
wire [23:0] dmr2; // DMR2 not implemented
|
wire [23:0] dmr2; // DMR2 not implemented
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Stop Register
|
// Debug Stop Register
|
//
|
//
|
`ifdef OR1200_DU_DSR
|
`ifdef OR1200_DU_DSR
|
reg [`OR1200_DU_DSR_WIDTH-1:0] dsr; // DSR implemented
|
reg [`OR1200_DU_DSR_WIDTH-1:0] dsr; // DSR implemented
|
`else
|
`else
|
wire [`OR1200_DU_DSR_WIDTH-1:0] dsr; // DSR not implemented
|
wire [`OR1200_DU_DSR_WIDTH-1:0] dsr; // DSR not implemented
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Reason Register
|
// Debug Reason Register
|
//
|
//
|
`ifdef OR1200_DU_DRR
|
`ifdef OR1200_DU_DRR
|
reg [13:0] drr; // DRR implemented
|
reg [13:0] drr; // DRR implemented
|
`else
|
`else
|
wire [13:0] drr; // DRR not implemented
|
wire [13:0] drr; // DRR not implemented
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Value Register N
|
// Debug Value Register N
|
//
|
//
|
`ifdef OR1200_DU_DVR0
|
`ifdef OR1200_DU_DVR0
|
reg [31:0] dvr0;
|
reg [31:0] dvr0;
|
`else
|
`else
|
wire [31:0] dvr0;
|
wire [31:0] dvr0;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Value Register N
|
// Debug Value Register N
|
//
|
//
|
`ifdef OR1200_DU_DVR1
|
`ifdef OR1200_DU_DVR1
|
reg [31:0] dvr1;
|
reg [31:0] dvr1;
|
`else
|
`else
|
wire [31:0] dvr1;
|
wire [31:0] dvr1;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Value Register N
|
// Debug Value Register N
|
//
|
//
|
`ifdef OR1200_DU_DVR2
|
`ifdef OR1200_DU_DVR2
|
reg [31:0] dvr2;
|
reg [31:0] dvr2;
|
`else
|
`else
|
wire [31:0] dvr2;
|
wire [31:0] dvr2;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Value Register N
|
// Debug Value Register N
|
//
|
//
|
`ifdef OR1200_DU_DVR3
|
`ifdef OR1200_DU_DVR3
|
reg [31:0] dvr3;
|
reg [31:0] dvr3;
|
`else
|
`else
|
wire [31:0] dvr3;
|
wire [31:0] dvr3;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Value Register N
|
// Debug Value Register N
|
//
|
//
|
`ifdef OR1200_DU_DVR4
|
`ifdef OR1200_DU_DVR4
|
reg [31:0] dvr4;
|
reg [31:0] dvr4;
|
`else
|
`else
|
wire [31:0] dvr4;
|
wire [31:0] dvr4;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Value Register N
|
// Debug Value Register N
|
//
|
//
|
`ifdef OR1200_DU_DVR5
|
`ifdef OR1200_DU_DVR5
|
reg [31:0] dvr5;
|
reg [31:0] dvr5;
|
`else
|
`else
|
wire [31:0] dvr5;
|
wire [31:0] dvr5;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Value Register N
|
// Debug Value Register N
|
//
|
//
|
`ifdef OR1200_DU_DVR6
|
`ifdef OR1200_DU_DVR6
|
reg [31:0] dvr6;
|
reg [31:0] dvr6;
|
`else
|
`else
|
wire [31:0] dvr6;
|
wire [31:0] dvr6;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Value Register N
|
// Debug Value Register N
|
//
|
//
|
`ifdef OR1200_DU_DVR7
|
`ifdef OR1200_DU_DVR7
|
reg [31:0] dvr7;
|
reg [31:0] dvr7;
|
`else
|
`else
|
wire [31:0] dvr7;
|
wire [31:0] dvr7;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Control Register N
|
// Debug Control Register N
|
//
|
//
|
`ifdef OR1200_DU_DCR0
|
`ifdef OR1200_DU_DCR0
|
reg [7:0] dcr0;
|
reg [7:0] dcr0;
|
`else
|
`else
|
wire [7:0] dcr0;
|
wire [7:0] dcr0;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Control Register N
|
// Debug Control Register N
|
//
|
//
|
`ifdef OR1200_DU_DCR1
|
`ifdef OR1200_DU_DCR1
|
reg [7:0] dcr1;
|
reg [7:0] dcr1;
|
`else
|
`else
|
wire [7:0] dcr1;
|
wire [7:0] dcr1;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Control Register N
|
// Debug Control Register N
|
//
|
//
|
`ifdef OR1200_DU_DCR2
|
`ifdef OR1200_DU_DCR2
|
reg [7:0] dcr2;
|
reg [7:0] dcr2;
|
`else
|
`else
|
wire [7:0] dcr2;
|
wire [7:0] dcr2;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Control Register N
|
// Debug Control Register N
|
//
|
//
|
`ifdef OR1200_DU_DCR3
|
`ifdef OR1200_DU_DCR3
|
reg [7:0] dcr3;
|
reg [7:0] dcr3;
|
`else
|
`else
|
wire [7:0] dcr3;
|
wire [7:0] dcr3;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Control Register N
|
// Debug Control Register N
|
//
|
//
|
`ifdef OR1200_DU_DCR4
|
`ifdef OR1200_DU_DCR4
|
reg [7:0] dcr4;
|
reg [7:0] dcr4;
|
`else
|
`else
|
wire [7:0] dcr4;
|
wire [7:0] dcr4;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Control Register N
|
// Debug Control Register N
|
//
|
//
|
`ifdef OR1200_DU_DCR5
|
`ifdef OR1200_DU_DCR5
|
reg [7:0] dcr5;
|
reg [7:0] dcr5;
|
`else
|
`else
|
wire [7:0] dcr5;
|
wire [7:0] dcr5;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Control Register N
|
// Debug Control Register N
|
//
|
//
|
`ifdef OR1200_DU_DCR6
|
`ifdef OR1200_DU_DCR6
|
reg [7:0] dcr6;
|
reg [7:0] dcr6;
|
`else
|
`else
|
wire [7:0] dcr6;
|
wire [7:0] dcr6;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Control Register N
|
// Debug Control Register N
|
//
|
//
|
`ifdef OR1200_DU_DCR7
|
`ifdef OR1200_DU_DCR7
|
reg [7:0] dcr7;
|
reg [7:0] dcr7;
|
`else
|
`else
|
wire [7:0] dcr7;
|
wire [7:0] dcr7;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Watchpoint Counter Register 0
|
// Debug Watchpoint Counter Register 0
|
//
|
//
|
`ifdef OR1200_DU_DWCR0
|
`ifdef OR1200_DU_DWCR0
|
reg [31:0] dwcr0;
|
reg [31:0] dwcr0;
|
`else
|
`else
|
wire [31:0] dwcr0;
|
wire [31:0] dwcr0;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Debug Watchpoint Counter Register 1
|
// Debug Watchpoint Counter Register 1
|
//
|
//
|
`ifdef OR1200_DU_DWCR1
|
`ifdef OR1200_DU_DWCR1
|
reg [31:0] dwcr1;
|
reg [31:0] dwcr1;
|
`else
|
`else
|
wire [31:0] dwcr1;
|
wire [31:0] dwcr1;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Internal wires
|
// Internal wires
|
//
|
//
|
wire dmr1_sel; // DMR1 select
|
wire dmr1_sel; // DMR1 select
|
wire dmr2_sel; // DMR2 select
|
wire dmr2_sel; // DMR2 select
|
wire dsr_sel; // DSR select
|
wire dsr_sel; // DSR select
|
wire drr_sel; // DRR select
|
wire drr_sel; // DRR select
|
wire dvr0_sel,
|
wire dvr0_sel,
|
dvr1_sel,
|
dvr1_sel,
|
dvr2_sel,
|
dvr2_sel,
|
dvr3_sel,
|
dvr3_sel,
|
dvr4_sel,
|
dvr4_sel,
|
dvr5_sel,
|
dvr5_sel,
|
dvr6_sel,
|
dvr6_sel,
|
dvr7_sel; // DVR selects
|
dvr7_sel; // DVR selects
|
wire dcr0_sel,
|
wire dcr0_sel,
|
dcr1_sel,
|
dcr1_sel,
|
dcr2_sel,
|
dcr2_sel,
|
dcr3_sel,
|
dcr3_sel,
|
dcr4_sel,
|
dcr4_sel,
|
dcr5_sel,
|
dcr5_sel,
|
dcr6_sel,
|
dcr6_sel,
|
dcr7_sel; // DCR selects
|
dcr7_sel; // DCR selects
|
wire dwcr0_sel,
|
wire dwcr0_sel,
|
dwcr1_sel; // DWCR selects
|
dwcr1_sel; // DWCR selects
|
reg dbg_bp_r;
|
reg dbg_bp_r;
|
`ifdef OR1200_DU_HWBKPTS
|
`ifdef OR1200_DU_HWBKPTS
|
reg [31:0] match_cond0_ct;
|
reg [31:0] match_cond0_ct;
|
reg [31:0] match_cond1_ct;
|
reg [31:0] match_cond1_ct;
|
reg [31:0] match_cond2_ct;
|
reg [31:0] match_cond2_ct;
|
reg [31:0] match_cond3_ct;
|
reg [31:0] match_cond3_ct;
|
reg [31:0] match_cond4_ct;
|
reg [31:0] match_cond4_ct;
|
reg [31:0] match_cond5_ct;
|
reg [31:0] match_cond5_ct;
|
reg [31:0] match_cond6_ct;
|
reg [31:0] match_cond6_ct;
|
reg [31:0] match_cond7_ct;
|
reg [31:0] match_cond7_ct;
|
reg match_cond0_stb;
|
reg match_cond0_stb;
|
reg match_cond1_stb;
|
reg match_cond1_stb;
|
reg match_cond2_stb;
|
reg match_cond2_stb;
|
reg match_cond3_stb;
|
reg match_cond3_stb;
|
reg match_cond4_stb;
|
reg match_cond4_stb;
|
reg match_cond5_stb;
|
reg match_cond5_stb;
|
reg match_cond6_stb;
|
reg match_cond6_stb;
|
reg match_cond7_stb;
|
reg match_cond7_stb;
|
reg match0;
|
reg match0;
|
reg match1;
|
reg match1;
|
reg match2;
|
reg match2;
|
reg match3;
|
reg match3;
|
reg match4;
|
reg match4;
|
reg match5;
|
reg match5;
|
reg match6;
|
reg match6;
|
reg match7;
|
reg match7;
|
reg wpcntr0_match;
|
reg wpcntr0_match;
|
reg wpcntr1_match;
|
reg wpcntr1_match;
|
reg incr_wpcntr0;
|
reg incr_wpcntr0;
|
reg incr_wpcntr1;
|
reg incr_wpcntr1;
|
reg [10:0] wp;
|
reg [10:0] wp;
|
`endif
|
`endif
|
wire du_hwbkpt;
|
wire du_hwbkpt;
|
`ifdef OR1200_DU_READREGS
|
`ifdef OR1200_DU_READREGS
|
reg [31:0] spr_dat_o;
|
reg [31:0] spr_dat_o;
|
`endif
|
`endif
|
reg [13:0] except_stop; // Exceptions that stop because of DSR
|
reg [13:0] except_stop; // Exceptions that stop because of DSR
|
`ifdef OR1200_DU_TB_IMPLEMENTED
|
`ifdef OR1200_DU_TB_IMPLEMENTED
|
wire tb_enw;
|
wire tb_enw;
|
reg [7:0] tb_wadr;
|
reg [7:0] tb_wadr;
|
reg [31:0] tb_timstmp;
|
reg [31:0] tb_timstmp;
|
`endif
|
`endif
|
wire [31:0] tbia_dat_o;
|
wire [31:0] tbia_dat_o;
|
wire [31:0] tbim_dat_o;
|
wire [31:0] tbim_dat_o;
|
wire [31:0] tbar_dat_o;
|
wire [31:0] tbar_dat_o;
|
wire [31:0] tbts_dat_o;
|
wire [31:0] tbts_dat_o;
|
|
|
//
|
//
|
// DU registers address decoder
|
// DU registers address decoder
|
//
|
//
|
`ifdef OR1200_DU_DMR1
|
`ifdef OR1200_DU_DMR1
|
assign dmr1_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DMR1));
|
assign dmr1_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DMR1));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DMR2
|
`ifdef OR1200_DU_DMR2
|
assign dmr2_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DMR2));
|
assign dmr2_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DMR2));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DSR
|
`ifdef OR1200_DU_DSR
|
assign dsr_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DSR));
|
assign dsr_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DSR));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DRR
|
`ifdef OR1200_DU_DRR
|
assign drr_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DRR));
|
assign drr_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DRR));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR0
|
`ifdef OR1200_DU_DVR0
|
assign dvr0_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR0));
|
assign dvr0_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR0));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR1
|
`ifdef OR1200_DU_DVR1
|
assign dvr1_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR1));
|
assign dvr1_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR1));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR2
|
`ifdef OR1200_DU_DVR2
|
assign dvr2_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR2));
|
assign dvr2_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR2));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR3
|
`ifdef OR1200_DU_DVR3
|
assign dvr3_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR3));
|
assign dvr3_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR3));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR4
|
`ifdef OR1200_DU_DVR4
|
assign dvr4_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR4));
|
assign dvr4_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR4));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR5
|
`ifdef OR1200_DU_DVR5
|
assign dvr5_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR5));
|
assign dvr5_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR5));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR6
|
`ifdef OR1200_DU_DVR6
|
assign dvr6_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR6));
|
assign dvr6_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR6));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR7
|
`ifdef OR1200_DU_DVR7
|
assign dvr7_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR7));
|
assign dvr7_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DVR7));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR0
|
`ifdef OR1200_DU_DCR0
|
assign dcr0_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR0));
|
assign dcr0_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR0));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR1
|
`ifdef OR1200_DU_DCR1
|
assign dcr1_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR1));
|
assign dcr1_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR1));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR2
|
`ifdef OR1200_DU_DCR2
|
assign dcr2_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR2));
|
assign dcr2_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR2));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR3
|
`ifdef OR1200_DU_DCR3
|
assign dcr3_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR3));
|
assign dcr3_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR3));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR4
|
`ifdef OR1200_DU_DCR4
|
assign dcr4_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR4));
|
assign dcr4_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR4));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR5
|
`ifdef OR1200_DU_DCR5
|
assign dcr5_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR5));
|
assign dcr5_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR5));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR6
|
`ifdef OR1200_DU_DCR6
|
assign dcr6_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR6));
|
assign dcr6_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR6));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR7
|
`ifdef OR1200_DU_DCR7
|
assign dcr7_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR7));
|
assign dcr7_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DCR7));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DWCR0
|
`ifdef OR1200_DU_DWCR0
|
assign dwcr0_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DWCR0));
|
assign dwcr0_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DWCR0));
|
`endif
|
`endif
|
`ifdef OR1200_DU_DWCR1
|
`ifdef OR1200_DU_DWCR1
|
assign dwcr1_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DWCR1));
|
assign dwcr1_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_DWCR1));
|
`endif
|
`endif
|
|
|
//
|
//
|
// Decode started exception
|
// Decode started exception
|
//
|
//
|
always @(du_except) begin
|
always @(du_except) begin
|
except_stop = 14'b0000_0000_0000;
|
except_stop = 14'b0000_0000_0000;
|
casex (du_except)
|
casex (du_except)
|
13'b1_xxxx_xxxx_xxxx:
|
13'b1_xxxx_xxxx_xxxx:
|
except_stop[`OR1200_DU_DRR_TTE] = 1'b1;
|
except_stop[`OR1200_DU_DRR_TTE] = 1'b1;
|
13'b0_1xxx_xxxx_xxxx: begin
|
13'b0_1xxx_xxxx_xxxx: begin
|
except_stop[`OR1200_DU_DRR_IE] = 1'b1;
|
except_stop[`OR1200_DU_DRR_IE] = 1'b1;
|
end
|
end
|
13'b0_01xx_xxxx_xxxx: begin
|
13'b0_01xx_xxxx_xxxx: begin
|
except_stop[`OR1200_DU_DRR_IME] = 1'b1;
|
except_stop[`OR1200_DU_DRR_IME] = 1'b1;
|
end
|
end
|
13'b0_001x_xxxx_xxxx:
|
13'b0_001x_xxxx_xxxx:
|
except_stop[`OR1200_DU_DRR_IPFE] = 1'b1;
|
except_stop[`OR1200_DU_DRR_IPFE] = 1'b1;
|
13'b0_0001_xxxx_xxxx: begin
|
13'b0_0001_xxxx_xxxx: begin
|
except_stop[`OR1200_DU_DRR_BUSEE] = 1'b1;
|
except_stop[`OR1200_DU_DRR_BUSEE] = 1'b1;
|
end
|
end
|
13'b0_0000_1xxx_xxxx:
|
13'b0_0000_1xxx_xxxx:
|
except_stop[`OR1200_DU_DRR_IIE] = 1'b1;
|
except_stop[`OR1200_DU_DRR_IIE] = 1'b1;
|
13'b0_0000_01xx_xxxx: begin
|
13'b0_0000_01xx_xxxx: begin
|
except_stop[`OR1200_DU_DRR_AE] = 1'b1;
|
except_stop[`OR1200_DU_DRR_AE] = 1'b1;
|
end
|
end
|
13'b0_0000_001x_xxxx: begin
|
13'b0_0000_001x_xxxx: begin
|
except_stop[`OR1200_DU_DRR_DME] = 1'b1;
|
except_stop[`OR1200_DU_DRR_DME] = 1'b1;
|
end
|
end
|
13'b0_0000_0001_xxxx:
|
13'b0_0000_0001_xxxx:
|
except_stop[`OR1200_DU_DRR_DPFE] = 1'b1;
|
except_stop[`OR1200_DU_DRR_DPFE] = 1'b1;
|
13'b0_0000_0000_1xxx:
|
13'b0_0000_0000_1xxx:
|
except_stop[`OR1200_DU_DRR_BUSEE] = 1'b1;
|
except_stop[`OR1200_DU_DRR_BUSEE] = 1'b1;
|
13'b0_0000_0000_01xx: begin
|
13'b0_0000_0000_01xx: begin
|
except_stop[`OR1200_DU_DRR_RE] = 1'b1;
|
except_stop[`OR1200_DU_DRR_RE] = 1'b1;
|
end
|
end
|
13'b0_0000_0000_001x: begin
|
13'b0_0000_0000_001x: begin
|
except_stop[`OR1200_DU_DRR_TE] = 1'b1;
|
except_stop[`OR1200_DU_DRR_TE] = 1'b1;
|
end
|
end
|
13'b0_0000_0000_0001:
|
13'b0_0000_0000_0001:
|
except_stop[`OR1200_DU_DRR_SCE] = 1'b1;
|
except_stop[`OR1200_DU_DRR_SCE] = 1'b1;
|
default:
|
default:
|
except_stop = 14'b0000_0000_0000;
|
except_stop = 14'b0000_0000_0000;
|
endcase
|
endcase
|
end
|
end
|
|
|
//
|
//
|
// dbg_bp_o is registered
|
// dbg_bp_o is registered
|
//
|
//
|
assign dbg_bp_o = dbg_bp_r;
|
assign dbg_bp_o = dbg_bp_r;
|
|
|
//
|
//
|
// Breakpoint activation register
|
// Breakpoint activation register
|
//
|
//
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dbg_bp_r <= #1 1'b0;
|
dbg_bp_r <= #1 1'b0;
|
else if (!ex_freeze)
|
else if (!ex_freeze)
|
dbg_bp_r <= #1 |except_stop
|
dbg_bp_r <= #1 |except_stop
|
`ifdef OR1200_DU_DMR1_ST
|
`ifdef OR1200_DU_DMR1_ST
|
| ~((ex_insn[31:26] == `OR1200_OR32_NOP) & ex_insn[16]) & dmr1[`OR1200_DU_DMR1_ST]
|
| ~((ex_insn[31:26] == `OR1200_OR32_NOP) & ex_insn[16]) & dmr1[`OR1200_DU_DMR1_ST]
|
`endif
|
`endif
|
`ifdef OR1200_DU_DMR1_BT
|
`ifdef OR1200_DU_DMR1_BT
|
| (branch_op != `OR1200_BRANCHOP_NOP) & dmr1[`OR1200_DU_DMR1_BT]
|
| (branch_op != `OR1200_BRANCHOP_NOP) & dmr1[`OR1200_DU_DMR1_BT]
|
`endif
|
`endif
|
;
|
;
|
else
|
else
|
dbg_bp_r <= #1 |except_stop;
|
dbg_bp_r <= #1 |except_stop;
|
|
|
//
|
//
|
// Write to DMR1
|
// Write to DMR1
|
//
|
//
|
`ifdef OR1200_DU_DMR1
|
`ifdef OR1200_DU_DMR1
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dmr1 <= 25'h000_0000;
|
dmr1 <= 25'h000_0000;
|
else if (dmr1_sel && spr_write)
|
else if (dmr1_sel && spr_write)
|
`ifdef OR1200_DU_HWBKPTS
|
`ifdef OR1200_DU_HWBKPTS
|
dmr1 <= #1 spr_dat_i[24:0];
|
dmr1 <= #1 spr_dat_i[24:0];
|
`else
|
`else
|
dmr1 <= #1 {1'b0, spr_dat_i[23:22], 22'h00_0000};
|
dmr1 <= #1 {1'b0, spr_dat_i[23:22], 22'h00_0000};
|
`endif
|
`endif
|
`else
|
`else
|
assign dmr1 = 25'h000_0000;
|
assign dmr1 = 25'h000_0000;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DMR2
|
// Write to DMR2
|
//
|
//
|
`ifdef OR1200_DU_DMR2
|
`ifdef OR1200_DU_DMR2
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dmr2 <= 24'h00_0000;
|
dmr2 <= 24'h00_0000;
|
else if (dmr2_sel && spr_write)
|
else if (dmr2_sel && spr_write)
|
dmr2 <= #1 spr_dat_i[23:0];
|
dmr2 <= #1 spr_dat_i[23:0];
|
`else
|
`else
|
assign dmr2 = 24'h00_0000;
|
assign dmr2 = 24'h00_0000;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DSR
|
// Write to DSR
|
//
|
//
|
`ifdef OR1200_DU_DSR
|
`ifdef OR1200_DU_DSR
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dsr <= {`OR1200_DU_DSR_WIDTH{1'b0}};
|
dsr <= {`OR1200_DU_DSR_WIDTH{1'b0}};
|
else if (dsr_sel && spr_write)
|
else if (dsr_sel && spr_write)
|
dsr <= #1 spr_dat_i[`OR1200_DU_DSR_WIDTH-1:0];
|
dsr <= #1 spr_dat_i[`OR1200_DU_DSR_WIDTH-1:0];
|
`else
|
`else
|
assign dsr = {`OR1200_DU_DSR_WIDTH{1'b0}};
|
assign dsr = {`OR1200_DU_DSR_WIDTH{1'b0}};
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DRR
|
// Write to DRR
|
//
|
//
|
`ifdef OR1200_DU_DRR
|
`ifdef OR1200_DU_DRR
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
drr <= 14'b0;
|
drr <= 14'b0;
|
else if (drr_sel && spr_write)
|
else if (drr_sel && spr_write)
|
drr <= #1 spr_dat_i[13:0];
|
drr <= #1 spr_dat_i[13:0];
|
else
|
else
|
drr <= #1 drr | except_stop;
|
drr <= #1 drr | except_stop;
|
`else
|
`else
|
assign drr = 14'b0;
|
assign drr = 14'b0;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DVR0
|
// Write to DVR0
|
//
|
//
|
`ifdef OR1200_DU_DVR0
|
`ifdef OR1200_DU_DVR0
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dvr0 <= 32'h0000_0000;
|
dvr0 <= 32'h0000_0000;
|
else if (dvr0_sel && spr_write)
|
else if (dvr0_sel && spr_write)
|
dvr0 <= #1 spr_dat_i[31:0];
|
dvr0 <= #1 spr_dat_i[31:0];
|
`else
|
`else
|
assign dvr0 = 32'h0000_0000;
|
assign dvr0 = 32'h0000_0000;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DVR1
|
// Write to DVR1
|
//
|
//
|
`ifdef OR1200_DU_DVR1
|
`ifdef OR1200_DU_DVR1
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dvr1 <= 32'h0000_0000;
|
dvr1 <= 32'h0000_0000;
|
else if (dvr1_sel && spr_write)
|
else if (dvr1_sel && spr_write)
|
dvr1 <= #1 spr_dat_i[31:0];
|
dvr1 <= #1 spr_dat_i[31:0];
|
`else
|
`else
|
assign dvr1 = 32'h0000_0000;
|
assign dvr1 = 32'h0000_0000;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DVR2
|
// Write to DVR2
|
//
|
//
|
`ifdef OR1200_DU_DVR2
|
`ifdef OR1200_DU_DVR2
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dvr2 <= 32'h0000_0000;
|
dvr2 <= 32'h0000_0000;
|
else if (dvr2_sel && spr_write)
|
else if (dvr2_sel && spr_write)
|
dvr2 <= #1 spr_dat_i[31:0];
|
dvr2 <= #1 spr_dat_i[31:0];
|
`else
|
`else
|
assign dvr2 = 32'h0000_0000;
|
assign dvr2 = 32'h0000_0000;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DVR3
|
// Write to DVR3
|
//
|
//
|
`ifdef OR1200_DU_DVR3
|
`ifdef OR1200_DU_DVR3
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dvr3 <= 32'h0000_0000;
|
dvr3 <= 32'h0000_0000;
|
else if (dvr3_sel && spr_write)
|
else if (dvr3_sel && spr_write)
|
dvr3 <= #1 spr_dat_i[31:0];
|
dvr3 <= #1 spr_dat_i[31:0];
|
`else
|
`else
|
assign dvr3 = 32'h0000_0000;
|
assign dvr3 = 32'h0000_0000;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DVR4
|
// Write to DVR4
|
//
|
//
|
`ifdef OR1200_DU_DVR4
|
`ifdef OR1200_DU_DVR4
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dvr4 <= 32'h0000_0000;
|
dvr4 <= 32'h0000_0000;
|
else if (dvr4_sel && spr_write)
|
else if (dvr4_sel && spr_write)
|
dvr4 <= #1 spr_dat_i[31:0];
|
dvr4 <= #1 spr_dat_i[31:0];
|
`else
|
`else
|
assign dvr4 = 32'h0000_0000;
|
assign dvr4 = 32'h0000_0000;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DVR5
|
// Write to DVR5
|
//
|
//
|
`ifdef OR1200_DU_DVR5
|
`ifdef OR1200_DU_DVR5
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dvr5 <= 32'h0000_0000;
|
dvr5 <= 32'h0000_0000;
|
else if (dvr5_sel && spr_write)
|
else if (dvr5_sel && spr_write)
|
dvr5 <= #1 spr_dat_i[31:0];
|
dvr5 <= #1 spr_dat_i[31:0];
|
`else
|
`else
|
assign dvr5 = 32'h0000_0000;
|
assign dvr5 = 32'h0000_0000;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DVR6
|
// Write to DVR6
|
//
|
//
|
`ifdef OR1200_DU_DVR6
|
`ifdef OR1200_DU_DVR6
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dvr6 <= 32'h0000_0000;
|
dvr6 <= 32'h0000_0000;
|
else if (dvr6_sel && spr_write)
|
else if (dvr6_sel && spr_write)
|
dvr6 <= #1 spr_dat_i[31:0];
|
dvr6 <= #1 spr_dat_i[31:0];
|
`else
|
`else
|
assign dvr6 = 32'h0000_0000;
|
assign dvr6 = 32'h0000_0000;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DVR7
|
// Write to DVR7
|
//
|
//
|
`ifdef OR1200_DU_DVR7
|
`ifdef OR1200_DU_DVR7
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dvr7 <= 32'h0000_0000;
|
dvr7 <= 32'h0000_0000;
|
else if (dvr7_sel && spr_write)
|
else if (dvr7_sel && spr_write)
|
dvr7 <= #1 spr_dat_i[31:0];
|
dvr7 <= #1 spr_dat_i[31:0];
|
`else
|
`else
|
assign dvr7 = 32'h0000_0000;
|
assign dvr7 = 32'h0000_0000;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DCR0
|
// Write to DCR0
|
//
|
//
|
`ifdef OR1200_DU_DCR0
|
`ifdef OR1200_DU_DCR0
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dcr0 <= 8'h00;
|
dcr0 <= 8'h00;
|
else if (dcr0_sel && spr_write)
|
else if (dcr0_sel && spr_write)
|
dcr0 <= #1 spr_dat_i[7:0];
|
dcr0 <= #1 spr_dat_i[7:0];
|
`else
|
`else
|
assign dcr0 = 8'h00;
|
assign dcr0 = 8'h00;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DCR1
|
// Write to DCR1
|
//
|
//
|
`ifdef OR1200_DU_DCR1
|
`ifdef OR1200_DU_DCR1
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dcr1 <= 8'h00;
|
dcr1 <= 8'h00;
|
else if (dcr1_sel && spr_write)
|
else if (dcr1_sel && spr_write)
|
dcr1 <= #1 spr_dat_i[7:0];
|
dcr1 <= #1 spr_dat_i[7:0];
|
`else
|
`else
|
assign dcr1 = 8'h00;
|
assign dcr1 = 8'h00;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DCR2
|
// Write to DCR2
|
//
|
//
|
`ifdef OR1200_DU_DCR2
|
`ifdef OR1200_DU_DCR2
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dcr2 <= 8'h00;
|
dcr2 <= 8'h00;
|
else if (dcr2_sel && spr_write)
|
else if (dcr2_sel && spr_write)
|
dcr2 <= #1 spr_dat_i[7:0];
|
dcr2 <= #1 spr_dat_i[7:0];
|
`else
|
`else
|
assign dcr2 = 8'h00;
|
assign dcr2 = 8'h00;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DCR3
|
// Write to DCR3
|
//
|
//
|
`ifdef OR1200_DU_DCR3
|
`ifdef OR1200_DU_DCR3
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dcr3 <= 8'h00;
|
dcr3 <= 8'h00;
|
else if (dcr3_sel && spr_write)
|
else if (dcr3_sel && spr_write)
|
dcr3 <= #1 spr_dat_i[7:0];
|
dcr3 <= #1 spr_dat_i[7:0];
|
`else
|
`else
|
assign dcr3 = 8'h00;
|
assign dcr3 = 8'h00;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DCR4
|
// Write to DCR4
|
//
|
//
|
`ifdef OR1200_DU_DCR4
|
`ifdef OR1200_DU_DCR4
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dcr4 <= 8'h00;
|
dcr4 <= 8'h00;
|
else if (dcr4_sel && spr_write)
|
else if (dcr4_sel && spr_write)
|
dcr4 <= #1 spr_dat_i[7:0];
|
dcr4 <= #1 spr_dat_i[7:0];
|
`else
|
`else
|
assign dcr4 = 8'h00;
|
assign dcr4 = 8'h00;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DCR5
|
// Write to DCR5
|
//
|
//
|
`ifdef OR1200_DU_DCR5
|
`ifdef OR1200_DU_DCR5
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dcr5 <= 8'h00;
|
dcr5 <= 8'h00;
|
else if (dcr5_sel && spr_write)
|
else if (dcr5_sel && spr_write)
|
dcr5 <= #1 spr_dat_i[7:0];
|
dcr5 <= #1 spr_dat_i[7:0];
|
`else
|
`else
|
assign dcr5 = 8'h00;
|
assign dcr5 = 8'h00;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DCR6
|
// Write to DCR6
|
//
|
//
|
`ifdef OR1200_DU_DCR6
|
`ifdef OR1200_DU_DCR6
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dcr6 <= 8'h00;
|
dcr6 <= 8'h00;
|
else if (dcr6_sel && spr_write)
|
else if (dcr6_sel && spr_write)
|
dcr6 <= #1 spr_dat_i[7:0];
|
dcr6 <= #1 spr_dat_i[7:0];
|
`else
|
`else
|
assign dcr6 = 8'h00;
|
assign dcr6 = 8'h00;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DCR7
|
// Write to DCR7
|
//
|
//
|
`ifdef OR1200_DU_DCR7
|
`ifdef OR1200_DU_DCR7
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dcr7 <= 8'h00;
|
dcr7 <= 8'h00;
|
else if (dcr7_sel && spr_write)
|
else if (dcr7_sel && spr_write)
|
dcr7 <= #1 spr_dat_i[7:0];
|
dcr7 <= #1 spr_dat_i[7:0];
|
`else
|
`else
|
assign dcr7 = 8'h00;
|
assign dcr7 = 8'h00;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DWCR0
|
// Write to DWCR0
|
//
|
//
|
`ifdef OR1200_DU_DWCR0
|
`ifdef OR1200_DU_DWCR0
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dwcr0 <= 32'h0000_0000;
|
dwcr0 <= 32'h0000_0000;
|
else if (dwcr0_sel && spr_write)
|
else if (dwcr0_sel && spr_write)
|
dwcr0 <= #1 spr_dat_i[31:0];
|
dwcr0 <= #1 spr_dat_i[31:0];
|
else if (incr_wpcntr0)
|
else if (incr_wpcntr0)
|
dwcr0[`OR1200_DU_DWCR_COUNT] <= #1 dwcr0[`OR1200_DU_DWCR_COUNT] + 16'h0001;
|
dwcr0[`OR1200_DU_DWCR_COUNT] <= #1 dwcr0[`OR1200_DU_DWCR_COUNT] + 16'h0001;
|
`else
|
`else
|
assign dwcr0 = 32'h0000_0000;
|
assign dwcr0 = 32'h0000_0000;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Write to DWCR1
|
// Write to DWCR1
|
//
|
//
|
`ifdef OR1200_DU_DWCR1
|
`ifdef OR1200_DU_DWCR1
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
dwcr1 <= 32'h0000_0000;
|
dwcr1 <= 32'h0000_0000;
|
else if (dwcr1_sel && spr_write)
|
else if (dwcr1_sel && spr_write)
|
dwcr1 <= #1 spr_dat_i[31:0];
|
dwcr1 <= #1 spr_dat_i[31:0];
|
else if (incr_wpcntr1)
|
else if (incr_wpcntr1)
|
dwcr1[`OR1200_DU_DWCR_COUNT] <= #1 dwcr1[`OR1200_DU_DWCR_COUNT] + 16'h0001;
|
dwcr1[`OR1200_DU_DWCR_COUNT] <= #1 dwcr1[`OR1200_DU_DWCR_COUNT] + 16'h0001;
|
`else
|
`else
|
assign dwcr1 = 32'h0000_0000;
|
assign dwcr1 = 32'h0000_0000;
|
`endif
|
`endif
|
|
|
//
|
//
|
// Read DU registers
|
// Read DU registers
|
//
|
//
|
`ifdef OR1200_DU_READREGS
|
`ifdef OR1200_DU_READREGS
|
always @(spr_addr or dsr or drr or dmr1 or dmr2
|
always @(spr_addr or dsr or drr or dmr1 or dmr2
|
or dvr0 or dvr1 or dvr2 or dvr3 or dvr4
|
or dvr0 or dvr1 or dvr2 or dvr3 or dvr4
|
or dvr5 or dvr6 or dvr7
|
or dvr5 or dvr6 or dvr7
|
or dcr0 or dcr1 or dcr2 or dcr3 or dcr4
|
or dcr0 or dcr1 or dcr2 or dcr3 or dcr4
|
or dcr5 or dcr6 or dcr7
|
or dcr5 or dcr6 or dcr7
|
or dwcr0 or dwcr1
|
or dwcr0 or dwcr1
|
`ifdef OR1200_DU_TB_IMPLEMENTED
|
`ifdef OR1200_DU_TB_IMPLEMENTED
|
or tb_wadr or tbia_dat_o or tbim_dat_o
|
or tb_wadr or tbia_dat_o or tbim_dat_o
|
or tbar_dat_o or tbts_dat_o
|
or tbar_dat_o or tbts_dat_o
|
`endif
|
`endif
|
)
|
)
|
casex (spr_addr[`OR1200_DUOFS_BITS]) // synopsys parallel_case
|
casex (spr_addr[`OR1200_DUOFS_BITS]) // synopsys parallel_case
|
`ifdef OR1200_DU_DVR0
|
`ifdef OR1200_DU_DVR0
|
`OR1200_DU_DVR0:
|
`OR1200_DU_DVR0:
|
spr_dat_o = dvr0;
|
spr_dat_o = dvr0;
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR1
|
`ifdef OR1200_DU_DVR1
|
`OR1200_DU_DVR1:
|
`OR1200_DU_DVR1:
|
spr_dat_o = dvr1;
|
spr_dat_o = dvr1;
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR2
|
`ifdef OR1200_DU_DVR2
|
`OR1200_DU_DVR2:
|
`OR1200_DU_DVR2:
|
spr_dat_o = dvr2;
|
spr_dat_o = dvr2;
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR3
|
`ifdef OR1200_DU_DVR3
|
`OR1200_DU_DVR3:
|
`OR1200_DU_DVR3:
|
spr_dat_o = dvr3;
|
spr_dat_o = dvr3;
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR4
|
`ifdef OR1200_DU_DVR4
|
`OR1200_DU_DVR4:
|
`OR1200_DU_DVR4:
|
spr_dat_o = dvr4;
|
spr_dat_o = dvr4;
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR5
|
`ifdef OR1200_DU_DVR5
|
`OR1200_DU_DVR5:
|
`OR1200_DU_DVR5:
|
spr_dat_o = dvr5;
|
spr_dat_o = dvr5;
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR6
|
`ifdef OR1200_DU_DVR6
|
`OR1200_DU_DVR6:
|
`OR1200_DU_DVR6:
|
spr_dat_o = dvr6;
|
spr_dat_o = dvr6;
|
`endif
|
`endif
|
`ifdef OR1200_DU_DVR7
|
`ifdef OR1200_DU_DVR7
|
`OR1200_DU_DVR7:
|
`OR1200_DU_DVR7:
|
spr_dat_o = dvr7;
|
spr_dat_o = dvr7;
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR0
|
`ifdef OR1200_DU_DCR0
|
`OR1200_DU_DCR0:
|
`OR1200_DU_DCR0:
|
spr_dat_o = {24'h00_0000, dcr0};
|
spr_dat_o = {24'h00_0000, dcr0};
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR1
|
`ifdef OR1200_DU_DCR1
|
`OR1200_DU_DCR1:
|
`OR1200_DU_DCR1:
|
spr_dat_o = {24'h00_0000, dcr1};
|
spr_dat_o = {24'h00_0000, dcr1};
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR2
|
`ifdef OR1200_DU_DCR2
|
`OR1200_DU_DCR2:
|
`OR1200_DU_DCR2:
|
spr_dat_o = {24'h00_0000, dcr2};
|
spr_dat_o = {24'h00_0000, dcr2};
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR3
|
`ifdef OR1200_DU_DCR3
|
`OR1200_DU_DCR3:
|
`OR1200_DU_DCR3:
|
spr_dat_o = {24'h00_0000, dcr3};
|
spr_dat_o = {24'h00_0000, dcr3};
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR4
|
`ifdef OR1200_DU_DCR4
|
`OR1200_DU_DCR4:
|
`OR1200_DU_DCR4:
|
spr_dat_o = {24'h00_0000, dcr4};
|
spr_dat_o = {24'h00_0000, dcr4};
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR5
|
`ifdef OR1200_DU_DCR5
|
`OR1200_DU_DCR5:
|
`OR1200_DU_DCR5:
|
spr_dat_o = {24'h00_0000, dcr5};
|
spr_dat_o = {24'h00_0000, dcr5};
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR6
|
`ifdef OR1200_DU_DCR6
|
`OR1200_DU_DCR6:
|
`OR1200_DU_DCR6:
|
spr_dat_o = {24'h00_0000, dcr6};
|
spr_dat_o = {24'h00_0000, dcr6};
|
`endif
|
`endif
|
`ifdef OR1200_DU_DCR7
|
`ifdef OR1200_DU_DCR7
|
`OR1200_DU_DCR7:
|
`OR1200_DU_DCR7:
|
spr_dat_o = {24'h00_0000, dcr7};
|
spr_dat_o = {24'h00_0000, dcr7};
|
`endif
|
`endif
|
`ifdef OR1200_DU_DMR1
|
`ifdef OR1200_DU_DMR1
|
`OR1200_DU_DMR1:
|
`OR1200_DU_DMR1:
|
spr_dat_o = {7'h00, dmr1};
|
spr_dat_o = {7'h00, dmr1};
|
`endif
|
`endif
|
`ifdef OR1200_DU_DMR2
|
`ifdef OR1200_DU_DMR2
|
`OR1200_DU_DMR2:
|
`OR1200_DU_DMR2:
|
spr_dat_o = {8'h00, dmr2};
|
spr_dat_o = {8'h00, dmr2};
|
`endif
|
`endif
|
`ifdef OR1200_DU_DWCR0
|
`ifdef OR1200_DU_DWCR0
|
`OR1200_DU_DWCR0:
|
`OR1200_DU_DWCR0:
|
spr_dat_o = dwcr0;
|
spr_dat_o = dwcr0;
|
`endif
|
`endif
|
`ifdef OR1200_DU_DWCR1
|
`ifdef OR1200_DU_DWCR1
|
`OR1200_DU_DWCR1:
|
`OR1200_DU_DWCR1:
|
spr_dat_o = dwcr1;
|
spr_dat_o = dwcr1;
|
`endif
|
`endif
|
`ifdef OR1200_DU_DSR
|
`ifdef OR1200_DU_DSR
|
`OR1200_DU_DSR:
|
`OR1200_DU_DSR:
|
spr_dat_o = {18'b0, dsr};
|
spr_dat_o = {18'b0, dsr};
|
`endif
|
`endif
|
`ifdef OR1200_DU_DRR
|
`ifdef OR1200_DU_DRR
|
`OR1200_DU_DRR:
|
`OR1200_DU_DRR:
|
spr_dat_o = {18'b0, drr};
|
spr_dat_o = {18'b0, drr};
|
`endif
|
`endif
|
`ifdef OR1200_DU_TB_IMPLEMENTED
|
`ifdef OR1200_DU_TB_IMPLEMENTED
|
`OR1200_DU_TBADR:
|
`OR1200_DU_TBADR:
|
spr_dat_o = {24'h000000, tb_wadr};
|
spr_dat_o = {24'h000000, tb_wadr};
|
`OR1200_DU_TBIA:
|
`OR1200_DU_TBIA:
|
spr_dat_o = tbia_dat_o;
|
spr_dat_o = tbia_dat_o;
|
`OR1200_DU_TBIM:
|
`OR1200_DU_TBIM:
|
spr_dat_o = tbim_dat_o;
|
spr_dat_o = tbim_dat_o;
|
`OR1200_DU_TBAR:
|
`OR1200_DU_TBAR:
|
spr_dat_o = tbar_dat_o;
|
spr_dat_o = tbar_dat_o;
|
`OR1200_DU_TBTS:
|
`OR1200_DU_TBTS:
|
spr_dat_o = tbts_dat_o;
|
spr_dat_o = tbts_dat_o;
|
`endif
|
`endif
|
default:
|
default:
|
spr_dat_o = 32'h0000_0000;
|
spr_dat_o = 32'h0000_0000;
|
endcase
|
endcase
|
`endif
|
`endif
|
|
|
//
|
//
|
// DSR alias
|
// DSR alias
|
//
|
//
|
assign du_dsr = dsr;
|
assign du_dsr = dsr;
|
|
|
`ifdef OR1200_DU_HWBKPTS
|
`ifdef OR1200_DU_HWBKPTS
|
|
|
//
|
//
|
// Compare To What (Match Condition 0)
|
// Compare To What (Match Condition 0)
|
//
|
//
|
always @(dcr0 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
always @(dcr0 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
or dcpu_dat_lsu or dcpu_we_i)
|
or dcpu_dat_lsu or dcpu_we_i)
|
case (dcr0[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr0[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b001: match_cond0_ct = id_pc; // insn fetch EA
|
3'b001: match_cond0_ct = id_pc; // insn fetch EA
|
3'b010: match_cond0_ct = dcpu_adr_i; // load EA
|
3'b010: match_cond0_ct = dcpu_adr_i; // load EA
|
3'b011: match_cond0_ct = dcpu_adr_i; // store EA
|
3'b011: match_cond0_ct = dcpu_adr_i; // store EA
|
3'b100: match_cond0_ct = dcpu_dat_dc; // load data
|
3'b100: match_cond0_ct = dcpu_dat_dc; // load data
|
3'b101: match_cond0_ct = dcpu_dat_lsu; // store data
|
3'b101: match_cond0_ct = dcpu_dat_lsu; // store data
|
3'b110: match_cond0_ct = dcpu_adr_i; // load/store EA
|
3'b110: match_cond0_ct = dcpu_adr_i; // load/store EA
|
default:match_cond0_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
default:match_cond0_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
endcase
|
endcase
|
|
|
//
|
//
|
// When To Compare (Match Condition 0)
|
// When To Compare (Match Condition 0)
|
//
|
//
|
always @(dcr0 or dcpu_cycstb_i)
|
always @(dcr0 or dcpu_cycstb_i)
|
case (dcr0[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr0[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b000: match_cond0_stb = 1'b0; //comparison disabled
|
3'b000: match_cond0_stb = 1'b0; //comparison disabled
|
3'b001: match_cond0_stb = 1'b1; // insn fetch EA
|
3'b001: match_cond0_stb = 1'b1; // insn fetch EA
|
default:match_cond0_stb = dcpu_cycstb_i; // any load/store
|
default:match_cond0_stb = dcpu_cycstb_i; // any load/store
|
endcase
|
endcase
|
|
|
//
|
//
|
// Match Condition 0
|
// Match Condition 0
|
//
|
//
|
always @(match_cond0_stb or dcr0 or dvr0 or match_cond0_ct)
|
always @(match_cond0_stb or dcr0 or dvr0 or match_cond0_ct)
|
casex ({match_cond0_stb, dcr0[`OR1200_DU_DCR_CC]})
|
casex ({match_cond0_stb, dcr0[`OR1200_DU_DCR_CC]})
|
4'b0_xxx,
|
4'b0_xxx,
|
4'b1_000,
|
4'b1_000,
|
4'b1_111: match0 = 1'b0;
|
4'b1_111: match0 = 1'b0;
|
4'b1_001: match0 =
|
4'b1_001: match0 =
|
((match_cond0_ct[31] ^ dcr0[`OR1200_DU_DCR_SC]) ==
|
((match_cond0_ct[31] ^ dcr0[`OR1200_DU_DCR_SC]) ==
|
(dvr0[31] ^ dcr0[`OR1200_DU_DCR_SC]));
|
(dvr0[31] ^ dcr0[`OR1200_DU_DCR_SC]));
|
4'b1_010: match0 =
|
4'b1_010: match0 =
|
((match_cond0_ct[31] ^ dcr0[`OR1200_DU_DCR_SC]) <
|
((match_cond0_ct[31] ^ dcr0[`OR1200_DU_DCR_SC]) <
|
(dvr0[31] ^ dcr0[`OR1200_DU_DCR_SC]));
|
(dvr0[31] ^ dcr0[`OR1200_DU_DCR_SC]));
|
4'b1_011: match0 =
|
4'b1_011: match0 =
|
((match_cond0_ct[31] ^ dcr0[`OR1200_DU_DCR_SC]) <=
|
((match_cond0_ct[31] ^ dcr0[`OR1200_DU_DCR_SC]) <=
|
(dvr0[31] ^ dcr0[`OR1200_DU_DCR_SC]));
|
(dvr0[31] ^ dcr0[`OR1200_DU_DCR_SC]));
|
4'b1_100: match0 =
|
4'b1_100: match0 =
|
((match_cond0_ct[31] ^ dcr0[`OR1200_DU_DCR_SC]) >
|
((match_cond0_ct[31] ^ dcr0[`OR1200_DU_DCR_SC]) >
|
(dvr0[31] ^ dcr0[`OR1200_DU_DCR_SC]));
|
(dvr0[31] ^ dcr0[`OR1200_DU_DCR_SC]));
|
4'b1_101: match0 =
|
4'b1_101: match0 =
|
((match_cond0_ct[31] ^ dcr0[`OR1200_DU_DCR_SC]) >=
|
((match_cond0_ct[31] ^ dcr0[`OR1200_DU_DCR_SC]) >=
|
(dvr0[31] ^ dcr0[`OR1200_DU_DCR_SC]));
|
(dvr0[31] ^ dcr0[`OR1200_DU_DCR_SC]));
|
4'b1_110: match0 =
|
4'b1_110: match0 =
|
((match_cond0_ct[31] ^ dcr0[`OR1200_DU_DCR_SC]) !=
|
((match_cond0_ct[31] ^ dcr0[`OR1200_DU_DCR_SC]) !=
|
(dvr0[31] ^ dcr0[`OR1200_DU_DCR_SC]));
|
(dvr0[31] ^ dcr0[`OR1200_DU_DCR_SC]));
|
endcase
|
endcase
|
|
|
//
|
//
|
// Watchpoint 0
|
// Watchpoint 0
|
//
|
//
|
always @(dmr1 or match0)
|
always @(dmr1 or match0)
|
case (dmr1[`OR1200_DU_DMR1_CW0])
|
case (dmr1[`OR1200_DU_DMR1_CW0])
|
2'b00: wp[0] = match0;
|
2'b00: wp[0] = match0;
|
2'b01: wp[0] = match0;
|
2'b01: wp[0] = match0;
|
2'b10: wp[0] = match0;
|
2'b10: wp[0] = match0;
|
2'b11: wp[0] = 1'b0;
|
2'b11: wp[0] = 1'b0;
|
endcase
|
endcase
|
|
|
//
|
//
|
// Compare To What (Match Condition 1)
|
// Compare To What (Match Condition 1)
|
//
|
//
|
always @(dcr1 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
always @(dcr1 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
or dcpu_dat_lsu or dcpu_we_i)
|
or dcpu_dat_lsu or dcpu_we_i)
|
case (dcr1[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr1[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b001: match_cond1_ct = id_pc; // insn fetch EA
|
3'b001: match_cond1_ct = id_pc; // insn fetch EA
|
3'b010: match_cond1_ct = dcpu_adr_i; // load EA
|
3'b010: match_cond1_ct = dcpu_adr_i; // load EA
|
3'b011: match_cond1_ct = dcpu_adr_i; // store EA
|
3'b011: match_cond1_ct = dcpu_adr_i; // store EA
|
3'b100: match_cond1_ct = dcpu_dat_dc; // load data
|
3'b100: match_cond1_ct = dcpu_dat_dc; // load data
|
3'b101: match_cond1_ct = dcpu_dat_lsu; // store data
|
3'b101: match_cond1_ct = dcpu_dat_lsu; // store data
|
3'b110: match_cond1_ct = dcpu_adr_i; // load/store EA
|
3'b110: match_cond1_ct = dcpu_adr_i; // load/store EA
|
default:match_cond1_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
default:match_cond1_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
endcase
|
endcase
|
|
|
//
|
//
|
// When To Compare (Match Condition 1)
|
// When To Compare (Match Condition 1)
|
//
|
//
|
always @(dcr1 or dcpu_cycstb_i)
|
always @(dcr1 or dcpu_cycstb_i)
|
case (dcr1[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr1[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b000: match_cond1_stb = 1'b0; //comparison disabled
|
3'b000: match_cond1_stb = 1'b0; //comparison disabled
|
3'b001: match_cond1_stb = 1'b1; // insn fetch EA
|
3'b001: match_cond1_stb = 1'b1; // insn fetch EA
|
default:match_cond1_stb = dcpu_cycstb_i; // any load/store
|
default:match_cond1_stb = dcpu_cycstb_i; // any load/store
|
endcase
|
endcase
|
|
|
//
|
//
|
// Match Condition 1
|
// Match Condition 1
|
//
|
//
|
always @(match_cond1_stb or dcr1 or dvr1 or match_cond1_ct)
|
always @(match_cond1_stb or dcr1 or dvr1 or match_cond1_ct)
|
casex ({match_cond1_stb, dcr1[`OR1200_DU_DCR_CC]})
|
casex ({match_cond1_stb, dcr1[`OR1200_DU_DCR_CC]})
|
4'b0_xxx,
|
4'b0_xxx,
|
4'b1_000,
|
4'b1_000,
|
4'b1_111: match1 = 1'b0;
|
4'b1_111: match1 = 1'b0;
|
4'b1_001: match1 =
|
4'b1_001: match1 =
|
((match_cond1_ct[31] ^ dcr1[`OR1200_DU_DCR_SC]) ==
|
((match_cond1_ct[31] ^ dcr1[`OR1200_DU_DCR_SC]) ==
|
(dvr1[31] ^ dcr1[`OR1200_DU_DCR_SC]));
|
(dvr1[31] ^ dcr1[`OR1200_DU_DCR_SC]));
|
4'b1_010: match1 =
|
4'b1_010: match1 =
|
((match_cond1_ct[31] ^ dcr1[`OR1200_DU_DCR_SC]) <
|
((match_cond1_ct[31] ^ dcr1[`OR1200_DU_DCR_SC]) <
|
(dvr1[31] ^ dcr1[`OR1200_DU_DCR_SC]));
|
(dvr1[31] ^ dcr1[`OR1200_DU_DCR_SC]));
|
4'b1_011: match1 =
|
4'b1_011: match1 =
|
((match_cond1_ct[31] ^ dcr1[`OR1200_DU_DCR_SC]) <=
|
((match_cond1_ct[31] ^ dcr1[`OR1200_DU_DCR_SC]) <=
|
(dvr1[31] ^ dcr1[`OR1200_DU_DCR_SC]));
|
(dvr1[31] ^ dcr1[`OR1200_DU_DCR_SC]));
|
4'b1_100: match1 =
|
4'b1_100: match1 =
|
((match_cond1_ct[31] ^ dcr1[`OR1200_DU_DCR_SC]) >
|
((match_cond1_ct[31] ^ dcr1[`OR1200_DU_DCR_SC]) >
|
(dvr1[31] ^ dcr1[`OR1200_DU_DCR_SC]));
|
(dvr1[31] ^ dcr1[`OR1200_DU_DCR_SC]));
|
4'b1_101: match1 =
|
4'b1_101: match1 =
|
((match_cond1_ct[31] ^ dcr1[`OR1200_DU_DCR_SC]) >=
|
((match_cond1_ct[31] ^ dcr1[`OR1200_DU_DCR_SC]) >=
|
(dvr1[31] ^ dcr1[`OR1200_DU_DCR_SC]));
|
(dvr1[31] ^ dcr1[`OR1200_DU_DCR_SC]));
|
4'b1_110: match1 =
|
4'b1_110: match1 =
|
((match_cond1_ct[31] ^ dcr1[`OR1200_DU_DCR_SC]) !=
|
((match_cond1_ct[31] ^ dcr1[`OR1200_DU_DCR_SC]) !=
|
(dvr1[31] ^ dcr1[`OR1200_DU_DCR_SC]));
|
(dvr1[31] ^ dcr1[`OR1200_DU_DCR_SC]));
|
endcase
|
endcase
|
|
|
//
|
//
|
// Watchpoint 1
|
// Watchpoint 1
|
//
|
//
|
always @(dmr1 or match1 or wp)
|
always @(dmr1 or match1 or wp)
|
case (dmr1[`OR1200_DU_DMR1_CW1])
|
case (dmr1[`OR1200_DU_DMR1_CW1])
|
2'b00: wp[1] = match1;
|
2'b00: wp[1] = match1;
|
2'b01: wp[1] = match1 & wp[0];
|
2'b01: wp[1] = match1 & wp[0];
|
2'b10: wp[1] = match1 | wp[0];
|
2'b10: wp[1] = match1 | wp[0];
|
2'b11: wp[1] = 1'b0;
|
2'b11: wp[1] = 1'b0;
|
endcase
|
endcase
|
|
|
//
|
//
|
// Compare To What (Match Condition 2)
|
// Compare To What (Match Condition 2)
|
//
|
//
|
always @(dcr2 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
always @(dcr2 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
or dcpu_dat_lsu or dcpu_we_i)
|
or dcpu_dat_lsu or dcpu_we_i)
|
case (dcr2[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr2[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b001: match_cond2_ct = id_pc; // insn fetch EA
|
3'b001: match_cond2_ct = id_pc; // insn fetch EA
|
3'b010: match_cond2_ct = dcpu_adr_i; // load EA
|
3'b010: match_cond2_ct = dcpu_adr_i; // load EA
|
3'b011: match_cond2_ct = dcpu_adr_i; // store EA
|
3'b011: match_cond2_ct = dcpu_adr_i; // store EA
|
3'b100: match_cond2_ct = dcpu_dat_dc; // load data
|
3'b100: match_cond2_ct = dcpu_dat_dc; // load data
|
3'b101: match_cond2_ct = dcpu_dat_lsu; // store data
|
3'b101: match_cond2_ct = dcpu_dat_lsu; // store data
|
3'b110: match_cond2_ct = dcpu_adr_i; // load/store EA
|
3'b110: match_cond2_ct = dcpu_adr_i; // load/store EA
|
default:match_cond2_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
default:match_cond2_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
endcase
|
endcase
|
|
|
//
|
//
|
// When To Compare (Match Condition 2)
|
// When To Compare (Match Condition 2)
|
//
|
//
|
always @(dcr2 or dcpu_cycstb_i)
|
always @(dcr2 or dcpu_cycstb_i)
|
case (dcr2[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr2[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b000: match_cond2_stb = 1'b0; //comparison disabled
|
3'b000: match_cond2_stb = 1'b0; //comparison disabled
|
3'b001: match_cond2_stb = 1'b1; // insn fetch EA
|
3'b001: match_cond2_stb = 1'b1; // insn fetch EA
|
default:match_cond2_stb = dcpu_cycstb_i; // any load/store
|
default:match_cond2_stb = dcpu_cycstb_i; // any load/store
|
endcase
|
endcase
|
|
|
//
|
//
|
// Match Condition 2
|
// Match Condition 2
|
//
|
//
|
always @(match_cond2_stb or dcr2 or dvr2 or match_cond2_ct)
|
always @(match_cond2_stb or dcr2 or dvr2 or match_cond2_ct)
|
casex ({match_cond2_stb, dcr2[`OR1200_DU_DCR_CC]})
|
casex ({match_cond2_stb, dcr2[`OR1200_DU_DCR_CC]})
|
4'b0_xxx,
|
4'b0_xxx,
|
4'b1_000,
|
4'b1_000,
|
4'b1_111: match2 = 1'b0;
|
4'b1_111: match2 = 1'b0;
|
4'b1_001: match2 =
|
4'b1_001: match2 =
|
((match_cond2_ct[31] ^ dcr2[`OR1200_DU_DCR_SC]) ==
|
((match_cond2_ct[31] ^ dcr2[`OR1200_DU_DCR_SC]) ==
|
(dvr2[31] ^ dcr2[`OR1200_DU_DCR_SC]));
|
(dvr2[31] ^ dcr2[`OR1200_DU_DCR_SC]));
|
4'b1_010: match2 =
|
4'b1_010: match2 =
|
((match_cond2_ct[31] ^ dcr2[`OR1200_DU_DCR_SC]) <
|
((match_cond2_ct[31] ^ dcr2[`OR1200_DU_DCR_SC]) <
|
(dvr2[31] ^ dcr2[`OR1200_DU_DCR_SC]));
|
(dvr2[31] ^ dcr2[`OR1200_DU_DCR_SC]));
|
4'b1_011: match2 =
|
4'b1_011: match2 =
|
((match_cond2_ct[31] ^ dcr2[`OR1200_DU_DCR_SC]) <=
|
((match_cond2_ct[31] ^ dcr2[`OR1200_DU_DCR_SC]) <=
|
(dvr2[31] ^ dcr2[`OR1200_DU_DCR_SC]));
|
(dvr2[31] ^ dcr2[`OR1200_DU_DCR_SC]));
|
4'b1_100: match2 =
|
4'b1_100: match2 =
|
((match_cond2_ct[31] ^ dcr2[`OR1200_DU_DCR_SC]) >
|
((match_cond2_ct[31] ^ dcr2[`OR1200_DU_DCR_SC]) >
|
(dvr2[31] ^ dcr2[`OR1200_DU_DCR_SC]));
|
(dvr2[31] ^ dcr2[`OR1200_DU_DCR_SC]));
|
4'b1_101: match2 =
|
4'b1_101: match2 =
|
((match_cond2_ct[31] ^ dcr2[`OR1200_DU_DCR_SC]) >=
|
((match_cond2_ct[31] ^ dcr2[`OR1200_DU_DCR_SC]) >=
|
(dvr2[31] ^ dcr2[`OR1200_DU_DCR_SC]));
|
(dvr2[31] ^ dcr2[`OR1200_DU_DCR_SC]));
|
4'b1_110: match2 =
|
4'b1_110: match2 =
|
((match_cond2_ct[31] ^ dcr2[`OR1200_DU_DCR_SC]) !=
|
((match_cond2_ct[31] ^ dcr2[`OR1200_DU_DCR_SC]) !=
|
(dvr2[31] ^ dcr2[`OR1200_DU_DCR_SC]));
|
(dvr2[31] ^ dcr2[`OR1200_DU_DCR_SC]));
|
endcase
|
endcase
|
|
|
//
|
//
|
// Watchpoint 2
|
// Watchpoint 2
|
//
|
//
|
always @(dmr1 or match2 or wp)
|
always @(dmr1 or match2 or wp)
|
case (dmr1[`OR1200_DU_DMR1_CW2])
|
case (dmr1[`OR1200_DU_DMR1_CW2])
|
2'b00: wp[2] = match2;
|
2'b00: wp[2] = match2;
|
2'b01: wp[2] = match2 & wp[1];
|
2'b01: wp[2] = match2 & wp[1];
|
2'b10: wp[2] = match2 | wp[1];
|
2'b10: wp[2] = match2 | wp[1];
|
2'b11: wp[2] = 1'b0;
|
2'b11: wp[2] = 1'b0;
|
endcase
|
endcase
|
|
|
//
|
//
|
// Compare To What (Match Condition 3)
|
// Compare To What (Match Condition 3)
|
//
|
//
|
always @(dcr3 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
always @(dcr3 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
or dcpu_dat_lsu or dcpu_we_i)
|
or dcpu_dat_lsu or dcpu_we_i)
|
case (dcr3[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr3[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b001: match_cond3_ct = id_pc; // insn fetch EA
|
3'b001: match_cond3_ct = id_pc; // insn fetch EA
|
3'b010: match_cond3_ct = dcpu_adr_i; // load EA
|
3'b010: match_cond3_ct = dcpu_adr_i; // load EA
|
3'b011: match_cond3_ct = dcpu_adr_i; // store EA
|
3'b011: match_cond3_ct = dcpu_adr_i; // store EA
|
3'b100: match_cond3_ct = dcpu_dat_dc; // load data
|
3'b100: match_cond3_ct = dcpu_dat_dc; // load data
|
3'b101: match_cond3_ct = dcpu_dat_lsu; // store data
|
3'b101: match_cond3_ct = dcpu_dat_lsu; // store data
|
3'b110: match_cond3_ct = dcpu_adr_i; // load/store EA
|
3'b110: match_cond3_ct = dcpu_adr_i; // load/store EA
|
default:match_cond3_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
default:match_cond3_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
endcase
|
endcase
|
|
|
//
|
//
|
// When To Compare (Match Condition 3)
|
// When To Compare (Match Condition 3)
|
//
|
//
|
always @(dcr3 or dcpu_cycstb_i)
|
always @(dcr3 or dcpu_cycstb_i)
|
case (dcr3[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr3[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b000: match_cond3_stb = 1'b0; //comparison disabled
|
3'b000: match_cond3_stb = 1'b0; //comparison disabled
|
3'b001: match_cond3_stb = 1'b1; // insn fetch EA
|
3'b001: match_cond3_stb = 1'b1; // insn fetch EA
|
default:match_cond3_stb = dcpu_cycstb_i; // any load/store
|
default:match_cond3_stb = dcpu_cycstb_i; // any load/store
|
endcase
|
endcase
|
|
|
//
|
//
|
// Match Condition 3
|
// Match Condition 3
|
//
|
//
|
always @(match_cond3_stb or dcr3 or dvr3 or match_cond3_ct)
|
always @(match_cond3_stb or dcr3 or dvr3 or match_cond3_ct)
|
casex ({match_cond3_stb, dcr3[`OR1200_DU_DCR_CC]})
|
casex ({match_cond3_stb, dcr3[`OR1200_DU_DCR_CC]})
|
4'b0_xxx,
|
4'b0_xxx,
|
4'b1_000,
|
4'b1_000,
|
4'b1_111: match3 = 1'b0;
|
4'b1_111: match3 = 1'b0;
|
4'b1_001: match3 =
|
4'b1_001: match3 =
|
((match_cond3_ct[31] ^ dcr3[`OR1200_DU_DCR_SC]) ==
|
((match_cond3_ct[31] ^ dcr3[`OR1200_DU_DCR_SC]) ==
|
(dvr3[31] ^ dcr3[`OR1200_DU_DCR_SC]));
|
(dvr3[31] ^ dcr3[`OR1200_DU_DCR_SC]));
|
4'b1_010: match3 =
|
4'b1_010: match3 =
|
((match_cond3_ct[31] ^ dcr3[`OR1200_DU_DCR_SC]) <
|
((match_cond3_ct[31] ^ dcr3[`OR1200_DU_DCR_SC]) <
|
(dvr3[31] ^ dcr3[`OR1200_DU_DCR_SC]));
|
(dvr3[31] ^ dcr3[`OR1200_DU_DCR_SC]));
|
4'b1_011: match3 =
|
4'b1_011: match3 =
|
((match_cond3_ct[31] ^ dcr3[`OR1200_DU_DCR_SC]) <=
|
((match_cond3_ct[31] ^ dcr3[`OR1200_DU_DCR_SC]) <=
|
(dvr3[31] ^ dcr3[`OR1200_DU_DCR_SC]));
|
(dvr3[31] ^ dcr3[`OR1200_DU_DCR_SC]));
|
4'b1_100: match3 =
|
4'b1_100: match3 =
|
((match_cond3_ct[31] ^ dcr3[`OR1200_DU_DCR_SC]) >
|
((match_cond3_ct[31] ^ dcr3[`OR1200_DU_DCR_SC]) >
|
(dvr3[31] ^ dcr3[`OR1200_DU_DCR_SC]));
|
(dvr3[31] ^ dcr3[`OR1200_DU_DCR_SC]));
|
4'b1_101: match3 =
|
4'b1_101: match3 =
|
((match_cond3_ct[31] ^ dcr3[`OR1200_DU_DCR_SC]) >=
|
((match_cond3_ct[31] ^ dcr3[`OR1200_DU_DCR_SC]) >=
|
(dvr3[31] ^ dcr3[`OR1200_DU_DCR_SC]));
|
(dvr3[31] ^ dcr3[`OR1200_DU_DCR_SC]));
|
4'b1_110: match3 =
|
4'b1_110: match3 =
|
((match_cond3_ct[31] ^ dcr3[`OR1200_DU_DCR_SC]) !=
|
((match_cond3_ct[31] ^ dcr3[`OR1200_DU_DCR_SC]) !=
|
(dvr3[31] ^ dcr3[`OR1200_DU_DCR_SC]));
|
(dvr3[31] ^ dcr3[`OR1200_DU_DCR_SC]));
|
endcase
|
endcase
|
|
|
//
|
//
|
// Watchpoint 3
|
// Watchpoint 3
|
//
|
//
|
always @(dmr1 or match3 or wp)
|
always @(dmr1 or match3 or wp)
|
case (dmr1[`OR1200_DU_DMR1_CW3])
|
case (dmr1[`OR1200_DU_DMR1_CW3])
|
2'b00: wp[3] = match3;
|
2'b00: wp[3] = match3;
|
2'b01: wp[3] = match3 & wp[2];
|
2'b01: wp[3] = match3 & wp[2];
|
2'b10: wp[3] = match3 | wp[2];
|
2'b10: wp[3] = match3 | wp[2];
|
2'b11: wp[3] = 1'b0;
|
2'b11: wp[3] = 1'b0;
|
endcase
|
endcase
|
|
|
//
|
//
|
// Compare To What (Match Condition 4)
|
// Compare To What (Match Condition 4)
|
//
|
//
|
always @(dcr4 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
always @(dcr4 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
or dcpu_dat_lsu or dcpu_we_i)
|
or dcpu_dat_lsu or dcpu_we_i)
|
case (dcr4[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr4[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b001: match_cond4_ct = id_pc; // insn fetch EA
|
3'b001: match_cond4_ct = id_pc; // insn fetch EA
|
3'b010: match_cond4_ct = dcpu_adr_i; // load EA
|
3'b010: match_cond4_ct = dcpu_adr_i; // load EA
|
3'b011: match_cond4_ct = dcpu_adr_i; // store EA
|
3'b011: match_cond4_ct = dcpu_adr_i; // store EA
|
3'b100: match_cond4_ct = dcpu_dat_dc; // load data
|
3'b100: match_cond4_ct = dcpu_dat_dc; // load data
|
3'b101: match_cond4_ct = dcpu_dat_lsu; // store data
|
3'b101: match_cond4_ct = dcpu_dat_lsu; // store data
|
3'b110: match_cond4_ct = dcpu_adr_i; // load/store EA
|
3'b110: match_cond4_ct = dcpu_adr_i; // load/store EA
|
default:match_cond4_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
default:match_cond4_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
endcase
|
endcase
|
|
|
//
|
//
|
// When To Compare (Match Condition 4)
|
// When To Compare (Match Condition 4)
|
//
|
//
|
always @(dcr4 or dcpu_cycstb_i)
|
always @(dcr4 or dcpu_cycstb_i)
|
case (dcr4[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr4[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b000: match_cond4_stb = 1'b0; //comparison disabled
|
3'b000: match_cond4_stb = 1'b0; //comparison disabled
|
3'b001: match_cond4_stb = 1'b1; // insn fetch EA
|
3'b001: match_cond4_stb = 1'b1; // insn fetch EA
|
default:match_cond4_stb = dcpu_cycstb_i; // any load/store
|
default:match_cond4_stb = dcpu_cycstb_i; // any load/store
|
endcase
|
endcase
|
|
|
//
|
//
|
// Match Condition 4
|
// Match Condition 4
|
//
|
//
|
always @(match_cond4_stb or dcr4 or dvr4 or match_cond4_ct)
|
always @(match_cond4_stb or dcr4 or dvr4 or match_cond4_ct)
|
casex ({match_cond4_stb, dcr4[`OR1200_DU_DCR_CC]})
|
casex ({match_cond4_stb, dcr4[`OR1200_DU_DCR_CC]})
|
4'b0_xxx,
|
4'b0_xxx,
|
4'b1_000,
|
4'b1_000,
|
4'b1_111: match4 = 1'b0;
|
4'b1_111: match4 = 1'b0;
|
4'b1_001: match4 =
|
4'b1_001: match4 =
|
((match_cond4_ct[31] ^ dcr4[`OR1200_DU_DCR_SC]) ==
|
((match_cond4_ct[31] ^ dcr4[`OR1200_DU_DCR_SC]) ==
|
(dvr4[31] ^ dcr4[`OR1200_DU_DCR_SC]));
|
(dvr4[31] ^ dcr4[`OR1200_DU_DCR_SC]));
|
4'b1_010: match4 =
|
4'b1_010: match4 =
|
((match_cond4_ct[31] ^ dcr4[`OR1200_DU_DCR_SC]) <
|
((match_cond4_ct[31] ^ dcr4[`OR1200_DU_DCR_SC]) <
|
(dvr4[31] ^ dcr4[`OR1200_DU_DCR_SC]));
|
(dvr4[31] ^ dcr4[`OR1200_DU_DCR_SC]));
|
4'b1_011: match4 =
|
4'b1_011: match4 =
|
((match_cond4_ct[31] ^ dcr4[`OR1200_DU_DCR_SC]) <=
|
((match_cond4_ct[31] ^ dcr4[`OR1200_DU_DCR_SC]) <=
|
(dvr4[31] ^ dcr4[`OR1200_DU_DCR_SC]));
|
(dvr4[31] ^ dcr4[`OR1200_DU_DCR_SC]));
|
4'b1_100: match4 =
|
4'b1_100: match4 =
|
((match_cond4_ct[31] ^ dcr4[`OR1200_DU_DCR_SC]) >
|
((match_cond4_ct[31] ^ dcr4[`OR1200_DU_DCR_SC]) >
|
(dvr4[31] ^ dcr4[`OR1200_DU_DCR_SC]));
|
(dvr4[31] ^ dcr4[`OR1200_DU_DCR_SC]));
|
4'b1_101: match4 =
|
4'b1_101: match4 =
|
((match_cond4_ct[31] ^ dcr4[`OR1200_DU_DCR_SC]) >=
|
((match_cond4_ct[31] ^ dcr4[`OR1200_DU_DCR_SC]) >=
|
(dvr4[31] ^ dcr4[`OR1200_DU_DCR_SC]));
|
(dvr4[31] ^ dcr4[`OR1200_DU_DCR_SC]));
|
4'b1_110: match4 =
|
4'b1_110: match4 =
|
((match_cond4_ct[31] ^ dcr4[`OR1200_DU_DCR_SC]) !=
|
((match_cond4_ct[31] ^ dcr4[`OR1200_DU_DCR_SC]) !=
|
(dvr4[31] ^ dcr4[`OR1200_DU_DCR_SC]));
|
(dvr4[31] ^ dcr4[`OR1200_DU_DCR_SC]));
|
endcase
|
endcase
|
|
|
//
|
//
|
// Watchpoint 4
|
// Watchpoint 4
|
//
|
//
|
always @(dmr1 or match4 or wp)
|
always @(dmr1 or match4 or wp)
|
case (dmr1[`OR1200_DU_DMR1_CW4])
|
case (dmr1[`OR1200_DU_DMR1_CW4])
|
2'b00: wp[4] = match4;
|
2'b00: wp[4] = match4;
|
2'b01: wp[4] = match4 & wp[3];
|
2'b01: wp[4] = match4 & wp[3];
|
2'b10: wp[4] = match4 | wp[3];
|
2'b10: wp[4] = match4 | wp[3];
|
2'b11: wp[4] = 1'b0;
|
2'b11: wp[4] = 1'b0;
|
endcase
|
endcase
|
|
|
//
|
//
|
// Compare To What (Match Condition 5)
|
// Compare To What (Match Condition 5)
|
//
|
//
|
always @(dcr5 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
always @(dcr5 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
or dcpu_dat_lsu or dcpu_we_i)
|
or dcpu_dat_lsu or dcpu_we_i)
|
case (dcr5[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr5[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b001: match_cond5_ct = id_pc; // insn fetch EA
|
3'b001: match_cond5_ct = id_pc; // insn fetch EA
|
3'b010: match_cond5_ct = dcpu_adr_i; // load EA
|
3'b010: match_cond5_ct = dcpu_adr_i; // load EA
|
3'b011: match_cond5_ct = dcpu_adr_i; // store EA
|
3'b011: match_cond5_ct = dcpu_adr_i; // store EA
|
3'b100: match_cond5_ct = dcpu_dat_dc; // load data
|
3'b100: match_cond5_ct = dcpu_dat_dc; // load data
|
3'b101: match_cond5_ct = dcpu_dat_lsu; // store data
|
3'b101: match_cond5_ct = dcpu_dat_lsu; // store data
|
3'b110: match_cond5_ct = dcpu_adr_i; // load/store EA
|
3'b110: match_cond5_ct = dcpu_adr_i; // load/store EA
|
default:match_cond5_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
default:match_cond5_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
endcase
|
endcase
|
|
|
//
|
//
|
// When To Compare (Match Condition 5)
|
// When To Compare (Match Condition 5)
|
//
|
//
|
always @(dcr5 or dcpu_cycstb_i)
|
always @(dcr5 or dcpu_cycstb_i)
|
case (dcr5[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr5[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b000: match_cond5_stb = 1'b0; //comparison disabled
|
3'b000: match_cond5_stb = 1'b0; //comparison disabled
|
3'b001: match_cond5_stb = 1'b1; // insn fetch EA
|
3'b001: match_cond5_stb = 1'b1; // insn fetch EA
|
default:match_cond5_stb = dcpu_cycstb_i; // any load/store
|
default:match_cond5_stb = dcpu_cycstb_i; // any load/store
|
endcase
|
endcase
|
|
|
//
|
//
|
// Match Condition 5
|
// Match Condition 5
|
//
|
//
|
always @(match_cond5_stb or dcr5 or dvr5 or match_cond5_ct)
|
always @(match_cond5_stb or dcr5 or dvr5 or match_cond5_ct)
|
casex ({match_cond5_stb, dcr5[`OR1200_DU_DCR_CC]})
|
casex ({match_cond5_stb, dcr5[`OR1200_DU_DCR_CC]})
|
4'b0_xxx,
|
4'b0_xxx,
|
4'b1_000,
|
4'b1_000,
|
4'b1_111: match5 = 1'b0;
|
4'b1_111: match5 = 1'b0;
|
4'b1_001: match5 =
|
4'b1_001: match5 =
|
((match_cond5_ct[31] ^ dcr5[`OR1200_DU_DCR_SC]) ==
|
((match_cond5_ct[31] ^ dcr5[`OR1200_DU_DCR_SC]) ==
|
(dvr5[31] ^ dcr5[`OR1200_DU_DCR_SC]));
|
(dvr5[31] ^ dcr5[`OR1200_DU_DCR_SC]));
|
4'b1_010: match5 =
|
4'b1_010: match5 =
|
((match_cond5_ct[31] ^ dcr5[`OR1200_DU_DCR_SC]) <
|
((match_cond5_ct[31] ^ dcr5[`OR1200_DU_DCR_SC]) <
|
(dvr5[31] ^ dcr5[`OR1200_DU_DCR_SC]));
|
(dvr5[31] ^ dcr5[`OR1200_DU_DCR_SC]));
|
4'b1_011: match5 =
|
4'b1_011: match5 =
|
((match_cond5_ct[31] ^ dcr5[`OR1200_DU_DCR_SC]) <=
|
((match_cond5_ct[31] ^ dcr5[`OR1200_DU_DCR_SC]) <=
|
(dvr5[31] ^ dcr5[`OR1200_DU_DCR_SC]));
|
(dvr5[31] ^ dcr5[`OR1200_DU_DCR_SC]));
|
4'b1_100: match5 =
|
4'b1_100: match5 =
|
((match_cond5_ct[31] ^ dcr5[`OR1200_DU_DCR_SC]) >
|
((match_cond5_ct[31] ^ dcr5[`OR1200_DU_DCR_SC]) >
|
(dvr5[31] ^ dcr5[`OR1200_DU_DCR_SC]));
|
(dvr5[31] ^ dcr5[`OR1200_DU_DCR_SC]));
|
4'b1_101: match5 =
|
4'b1_101: match5 =
|
((match_cond5_ct[31] ^ dcr5[`OR1200_DU_DCR_SC]) >=
|
((match_cond5_ct[31] ^ dcr5[`OR1200_DU_DCR_SC]) >=
|
(dvr5[31] ^ dcr5[`OR1200_DU_DCR_SC]));
|
(dvr5[31] ^ dcr5[`OR1200_DU_DCR_SC]));
|
4'b1_110: match5 =
|
4'b1_110: match5 =
|
((match_cond5_ct[31] ^ dcr5[`OR1200_DU_DCR_SC]) !=
|
((match_cond5_ct[31] ^ dcr5[`OR1200_DU_DCR_SC]) !=
|
(dvr5[31] ^ dcr5[`OR1200_DU_DCR_SC]));
|
(dvr5[31] ^ dcr5[`OR1200_DU_DCR_SC]));
|
endcase
|
endcase
|
|
|
//
|
//
|
// Watchpoint 5
|
// Watchpoint 5
|
//
|
//
|
always @(dmr1 or match5 or wp)
|
always @(dmr1 or match5 or wp)
|
case (dmr1[`OR1200_DU_DMR1_CW5])
|
case (dmr1[`OR1200_DU_DMR1_CW5])
|
2'b00: wp[5] = match5;
|
2'b00: wp[5] = match5;
|
2'b01: wp[5] = match5 & wp[4];
|
2'b01: wp[5] = match5 & wp[4];
|
2'b10: wp[5] = match5 | wp[4];
|
2'b10: wp[5] = match5 | wp[4];
|
2'b11: wp[5] = 1'b0;
|
2'b11: wp[5] = 1'b0;
|
endcase
|
endcase
|
|
|
//
|
//
|
// Compare To What (Match Condition 6)
|
// Compare To What (Match Condition 6)
|
//
|
//
|
always @(dcr6 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
always @(dcr6 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
or dcpu_dat_lsu or dcpu_we_i)
|
or dcpu_dat_lsu or dcpu_we_i)
|
case (dcr6[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr6[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b001: match_cond6_ct = id_pc; // insn fetch EA
|
3'b001: match_cond6_ct = id_pc; // insn fetch EA
|
3'b010: match_cond6_ct = dcpu_adr_i; // load EA
|
3'b010: match_cond6_ct = dcpu_adr_i; // load EA
|
3'b011: match_cond6_ct = dcpu_adr_i; // store EA
|
3'b011: match_cond6_ct = dcpu_adr_i; // store EA
|
3'b100: match_cond6_ct = dcpu_dat_dc; // load data
|
3'b100: match_cond6_ct = dcpu_dat_dc; // load data
|
3'b101: match_cond6_ct = dcpu_dat_lsu; // store data
|
3'b101: match_cond6_ct = dcpu_dat_lsu; // store data
|
3'b110: match_cond6_ct = dcpu_adr_i; // load/store EA
|
3'b110: match_cond6_ct = dcpu_adr_i; // load/store EA
|
default:match_cond6_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
default:match_cond6_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
endcase
|
endcase
|
|
|
//
|
//
|
// When To Compare (Match Condition 6)
|
// When To Compare (Match Condition 6)
|
//
|
//
|
always @(dcr6 or dcpu_cycstb_i)
|
always @(dcr6 or dcpu_cycstb_i)
|
case (dcr6[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr6[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b000: match_cond6_stb = 1'b0; //comparison disabled
|
3'b000: match_cond6_stb = 1'b0; //comparison disabled
|
3'b001: match_cond6_stb = 1'b1; // insn fetch EA
|
3'b001: match_cond6_stb = 1'b1; // insn fetch EA
|
default:match_cond6_stb = dcpu_cycstb_i; // any load/store
|
default:match_cond6_stb = dcpu_cycstb_i; // any load/store
|
endcase
|
endcase
|
|
|
//
|
//
|
// Match Condition 6
|
// Match Condition 6
|
//
|
//
|
always @(match_cond6_stb or dcr6 or dvr6 or match_cond6_ct)
|
always @(match_cond6_stb or dcr6 or dvr6 or match_cond6_ct)
|
casex ({match_cond6_stb, dcr6[`OR1200_DU_DCR_CC]})
|
casex ({match_cond6_stb, dcr6[`OR1200_DU_DCR_CC]})
|
4'b0_xxx,
|
4'b0_xxx,
|
4'b1_000,
|
4'b1_000,
|
4'b1_111: match6 = 1'b0;
|
4'b1_111: match6 = 1'b0;
|
4'b1_001: match6 =
|
4'b1_001: match6 =
|
((match_cond6_ct[31] ^ dcr6[`OR1200_DU_DCR_SC]) ==
|
((match_cond6_ct[31] ^ dcr6[`OR1200_DU_DCR_SC]) ==
|
(dvr6[31] ^ dcr6[`OR1200_DU_DCR_SC]));
|
(dvr6[31] ^ dcr6[`OR1200_DU_DCR_SC]));
|
4'b1_010: match6 =
|
4'b1_010: match6 =
|
((match_cond6_ct[31] ^ dcr6[`OR1200_DU_DCR_SC]) <
|
((match_cond6_ct[31] ^ dcr6[`OR1200_DU_DCR_SC]) <
|
(dvr6[31] ^ dcr6[`OR1200_DU_DCR_SC]));
|
(dvr6[31] ^ dcr6[`OR1200_DU_DCR_SC]));
|
4'b1_011: match6 =
|
4'b1_011: match6 =
|
((match_cond6_ct[31] ^ dcr6[`OR1200_DU_DCR_SC]) <=
|
((match_cond6_ct[31] ^ dcr6[`OR1200_DU_DCR_SC]) <=
|
(dvr6[31] ^ dcr6[`OR1200_DU_DCR_SC]));
|
(dvr6[31] ^ dcr6[`OR1200_DU_DCR_SC]));
|
4'b1_100: match6 =
|
4'b1_100: match6 =
|
((match_cond6_ct[31] ^ dcr6[`OR1200_DU_DCR_SC]) >
|
((match_cond6_ct[31] ^ dcr6[`OR1200_DU_DCR_SC]) >
|
(dvr6[31] ^ dcr6[`OR1200_DU_DCR_SC]));
|
(dvr6[31] ^ dcr6[`OR1200_DU_DCR_SC]));
|
4'b1_101: match6 =
|
4'b1_101: match6 =
|
((match_cond6_ct[31] ^ dcr6[`OR1200_DU_DCR_SC]) >=
|
((match_cond6_ct[31] ^ dcr6[`OR1200_DU_DCR_SC]) >=
|
(dvr6[31] ^ dcr6[`OR1200_DU_DCR_SC]));
|
(dvr6[31] ^ dcr6[`OR1200_DU_DCR_SC]));
|
4'b1_110: match6 =
|
4'b1_110: match6 =
|
((match_cond6_ct[31] ^ dcr6[`OR1200_DU_DCR_SC]) !=
|
((match_cond6_ct[31] ^ dcr6[`OR1200_DU_DCR_SC]) !=
|
(dvr6[31] ^ dcr6[`OR1200_DU_DCR_SC]));
|
(dvr6[31] ^ dcr6[`OR1200_DU_DCR_SC]));
|
endcase
|
endcase
|
|
|
//
|
//
|
// Watchpoint 6
|
// Watchpoint 6
|
//
|
//
|
always @(dmr1 or match6 or wp)
|
always @(dmr1 or match6 or wp)
|
case (dmr1[`OR1200_DU_DMR1_CW6])
|
case (dmr1[`OR1200_DU_DMR1_CW6])
|
2'b00: wp[6] = match6;
|
2'b00: wp[6] = match6;
|
2'b01: wp[6] = match6 & wp[5];
|
2'b01: wp[6] = match6 & wp[5];
|
2'b10: wp[6] = match6 | wp[5];
|
2'b10: wp[6] = match6 | wp[5];
|
2'b11: wp[6] = 1'b0;
|
2'b11: wp[6] = 1'b0;
|
endcase
|
endcase
|
|
|
//
|
//
|
// Compare To What (Match Condition 7)
|
// Compare To What (Match Condition 7)
|
//
|
//
|
always @(dcr7 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
always @(dcr7 or id_pc or dcpu_adr_i or dcpu_dat_dc
|
or dcpu_dat_lsu or dcpu_we_i)
|
or dcpu_dat_lsu or dcpu_we_i)
|
case (dcr7[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr7[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b001: match_cond7_ct = id_pc; // insn fetch EA
|
3'b001: match_cond7_ct = id_pc; // insn fetch EA
|
3'b010: match_cond7_ct = dcpu_adr_i; // load EA
|
3'b010: match_cond7_ct = dcpu_adr_i; // load EA
|
3'b011: match_cond7_ct = dcpu_adr_i; // store EA
|
3'b011: match_cond7_ct = dcpu_adr_i; // store EA
|
3'b100: match_cond7_ct = dcpu_dat_dc; // load data
|
3'b100: match_cond7_ct = dcpu_dat_dc; // load data
|
3'b101: match_cond7_ct = dcpu_dat_lsu; // store data
|
3'b101: match_cond7_ct = dcpu_dat_lsu; // store data
|
3'b110: match_cond7_ct = dcpu_adr_i; // load/store EA
|
3'b110: match_cond7_ct = dcpu_adr_i; // load/store EA
|
default:match_cond7_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
default:match_cond7_ct = dcpu_we_i ? dcpu_dat_lsu : dcpu_dat_dc;
|
endcase
|
endcase
|
|
|
//
|
//
|
// When To Compare (Match Condition 7)
|
// When To Compare (Match Condition 7)
|
//
|
//
|
always @(dcr7 or dcpu_cycstb_i)
|
always @(dcr7 or dcpu_cycstb_i)
|
case (dcr7[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
case (dcr7[`OR1200_DU_DCR_CT]) // synopsys parallel_case
|
3'b000: match_cond7_stb = 1'b0; //comparison disabled
|
3'b000: match_cond7_stb = 1'b0; //comparison disabled
|
3'b001: match_cond7_stb = 1'b1; // insn fetch EA
|
3'b001: match_cond7_stb = 1'b1; // insn fetch EA
|
default:match_cond7_stb = dcpu_cycstb_i; // any load/store
|
default:match_cond7_stb = dcpu_cycstb_i; // any load/store
|
endcase
|
endcase
|
|
|
//
|
//
|
// Match Condition 7
|
// Match Condition 7
|
//
|
//
|
always @(match_cond7_stb or dcr7 or dvr7 or match_cond7_ct)
|
always @(match_cond7_stb or dcr7 or dvr7 or match_cond7_ct)
|
casex ({match_cond7_stb, dcr7[`OR1200_DU_DCR_CC]})
|
casex ({match_cond7_stb, dcr7[`OR1200_DU_DCR_CC]})
|
4'b0_xxx,
|
4'b0_xxx,
|
4'b1_000,
|
4'b1_000,
|
4'b1_111: match7 = 1'b0;
|
4'b1_111: match7 = 1'b0;
|
4'b1_001: match7 =
|
4'b1_001: match7 =
|
((match_cond7_ct[31] ^ dcr7[`OR1200_DU_DCR_SC]) ==
|
((match_cond7_ct[31] ^ dcr7[`OR1200_DU_DCR_SC]) ==
|
(dvr7[31] ^ dcr7[`OR1200_DU_DCR_SC]));
|
(dvr7[31] ^ dcr7[`OR1200_DU_DCR_SC]));
|
4'b1_010: match7 =
|
4'b1_010: match7 =
|
((match_cond7_ct[31] ^ dcr7[`OR1200_DU_DCR_SC]) <
|
((match_cond7_ct[31] ^ dcr7[`OR1200_DU_DCR_SC]) <
|
(dvr7[31] ^ dcr7[`OR1200_DU_DCR_SC]));
|
(dvr7[31] ^ dcr7[`OR1200_DU_DCR_SC]));
|
4'b1_011: match7 =
|
4'b1_011: match7 =
|
((match_cond7_ct[31] ^ dcr7[`OR1200_DU_DCR_SC]) <=
|
((match_cond7_ct[31] ^ dcr7[`OR1200_DU_DCR_SC]) <=
|
(dvr7[31] ^ dcr7[`OR1200_DU_DCR_SC]));
|
(dvr7[31] ^ dcr7[`OR1200_DU_DCR_SC]));
|
4'b1_100: match7 =
|
4'b1_100: match7 =
|
((match_cond7_ct[31] ^ dcr7[`OR1200_DU_DCR_SC]) >
|
((match_cond7_ct[31] ^ dcr7[`OR1200_DU_DCR_SC]) >
|
(dvr7[31] ^ dcr7[`OR1200_DU_DCR_SC]));
|
(dvr7[31] ^ dcr7[`OR1200_DU_DCR_SC]));
|
4'b1_101: match7 =
|
4'b1_101: match7 =
|
((match_cond7_ct[31] ^ dcr7[`OR1200_DU_DCR_SC]) >=
|
((match_cond7_ct[31] ^ dcr7[`OR1200_DU_DCR_SC]) >=
|
(dvr7[31] ^ dcr7[`OR1200_DU_DCR_SC]));
|
(dvr7[31] ^ dcr7[`OR1200_DU_DCR_SC]));
|
4'b1_110: match7 =
|
4'b1_110: match7 =
|
((match_cond7_ct[31] ^ dcr7[`OR1200_DU_DCR_SC]) !=
|
((match_cond7_ct[31] ^ dcr7[`OR1200_DU_DCR_SC]) !=
|
(dvr7[31] ^ dcr7[`OR1200_DU_DCR_SC]));
|
(dvr7[31] ^ dcr7[`OR1200_DU_DCR_SC]));
|
endcase
|
endcase
|
|
|
//
|
//
|
// Watchpoint 7
|
// Watchpoint 7
|
//
|
//
|
always @(dmr1 or match7 or wp)
|
always @(dmr1 or match7 or wp)
|
case (dmr1[`OR1200_DU_DMR1_CW7])
|
case (dmr1[`OR1200_DU_DMR1_CW7])
|
2'b00: wp[7] = match7;
|
2'b00: wp[7] = match7;
|
2'b01: wp[7] = match7 & wp[6];
|
2'b01: wp[7] = match7 & wp[6];
|
2'b10: wp[7] = match7 | wp[6];
|
2'b10: wp[7] = match7 | wp[6];
|
2'b11: wp[7] = 1'b0;
|
2'b11: wp[7] = 1'b0;
|
endcase
|
endcase
|
|
|
//
|
//
|
// Increment Watchpoint Counter 0
|
// Increment Watchpoint Counter 0
|
//
|
//
|
always @(wp or dmr2)
|
always @(wp or dmr2)
|
if (dmr2[`OR1200_DU_DMR2_WCE0])
|
if (dmr2[`OR1200_DU_DMR2_WCE0])
|
incr_wpcntr0 = |(wp & ~dmr2[`OR1200_DU_DMR2_AWTC]);
|
incr_wpcntr0 = |(wp & ~dmr2[`OR1200_DU_DMR2_AWTC]);
|
else
|
else
|
incr_wpcntr0 = 1'b0;
|
incr_wpcntr0 = 1'b0;
|
|
|
//
|
//
|
// Match Condition Watchpoint Counter 0
|
// Match Condition Watchpoint Counter 0
|
//
|
//
|
always @(dwcr0)
|
always @(dwcr0)
|
if (dwcr0[`OR1200_DU_DWCR_MATCH] == dwcr0[`OR1200_DU_DWCR_COUNT])
|
if (dwcr0[`OR1200_DU_DWCR_MATCH] == dwcr0[`OR1200_DU_DWCR_COUNT])
|
wpcntr0_match = 1'b1;
|
wpcntr0_match = 1'b1;
|
else
|
else
|
wpcntr0_match = 1'b0;
|
wpcntr0_match = 1'b0;
|
|
|
|
|
//
|
//
|
// Watchpoint 8
|
// Watchpoint 8
|
//
|
//
|
always @(dmr1 or wpcntr0_match or wp)
|
always @(dmr1 or wpcntr0_match or wp)
|
case (dmr1[`OR1200_DU_DMR1_CW8])
|
case (dmr1[`OR1200_DU_DMR1_CW8])
|
2'b00: wp[8] = wpcntr0_match;
|
2'b00: wp[8] = wpcntr0_match;
|
2'b01: wp[8] = wpcntr0_match & wp[7];
|
2'b01: wp[8] = wpcntr0_match & wp[7];
|
2'b10: wp[8] = wpcntr0_match | wp[7];
|
2'b10: wp[8] = wpcntr0_match | wp[7];
|
2'b11: wp[8] = 1'b0;
|
2'b11: wp[8] = 1'b0;
|
endcase
|
endcase
|
|
|
|
|
//
|
//
|
// Increment Watchpoint Counter 1
|
// Increment Watchpoint Counter 1
|
//
|
//
|
always @(wp or dmr2)
|
always @(wp or dmr2)
|
if (dmr2[`OR1200_DU_DMR2_WCE1])
|
if (dmr2[`OR1200_DU_DMR2_WCE1])
|
incr_wpcntr1 = |(wp & dmr2[`OR1200_DU_DMR2_AWTC]);
|
incr_wpcntr1 = |(wp & dmr2[`OR1200_DU_DMR2_AWTC]);
|
else
|
else
|
incr_wpcntr1 = 1'b0;
|
incr_wpcntr1 = 1'b0;
|
|
|
//
|
//
|
// Match Condition Watchpoint Counter 1
|
// Match Condition Watchpoint Counter 1
|
//
|
//
|
always @(dwcr1)
|
always @(dwcr1)
|
if (dwcr1[`OR1200_DU_DWCR_MATCH] == dwcr1[`OR1200_DU_DWCR_COUNT])
|
if (dwcr1[`OR1200_DU_DWCR_MATCH] == dwcr1[`OR1200_DU_DWCR_COUNT])
|
wpcntr1_match = 1'b1;
|
wpcntr1_match = 1'b1;
|
else
|
else
|
wpcntr1_match = 1'b0;
|
wpcntr1_match = 1'b0;
|
|
|
//
|
//
|
// Watchpoint 9
|
// Watchpoint 9
|
//
|
//
|
always @(dmr1 or wpcntr1_match or wp)
|
always @(dmr1 or wpcntr1_match or wp)
|
case (dmr1[`OR1200_DU_DMR1_CW9])
|
case (dmr1[`OR1200_DU_DMR1_CW9])
|
2'b00: wp[9] = wpcntr1_match;
|
2'b00: wp[9] = wpcntr1_match;
|
2'b01: wp[9] = wpcntr1_match & wp[8];
|
2'b01: wp[9] = wpcntr1_match & wp[8];
|
2'b10: wp[9] = wpcntr1_match | wp[8];
|
2'b10: wp[9] = wpcntr1_match | wp[8];
|
2'b11: wp[9] = 1'b0;
|
2'b11: wp[9] = 1'b0;
|
endcase
|
endcase
|
|
|
//
|
//
|
// Watchpoint 10
|
// Watchpoint 10
|
//
|
//
|
always @(dmr1 or dbg_ewt_i or wp)
|
always @(dmr1 or dbg_ewt_i or wp)
|
case (dmr1[`OR1200_DU_DMR1_CW10])
|
case (dmr1[`OR1200_DU_DMR1_CW10])
|
2'b00: wp[10] = dbg_ewt_i;
|
2'b00: wp[10] = dbg_ewt_i;
|
2'b01: wp[10] = dbg_ewt_i & wp[9];
|
2'b01: wp[10] = dbg_ewt_i & wp[9];
|
2'b10: wp[10] = dbg_ewt_i | wp[9];
|
2'b10: wp[10] = dbg_ewt_i | wp[9];
|
2'b11: wp[10] = 1'b0;
|
2'b11: wp[10] = 1'b0;
|
endcase
|
endcase
|
|
|
`endif
|
`endif
|
|
|
//
|
//
|
// Watchpoints can cause trap exception
|
// Watchpoints can cause trap exception
|
//
|
//
|
`ifdef OR1200_DU_HWBKPTS
|
`ifdef OR1200_DU_HWBKPTS
|
assign du_hwbkpt = |(wp & dmr2[`OR1200_DU_DMR2_WGB]);
|
assign du_hwbkpt = |(wp & dmr2[`OR1200_DU_DMR2_WGB]);
|
`else
|
`else
|
assign du_hwbkpt = 1'b0;
|
assign du_hwbkpt = 1'b0;
|
`endif
|
`endif
|
|
|
`ifdef OR1200_DU_TB_IMPLEMENTED
|
`ifdef OR1200_DU_TB_IMPLEMENTED
|
//
|
//
|
// Simple trace buffer
|
// Simple trace buffer
|
// (right now hardcoded for Xilinx Virtex FPGAs)
|
// (right now hardcoded for Xilinx Virtex FPGAs)
|
//
|
//
|
// Stores last 256 instruction addresses, instruction
|
// Stores last 256 instruction addresses, instruction
|
// machine words and ALU results
|
// machine words and ALU results
|
//
|
//
|
|
|
//
|
//
|
// Trace buffer write enable
|
// Trace buffer write enable
|
//
|
//
|
assign tb_enw = ~ex_freeze & ~((ex_insn[31:26] == `OR1200_OR32_NOP) & ex_insn[16]);
|
assign tb_enw = ~ex_freeze & ~((ex_insn[31:26] == `OR1200_OR32_NOP) & ex_insn[16]);
|
|
|
//
|
//
|
// Trace buffer write address pointer
|
// Trace buffer write address pointer
|
//
|
//
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
tb_wadr <= #1 8'h00;
|
tb_wadr <= #1 8'h00;
|
else if (tb_enw)
|
else if (tb_enw)
|
tb_wadr <= #1 tb_wadr + 8'd1;
|
tb_wadr <= #1 tb_wadr + 8'd1;
|
|
|
//
|
//
|
// Free running counter (time stamp)
|
// Free running counter (time stamp)
|
//
|
//
|
always @(posedge clk or posedge rst)
|
always @(posedge clk or posedge rst)
|
if (rst)
|
if (rst)
|
tb_timstmp <= #1 32'h00000000;
|
tb_timstmp <= #1 32'h00000000;
|
else if (!dbg_bp_r)
|
else if (!dbg_bp_r)
|
tb_timstmp <= #1 tb_timstmp + 32'd1;
|
tb_timstmp <= #1 tb_timstmp + 32'd1;
|
|
|
//
|
//
|
// Trace buffer RAMs
|
// Trace buffer RAMs
|
//
|
//
|
RAMB4_S16_S16 tbia_ramb4_s16_0(
|
RAMB4_S16_S16 tbia_ramb4_s16_0(
|
.CLKA(clk),
|
.CLKA(clk),
|
.RSTA(rst),
|
.RSTA(rst),
|
.ADDRA(tb_wadr),
|
.ADDRA(tb_wadr),
|
.DIA(spr_dat_npc[15:0]),
|
.DIA(spr_dat_npc[15:0]),
|
.ENA(1'b1),
|
.ENA(1'b1),
|
.WEA(tb_enw),
|
.WEA(tb_enw),
|
.DOA(),
|
.DOA(),
|
|
|
.CLKB(clk),
|
.CLKB(clk),
|
.RSTB(rst),
|
.RSTB(rst),
|
.ADDRB(spr_addr[7:0]),
|
.ADDRB(spr_addr[7:0]),
|
.DIB(16'h0000),
|
.DIB(16'h0000),
|
.ENB(1'b1),
|
.ENB(1'b1),
|
.WEB(1'b0),
|
.WEB(1'b0),
|
.DOB(tbia_dat_o[15:0])
|
.DOB(tbia_dat_o[15:0])
|
);
|
);
|
|
|
RAMB4_S16_S16 tbia_ramb4_s16_1(
|
RAMB4_S16_S16 tbia_ramb4_s16_1(
|
.CLKA(clk),
|
.CLKA(clk),
|
.RSTA(rst),
|
.RSTA(rst),
|
.ADDRA(tb_wadr),
|
.ADDRA(tb_wadr),
|
.DIA(spr_dat_npc[31:16]),
|
.DIA(spr_dat_npc[31:16]),
|
.ENA(1'b1),
|
.ENA(1'b1),
|
.WEA(tb_enw),
|
.WEA(tb_enw),
|
.DOA(),
|
.DOA(),
|
|
|
.CLKB(clk),
|
.CLKB(clk),
|
.RSTB(rst),
|
.RSTB(rst),
|
.ADDRB(spr_addr[7:0]),
|
.ADDRB(spr_addr[7:0]),
|
.DIB(16'h0000),
|
.DIB(16'h0000),
|
.ENB(1'b1),
|
.ENB(1'b1),
|
.WEB(1'b0),
|
.WEB(1'b0),
|
.DOB(tbia_dat_o[31:16])
|
.DOB(tbia_dat_o[31:16])
|
);
|
);
|
|
|
RAMB4_S16_S16 tbim_ramb4_s16_0(
|
RAMB4_S16_S16 tbim_ramb4_s16_0(
|
.CLKA(clk),
|
.CLKA(clk),
|
.RSTA(rst),
|
.RSTA(rst),
|
.ADDRA(tb_wadr),
|
.ADDRA(tb_wadr),
|
.DIA(ex_insn[15:0]),
|
.DIA(ex_insn[15:0]),
|
.ENA(1'b1),
|
.ENA(1'b1),
|
.WEA(tb_enw),
|
.WEA(tb_enw),
|
.DOA(),
|
.DOA(),
|
|
|
.CLKB(clk),
|
.CLKB(clk),
|
.RSTB(rst),
|
.RSTB(rst),
|
.ADDRB(spr_addr[7:0]),
|
.ADDRB(spr_addr[7:0]),
|
.DIB(16'h0000),
|
.DIB(16'h0000),
|
.ENB(1'b1),
|
.ENB(1'b1),
|
.WEB(1'b0),
|
.WEB(1'b0),
|
.DOB(tbim_dat_o[15:0])
|
.DOB(tbim_dat_o[15:0])
|
);
|
);
|
|
|
RAMB4_S16_S16 tbim_ramb4_s16_1(
|
RAMB4_S16_S16 tbim_ramb4_s16_1(
|
.CLKA(clk),
|
.CLKA(clk),
|
.RSTA(rst),
|
.RSTA(rst),
|
.ADDRA(tb_wadr),
|
.ADDRA(tb_wadr),
|
.DIA(ex_insn[31:16]),
|
.DIA(ex_insn[31:16]),
|
.ENA(1'b1),
|
.ENA(1'b1),
|
.WEA(tb_enw),
|
.WEA(tb_enw),
|
.DOA(),
|
.DOA(),
|
|
|
.CLKB(clk),
|
.CLKB(clk),
|
.RSTB(rst),
|
.RSTB(rst),
|
.ADDRB(spr_addr[7:0]),
|
.ADDRB(spr_addr[7:0]),
|
.DIB(16'h0000),
|
.DIB(16'h0000),
|
.ENB(1'b1),
|
.ENB(1'b1),
|
.WEB(1'b0),
|
.WEB(1'b0),
|
.DOB(tbim_dat_o[31:16])
|
.DOB(tbim_dat_o[31:16])
|
);
|
);
|
|
|
RAMB4_S16_S16 tbar_ramb4_s16_0(
|
RAMB4_S16_S16 tbar_ramb4_s16_0(
|
.CLKA(clk),
|
.CLKA(clk),
|
.RSTA(rst),
|
.RSTA(rst),
|
.ADDRA(tb_wadr),
|
.ADDRA(tb_wadr),
|
.DIA(rf_dataw[15:0]),
|
.DIA(rf_dataw[15:0]),
|
.ENA(1'b1),
|
.ENA(1'b1),
|
.WEA(tb_enw),
|
.WEA(tb_enw),
|
.DOA(),
|
.DOA(),
|
|
|
.CLKB(clk),
|
.CLKB(clk),
|
.RSTB(rst),
|
.RSTB(rst),
|
.ADDRB(spr_addr[7:0]),
|
.ADDRB(spr_addr[7:0]),
|
.DIB(16'h0000),
|
.DIB(16'h0000),
|
.ENB(1'b1),
|
.ENB(1'b1),
|
.WEB(1'b0),
|
.WEB(1'b0),
|
.DOB(tbar_dat_o[15:0])
|
.DOB(tbar_dat_o[15:0])
|
);
|
);
|
|
|
RAMB4_S16_S16 tbar_ramb4_s16_1(
|
RAMB4_S16_S16 tbar_ramb4_s16_1(
|
.CLKA(clk),
|
.CLKA(clk),
|
.RSTA(rst),
|
.RSTA(rst),
|
.ADDRA(tb_wadr),
|
.ADDRA(tb_wadr),
|
.DIA(rf_dataw[31:16]),
|
.DIA(rf_dataw[31:16]),
|
.ENA(1'b1),
|
.ENA(1'b1),
|
.WEA(tb_enw),
|
.WEA(tb_enw),
|
.DOA(),
|
.DOA(),
|
|
|
.CLKB(clk),
|
.CLKB(clk),
|
.RSTB(rst),
|
.RSTB(rst),
|
.ADDRB(spr_addr[7:0]),
|
.ADDRB(spr_addr[7:0]),
|
.DIB(16'h0000),
|
.DIB(16'h0000),
|
.ENB(1'b1),
|
.ENB(1'b1),
|
.WEB(1'b0),
|
.WEB(1'b0),
|
.DOB(tbar_dat_o[31:16])
|
.DOB(tbar_dat_o[31:16])
|
);
|
);
|
|
|
RAMB4_S16_S16 tbts_ramb4_s16_0(
|
RAMB4_S16_S16 tbts_ramb4_s16_0(
|
.CLKA(clk),
|
.CLKA(clk),
|
.RSTA(rst),
|
.RSTA(rst),
|
.ADDRA(tb_wadr),
|
.ADDRA(tb_wadr),
|
.DIA(tb_timstmp[15:0]),
|
.DIA(tb_timstmp[15:0]),
|
.ENA(1'b1),
|
.ENA(1'b1),
|
.WEA(tb_enw),
|
.WEA(tb_enw),
|
.DOA(),
|
.DOA(),
|
|
|
.CLKB(clk),
|
.CLKB(clk),
|
.RSTB(rst),
|
.RSTB(rst),
|
.ADDRB(spr_addr[7:0]),
|
.ADDRB(spr_addr[7:0]),
|
.DIB(16'h0000),
|
.DIB(16'h0000),
|
.ENB(1'b1),
|
.ENB(1'b1),
|
.WEB(1'b0),
|
.WEB(1'b0),
|
.DOB(tbts_dat_o[15:0])
|
.DOB(tbts_dat_o[15:0])
|
);
|
);
|
|
|
RAMB4_S16_S16 tbts_ramb4_s16_1(
|
RAMB4_S16_S16 tbts_ramb4_s16_1(
|
.CLKA(clk),
|
.CLKA(clk),
|
.RSTA(rst),
|
.RSTA(rst),
|
.ADDRA(tb_wadr),
|
.ADDRA(tb_wadr),
|
.DIA(tb_timstmp[31:16]),
|
.DIA(tb_timstmp[31:16]),
|
.ENA(1'b1),
|
.ENA(1'b1),
|
.WEA(tb_enw),
|
.WEA(tb_enw),
|
.DOA(),
|
.DOA(),
|
|
|
.CLKB(clk),
|
.CLKB(clk),
|
.RSTB(rst),
|
.RSTB(rst),
|
.ADDRB(spr_addr[7:0]),
|
.ADDRB(spr_addr[7:0]),
|
.DIB(16'h0000),
|
.DIB(16'h0000),
|
.ENB(1'b1),
|
.ENB(1'b1),
|
.WEB(1'b0),
|
.WEB(1'b0),
|
.DOB(tbts_dat_o[31:16])
|
.DOB(tbts_dat_o[31:16])
|
);
|
);
|
|
|
`else
|
`else
|
assign tbia_dat_o = 32'h0000_0000;
|
assign tbia_dat_o = 32'h0000_0000;
|
assign tbim_dat_o = 32'h0000_0000;
|
assign tbim_dat_o = 32'h0000_0000;
|
assign tbar_dat_o = 32'h0000_0000;
|
assign tbar_dat_o = 32'h0000_0000;
|
assign tbts_dat_o = 32'h0000_0000;
|
assign tbts_dat_o = 32'h0000_0000;
|
|
|
`endif // OR1200_DU_TB_IMPLEMENTED
|
`endif // OR1200_DU_TB_IMPLEMENTED
|
|
|
`else // OR1200_DU_IMPLEMENTED
|
`else // OR1200_DU_IMPLEMENTED
|
|
|
//
|
//
|
// When DU is not implemented, drive all outputs as would when DU is disabled
|
// When DU is not implemented, drive all outputs as would when DU is disabled
|
//
|
//
|
assign dbg_bp_o = 1'b0;
|
assign dbg_bp_o = 1'b0;
|
assign du_dsr = {`OR1200_DU_DSR_WIDTH{1'b0}};
|
assign du_dsr = {`OR1200_DU_DSR_WIDTH{1'b0}};
|
|
assign du_hwbkpt = 1'b0;
|
|
|
//
|
//
|
// Read DU registers
|
// Read DU registers
|
//
|
//
|
`ifdef OR1200_DU_READREGS
|
`ifdef OR1200_DU_READREGS
|
assign spr_dat_o = 32'h0000_0000;
|
assign spr_dat_o = 32'h0000_0000;
|
`ifdef OR1200_DU_UNUSED_ZERO
|
`ifdef OR1200_DU_UNUSED_ZERO
|
`endif
|
`endif
|
`endif
|
`endif
|
|
|
`endif
|
`endif
|
|
|
endmodule
|
endmodule
|
|
|