From d7b016e8f349c0117cdf26473bcd029d5f176f88 Mon Sep 17 00:00:00 2001 From: David Harris Date: Fri, 12 Jan 2024 18:12:52 -0800 Subject: [PATCH 1/2] Cleaned up Zicond implementation --- src/ieu/alu.sv | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ieu/alu.sv b/src/ieu/alu.sv index b13c3a65c..4c296fda2 100644 --- a/src/ieu/alu.sv +++ b/src/ieu/alu.sv @@ -101,11 +101,16 @@ module alu import cvw::*; #(parameter cvw_t P) ( // Zicond block if (P.ZICOND_SUPPORTED) begin: zicond - logic BZero, KillB; + logic BZero; + assign BZero = (B == 0); // check if rs2 = 0 // Create a signal that is 0 when czero.* instruction should clear result // If B = 0 for czero.eqz or if B != 0 for czero.nez - assign KillB = BZero & CZero[0] | ~BZero & CZero[1]; - assign ZeroCondMaskInvB = |CZero ? {P.XLEN{~KillB}} : CondMaskInvB; // extend to full width + always_comb + case (CZero) + 2'b01: ZeroCondMaskInvB = {P.XLEN{~BZero}}; // czero.eqz: kill if B = 0 + 2'b10: ZeroCondMaskInvB = {P.XLEN{BZero}}; // czero.nez: kill if B != 0 + default: ZeroCondMaskInvB = CondMaskInvB; // otherwise normal behavior + endcase end else assign ZeroCondMaskInvB = CondMaskInvB; // no masking if Zicond is not supported endmodule From a9acb5f269635d0bec9a5d19dc7e31a9a818b14b Mon Sep 17 00:00:00 2001 From: David Harris Date: Fri, 12 Jan 2024 18:13:11 -0800 Subject: [PATCH 2/2] Added comments with a way to build Sail on RedHat --- bin/wally-tool-chain-install.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/bin/wally-tool-chain-install.sh b/bin/wally-tool-chain-install.sh index f690bfac1..7ccb1a138 100755 --- a/bin/wally-tool-chain-install.sh +++ b/bin/wally-tool-chain-install.sh @@ -137,6 +137,27 @@ sudo make install # package manager. Sail has so many dependencies that it can be difficult to install. # This script works for Ubuntu. +# Alex Solomatnikov found these commands worked to build Sail for Centos 8 on 1/12/24 +#sudo su - +#dnf install ocaml.x86_64 +#pip3 install z3-solver +#wget https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh +#sh install.sh +#opam init +#exit +#ocaml -version +#opam switch create 5.1.0 +#eval $(opam config env) +#git clone --recurse-submodules git@github.com:riscv/sail-riscv.git +#cd sail-riscv +#make +#ARCH=RV32 make +#ARCH=RV64 make +#git log -1 +#cp -p c_emulator/riscv_sim_RV* /tools/sail-riscv/d7a3d8012fd579f40e53a29569141d72dd5e0c32/bin/. + + +# This was an earlier attemp to prepare to install Sail on RedHat 8 # Do these commands only for RedHat / Rocky 8 to build from source. #cd $RISCV #git clone https://github.com/Z3Prover/z3.git