From b6b67516eb7f4cad63bcb32b75cac52dfd66cb0e Mon Sep 17 00:00:00 2001 From: David Harris Date: Mon, 23 Jan 2023 10:37:33 -0800 Subject: [PATCH 01/10] Repo cleanup --- .../radixcopiesmultiregression.sh | 0 pipelined/misc/lzd.sv | 136 ------------------ 2 files changed, 136 deletions(-) rename {pipelined => bin}/radixcopiesmultiregression.sh (100%) delete mode 100644 pipelined/misc/lzd.sv diff --git a/pipelined/radixcopiesmultiregression.sh b/bin/radixcopiesmultiregression.sh similarity index 100% rename from pipelined/radixcopiesmultiregression.sh rename to bin/radixcopiesmultiregression.sh diff --git a/pipelined/misc/lzd.sv b/pipelined/misc/lzd.sv deleted file mode 100644 index 5ca99bae1..000000000 --- a/pipelined/misc/lzd.sv +++ /dev/null @@ -1,136 +0,0 @@ -// V. G. Oklobdzija, "Algorithmic design of a hierarchical and modular -// leading zero detector circuit," in Electronics Letters, vol. 29, -// no. 3, pp. 283-284, 4 Feb. 1993, doi: 10.1049/el:19930193. - -module lz2 (P, V, B0, B1); - - input logic B0; - input logic B1; - - output logic P; - output logic V; - - assign V = B0 | B1; - assign P = B0 & ~B1; - -endmodule // lz2 - -// Note: This module is not made out of two lz2's - why not? (MJS) - -module lz4 (ZP, ZV, B0, B1, V0, V1); - - output logic [1:0] ZP; - output logic ZV; - - input logic B0; - input logic B1; - input logic V0; - input logic V1; - - assign ZP[0] = V0 ? B0 : B1; - assign ZP[1] = ~V0; - assign ZV = V0 | V1; - -endmodule // lz4 - -// Note: This module is not made out of two lz4's - why not? (MJS) - -module lz8 (ZP, ZV, B); - - input logic [7:0] B; - - output logic [2:0] ZP; - output logic ZV; - - logic s1p0; - logic s1v0; - logic s1p1; - logic s1v1; - logic s2p0; - logic s2v0; - logic s2p1; - logic s2v1; - logic [1:0] ZPa; - logic [1:0] ZPb; - logic ZVa; - logic ZVb; - - lz2 l1(s1p0, s1v0, B[2], B[3]); - lz2 l2(s1p1, s1v1, B[0], B[1]); - lz4 l3(ZPa, ZVa, s1p0, s1p1, s1v0, s1v1); - - lz2 l4(s2p0, s2v0, B[6], B[7]); - lz2 l5(s2p1, s2v1, B[4], B[5]); - lz4 l6(ZPb, ZVb, s2p0, s2p1, s2v0, s2v1); - - assign ZP[1:0] = ZVb ? ZPb : ZPa; - assign ZP[2] = ~ZVb; - assign ZV = ZVa | ZVb; - -endmodule // lz8 - -module lz16 (ZP, ZV, B); - - input logic [15:0] B; - - output logic [3:0] ZP; - output logic ZV; - - logic [2:0] ZPa; - logic [2:0] ZPb; - logic ZVa; - logic ZVb; - - lz8 l1(ZPa, ZVa, B[7:0]); - lz8 l2(ZPb, ZVb, B[15:8]); - - assign ZP[2:0] = ZVb ? ZPb : ZPa; - assign ZP[3] = ~ZVb; - assign ZV = ZVa | ZVb; - -endmodule // lz16 - -module lz32 (ZP, ZV, B); - - input logic [31:0] B; - - output logic [4:0] ZP; - output logic ZV; - - logic [3:0] ZPa; - logic [3:0] ZPb; - logic ZVa; - logic ZVb; - - lz16 l1(ZPa, ZVa, B[15:0]); - lz16 l2(ZPb, ZVb, B[31:16]); - - assign ZP[3:0] = ZVb ? ZPb : ZPa; - assign ZP[4] = ~ZVb; - assign ZV = ZVa | ZVb; - -endmodule // lz32 - -// This module returns the number of leading zeros ZP in the 64-bit -// number B. If there are no ones in B, then ZP and ZV are both 0. - -module lz64 (ZP, ZV, B); - - input logic [63:0] B; - - output logic [5:0] ZP; - output logic ZV; - - logic [4:0] ZPa; - logic [4:0] ZPb; - logic ZVa; - logic ZVb; - - lz32 l1(ZPa, ZVa, B[31:0]); - lz32 l2(ZPb, ZVb, B[63:32]); - - assign ZV = ZVa | ZVb; - assign ZP[4:0] = (ZVb ? ZPb : ZPa) & {5{ZV}}; - assign ZP[5] = ~ZVb & ZV; - -endmodule // lz64 From ad570a4c47c4a8906a0e7b2db204eb5774d9a401 Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Mon, 23 Jan 2023 12:53:31 -0600 Subject: [PATCH 02/10] Test commit. please merge. --- bugs.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bugs.txt b/bugs.txt index f2a22fd81..95d68b0d4 100644 --- a/bugs.txt +++ b/bugs.txt @@ -1,2 +1,5 @@ 1. [X] Cache is suppressing d cache flush if there is a dtlb miss. 1. Fixed by disabling mmu's address translation on flush. + + +2. Test commit. From 678a879415d0e67ccc3635563cd5e3a4f401ba4f Mon Sep 17 00:00:00 2001 From: David Harris Date: Mon, 23 Jan 2023 10:54:06 -0800 Subject: [PATCH 03/10] formatting --- pipelined/src/wally/wallypipelinedcore.sv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelined/src/wally/wallypipelinedcore.sv b/pipelined/src/wally/wallypipelinedcore.sv index 3e1bd5846..2b71851f5 100644 --- a/pipelined/src/wally/wallypipelinedcore.sv +++ b/pipelined/src/wally/wallypipelinedcore.sv @@ -47,7 +47,7 @@ module wallypipelinedcore ( output logic [3:0] HPROT, output logic [1:0] HTRANS, output logic HMASTLOCK - ); +); logic StallF, StallD, StallE, StallM, StallW; logic FlushD, FlushE, FlushM, FlushW; From a5e1b09a402da9363a27b1005790ea30b3a86de9 Mon Sep 17 00:00:00 2001 From: David Harris <74973295+davidharrishmc@users.noreply.github.com> Date: Mon, 23 Jan 2023 12:12:14 -0800 Subject: [PATCH 04/10] installation instructions --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 45e503d94..2957b3490 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,12 @@ Then follow Section 2.2 to clone the repo, source setup, make the tests and run On the Linux computer where you will be working, log in, clone your fork of the repo, run the setup script, and build the tests: +Add the following lines to your .bashrc or .bash_profile + + if [ -f ~/cvw/setup.sh ]; then + source ~/cvw/setup.sh + fi + $ cd $ git clone --recurse-submodules https://github.com//cvw $ cd cvw @@ -34,12 +40,6 @@ Then follow Section 2.2 to clone the repo, source setup, make the tests and run $ cd pipelined/regression $ ./regression-wally (depends on having Questa installed) -Add the following lines to your .bashrc or .bash_profile - - if [ -f ~/cvw/setup.sh ]; then - source ~/cvw/setup.sh - fi - # Tool-chain Installation (Sys Admin) This section describes the open source toolchain installation. These steps should only be done once by the system admin. From 931846906990c4d1310a75b9ca756caa8744bb18 Mon Sep 17 00:00:00 2001 From: David Harris <74973295+davidharrishmc@users.noreply.github.com> Date: Mon, 23 Jan 2023 12:13:26 -0800 Subject: [PATCH 05/10] installation instructions --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2957b3490..dfb8060d3 100644 --- a/README.md +++ b/README.md @@ -23,15 +23,15 @@ Then follow Section 2.2 to clone the repo, source setup, make the tests and run In the upper right part of the screen, click on Fork Create a fork, choosing the owner as your github account and the repository as cvw. - On the Linux computer where you will be working, log in, clone your fork of the repo, - run the setup script, and build the tests: + On the Linux computer where you will be working, log in -Add the following lines to your .bashrc or .bash_profile +Add the following lines to your .bashrc or .bash_profile to run the setup script each time you log in. if [ -f ~/cvw/setup.sh ]; then source ~/cvw/setup.sh fi +Clone your fork of the repo, run the setup script, and build the tests: $ cd $ git clone --recurse-submodules https://github.com//cvw $ cd cvw From 5f2ddffa9f6053e58cf716722ed1b233264f0fa2 Mon Sep 17 00:00:00 2001 From: David Harris <74973295+davidharrishmc@users.noreply.github.com> Date: Mon, 23 Jan 2023 12:13:49 -0800 Subject: [PATCH 06/10] installation instructions --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index dfb8060d3..e6872c4a7 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ Add the following lines to your .bashrc or .bash_profile to run the setup script fi Clone your fork of the repo, run the setup script, and build the tests: + $ cd $ git clone --recurse-submodules https://github.com//cvw $ cd cvw From 7a5544a450fd8992a62bd21bfa664dada517d060 Mon Sep 17 00:00:00 2001 From: David Harris <74973295+davidharrishmc@users.noreply.github.com> Date: Mon, 23 Jan 2023 12:14:56 -0800 Subject: [PATCH 07/10] installation instructions --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index e6872c4a7..0e41f952e 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ New users may wish to do the following setup to access the server via a GUI and Terminal on Mac, cmd on Windows, xterm on Linux See A.1 about ssh -Y login from a terminal Git started with Git configuration and authentication: B.1 + $ git config --global user.name ″Ben Bitdiddle″ + $ git config --global user.email ″ben_bitdiddle@wally.edu″ + $ git config --global pull.rebase false Then follow Section 2.2 to clone the repo, source setup, make the tests and run regression From 64cf68f684f9d7a974df0305268af0afff0cb310 Mon Sep 17 00:00:00 2001 From: David Harris <74973295+davidharrishmc@users.noreply.github.com> Date: Mon, 23 Jan 2023 12:24:11 -0800 Subject: [PATCH 08/10] Added sudo to sysadmin install directions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0e41f952e..15cd8c757 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ This section describes the open source toolchain installation. These steps shou The full instalation details are involved can be be skipped using the following script, wally-tool-chain-install.sh. The script installs the open source tools to /opt/riscv by default. This can be changed by supply the path as the first argument. This script does not install buildroot (see the Detailed Tool-chain Install Guide in the following section) and does not install commercial EDA tools; Siemens Questa, Synopsys Design Compiler, or Cadence Innovus (see section Installing IDA Tools). It must be run as root or with sudo. This script is tested for Ubuntu, 20.04 and 22.04. Fedora and Red Hat can be installed in the Detailed Tool-chain Install Guide. - $ wally-tool-chain-install.sh + $ sudo wally-tool-chain-install.sh ## Detailed Tool-chain Install Guide From ca6748121fe5725318fdce7302c1767170e06537 Mon Sep 17 00:00:00 2001 From: David Harris <74973295+davidharrishmc@users.noreply.github.com> Date: Mon, 23 Jan 2023 12:30:23 -0800 Subject: [PATCH 09/10] installation instructions --- README.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 15cd8c757..92e4c638d 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,13 @@ Wally is a 5-stage pipelined processor configurable to support all the standard Wally is described in a textbook, RISC-V System-on-Chip Design, by Harris, Stine, Thompson, and Harris. Users should follow the setup instructions below. A system administrator must install CAD tools using the directions further down. +# New User Setup + New users may wish to do the following setup to access the server via a GUI and use a text editor. - Download and install x2go - A.1.1 - Download and install VSCode - A.4.2 - Make sure you can log into Tera acceptly via x2go and via a terminal + Optional: Download and install x2go - A.1.1 + Optional: Download and install VSCode - A.4.2 + Optional: Make sure you can log into your server via x2go and via a terminal Terminal on Mac, cmd on Windows, xterm on Linux See A.1 about ssh -Y login from a terminal Git started with Git configuration and authentication: B.1 @@ -19,7 +21,7 @@ New users may wish to do the following setup to access the server via a GUI and $ git config --global user.email ″ben_bitdiddle@wally.edu″ $ git config --global pull.rebase false -Then follow Section 2.2 to clone the repo, source setup, make the tests and run regression +Then clone the repo, source setup, make the tests and run regression If you don't already have a Github account, create one In a web browser, visit https://github.com/openhwgroup/cvw @@ -41,6 +43,16 @@ Clone your fork of the repo, run the setup script, and build the tests: $ cd cvw $ source ./setup.sh $ make + +Edit setup.sh and change the following lines to point to the path and license server for your Siemens Questa and Synopsys Design Compiler installation and license server. If you only have Questa, you can still simulate but cannot run logic synthesis. + + export MGLS_LICENSE_FILE=1717@solidworks.eng.hmc.edu # Change this to your Siemens license server + export SNPSLMD_LICENSE_FILE=27020@zircon.eng.hmc.edu # Change this to your Synopsys license server + export QUESTAPATH=/cad/mentor/questa_sim-2021.2_1/questasim/bin # Change this for your path to Questa + export SNPSPATH=/cad/synopsys/SYN/bin # Change this for your path to Design Compiler + +Run a regression simulation with Questa to prove everything is installed. + $ cd pipelined/regression $ ./regression-wally (depends on having Questa installed) From a03526c1a2c2123b38a5102306f5582d61407873 Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Mon, 23 Jan 2023 15:17:12 -0600 Subject: [PATCH 10/10] Added github cli (gh) to install script. --- bin/wally-tool-chain-install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/wally-tool-chain-install.sh b/bin/wally-tool-chain-install.sh index 3265795c5..2b45d8e77 100755 --- a/bin/wally-tool-chain-install.sh +++ b/bin/wally-tool-chain-install.sh @@ -125,3 +125,10 @@ pip3 install riscof --ignore-installed PyYAML # Verilator apt install -y verilator +# install github cli (gh) +type -p curl >/dev/null || sudo apt install curl -y +curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ +&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ +&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ +&& sudo apt update \ +&& sudo apt install gh -y