Skip to content

Commit e8e7967

Browse files
authored
Changes to make the X_if addition compatible with the golden version of the core, minus the rf_we line (#289)
1 parent 73ba222 commit e8e7967

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

rtl/cve2_decoder.sv

+1
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ module cve2_decoder #(
660660
// insufficient privileges), or when accessing non-available registers in RV32E,
661661
// these cases are not handled here
662662
if (illegal_insn) begin
663+
// rf_we = 1'b0;
663664
data_req_o = 1'b0;
664665
data_we_o = 1'b0;
665666
jump_in_dec_o = 1'b0;

rtl/cve2_id_stage.sv

+14-8
Original file line numberDiff line numberDiff line change
@@ -418,12 +418,19 @@ module cve2_id_stage #(
418418

419419
// Register file write data mux
420420
always_comb begin : rf_wdata_id_mux
421-
unique case (rf_wdata_sel)
422-
RF_WD_EX: rf_wdata_id_o = result_ex_i;
423-
RF_WD_CSR: rf_wdata_id_o = csr_rdata_i;
424-
RF_WD_COPROC: rf_wdata_id_o = x_result_i.data;
425-
default: rf_wdata_id_o = result_ex_i;
426-
endcase
421+
if (XInterface)
422+
unique case (rf_wdata_sel)
423+
RF_WD_EX: rf_wdata_id_o = result_ex_i;
424+
RF_WD_CSR: rf_wdata_id_o = csr_rdata_i;
425+
RF_WD_COPROC: rf_wdata_id_o = x_result_i.data;
426+
default: rf_wdata_id_o = result_ex_i;
427+
endcase
428+
else
429+
unique case (rf_wdata_sel)
430+
RF_WD_EX: rf_wdata_id_o = result_ex_i;
431+
RF_WD_CSR: rf_wdata_id_o = csr_rdata_i;
432+
default: rf_wdata_id_o = result_ex_i;
433+
endcase
427434
end
428435

429436
/////////////
@@ -711,7 +718,6 @@ module cve2_id_stage #(
711718
stall_branch = 1'b0;
712719
stall_alu = 1'b0;
713720
stall_coproc = 1'b0;
714-
stall_coproc = 1'b0;
715721
branch_set_raw_d = 1'b0;
716722
jump_set_raw = 1'b0;
717723
perf_branch_o = 1'b0;
@@ -800,7 +806,7 @@ module cve2_id_stage #(
800806
stall_multdiv = multdiv_en_dec;
801807
stall_branch = branch_in_dec;
802808
stall_jump = jump_in_dec;
803-
stall_coproc = illegal_insn_dec;
809+
stall_coproc = XInterface & illegal_insn_dec;
804810
end
805811
end
806812

scripts/sec/sec.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,21 @@ elif [[ "${target_tool}" == "mentor" ]]; then
100100

101101
elif [[ "${target_tool}" == "yosys" ]]; then
102102
echo "Using Yosys EQY"
103-
eqy -f yosys/sec.eqy -j $(($(nproc)/2)) -d ${report_dir} &> ${report_dir}/output.yosys.log
103+
104+
if ! [ -x "$(command -v eqy)" ]; then
105+
echo "Yosys EQY (eqy) could not be found"
106+
exit 1
107+
fi
108+
109+
eqy -f yosys/sec.eqy -j $(($(nproc)/2)) -d ${report_dir} &> /dev/null
110+
mv ${report_dir}/logfile.txt ${report_dir}/output.yosys.log
104111
rm yosys/golden_io.txt
105112

106113
if [ -f "${report_dir}/PASS" ]; then
107114
RESULT=0
108115
elif [ -f "${report_dir}/FAIL" ]; then
109116
RESULT=1
117+
echo "Check ${report_dir}/output.yosys.log"
110118
else
111119
echo "Failed to run Yosys EQY"
112120
exit 1

0 commit comments

Comments
 (0)