gateware

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 6b430cd8294e52cd6ba8e997b9cad4ffc55da173
parent b8fbe188590994043da98f1228c8ddd735fd641c
Author: Brian Swetland <swetland@frotz.net>
Date:   Wed, 30 Dec 2015 18:43:29 -0800

debug nop support

Diffstat:
Mhdl/cpu/cpu.v | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/hdl/cpu/cpu.v b/hdl/cpu/cpu.v @@ -8,6 +8,11 @@ module cpu #( parameter SWIDTH = 4 )( input clk, +`ifdef WITH_DEBUG + output [RWIDTH-1:0]debug_data + output [3:0]debug_op, + output debug_wr, +`endif output [15:0]mem_raddr_o, input [15:0]mem_rdata_i, output [15:0]mem_waddr_o, @@ -196,6 +201,12 @@ reg [1:0]using; wire conflict_a = (wsel == ir_asel) & using[1]; wire conflict_b = (wsel == ir_bsel) & using[0]; +`ifdef WITH_DEBUG +assign debug_op = ir_bsel; +assign debug_data = regs_adata; +assign debug_wr = do_fetch & ir_valid & (ir[15:12] == 4'b0010) & (ir[3:0] == 4'b1110); +`endif + always @(*) begin // decode stage do_fetch = 1'b1;