Skip to content

riscv/fake-spec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RISC-V Specification Template

This repository serves as a template for creating GitHub repositories within the RISC-V organization for the purpose of developing specifications. It aims to facilitate and standardize the process of specification development.

Note
If you are viewing this in a specification repository, kindly update the title for this section and provide an introduction relevant to your repository.
Important

ARC submissions: Specifications submitted to the Architecture Review Committee (ARC) must follow the conventions in ARC_SUBMISSION.md — versioned GitHub tag, PDF named <short>-v<MAJOR>.<MINOR>-<YYYYMMDD>.pdf, and a title page that matches. The Makefile and CI workflows in this template produce ARC-compliant artifacts on every build by default.

Migrating an existing repo? See MIGRATION.md for the step-by-step checklist to bring a downstream fork in line with the current toolchain — both the ARC submission PDF and the Antora site, which share one source tree. See ANTORA.md for how that dual build works and why.

License

This work is licensed under a Creative Commons Attribution 4.0 International License (CC-BY-4.0). For details, see the LICENSE file.

Maintainers

The list of maintainers of this specification is maintained in the MAINTAINERS file.

Contributors

The list of contributors to this specification is maintained in the contributors file.

For guidelines on how to contribute, refer to the CONTRIBUTING file.

Governance

The governance for this project is defined in the GOVERNANCE file.

Community information, including meeting (if held) and mailing lists are detailed in this file.

Building the Document

Directory Structure

The following directories are used to organize the contents of this repo:

  • dependencies/: software dependencies needed to build the specification

  • docs-resources/: resources for all specifications sourced from git submodule

  • src/: source files for the specification

  • build/: default directory where the build artifacts are generated

Prerequisites

To build the document, you’ll need the following tools installed on your system:

  • Make

  • asciiDoctor-pdf, asciidoctor-bibtex, asciidoctor-diagram, and asciidoctor-mathematical

  • Docker

Cloning the Repository

git clone --recurse-submodules https://github.com/riscv/docs-spec-template.git

All in one single line:

git clone --recurse-submodules https://github.com/riscv/docs-spec-template.git && cd docs-spec-template && git submodule update --init --recursive

Building the Documentation

To start the build process, run:

cd ./docs-spec-template && make build

The Makefile script will check the availability of Docker on your system:

  • If Docker is available, the documentation will be built inside a Docker container using the image riscvintl/riscv-docs-base-container-image:latest. This ensures a consistent build environment across different systems.

  • If Docker is not available, the documentation will be built directly on your system using the installed tools.

The documentation is generated from the AsciiDoctor source files in your project. The primary source file is specified by the HEADER_SOURCE variable in the Makefile.

The build process utilizes several options, including theming and font settings, and generates a PDF document as output.

Cleaning up

To clean up the generated files, run:

make clean

Previewing the Antora site locally

The chapter sources under modules/ROOT/pages/ also feed the Antora HTML site. To preview it locally (see ANTORA.md for the full dual-build details):

npm install                # Antora + the kroki/mathjax preview extensions
docker compose up -d kroki # local diagram server (wavedrom/kroki)
npm run preview            # builds the site into build/site/
Warning

Citations and the bibliography do not render in the local Antora preview. The cite: and bibliography::[] macros are handled by the RISC-V central playbook’s ASAM bibliography extension, which is not bundled in this repository. In local preview they appear as raw text; this is expected, not a build error.

To check bibliography output, build with make (the PDF/HTML use the asciidoctor-bibtex toolchain) or view the specification on the central RISC-V documentation site, where the ASAM extension renders them.

Important

Don’t forget site numbering rules. Chapter/section numbering on the published site is applied by the RISC-V central playbook, keyed to the line numbers of the xref entries in modules/ROOT/nav.adoc — not by anything in this repo. When you finalize your chapter structure (or add/remove/reorder pages in nav.adoc), you must add or update the matching entry in the central playbook’s numbering_rules, or your spec will render with wrong or missing chapter numbers. See the Section numbering section of ANTORA.md for the exact rule and format.

Automated Versioning and Milestones

The repository includes CI automation for specification revision metadata and state transitions.

Trigger for automated version bumps

The version bot runs on pushes to main only when files under src/** change (the main specification content).

End-to-end flow

  1. A commit that changes src/** is pushed to main.

  2. .github/workflows/version-bot.yml finds the latest v* tag and creates the next revision tag (vMAJOR.MINOR) for that commit.

  3. The new tag triggers .github/workflows/build-pdf.yml.

  4. The build uses the tag as :revnumber: and sets :revdate: to the build date.

  5. scripts/release-info.sh derives phase (:phase:), display state (:phase_display:), warning text (:phase_notice:), and :revremark: from the version milestone.

  6. Tag-triggered builds publish GitHub Releases with the generated PDF artifacts.

Version increment policy:

  • Versions are two-digit vMAJOR.MINOR as a fixed-point decimal (v0.6 = 0.60, v1.0 = 1.00). Ordering is decimal, not semver: v0.8 (0.80) is greater than v0.61.

  • Normal step: advance the revision by 0.01 (v0.61v0.62).

  • Milestone gates (v0.6, v0.8, v0.9, v0.99, v1.0) are cut manually; the bot never auto-advances onto a gate. When a band is exhausted (for example v0.79), a maintainer cuts the next milestone.

Milestone boundaries

  • v0.6: Developed (revisions v0.61v0.79)

  • v0.8: Stable (revisions v0.81v0.89)

  • v0.9: Frozen (revisions v0.91v0.98)

  • v0.99: Ratification-Ready

  • v1.0: Ratified

Official vs prerelease policy

Only these exact versions are published as official releases (prerelease=false):

  • v0.6

  • v0.8

  • v0.9

  • v0.99

  • v1.0

All other versions are published as prereleases (prerelease=true).

Milestone PR behavior

When a new tag crosses into a different phase than the previous tag, the bot opens a PR that updates SPEC_STATE.md for maintainer review. This PR is the checkpoint for governance/process updates required by the new phase.

Manual build overrides

workflow_dispatch for .github/workflows/build-pdf.yml supports:

  • release_version to force an explicit version.

  • target_phase to force a milestone floor (Developedv0.6, Stablev0.8, and so on).

  • With target_phase=auto-next (default), manual runs use the latest existing tag if that tag is between milestone floors; otherwise they compute the next revision.

Manual version jumps

workflow_dispatch for .github/workflows/version-bot.yml supports forced jumps:

  • Set target_phase=Frozen to force the milestone floor (v0.9).

  • Set target_phase=Stable to force v0.8, Ratification-Ready to force v0.99, and so on.

  • Set release_version (for example v0.9) to force an explicit version; this takes precedence over target_phase.

  • Manual jumps must run on main.

  • By default, backward jumps are blocked; set allow_non_monotonic=true only when intentionally overriding this safety check.

Enabling pre-commit checks locally

The repository has some basic commit checks set up with pre-commit that will be enforced by the GitHub CI. To ensure these checks are also run in the local repository while making changes the following can be done:

Installing pre-commit tool
# Do once on your system
pip3 install pre-commit
Installing pre-commit git hook in repo
# Do once in local repo
pre-commit install

Rather than doing the above pre-commit install in every repo that uses it, you can do it once on your system.

When enabling additional checks by editing .pre-commit-config.yaml, it is recommended running the newly added check on all files in the repository. This can be done with the following command:

Running all pre-commit hooks on all files
pre-commit run --all-files

About

Fake spec to test docs-spec-template.

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages