Skip to content

Commit

Permalink
fixes2
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan-108 committed Dec 11, 2024
1 parent cdb62ec commit c36df2d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions core/compressed_decoder.sv
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module compressed_decoder #(
is_compressed_o = 1'b1;
instr_o = instr_i;
is_macro_instr_o = 0;
is_zcmt_instr_o = 0;
is_zcmt_instr_o = 1'b0;;

// I: | imm[11:0] | rs1 | funct3 | rd | opcode |
// S: | imm[11:5] | rs2 | rs1 | funct3 | imm[4:0] | opcode |
Expand Down Expand Up @@ -875,7 +875,7 @@ module compressed_decoder #(
is_macro_instr_o = 1;
instr_o = instr_i;
end else if (instr_i[12:10] == 3'b000) begin //jt/jalt instruction
is_zcmt_instr_o = 1;
is_zcmt_instr_o = 1'b1;
end else begin
illegal_instr_o = 1'b1;
end
Expand Down
4 changes: 2 additions & 2 deletions core/ex_stage.sv
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ module ex_stage
.v_i,
.debug_mode_i,
.fu_data_i (one_cycle_data),
.pc_i,
.is_zcmt_i,
.pc_i (pc_i),
.is_zcmt_i (is_zcmt_i),
.is_compressed_instr_i,
.branch_valid_i (|branch_valid_i),
.branch_comp_res_i (alu_branch_res),
Expand Down
1 change: 0 additions & 1 deletion core/id_stage.sv
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ module id_stage #(
logic is_last_macro_instr_o;
logic is_double_rd_macro_instr_o;
logic [CVA6Cfg.NrIssuePorts-1:0] is_zcmt_instr_i;
branchpredict_sbe_t branch_predict;

if (CVA6Cfg.RVC) begin
// ---------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion core/issue_stage.sv
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ module issue_stage
.fu_data_o (fu_data_o),
.rs1_forwarding_o (rs1_forwarding_xlen),
.rs2_forwarding_o (rs2_forwarding_xlen),
.pc_o,
.pc_o (pc_o),
.is_zcmt_o (is_zcmt_o),
.is_compressed_instr_o,
.flu_ready_i (flu_ready_i),
Expand Down
16 changes: 8 additions & 8 deletions core/zcmt_decoder.sv
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ module zcmt_decoder #(
}
state_d, state_q;
// Temporary registers
logic [7:0] index; //index of instruction
//Physical address: jvt + (index <<2)
logic [CVA6Cfg.XLEN+1:0] table_address; //Virtual address: {00,Physical address}
logic [20:0] jump_addr; //jump address immidiate
logic [31:0] jump_addr; //jump address immidiate

always_comb begin
state_d = state_q;
Expand All @@ -47,21 +46,22 @@ module zcmt_decoder #(
fetch_stall_o = is_zcmt_instr_i ? 1'b1 : 0;

//cache request port
req_port_o.data_wdata = 1'b0;
req_port_o.data_wdata = '0;
req_port_o.data_wuser = '0;
req_port_o.data_req = 1'b0;
req_port_o.data_we = 1'b0;
req_port_o.data_be = 1'b0;
req_port_o.data_be = '0;
req_port_o.data_size = 2'b10;
req_port_o.data_id = 1;
req_port_o.kill_req = 0;
req_port_o.tag_valid = 1;
req_port_o.data_id = 1'b1;
req_port_o.kill_req = 1'b0;
req_port_o.tag_valid = 1'b1;

unique case (state_q)
IDLE: begin
if (is_zcmt_instr_i) begin
if (CVA6Cfg.XLEN == 32) begin //It is only target for 32 bit targets in cva6 with No MMU
table_address = {2'b00, ({jvt_i.base, jvt_i.mode} + (instr_i[9:2] << 2))};
// table_address = {2'b00, ({jvt_i.base, instr_i[7:2], 2'b00})};
table_address = {2'b00, ({jvt_i.base, jvt_i.mode} + {24'h0, instr_i[7:2], 2'b00})};
req_port_o.address_index = table_address[9:0];
req_port_o.address_tag = table_address[33:10];
state_d = TABLE_JUMP;
Expand Down

0 comments on commit c36df2d

Please sign in to comment.