diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 4060bfaf16..2f8b77ec6a 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -43,52 +43,8 @@ jobs: run: ./bin/build_container - name: Setup project run: ./bin/setup - - name: Build manual - run: ./do gen:html_manual MANUAL_NAME=isa VERSIONS=all - - name: Build html documentation for generic_rv64 - run: ./do gen:html[generic_rv64] - - name: Generate YARD docs - run: ./do gen:tool_doc - - name: Create _site/example_cfg - run: mkdir -p _site/example_cfg - - name: Create _site/manual - run: mkdir -p _site/manual - - name: Create _site/pdfs - run: mkdir -p _site/pdfs - - name: Create _site/htmls - run: mkdir -p _site/htmls - - name: Copy cfg html - run: cp -R gen/cfg_html_doc/generic_rv64/html _site/example_cfg - - name: Create RVA20 Profile Release PDF Spec - run: ./do gen:profile[RVA20] - - name: Copy RVA20 Profile Release PDF - run: cp gen/profile_doc/pdf/RVA20.pdf _site/pdfs/RVA20.pdf - - name: Create RVA22 Profile Release PDF Spec - run: ./do gen:profile[RVA22] - - name: Copy RVA22 Profile Release PDF - run: cp gen/profile_doc/pdf/RVA22.pdf _site/pdfs/RVA22.pdf - - name: Create RVI20 Profile Release PDF Spec - run: ./do gen:profile[RVI20] - - name: Copy RVI20 Profile Release PDF - run: cp gen/profile_doc/pdf/RVA20.pdf _site/pdfs/RVI20.pdf - - name: Create MC100-32 PDF Spec - run: ./do gen:cert_model_pdf[MC100-32] - - name: Copy MC100-32 PDF - run: cp gen/certificate_doc/pdf/MC100-32.pdf _site/pdfs/MC100-32.pdf - - name: Create MC100-32 HTML Spec - run: ./do gen:cert_model_html[MC100-32] - - name: Copy MC100-32 HTML - run: cp gen/certificate_doc/html/MC100-32.html _site/htmls/MC100-32.html - - name: Create MC100-64 PDF Spec - run: ./do gen:cert_model_pdf[MC100-64] - - name: Copy MC100-64 PDF - run: cp gen/certificate_doc/pdf/MC100-64.pdf _site/pdfs/MC100-64.pdf - - name: Create MC100-64 HTML Spec - run: ./do gen:cert_model_html[MC100-64] - - name: Copy MC100-64 HTML - run: cp gen/certificate_doc/html/MC100-64.html _site/htmls/MC100-64.html - - name: Copy manual html - run: cp -R gen/manual/isa/top/all/html _site/manual + - name: Create deploy dir + run: /bin/bash lib/deploy.sh - name: Setup Pages uses: actions/configure-pages@v5 - name: Upload artifact diff --git a/README.adoc b/README.adoc index bca01db3bf..30f7d8668d 100644 --- a/README.adoc +++ b/README.adoc @@ -2,17 +2,8 @@ == Generated artifacts -The following artifacts have been generated from the top of the `main` branch: - -* https://riscv-software-src.github.io/riscv-unified-db/manual/html/index.html[ISA Manual with instruction and CSR appendix] -* https://riscv-software-src.github.io/riscv-unified-db/example_cfg/html/index.html[configuration-specific documentation] -* https://riscv-software-src.github.io/riscv-unified-db/ruby/arch_def/index.html[Ruby API documentation (database interface)] -* https://riscv-software-src.github.io/riscv-unified-db/ruby/idl/index.html[Ruby IDL API documentation (IDL compiler)] -* https://riscv-software-src.github.io/riscv-unified-db/pdfs/RVI20.pdf[RVI20 Profile Release] -* https://riscv-software-src.github.io/riscv-unified-db/pdfs/RVA20.pdf[RVA20 Profile Release] -* https://riscv-software-src.github.io/riscv-unified-db/pdfs/RVA22.pdf[RVA22 Profile Release] -* https://riscv-software-src.github.io/riscv-unified-db/pdfs/MC100-32.pdf[MC100-32 Certification Requirements Document] -* https://riscv-software-src.github.io/riscv-unified-db/pdfs/MC100-64.pdf[MC100-64 Certification Requirements Document] +The latest documentation artifacts generated from the HEAD of main, include ISA manuals, profiles, etc., +can be found https://riscv-software-src.github.io/riscv-unified-db/index.html[on the GitHub pages site]. == Overview diff --git a/Rakefile b/Rakefile index 40b2c220e9..5e4d62a0f9 100644 --- a/Rakefile +++ b/Rakefile @@ -48,10 +48,8 @@ namespace :gen do end end - desc "Resolve the standard in arch/, and write it to resolved_arch/" - task "resolved_arch" do - sh "#{$root}/.home/.venv/bin/python3 lib/yaml_resolver.py resolve arch resolved_arch" - end + desc "Resolve the standard in arch/, and write it to gen/resolved_arch/_" + task "resolved_arch" => "#{$root}/.stamps/resolve-_.stamp" end # rule to generate standard for any configurations with an overlay @@ -121,12 +119,12 @@ namespace :test do end puts "All instruction encodings pass basic sanity tests" end - task schema: "gen:resolved_arch" do + task schema: "#{$root}/.stamps/resolve-_.stamp" do puts "Checking arch files against schema.." - Architecture.new("#{$root}/resolved_arch").validate(show_progress: true) + Architecture.new("#{$root}/gen/resolved_arch/_").validate(show_progress: true) puts "All files validate against their schema" end - task idl: ["gen:resolved_arch", "#{$root}/.stamps/resolve-rv32.stamp", "#{$root}/.stamps/resolve-rv64.stamp"] do + task idl: ["#{$root}/.stamps/resolve-rv32.stamp", "#{$root}/.stamps/resolve-rv64.stamp"] do print "Parsing IDL code for RV32..." cfg_arch32 = cfg_arch_for("rv32") puts "done" diff --git a/bin/setup b/bin/setup index 0f89e8b746..c5e8abf8d3 100755 --- a/bin/setup +++ b/bin/setup @@ -205,14 +205,15 @@ else exit 1 fi -if [ ! -f $ROOT/.git/hooks/pre-commit ]; then - cat << HOOK > $ROOT/.git/hooks/pre-commit +GIT_REPO_ROOT=`git rev-parse --path-format=absolute --git-common-dir | tr -d '\n'` +if [ ! -f $GIT_REPO_ROOT/hooks/pre-commit ]; then + cat << HOOK > $GIT_REPO_ROOT/hooks/pre-commit #!/usr/bin/env bash # File generated by pre-commit: https://pre-commit.com # ID: 138fd403232d2ddd5efb44317e38bf03 # start templated -INSTALL_PYTHON=$ROOT/bin/python +INSTALL_PYTHON=\$(realpath ./bin/python) ARGS=(hook-impl --config=.pre-commit-config.yaml --hook-type=pre-commit) # end templated @@ -228,5 +229,5 @@ else exit 1 fi HOOK - chmod +x $ROOT/.git/hooks/pre-commit + chmod +x $GIT_REPO_ROOT/hooks/pre-commit fi diff --git a/lib/deploy.sh b/lib/deploy.sh new file mode 100644 index 0000000000..f5c80c79f1 --- /dev/null +++ b/lib/deploy.sh @@ -0,0 +1,139 @@ +#!/bin/bash + +# deploy artifacts to a directory, in preparation for GitHub deployment + +ROOT=$(dirname $(dirname $(realpath $BASH_SOURCE[0]))) + +DEPLOY_DIR="$ROOT/_site" +PAGES_URL="https://riscv-software-src.github.io/riscv-unified-db" + +mkdir -p $DEPLOY_DIR + +echo "Create _site/example_cfg" +mkdir -p $DEPLOY_DIR/example_cfg + +echo "Create _site/manual" +mkdir -p $DEPLOY_DIR/manual + +echo "Create _site/pdfs" +mkdir -p $DEPLOY_DIR/pdfs + + + +echo "Resolve / Create Index" +./do gen:resolved_arch + +echo "Build manual" +./do gen:html_manual MANUAL_NAME=isa VERSIONS=all + +echo "Copy manual html" +cp -R gen/manual/isa/top/all/html $DEPLOY_DIR/manual + +echo "Build html documentation for generic_rv64" +./do gen:html[generic_rv64] + +echo "Generate YARD docs" +./do gen:tool_doc + +echo "Create _site/htmls" +mkdir mkdir -p $DEPLOY_DIR/htmls + +echo "Copy cfg html" +cp -R gen/cfg_html_doc/generic_rv64/html $DEPLOY_DIR/example_cfg + +echo "Create RVA20 Profile Release PDF Spec" +./do gen:profile[RVA20] + +echo "Copy RVA20 Profile Release PDF" +cp gen/profile_doc/pdf/RVA20.pdf $DEPLOY_DIR/pdfs/RVA20.pdf + +echo "Create RVA22 Profile Release PDF Spec" +./do gen:profile[RVA22] + +echo "Copy RVA22 Profile Release PDF" +cp gen/profile_doc/pdf/RVA22.pdf $DEPLOY_DIR/pdfs/RVA22.pdf + +echo "Create RVI20 Profile Release PDF Spec" +./do gen:profile[RVI20] + +echo "Copy RVI20 Profile Release PDF" +cp gen/profile_doc/pdf/RVA20.pdf $DEPLOY_DIR/pdfs/RVI20.pdf + +echo "Create MC100-32 PDF Spec" +./do gen:cert_model_pdf[MC100-32] + +echo "Copy MC100-32 PDF" +cp gen/certificate_doc/pdf/MC100-32.pdf $DEPLOY_DIR/pdfs/MC100-32.pdf + +echo "Create MC100-32 HTML Spec" +./do gen:cert_model_html[MC100-32] + +echo "Copy MC100-32 HTML" +cp gen/certificate_doc/html/MC100-32.html $DEPLOY_DIR/htmls/MC100-32.html + +echo "Create MC100-64 PDF Spec" +./do gen:cert_model_pdf[MC100-64] + +echo "Copy MC100-64 PDF" +cp gen/certificate_doc/pdf/MC100-64.pdf $DEPLOY_DIR/pdfs/MC100-64.pdf + +echo "Create MC100-64 HTML Spec" +./do gen:cert_model_html[MC100-64] + +echo "Copy MC100-64 HTML" +cp gen/certificate_doc/html/MC100-64.html $DEPLOY_DIR/htmls/MC100-64.html + +echo "Create index" +cat <<- EOF > $DEPLOY_DIR/index.html + + +
+riscv-unified-db, ref $GITHUB_REF_NAMECreated on $(date)
+ +