diff --git a/src/Core/Datapath.sv b/src/Core/Datapath.sv index e8536b4..b6a48e0 100644 --- a/src/Core/Datapath.sv +++ b/src/Core/Datapath.sv @@ -200,10 +200,10 @@ module Datapath ( prio_mux5 #(32) PF_pc_mux ( PF_pc0, PF_pcp8, - C0_EPC, `PCEXC, + C0_EPC, `PCRST, - {~F_valid, C0_exception.ExcValid, C0_exception.ERET, ~D_IA_valid}, + {~F_valid, C0_exception.ExcValid, ~D_IA_valid}, PF.pc ); @@ -212,7 +212,7 @@ module Datapath ( assign PF_req = ~D.IA_ExcValid & ~D.IB_ExcValid & ~E.I0.ExcValid & ~E.I1.ExcValid; assign PF_go = PF.pc[1:0] == 2'b00 & PF_req; - assign fetch_i.req = rst | C0_exception.ExcValid | C0_exception.ERET | ~D_IA_valid + assign fetch_i.req = rst | C0_exception.ERET | C0_exception.ExcValid | ~D_IA_valid | PF_go & (~D.IA.PFCtrl.BJRJ | D_IA_can_dispatch) & ( ~IQ_valids[3] | ~IQ_valids[2] & (PF.pc[2] | F.pc[2] | D_readygo | D_readygo1) diff --git a/src/Core/Gadgets.sv b/src/Core/Gadgets.sv index b81dfbc..6dd2bc9 100644 --- a/src/Core/Gadgets.sv +++ b/src/Core/Gadgets.sv @@ -98,16 +98,17 @@ module woutput ( error = (addr != 2'b00); end 2'b01: begin - wdata = addr[1] ? data[31:16] : data[15:0]; + wdata = {2{data[15:0]}}; wstrb = addr[1] ? 4'b1100 : 4'b0011; error = (addr[0] != 1'b0); end 2'b00: begin + wdata = {4{data[7:0]}}; case (addr) - 2'b11: begin wdata = data[31:24]; wstrb = 4'b1000; end - 2'b10: begin wdata = data[23:16]; wstrb = 4'b0100; end - 2'b01: begin wdata = data[15: 8]; wstrb = 4'b0010; end - 2'b00: begin wdata = data[ 7: 0]; wstrb = 4'b0001; end + 2'b11: wstrb = 4'b1000; + 2'b10: wstrb = 4'b0100; + 2'b01: wstrb = 4'b0010; + 2'b00: wstrb = 4'b0001; endcase error = 1'b0; end