Skip to content

Commit

Permalink
lint fixes 3
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan-108 committed Nov 28, 2024
1 parent a317239 commit 7651185
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
1 change: 0 additions & 1 deletion core/id_stage.sv
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ module id_stage #(
.is_compressed_o(is_compressed_cvxif_zcmt[0]),
.fetch_stall_o (stall_macro_deco_zcmt),
.jvt_i (jvt_i),
// .is_zcmt_o (is_zcmt),
.req_port_i (dcache_req_ports_i),
.req_port_o (dcache_req_ports_o)
);
Expand Down
39 changes: 18 additions & 21 deletions core/zcmt_decoder.sv
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ module zcmt_decoder #(
TABLE_FETCH, // Check the valid data from jump table and record
JUMP // Calculate the offset for jump and create jal instruction
}
state_d, state_q;
state_d, state_q;

//zcmt instruction type
enum logic {
JT, // 0 cm.jt instruction
JALT // 1: cm.jalt instruction
}
zcmt_instr_type;

JT, // 0 cm.jt instruction
JALT // 1: cm.jalt instruction
} zcmt_instr_type;

// Temporary registers
logic [7:0] index; //index of instruction
Expand All @@ -54,11 +52,11 @@ module zcmt_decoder #(
logic [20:0] jump_addr; //jump address immidiate

always_comb begin
state_d = state_q;
data_rdata_d = data_rdata_q;
illegal_instr_o = 1'b0;
is_compressed_o = is_zcmt_instr_i ? 1'b1 : is_compressed_i;
fetch_stall_o = is_zcmt_instr_i ? 1'b1 : 0;
state_d = state_q;
data_rdata_d = data_rdata_q;
illegal_instr_o = 1'b0;
is_compressed_o = is_zcmt_instr_i ? 1'b1 : is_compressed_i;
fetch_stall_o = is_zcmt_instr_i ? 1'b1 : 0;

//cache request port
req_port_o.data_wdata = 1'b0;
Expand Down Expand Up @@ -91,11 +89,10 @@ module zcmt_decoder #(
//table_address = {2'b00,({jvt_i.base, jvt_i.mode} + (index << 3))};
// will will completed in future( for 64 bit embedded core)
illegal_instr_o = 1'b1;
end else
illegal_instr_o = 1'b1;
end else illegal_instr_o = 1'b1;
end else begin
illegal_instr_o = illegal_instr_i;
instr_o = instr_i;
instr_o = instr_i;
end

unique case (state_q)
Expand All @@ -119,13 +116,13 @@ module zcmt_decoder #(
end
end
JUMP: begin
jump_addr = $unsigned($signed(data_rdata_q) - $signed(pc_i));
if (zcmt_instr_type == JT) begin //- jal pc_offset, x0 for no return stack
instr_o = {jump_addr[20], jump_addr[10:1], jump_addr[11], jump_addr[19:12], 5'h0, riscv::OpcodeJal};
end else if (zcmt_instr_type == JALT) begin //- jal pc_offset, x1 for return stack
instr_o = {jump_addr[20], jump_addr[10:1], jump_addr[11], jump_addr[19:12], 5'h1, riscv::OpcodeJal};
end
state_d = IDLE;
jump_addr = $unsigned($signed(data_rdata_q) - $signed(pc_i));
if (zcmt_instr_type == JT) begin //- jal pc_offset, x0 for no return stack
instr_o = {jump_addr[20], jump_addr[10:1], jump_addr[11], jump_addr[19:12], 5'h0, riscv::OpcodeJal};
end else if (zcmt_instr_type == JALT) begin //- jal pc_offset, x1 for return stack
instr_o = {jump_addr[20], jump_addr[10:1], jump_addr[11], jump_addr[19:12], 5'h1, riscv::OpcodeJal};
end
state_d = IDLE;
end
default: begin
state_d = IDLE;
Expand Down

0 comments on commit 7651185

Please sign in to comment.