diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index cdd9b102c..000b5c14c 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -27,7 +27,7 @@ jobs: uses: actions/cache@v3 with: path: .singularity/image.sif - key: ${{ hashFiles('container.def') }} + key: ${{ hashFiles('container.def', 'bin/.container-tag') }} - name: Get gems and node files from cache id: cache-bundle-npm uses: actions/cache@v3 diff --git a/.github/workflows/regress.yml b/.github/workflows/regress.yml index 1517a3beb..7a0d3d3f1 100644 --- a/.github/workflows/regress.yml +++ b/.github/workflows/regress.yml @@ -12,13 +12,11 @@ jobs: uses: actions/checkout@v4 - name: Setup apptainer uses: eWaterCycle/setup-apptainer@v2.0.0 - - name: Read container tag - run: echo "CONTAINER_TAG=$(cat bin/.container-tag)" >> $GITHUB_ENV - name: Get container from cache id: cache-sif uses: actions/cache@v3 with: - path: .singularity/image${{ env.CONTAINER_TAG }}.sif + path: .singularity/image.sif key: ${{ hashFiles('container.def', 'bin/.container-tag') }} - name: Get gems and node files from cache id: cache-bundle-npm diff --git a/arch/ext/B.yaml b/arch/ext/B.yaml index 831be28f6..799052c57 100644 --- a/arch/ext/B.yaml +++ b/arch/ext/B.yaml @@ -21,7 +21,7 @@ B: implies: - [Zba, 1.0] - [Zbb, 1.0] - - [Zbc, 1.0] + - [Zbs, 1.0] description: | The B standard extension comprises instructions provided by the `Zba`, `Zbb`, and `Zbs` extensions. diff --git a/arch/ext/Zba.yaml b/arch/ext/Zba.yaml index 0a113ab33..041c238b6 100644 --- a/arch/ext/Zba.yaml +++ b/arch/ext/Zba.yaml @@ -17,7 +17,45 @@ Zba: of wider elements. The `slli.uw` -- added in this extension -- can be used when the index is to be interpreted as an unsigned word. type: unprivileged + company: + name: RISC-V International + url: https://riscv.org versions: - version: 1.0 state: ratified ratification_date: 2021-06 + repositories: + - url: https://github.com/riscv/riscv-bitmanip + branch: main + contributors: + - name: Jacob Bachmeyer + - name: Allen Baum + - name: Ari Ben + - name: Alex Bradbury + - name: Steven Brager + - name: Rogier Brussee + - name: Michael Clark + - name: Ken Dockser + - name: Paul Donahue + - name: Dennis Ferguson + - name: Fabian Giesen + - name: John Hauser + - name: Robert Henry + - name: Bruce Holt + - name: Po-wei Huang + - name: Ben Marshall + - name: Rex McCrary + - name: Lee Moore + - name: Jiri Moravec + - name: Samuel Neves + - name: Markus Oberhumer + - name: Christopher Olson + - name: Nils Pipenbrinck + - name: Joseph Rahmeh + - name: Xue Saw + - name: Tommy Thorn + - name: Philipp Tomsich + - name: Avishai Tvila + - name: Andrew Waterman + - name: Thomas Wicki + - name: Claire Wolf diff --git a/arch/ext/Zbb.yaml b/arch/ext/Zbb.yaml index 5a046de02..40e37d763 100644 --- a/arch/ext/Zbb.yaml +++ b/arch/ext/Zbb.yaml @@ -5,7 +5,45 @@ Zbb: description: | Basic bit manipulation type: unprivileged + company: + name: RISC-V International + url: https://riscv.org versions: - version: 1.0 state: ratified ratification_date: 2021-06 + repositories: + - url: https://github.com/riscv/riscv-bitmanip + branch: main + contributors: + - name: Jacob Bachmeyer + - name: Allen Baum + - name: Ari Ben + - name: Alex Bradbury + - name: Steven Brager + - name: Rogier Brussee + - name: Michael Clark + - name: Ken Dockser + - name: Paul Donahue + - name: Dennis Ferguson + - name: Fabian Giesen + - name: John Hauser + - name: Robert Henry + - name: Bruce Holt + - name: Po-wei Huang + - name: Ben Marshall + - name: Rex McCrary + - name: Lee Moore + - name: Jiri Moravec + - name: Samuel Neves + - name: Markus Oberhumer + - name: Christopher Olson + - name: Nils Pipenbrinck + - name: Joseph Rahmeh + - name: Xue Saw + - name: Tommy Thorn + - name: Philipp Tomsich + - name: Avishai Tvila + - name: Andrew Waterman + - name: Thomas Wicki + - name: Claire Wolf diff --git a/arch/ext/Zbc.yaml b/arch/ext/Zbc.yaml index 84ded5eac..6d0e0d8d1 100644 --- a/arch/ext/Zbc.yaml +++ b/arch/ext/Zbc.yaml @@ -5,7 +5,47 @@ Zbc: description: | Carry-less multiplication is the multiplication in the polynomial ring over GF(2). type: unprivileged + company: + name: RISC-V International + url: https://riscv.org versions: - version: 1.0 state: ratified ratification_date: 2021-06 + repositories: + - url: https://github.com/riscv/riscv-bitmanip + branch: main + contributors: + - name: Jacob Bachmeyer + - name: Allen Baum + - name: Ari Ben + - name: Alex Bradbury + - name: Steven Brager + - name: Rogier Brussee + - name: Michael Clark + - name: Ken Dockser + - name: Paul Donahue + - name: Dennis Ferguson + - name: Fabian Giesen + - name: John Hauser + - name: Robert Henry + - name: Bruce Holt + - name: Po-wei Huang + - name: Ben Marshall + - name: Rex McCrary + - name: Lee Moore + - name: Jiri Moravec + - name: Samuel Neves + - name: Markus Oberhumer + - name: Christopher Olson + - name: Nils Pipenbrinck + - name: Joseph Rahmeh + - name: Xue Saw + - name: Tommy Thorn + - name: Philipp Tomsich + - name: Avishai Tvila + - name: Andrew Waterman + - name: Thomas Wicki + - name: Claire Wolf + + diff --git a/arch/ext/Zbs.yaml b/arch/ext/Zbs.yaml new file mode 100644 index 000000000..5964db6d8 --- /dev/null +++ b/arch/ext/Zbs.yaml @@ -0,0 +1,52 @@ +# yaml-language-server: $schema=../../schemas/ext_schema.json + +Zbs: + long_name: Single-bit instructions + description: | + The single-bit instructions provide a mechanism to set, clear, invert, or extract a single bit + in a register. The bit is specified by its index + type: unprivileged + company: + name: RISC-V International + url: https://riscv.org + versions: + - version: 1.0 + state: ratified + ratification_date: 2021-06 + repositories: + - url: https://github.com/riscv/riscv-bitmanip + branch: main + contributors: + - name: Jacob Bachmeyer + - name: Allen Baum + - name: Ari Ben + - name: Alex Bradbury + - name: Steven Brager + - name: Rogier Brussee + - name: Michael Clark + - name: Ken Dockser + - name: Paul Donahue + - name: Dennis Ferguson + - name: Fabian Giesen + - name: John Hauser + - name: Robert Henry + - name: Bruce Holt + - name: Po-wei Huang + - name: Ben Marshall + - name: Rex McCrary + - name: Lee Moore + - name: Jiri Moravec + - name: Samuel Neves + - name: Markus Oberhumer + - name: Christopher Olson + - name: Nils Pipenbrinck + - name: Joseph Rahmeh + - name: Xue Saw + - name: Tommy Thorn + - name: Philipp Tomsich + - name: Avishai Tvila + - name: Andrew Waterman + - name: Thomas Wicki + - name: Claire Wolf + + diff --git a/bin/build_container b/bin/build_container index 0c3e5a970..0e8729057 100755 --- a/bin/build_container +++ b/bin/build_container @@ -4,6 +4,17 @@ ROOT=$(realpath $(dirname $(dirname $BASH_SOURCE[0]))) CONTAINER_TAG=`cat ${ROOT}/bin/.container-tag` +if [ -v GITHUB_ACTIONS ]; then + echo "ACTIONS" + CONTAINER_PATH=${ROOT}/.singularity/image.sif + HOME_PATH=${GITHUB_WORKSPACE} + SINGULARITY_CACHE=--disable-cache +else + CONTAINER_PATH=${ROOT}/.singularity/image-$CONTAINER_TAG.sif + HOME_PATH=${HOME} + SINGULARITY_CACHE= +fi + # uncomment below if you have sudo permission and don't have fakeroot permission NEED_SUDO=0 cat /etc/subgid | grep "^$(id -u):" @@ -54,13 +65,13 @@ echo "Building container..." if [ ! -d "${ROOT}/.singularity" ]; then mkdir -p ${ROOT}/.singularity fi -if [ -e "${ROOT}/.singularity/image.sif" ]; then - rm -f "${ROOT}/.singularity/image.sif" +if [ -e ${CONTAINER_PATH} ]; then + rm -f ${CONTAINER_PATH} fi $SUDO singularity build --force \ $FAKEROOT \ - ${ROOT}/.singularity/image-${CONTAINER_TAG}.sif \ + ${CONTAINER_PATH} \ ${ROOT}/container.def if [ $? -ne 0 ]; then echo "Container build failed." 2>&1 diff --git a/bin/setup b/bin/setup index 4eb028dcb..4b63fe45a 100755 --- a/bin/setup +++ b/bin/setup @@ -6,30 +6,43 @@ cd $ROOT CONTAINER_TAG=`cat ${ROOT}/bin/.container-tag` +if [ -v GITHUB_ACTIONS ]; then + echo "ACTIONS" + CONTAINER_PATH=${ROOT}/.singularity/image.sif + HOME_PATH=${GITHUB_WORKSPACE} + HOME_OPT="--home ${ROOT}/.home" + SINGULARITY_CACHE=--disable-cache +else + CONTAINER_PATH=${ROOT}/.singularity/image-$CONTAINER_TAG.sif + HOME_PATH=${HOME} + HOME_OPT="--bind ${ROOT}/.home:${HOME_PATH}" + SINGULARITY_CACHE= +fi + if [ ! -d $ROOT/.home ]; then mkdir $ROOT/.home fi -if [ ! -f $ROOT/.singularity/image-$CONTAINER_TAG.sif ]; then +if [ ! -f ${CONTAINER_PATH} ]; then echo "Fetching container..." if [ ! -d "${ROOT}/.singularity" ]; then mkdir -p ${ROOT}/.singularity fi - singularity pull --disable-cache ${ROOT}/.singularity/image-$CONTAINER_TAG.sif oras://docker.io/riscvintl/spec-generator:$CONTAINER_TAG + singularity pull ${SINGULARITY_CACHE} ${CONTAINER_PATH} oras://docker.io/riscvintl/spec-generator:$CONTAINER_TAG fi if [ ! -f $ROOT/.bundle/config ]; then OLDDIR=$PWD cd $ROOT - singularity run --home ${ROOT}/.home .singularity/image-$CONTAINER_TAG.sif bundle config set --local path ${ROOT}/.home/.gems - singularity run --home ${ROOT}/.home .singularity/image-$CONTAINER_TAG.sif bundle config set --local cache_path ${ROOT}/.home/.cache + singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle config set --local path ${ROOT}/.home/.gems + singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle config set --local cache_path ${ROOT}/.home/.cache cd $OLDDIR fi if [ ! -d $ROOT/.home/.gems ]; then OLDDIR=$PWD cd $ROOT - singularity run --home ${ROOT}/.home .singularity/image-$CONTAINER_TAG.sif bundle install + singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle install cd $OLDDIR fi @@ -39,8 +52,8 @@ fi if [[ ! -z "$DEVELOPMENT" && $DEVELOPMENT -eq 1 ]]; then if [ ! -d "${ROOT}/.home/.yard/gem_index"]; then - singularity run --home ${ROOT}/.home .singularity/image-$CONTAINER_TAG.sif bundle exec --gemfile ${ROOT}/Gemfile yard config --gem-install-yri - singularity run --home ${ROOT}/.home .singularity/image-$CONTAINER_TAG.sif bundle exec --gemfile ${ROOT}/Gemfile yard gems + singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec --gemfile ${ROOT}/Gemfile yard config --gem-install-yri + singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec --gemfile ${ROOT}/Gemfile yard gems touch ${ROOT}/.stamps/dev_gems fi fi @@ -64,11 +77,11 @@ if [[ ! -z "$VSCODE" && $VSCODE -eq 1 ]]; then fi if [ ! -d ${ROOT}/node_modules ]; then - singularity run --home ${PWD}/.home .singularity/image-$CONTAINER_TAG.sif npm i + singularity run ${HOME_OPT} ${CONTAINER_PATH} npm i fi -BUNDLE="singularity run --home ${PWD}/.home .singularity/image-$CONTAINER_TAG.sif bundle" -RUBY="singularity run --home ${PWD}/.home .singularity/image-$CONTAINER_TAG.sif bundle exec ruby" -RAKE="singularity run --home ${PWD}/.home .singularity/image-$CONTAINER_TAG.sif bundle exec rake" -NPM="singularity run --home ${PWD}/.home .singularity/image-$CONTAINER_TAG.sif npm" -NPX="singularity run --home ${PWD}/.home .singularity/image-$CONTAINER_TAG.sif npx" +BUNDLE="singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle" +RUBY="singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec ruby" +RAKE="singularity run ${HOME_OPT} ${CONTAINER_PATH} bundle exec rake" +NPM="singularity run ${HOME_OPT} ${CONTAINER_PATH} npm" +NPX="singularity run ${HOME_OPT} ${CONTAINER_PATH} npx"