Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to make the X_if addition compatible with the golden version … #289

Merged
merged 1 commit into from
Mar 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rtl/cve2_decoder.sv
Original file line number Diff line number Diff line change
@@ -660,6 +660,7 @@ module cve2_decoder #(
// insufficient privileges), or when accessing non-available registers in RV32E,
// these cases are not handled here
if (illegal_insn) begin
// rf_we = 1'b0;
data_req_o = 1'b0;
data_we_o = 1'b0;
jump_in_dec_o = 1'b0;
22 changes: 14 additions & 8 deletions rtl/cve2_id_stage.sv
Original file line number Diff line number Diff line change
@@ -418,12 +418,19 @@ module cve2_id_stage #(

// Register file write data mux
always_comb begin : rf_wdata_id_mux
unique case (rf_wdata_sel)
RF_WD_EX: rf_wdata_id_o = result_ex_i;
RF_WD_CSR: rf_wdata_id_o = csr_rdata_i;
RF_WD_COPROC: rf_wdata_id_o = x_result_i.data;
default: rf_wdata_id_o = result_ex_i;
endcase
if (XInterface)
unique case (rf_wdata_sel)
RF_WD_EX: rf_wdata_id_o = result_ex_i;
RF_WD_CSR: rf_wdata_id_o = csr_rdata_i;
RF_WD_COPROC: rf_wdata_id_o = x_result_i.data;
default: rf_wdata_id_o = result_ex_i;
endcase
else
unique case (rf_wdata_sel)
RF_WD_EX: rf_wdata_id_o = result_ex_i;
RF_WD_CSR: rf_wdata_id_o = csr_rdata_i;
default: rf_wdata_id_o = result_ex_i;
endcase
end

/////////////
@@ -711,7 +718,6 @@ module cve2_id_stage #(
stall_branch = 1'b0;
stall_alu = 1'b0;
stall_coproc = 1'b0;
stall_coproc = 1'b0;
branch_set_raw_d = 1'b0;
jump_set_raw = 1'b0;
perf_branch_o = 1'b0;
@@ -800,7 +806,7 @@ module cve2_id_stage #(
stall_multdiv = multdiv_en_dec;
stall_branch = branch_in_dec;
stall_jump = jump_in_dec;
stall_coproc = illegal_insn_dec;
stall_coproc = XInterface & illegal_insn_dec;
end
end

10 changes: 9 additions & 1 deletion scripts/sec/sec.sh
Original file line number Diff line number Diff line change
@@ -100,13 +100,21 @@ elif [[ "${target_tool}" == "mentor" ]]; then

elif [[ "${target_tool}" == "yosys" ]]; then
echo "Using Yosys EQY"
eqy -f yosys/sec.eqy -j $(($(nproc)/2)) -d ${report_dir} &> ${report_dir}/output.yosys.log

if ! [ -x "$(command -v eqy)" ]; then
echo "Yosys EQY (eqy) could not be found"
exit 1
fi

eqy -f yosys/sec.eqy -j $(($(nproc)/2)) -d ${report_dir} &> /dev/null
mv ${report_dir}/logfile.txt ${report_dir}/output.yosys.log
rm yosys/golden_io.txt

if [ -f "${report_dir}/PASS" ]; then
RESULT=0
elif [ -f "${report_dir}/FAIL" ]; then
RESULT=1
echo "Check ${report_dir}/output.yosys.log"
else
echo "Failed to run Yosys EQY"
exit 1