docs: split User Guide

This commit is contained in:
umarcor 2021-06-02 05:34:00 +02:00
parent 9f838c1861
commit e78e43d15b
39 changed files with 152 additions and 67 deletions

View file

@ -46,22 +46,14 @@ jobs:
with:
fetch-depth: 0
- name: '📚 Build Datasheet (PDF and HTML)'
- name: '📚 Build Datasheet and User Guide (PDF and HTML)'
run: make container
- name: '📤 Upload Artifact: PDF'
uses: actions/upload-artifact@v2
with:
name: NEORV32-PDF
path: docs/NEORV32.pdf
- name: '📤 Upload Artifact: HTML'
uses: actions/upload-artifact@v2
with:
name: NEORV32-HTML
path: |
docs/index.html
docs/figures
name: NEORV32
path: docs/public
deploy:
@ -82,11 +74,13 @@ jobs:
- name: '🛠️ Organise public subdir and create a tarball'
run: |
mv NEORV32-HTML public
mv NEORV32 public
mv public/pdf ./
mv NEORV32-Doxygen public/sw
tar zvcf NEORV32-SITE-nightly.tar.gz -C public .
mv NEORV32-PDF/NEORV32.pdf public
cp public/NEORV32.pdf NEORV32-nightly.pdf
cd pdf
mv NEORV32.pdf NEORV32-nightly.pdf
mv NEORV32_UserGuide.pdf NEORV32_UserGuide-nightly.pdf
# Tagged: create a pre-release or a release (semver)
# Untagged: update the assets of pre-release 'nightly'
@ -97,7 +91,7 @@ jobs:
tag: 'nightly'
files: |
NEORV32-SITE-nightly.tar.gz
NEORV32-nightly.pdf
pdf/NEORV32*nightly.pdf
- name: '🚀 Deploy to GitHub-Pages'
run: |

7
.gitignore vendored
View file

@ -18,10 +18,9 @@ sw/image_gen/image_gen.exe
~*
# no generated documentation stuff
docs/doxygen_build
docs/NEORV32.pdf
/docs/.asciidoctor
/docs/index.html
/docs/doxygen_build/
/docs/.asciidoctor/
/docs/public/
# no compiled ghdl stuff
*.cf

View file

@ -1,14 +1,18 @@
.DEFAULT_GOAL := help
all: pdf html ug-pdf ug-html
mkdir -p docs/public/img/
cp -vr docs/figures/* docs/public/img/
# Generate PDF datasheet
pdf:
cd docs; \
[ -f revnumber.txt ] && REVNUMBER='-a revnumber='"$$(cat revnumber.txt)" || unset REVNUMBER; \
asciidoctor-pdf $$REVNUMBER \
-a pdf-theme=src_adoc/neorv32-theme.yml \
-a pdf-theme=neorv32-theme.yml \
-r asciidoctor-diagram \
src_adoc/neorv32.adoc \
--out-file NEORV32.pdf
datasheet/main.adoc \
--out-file public/pdf/NEORV32.pdf
# Generate HTML datasheet
html:
@ -16,8 +20,27 @@ html:
[ -f revnumber.txt ] && REVNUMBER='-a revnumber='"$$(cat revnumber.txt)" || unset REVNUMBER; \
asciidoctor $$REVNUMBER \
-r asciidoctor-diagram \
src_adoc/index.adoc \
--out-file index.html
datasheet/index.adoc \
--out-file public/index.html
# Generate PDF user guide
ug-pdf:
cd docs; \
[ -f revnumber.txt ] && REVNUMBER='-a revnumber='"$$(cat revnumber.txt)" || unset REVNUMBER; \
asciidoctor-pdf $$REVNUMBER \
-a pdf-theme=neorv32-theme.yml \
-r asciidoctor-diagram \
userguide/main.adoc \
--out-file public/pdf/NEORV32_UserGuide.pdf
# Generate HTML user guide
ug-html:
cd docs; \
[ -f revnumber.txt ] && REVNUMBER='-a revnumber='"$$(cat revnumber.txt)" || unset REVNUMBER; \
asciidoctor $$REVNUMBER \
-r asciidoctor-diagram \
userguide/index.adoc \
--out-file public/ug/index.html
# Generate revnumber.txt for overriding the revnumber attribute in 'pdf' and/or 'html'
revnumber:
@ -27,11 +50,13 @@ revnumber:
# Build 'pdf' and 'html' in an 'asciidoctor-wavedrom' container
container: revnumber
docker run --rm -v /$(PWD)://documents/ btdi/asciidoctor make pdf html
docker run --rm -v /$(PWD)://documents/ btdi/asciidoctor make all
# Help
help:
@echo "Targets:"
@echo " help - show this text"
@echo " html - build project documentation as HTML page (docs/index.html)"
@echo " pdf - build project documentation as pdf file (docs/NEORV32.pdf)"
@echo " help - show this text"
@echo " pdf - build datasheet as pdf file (docs/public/pdf/NEORV32.pdf)"
@echo " html - build datasheet as HTML page (docs/public/index.html)"
@echo " ug-pdf - build user guide as pdf file (docs/public/pdf/NEORV32_UserGuide.pdf)"
@echo " ug-html - build user guide as HTML page (docs/public/ug/index.html)"

View file

@ -11,7 +11,9 @@
[![license](https://img.shields.io/github/license/stnolting/neorv32?longCache=true&style=flat-square)](https://github.com/stnolting/neorv32/blob/master/LICENSE)
[![release](https://img.shields.io/github/v/release/stnolting/neorv32?longCache=true&style=flat-square&logo=GitHub)](https://github.com/stnolting/neorv32/releases)
[![datasheet (pdf)](https://img.shields.io/badge/data%20sheet-PDF-ffbd00?longCache=true&style=flat-square&logo=asciidoctor)](https://github.com/stnolting/neorv32/releases/tag/nightly)
[![datasheet (html)](https://img.shields.io/badge/data%20sheet-HTML-ffbd00?longCache=true&style=flat-square&logo=asciidoctor)](https://stnolting.github.io/neorv32)
[![datasheet (html)](https://img.shields.io/badge/-HTML-ffbd00?longCache=true&style=flat-square)](https://stnolting.github.io/neorv32)
[![userguide (pdf)](https://img.shields.io/badge/user%20guide-PDF-ffbd00?longCache=true&style=flat-square&logo=asciidoctor)](https://github.com/stnolting/neorv32/releases/tag/nightly)
[![userguide (html)](https://img.shields.io/badge/-HTML-ffbd00?longCache=true&style=flat-square)](https://stnolting.github.io/neorv32/ug)
[![doxygen](https://img.shields.io/badge/doxygen-HTML-ffbd00?longCache=true&style=flat-square&logo=Doxygen)](https://stnolting.github.io/neorv32/sw/files.html)
* [Overview](#Overview)

View file

@ -11,6 +11,4 @@ include::software.adoc[]
include::on_chip_debugger.adoc[]
include::getting_started.adoc[]
include::legal.adoc[]
include::../legal.adoc[]

View file

@ -1,4 +1,5 @@
= The NEORV32 RISC-V Processor
= The NEORV32 RISC-V Processor: Datasheet
:title: [Datasheet] The NEORV32 RISC-V Processor
:author: Dipl.-Ing. Stephan Nolting
:email: stnolting@gmail.com
:description: A size-optimized, customizable and open-source full-scale 32-bit RISC-V soft-core CPU and SoC written in platform-independent VHDL.
@ -6,14 +7,14 @@
:doctype: book
:sectnums:
:icons: font
:imagesdir: figures
:imagesdir: img
:stem:
:reproducible:
:listing-caption: Listing
:toc: left
:toclevels: 4
:title-logo-image: neorv32_logo_dark.png[pdfwidth=6.25in,align=center]
:favicon: figures/icon.png
:favicon: img/icon.png
image::neorv32_logo_transparent.png[align=center]
@ -23,6 +24,8 @@ image::riscv_logo.png[width=350,align=center]
https://github.com/stnolting/neorv32[image:https://img.shields.io/badge/GitHub-stnolting%2Fneorv32-ffbd00?style=flat-square&logo=github&[title='homepage']]
https://github.com/stnolting/neorv32/blob/master/LICENSE[image:https://img.shields.io/github/license/stnolting/neorv32?longCache=true&style=flat-square[title='license']]
https://github.com/stnolting/neorv32/releases/tag/nightly[image:https://img.shields.io/badge/data%20sheet-PDF-ffbd00?longCache=true&style=flat-square&logo=asciidoctor[title='datasheet (pdf)']]
https://github.com/stnolting/neorv32/releases/tag/nightly[image:https://img.shields.io/badge/user%20guide-PDF-ffbd00?longCache=true&style=flat-square&logo=asciidoctor[title='userguide (pdf)']]
https://stnolting.github.io/neorv32/ug[image:https://img.shields.io/badge/-HTML-ffbd00?longCache=true&style=flat-square[title='userguide (html)']]
https://stnolting.github.io/neorv32/sw/files.html[image:https://img.shields.io/badge/doxygen-HTML-ffbd00?longCache=true&style=flat-square&logo=Doxygen[title='doxygen']]

View file

@ -1,4 +1,4 @@
= The NEORV32 RISC-V Processor
= The NEORV32 RISC-V Processor: Datasheet
:author: Dipl.-Ing. Stephan Nolting
:email: stnolting@gmail.com
:description: A size-optimized, customizable and open-source full-scale 32-bit RISC-V soft-core CPU and SoC written in platform-independent VHDL.
@ -6,7 +6,7 @@
:doctype: book
:sectnums:
:icons: image
:iconsdir: icons
:iconsdir: ../icons
:imagesdir: ../figures
:stem:
:reproducible:
@ -14,8 +14,6 @@
:toc: macro
:toclevels: 4
:title-logo-image: image:neorv32_logo_dark.png[pdfwidth=6.25in,align=center]
// Uncomment next line to add a title page (or set doctype to book)
//:title-page:
// Uncomment next line to set page size (default is A4)
//:pdf-page-size: Letter

View file

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before After
Before After

View file

@ -1,11 +1,10 @@
:sectnums:
== Let's Get It Started!
Let's Get It Started!
To make your NEORV32 project run, follow the guides from the upcoming sections. Follow these guides
step by step and in the presented order.
:sectnums:
=== Toolchain Setup
== Toolchain Setup
There are two possibilities to get the actual RISC-V GCC toolchain:
@ -24,7 +23,7 @@ emulation) on an architecture without these extensions!
:sectnums:
==== Building the Toolchain from Scratch
=== Building the Toolchain from Scratch
To build the toolchain by yourself you can follow the guide from the official https://github.com/riscv/riscvgnu-toolchain GitHub page.
@ -64,7 +63,7 @@ After a while you will get `riscv32-unknown-elf-gcc` and all of its friends in y
:sectnums:
==== Downloading and Installing a Prebuilt Toolchain
=== Downloading and Installing a Prebuilt Toolchain
Alternatively, you can download a prebuilt toolchain.
@ -89,7 +88,7 @@ CPU extensions that are not supported by the NEORV32 (like `D`).
:sectnums:
==== Installation
=== Installation
Now you have the binaries. The last step is to add them to your `PATH` environment variable (if you have not
already done so). Make sure to add the binaries folder (`bin`) of your toolchain.
@ -103,7 +102,7 @@ You should add this command to your `.bashrc` (if you are using bash) to automat
toolchain at every console start.
:sectnums:
==== Testing the Installation
=== Testing the Installation
To make sure everything works fine, navigate to an example project in the NEORV32 example folder and
execute the following command:
@ -120,7 +119,7 @@ This will test all the tools required for the NEORV32. Everything is working fin
<<<
// ####################################################################################################################
:sectnums:
=== General Hardware Setup
== General Hardware Setup
The following steps are required to generate a bitstream for your FPGA board. If you want to run the
NEORV32 processor in simulation only, the following steps might also apply.
@ -234,7 +233,7 @@ flashing now and you should receive the bootloader start prompt in your UART con
<<<
// ####################################################################################################################
:sectnums:
=== General Software Framework Setup
== General Software Framework Setup
While your synthesis tool is crunching the NEORV32 HDL files, it is time to configure the project's software
framework for your processor hardware setup.
@ -287,7 +286,7 @@ _MEM_INT_DMEM_SIZE_ generic).
<<<
// ####################################################################################################################
:sectnums:
=== Application Program Compilation
== Application Program Compilation
[start=1]
. Open a terminal console and navigate to one of the project's example programs. For instance navigate to the
@ -328,7 +327,7 @@ shows the actual assembly code of the complete application.
<<<
// ####################################################################################################################
:sectnums:
=== Uploading and Starting of a Binary Executable Image via UART
== Uploading and Starting of a Binary Executable Image via UART
You have just created the executable. Now it is time to upload it to the processor. There are basically two
options to do so.
@ -455,7 +454,7 @@ Blinking LED demo program
<<<
// ####################################################################################################################
:sectnums:
=== Setup of a New Application Program Project
== Setup of a New Application Program Project
Done with all the introduction tutorials and those example programs? Then it is time to start your own
application project!
@ -510,7 +509,7 @@ All the assignments made to the makefile variable can also be done "inline" when
<<<
// ####################################################################################################################
:sectnums:
=== Enabling RISC-V CPU Extensions
== Enabling RISC-V CPU Extensions
Whenever you enable/disable a RISC-V CPU extensions via the according _CPU_EXTENSION_RISCV_x_ generic, you need to
adapt the toolchain configuration so the compiler can actually generate according code for it.
@ -548,7 +547,7 @@ The RISC-V ISA string (for _MARCH_) follows a certain canonical structure:
<<<
// ####################################################################################################################
:sectnums:
=== Building a Non-Volatile Application without External Boot Memory
== Building a Non-Volatile Application without External Boot Memory
The primary purpose of the bootloader is to allow an easy and fast update of the current application. In particular, this is very handy
during the development stage of a project as you can upload modified programs at any time via the UART.
@ -616,7 +615,7 @@ in the processor's IMEM and is directly executed after reset.
<<<
// ####################################################################################################################
:sectnums:
=== Customizing the Internal Bootloader
== Customizing the Internal Bootloader
The bootloader provides several configuration options to customize it for your specific applications. The
most important user-defined configuration options are available as C `#defines` right at the beginning of the
@ -714,10 +713,10 @@ minimal `rv32i` ISA only (`rv32e` would be even better).
<<<
// ####################################################################################################################
:sectnums:
=== Programming an External SPI Flash via the Bootloader
== Programming an External SPI Flash via the Bootloader
As described in section <<_external_spi_flash_for_booting>> the bootloader provides an option to store an application image to an external SPI flash
and to read this image back for booting. These steps show how to store a
and to read this image back for booting. These steps show how to store a
[start=1]
. At first, reset the NEORV32 processor and wait until the bootloader start screen appears in your terminal program.
@ -768,7 +767,7 @@ any user interaction.
<<<
// ####################################################################################################################
:sectnums:
=== Simulating the Processor
== Simulating the Processor
**Testbench**
@ -875,7 +874,7 @@ neorv32/sim$ sh ghdl_sim.sh --stop-time=4ms
<<<
// ####################################################################################################################
:sectnums:
=== Building the Software Framework Documentation
== Building the Software Framework Documentation
All core library software sources (libraries `sw/lib`, example programs `sw/example`, ...) are highly documented using _doxygen_.
To build the documentation by yourself navigate to the project's `doc` folder and run _doxygen_:
@ -896,7 +895,7 @@ The documentation is automatically built and deployed to GitHub pages by a CI wo
// ####################################################################################################################
:sectnums:
=== Building the Project Documentation
== Building the Project Documentation
This data sheet is written using `asciidoc`. The source files are locates in `docs/src_adoc`.
a makefiles in project's root directory is provided to either build a single pdf file
@ -925,7 +924,7 @@ a _docker container_ via `make container`.
<<<
// ####################################################################################################################
:sectnums:
=== FreeRTOS Support
== FreeRTOS Support
A NEORV32-specific port and a simple demo for FreeRTOS (https://github.com/FreeRTOS/FreeRTOS) are
available in the `sw/example/demo_freeRTOS` folder.
@ -936,7 +935,7 @@ See the according documentation (`sw/example/demo_freeRTOS/README.md`) for more
// ####################################################################################################################
:sectnums:
=== RISC-V Architecture Test Framework
== RISC-V Architecture Test Framework
The NEORV32 Processor passes the according tests provided by the official RISC-V Architecture Test Suite
(V2.0+), which is available online at GitHub: https://github.com/riscv/riscv-arch-test
@ -951,7 +950,7 @@ file for more information on how to run the tests and how testing is conducted i
<<<
// ####################################################################################################################
:sectnums:
=== Debugging using the On-Chip Debugger
== Debugging using the On-Chip Debugger
The NEORV32 <<_on_chip_debugger_ocd>> allows _online_ in-system debugging via an external JTAG access port from a
host machine. The general flow is independent of the host machine's operating system. However, this tutorial uses
@ -964,7 +963,7 @@ processor setup _with_ internal instruction memory (IMEM) make sure it is implem
:sectnums:
==== Hardware Requirements
=== Hardware Requirements
Make sure the on-chip debugger of your NEORV32 setups is implemented (_ON_CHIP_DEBUGGER_EN_ generic = true).
Connect a JTAG adapter to the NEORV32 `jtag_*` interface signals. If you do not have a full-scale JTAG adapter, you can
@ -988,7 +987,7 @@ If TRST is not used make sure to pull the signal _high_.
:sectnums:
==== OpenOCD
=== OpenOCD
The NEORV32 on-chip debugger can be accessed using the https://github.com/riscv/riscv-openocd[RISC-V port of OpenOCD].
Prebuilt binaries can be obtained - for example - from https://www.sifive.com/software[SiFive]. A pre-configured
@ -1030,7 +1029,7 @@ the `misa` CSRs). Now you can use `gdb` to connect via port 3333.
:sectnums:
==== Debugging with GDB
=== Debugging with GDB
This guide uses the simple "blink example" from `sw/example/blink_led` as simplified test application to
show the basics of in-system debugging.
@ -1112,7 +1111,7 @@ and halting the CPU right before executing the `blink_led` application.
:sectnums:
===== Breakpoint Example
==== Breakpoint Example
The following steps are just a small showcase that illustrate a simple debugging scheme.
@ -1133,7 +1132,7 @@ of the counter.
690: 00008067 ret
--------------------------
The very last instruction of the `neorv32_cpu_delay_ms` function is `ret` (= return)
The very last instruction of the `neorv32_cpu_delay_ms` function is `ret` (= return)
at hexadecimal `690` in this example. Add this address as _breakpoint_ to GDB.
[NOTE]
@ -1166,3 +1165,4 @@ Breakpoint 1, 0x00000690 in neorv32_cpu_delay_ms ()
Continuing.
--------------------------
include::../legal.adoc[]

32
docs/userguide/index.adoc Normal file
View file

@ -0,0 +1,32 @@
= The NEORV32 RISC-V Processor: User Guide
:title: [User Guide] The NEORV32 RISC-V Processor
:author: Dipl.-Ing. Stephan Nolting
:email: stnolting@gmail.com
:description: A size-optimized, customizable and open-source full-scale 32-bit RISC-V soft-core CPU and SoC written in platform-independent VHDL.
:revnumber: v1.5.6.0
:doctype: book
:sectnums:
:icons: font
:imagesdir: ../img
:stem:
:reproducible:
:listing-caption: Listing
:toc: left
:toclevels: 4
:title-logo-image: neorv32_logo_dark.png[pdfwidth=6.25in,align=center]
:favicon: ../img/icon.png
image::neorv32_logo_transparent.png[align=center]
image::riscv_logo.png[width=350,align=center]
[.text-center]
https://github.com/stnolting/neorv32[image:https://img.shields.io/badge/GitHub-stnolting%2Fneorv32-ffbd00?style=flat-square&logo=github&[title='homepage']]
https://github.com/stnolting/neorv32/blob/master/LICENSE[image:https://img.shields.io/github/license/stnolting/neorv32?longCache=true&style=flat-square[title='license']]
https://github.com/stnolting/neorv32/releases/tag/nightly[image:https://img.shields.io/badge/data%20sheet-PDF-ffbd00?longCache=true&style=flat-square&logo=asciidoctor[title='datasheet (pdf)']]
https://stnolting.github.io/neorv32[image:https://img.shields.io/badge/-HTML-ffbd00?longCache=true&style=flat-square[title='datasheet (html)']]
https://github.com/stnolting/neorv32/releases/tag/nightly[image:https://img.shields.io/badge/user%20guide-PDF-ffbd00?longCache=true&style=flat-square&logo=asciidoctor[title='userguide (pdf)']]
https://stnolting.github.io/neorv32/sw/files.html[image:https://img.shields.io/badge/doxygen-HTML-ffbd00?longCache=true&style=flat-square&logo=Doxygen[title='doxygen']]
include::content.adoc[]

34
docs/userguide/main.adoc Normal file
View file

@ -0,0 +1,34 @@
= The NEORV32 RISC-V Processor: User Guide
:author: Dipl.-Ing. Stephan Nolting
:email: stnolting@gmail.com
:description: A size-optimized, customizable and open-source full-scale 32-bit RISC-V soft-core CPU and SoC written in platform-independent VHDL.
:revnumber: v1.5.6.0
:doctype: book
:sectnums:
:icons: image
:iconsdir: ../icons
:imagesdir: ../figures
:stem:
:reproducible:
:listing-caption: Listing
:toc: macro
:toclevels: 4
:title-logo-image: image:neorv32_logo_dark.png[pdfwidth=6.25in,align=center]
// Uncomment next line to set page size (default is A4)
//:pdf-page-size: Letter
<<<
// ####################################################################################################################
.**Documentation**
[TIP]
The online documentation of the project (a.k.a. the **data sheet**) is available on GitHub-pages: https://stnolting.github.io/neorv32/ +
+
The online documentation of the **software framework** is also available on GitHub-pages: https://stnolting.github.io/neorv32/sw/files.html
<<<
// ####################################################################################################################
toc::[]
include::content.adoc[]