Configurable [l,s]w[l,r]
This commit is contained in:
parent
796c83b72a
commit
cb31fcd0db
@ -78,7 +78,9 @@ module Controller (
|
|||||||
assign ctrl.MCtrl1.MR = inst[31] & (~inst[26] | inst[26] & (~inst[27] | inst[27] & ~inst[28] & ~inst[30]));
|
assign ctrl.MCtrl1.MR = inst[31] & (~inst[26] | inst[26] & (~inst[27] | inst[27] & ~inst[28] & ~inst[30]));
|
||||||
assign ctrl.MCtrl1.MWR = inst[29];
|
assign ctrl.MCtrl1.MWR = inst[29];
|
||||||
assign ctrl.MCtrl1.MX = ~inst[28];
|
assign ctrl.MCtrl1.MX = ~inst[28];
|
||||||
|
`ifdef ENABLE_UNALIGNED
|
||||||
assign ctrl.MCtrl1.ALR = ALR_t'({inst[28] & inst[27] & ~inst[26], ~inst[28] & inst[27] & ~inst[26]});
|
assign ctrl.MCtrl1.ALR = ALR_t'({inst[28] & inst[27] & ~inst[26], ~inst[28] & inst[27] & ~inst[26]});
|
||||||
|
`endif
|
||||||
assign ctrl.MCtrl1.SZ = inst[27:26];
|
assign ctrl.MCtrl1.SZ = inst[27:26];
|
||||||
`ifdef ENABLE_TLB
|
`ifdef ENABLE_TLB
|
||||||
assign ctrl.MCtrl1.TLBR = ~inst[31] & inst[30] & ~inst[29] & inst[25] & ~inst[3] & ~inst[1];
|
assign ctrl.MCtrl1.TLBR = ~inst[31] & inst[30] & ~inst[29] & inst[25] & ~inst[3] & ~inst[1];
|
||||||
|
@ -195,8 +195,10 @@ module Datapath (
|
|||||||
word_t M_I1_ByteX;
|
word_t M_I1_ByteX;
|
||||||
word_t M_I1_HalfX;
|
word_t M_I1_HalfX;
|
||||||
word_t M_I1_MDataA;
|
word_t M_I1_MDataA;
|
||||||
|
`ifdef ENABLE_UNALIGNED
|
||||||
word_t M_I1_MDataUL;
|
word_t M_I1_MDataUL;
|
||||||
word_t M_I1_MDataUR;
|
word_t M_I1_MDataUR;
|
||||||
|
`endif
|
||||||
word_t M_I1_MData;
|
word_t M_I1_MData;
|
||||||
|
|
||||||
logic M_I0_DIV_valid;
|
logic M_I0_DIV_valid;
|
||||||
@ -535,8 +537,10 @@ module Datapath (
|
|||||||
| D.IA.WCtrl.RW & D.IB.RT == D.IA.RD & D.IB.MCtrl0.C0W & ~D.IA.DP0
|
| D.IA.WCtrl.RW & D.IB.RT == D.IA.RD & D.IB.MCtrl0.C0W & ~D.IA.DP0
|
||||||
// Not Arith -> Store
|
// Not Arith -> Store
|
||||||
| D.IA.WCtrl.RW & D.IB.RT == D.IA.RD & D.IB.MCtrl1.MWR & ~D.IA.DP1
|
| D.IA.WCtrl.RW & D.IB.RT == D.IA.RD & D.IB.MCtrl1.MWR & ~D.IA.DP1
|
||||||
|
`ifdef ENABLE_UNALIGNED
|
||||||
// Not Arith -> LWL/LWR
|
// Not Arith -> LWL/LWR
|
||||||
| D.IA.WCtrl.RW & D.IB.RT == D.IA.RD & |D.IB.MCtrl1.ALR & ~D.IA.DP1
|
| D.IA.WCtrl.RW & D.IB.RT == D.IA.RD & |D.IB.MCtrl1.ALR & ~D.IA.DP1
|
||||||
|
`endif
|
||||||
// Any -> MOVN/MOVZ
|
// Any -> MOVN/MOVZ
|
||||||
| D.IA.WCtrl.RW & D.IB.RT == D.IA.RD & D.IB.DT
|
| D.IA.WCtrl.RW & D.IB.RT == D.IA.RD & D.IB.DT
|
||||||
// Arith -> MOVN/MOVZ
|
// Arith -> MOVN/MOVZ
|
||||||
@ -963,7 +967,11 @@ module Datapath (
|
|||||||
`endif
|
`endif
|
||||||
assign mem.req = E.I1.MCtrl.MR & E_I1_goWithoutOF & M.en & ~rstM;
|
assign mem.req = E.I1.MCtrl.MR & E_I1_goWithoutOF & M.en & ~rstM;
|
||||||
assign E_I1_ADDR = E_I1_ForwardS + E.I1.imm;
|
assign E_I1_ADDR = E_I1_ForwardS + E.I1.imm;
|
||||||
|
`ifdef ENABLE_UNALIGNED
|
||||||
assign mem.addr = |E.I1.MCtrl.ALR ? {E_I1_ADDR[31:2], 2'b0} : E_I1_ADDR;
|
assign mem.addr = |E.I1.MCtrl.ALR ? {E_I1_ADDR[31:2], 2'b0} : E_I1_ADDR;
|
||||||
|
`else
|
||||||
|
assign mem.addr = E_I1_ADDR;
|
||||||
|
`endif
|
||||||
assign mem.size = {E.I1.MCtrl.SZ[1], E.I1.MCtrl.SZ[0] & ~E.I1.MCtrl.SZ[1]};
|
assign mem.size = {E.I1.MCtrl.SZ[1], E.I1.MCtrl.SZ[0] & ~E.I1.MCtrl.SZ[1]};
|
||||||
|
|
||||||
assign cache_op.req = cache_op.op.icache_op | cache_op.op.dcache_op;
|
assign cache_op.req = cache_op.op.icache_op | cache_op.op.dcache_op;
|
||||||
@ -1308,7 +1316,11 @@ module Datapath (
|
|||||||
.addr (M.I1.ALUOut[1:0]),
|
.addr (M.I1.ALUOut[1:0]),
|
||||||
.data (M_I1_ForwardT),
|
.data (M_I1_ForwardT),
|
||||||
.size (M.I1.MCtrl.SZ),
|
.size (M.I1.MCtrl.SZ),
|
||||||
|
`ifdef ENABLE_UNALIGNED
|
||||||
.alr (M.I1.MCtrl.ALR),
|
.alr (M.I1.MCtrl.ALR),
|
||||||
|
`else
|
||||||
|
.alr (ALR_t'(2'b00)),
|
||||||
|
`endif
|
||||||
.wdata(mem.wdata),
|
.wdata(mem.wdata),
|
||||||
.wstrb(mem.wstrb)
|
.wstrb(mem.wstrb)
|
||||||
);
|
);
|
||||||
@ -1344,6 +1356,7 @@ module Datapath (
|
|||||||
M.I1.MCtrl.SZ,
|
M.I1.MCtrl.SZ,
|
||||||
M_I1_MDataA
|
M_I1_MDataA
|
||||||
);
|
);
|
||||||
|
`ifdef ENABLE_UNALIGNED
|
||||||
mux4 #(32) M_I1_MDataUL_mux (
|
mux4 #(32) M_I1_MDataUL_mux (
|
||||||
{M_I1_DataR[ 7:0], M_I1_ForwardT[23:0]},
|
{M_I1_DataR[ 7:0], M_I1_ForwardT[23:0]},
|
||||||
{M_I1_DataR[15:0], M_I1_ForwardT[15:0]},
|
{M_I1_DataR[15:0], M_I1_ForwardT[15:0]},
|
||||||
@ -1367,6 +1380,9 @@ module Datapath (
|
|||||||
M.I1.MCtrl.ALR,
|
M.I1.MCtrl.ALR,
|
||||||
M_I1_MData
|
M_I1_MData
|
||||||
);
|
);
|
||||||
|
`else
|
||||||
|
assign M_I1_MData = M_I1_MDataA;
|
||||||
|
`endif
|
||||||
mux2 #(32) M_I1_DataRW_mux (
|
mux2 #(32) M_I1_DataRW_mux (
|
||||||
M.I1.ALUOut,
|
M.I1.ALUOut,
|
||||||
M_I1_MData,
|
M_I1_MData,
|
||||||
|
@ -104,16 +104,24 @@ module decoder2 (
|
|||||||
// 32'b01111100000??????????00000111011: begin cpu = 1'b1; ce = 2'b0; end // RDHWR (CpU)
|
// 32'b01111100000??????????00000111011: begin cpu = 1'b1; ce = 2'b0; end // RDHWR (CpU)
|
||||||
32'b100000??????????????????????????: ri = 1'b0; // LB
|
32'b100000??????????????????????????: ri = 1'b0; // LB
|
||||||
32'b100001??????????????????????????: ri = 1'b0; // LH
|
32'b100001??????????????????????????: ri = 1'b0; // LH
|
||||||
|
`ifdef ENABLE_UNALIGNED
|
||||||
32'b100010??????????????????????????: ri = 1'b0; // LWL
|
32'b100010??????????????????????????: ri = 1'b0; // LWL
|
||||||
|
`endif
|
||||||
32'b100011??????????????????????????: ri = 1'b0; // LW
|
32'b100011??????????????????????????: ri = 1'b0; // LW
|
||||||
32'b100100??????????????????????????: ri = 1'b0; // LBU
|
32'b100100??????????????????????????: ri = 1'b0; // LBU
|
||||||
32'b100101??????????????????????????: ri = 1'b0; // LHU
|
32'b100101??????????????????????????: ri = 1'b0; // LHU
|
||||||
|
`ifdef ENABLE_UNALIGNED
|
||||||
32'b100110??????????????????????????: ri = 1'b0; // LWR
|
32'b100110??????????????????????????: ri = 1'b0; // LWR
|
||||||
|
`endif
|
||||||
32'b101000??????????????????????????: ri = 1'b0; // SB
|
32'b101000??????????????????????????: ri = 1'b0; // SB
|
||||||
32'b101001??????????????????????????: ri = 1'b0; // SH
|
32'b101001??????????????????????????: ri = 1'b0; // SH
|
||||||
|
`ifdef ENABLE_UNALIGNED
|
||||||
32'b101010??????????????????????????: ri = 1'b0; // SWL
|
32'b101010??????????????????????????: ri = 1'b0; // SWL
|
||||||
|
`endif
|
||||||
32'b101011??????????????????????????: ri = 1'b0; // SW
|
32'b101011??????????????????????????: ri = 1'b0; // SW
|
||||||
|
`ifdef ENABLE_UNALIGNED
|
||||||
32'b101110??????????????????????????: ri = 1'b0; // SWR
|
32'b101110??????????????????????????: ri = 1'b0; // SWR
|
||||||
|
`endif
|
||||||
`ifdef ENABLE_CACHEOP
|
`ifdef ENABLE_CACHEOP
|
||||||
32'b101111?????00000????????????????: ri = 1'b0; // I-Cache Index Invalid
|
32'b101111?????00000????????????????: ri = 1'b0; // I-Cache Index Invalid
|
||||||
32'b101111?????01000????????????????: ri = 1'b0; // I-Cache Index Store Tag
|
32'b101111?????01000????????????????: ri = 1'b0; // I-Cache Index Store Tag
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
// `define ENABLE_CpU
|
// `define ENABLE_CpU
|
||||||
// `define ENABLE_TRAP
|
// `define ENABLE_TRAP
|
||||||
// `define ENABLE_MADD
|
// `define ENABLE_MADD
|
||||||
|
// `define ENABLE_UNALIGNED
|
||||||
|
|
||||||
`ifdef SIMULATION_VERILATOR
|
`ifdef SIMULATION_VERILATOR
|
||||||
`undef ENABLE_CpU
|
`undef ENABLE_CpU
|
||||||
@ -148,7 +149,9 @@ typedef struct packed {
|
|||||||
logic MR; // critical
|
logic MR; // critical
|
||||||
logic MWR; // critical
|
logic MWR; // critical
|
||||||
logic MX;
|
logic MX;
|
||||||
|
`ifdef ENABLE_UNALIGNED
|
||||||
ALR_t ALR; // critical
|
ALR_t ALR; // critical
|
||||||
|
`endif
|
||||||
logic [1:0] SZ;
|
logic [1:0] SZ;
|
||||||
`ifdef ENABLE_TLB
|
`ifdef ENABLE_TLB
|
||||||
logic TLBWI; // critical
|
logic TLBWI; // critical
|
||||||
|
Loading…
Reference in New Issue
Block a user