Added Wavedrom register diagrams for the instruction encoding formats

This commit is contained in:
Elyan 2024-10-13 01:27:08 +02:00
parent 2bcab589b8
commit 8f2ee738da
6 changed files with 68 additions and 8 deletions

View File

@ -3,7 +3,7 @@
DOCS := central-execution-engine-spec DOCS := central-execution-engine-spec
DOCKER_IMG := asciidoctor/docker-asciidoctor:latest DOCKER_IMG := docker-asciidoctor-wavedrom:latest
ENV := LANG=C.utf8 ENV := LANG=C.utf8
@ -40,13 +40,14 @@ WORKDIR_TEARDOWN = \
mv $@.workdir/$@ $@ && \ mv $@.workdir/$@ $@ && \
rm -rf $@.workdir rm -rf $@.workdir
SRC_DIR := src SRC_DIR := src
BUILD_DIR := build BUILD_DIR := build
DOCKER_DIR := docker
ALL_SRC := $(shell find $(SRC_DIR) -type f -name '*.adoc' -print) ALL_SRC := $(shell find $(SRC_DIR) -type f -name '*.adoc' -print)
DOCS_PDF := $(addprefix $(BUILD_DIR)/, $(addsuffix .pdf, $(DOCS))) DOCS_PDF := $(addprefix $(BUILD_DIR)/, $(addsuffix .pdf, $(DOCS)))
.PHONY: all build docker-pull-latest clean .PHONY: all build create-docker-image clean
all: build-pdf all: build-pdf
@ -57,8 +58,8 @@ $(BUILD_DIR)/%.pdf: $(SRC_DIR)/%.adoc $(ALL_SRC)
$(DOCKER_CMD) '$(ENV) asciidoctor-pdf $(OPTIONS) $(REQUIRES) $<' $(DOCKER_CMD) '$(ENV) asciidoctor-pdf $(OPTIONS) $(REQUIRES) $<'
$(WORKDIR_TEARDOWN) $(WORKDIR_TEARDOWN)
docker-pull-latest: create-docker-image:
$(SUDO_PREFIX) docker pull $(DOCKER_IMG) $(SUDO_PREFIX) docker build -t $(DOCKER_IMG) $(DOCKER_DIR)
clean: clean:
@echo "Cleaning up generated files..." @echo "Cleaning up generated files..."

View File

@ -5,5 +5,5 @@ This repository contains the documentation on the Central(Architecture).
To build the documentation, `make` and `docker` should be installed in the build environment. To build the documentation, `make` and `docker` should be installed in the build environment.
```bash ```bash
make clean && make make create-docker-image && make
``` ```

4
docker/Dockerfile Normal file
View File

@ -0,0 +1,4 @@
FROM asciidoctor/docker-asciidoctor:latest
RUN apk add npm
RUN npm install -g wavedrom-cli bytefield-svg

View File

@ -9,3 +9,5 @@ This means that the amount of information pertaining to the internals of an _Exe
include::execution-engine-spec/glossary.adoc[] include::execution-engine-spec/glossary.adoc[]
include::execution-engine-spec/data-manipulation.adoc[] include::execution-engine-spec/data-manipulation.adoc[]
include::execution-engine-spec/instructions.adoc[]

View File

@ -0,0 +1,48 @@
[wavedrom, ,svg]
....
{reg: [
{bits: 7, name: 'opcode'},
{bits: 5, name: 'rd'},
{bits: 5, name: 'rs1'},
{bits: 5, name: 'rs2'},
{bits: 10, name: 'imm'}
], config: {label: {right: 'A-Type'}}}
....
[wavedrom, ,svg]
....
{reg: [
{bits: 7, name: 'opcode'},
{bits: 5, name: 'rd'},
{bits: 5, name: 'rs'},
{bits: 15, name: 'imm'}
], config: {label: {right: 'B-Type'}}}
....
[wavedrom, ,svg]
....
{reg: [
{bits: 7, name: 'opcode'},
{bits: 5, name: 'rd'},
{bits: 20, name: 'imm'}
], config: {label: {right: 'C-Type'}}}
....
[wavedrom, ,svg]
....
{reg: [
{bits: 7, name: 'opcode'},
{bits: 25, name: 'imm'}
], config: {label: {right: 'D-Type'}}}
....
[wavedrom, ,svg]
....
{reg: [
{bits: 7, name: 'opcode'},
{bits: 5, name: 'reg'},
{bits: 4, name: 'sid'},
{bits: 8, name: 'sre'},
{bits: 8, name: 'cmd'}
], config: {label: {right: 'E-Type'}}}
....

View File

@ -0,0 +1,5 @@
== Instructions
=== Instruction Encoding Formats
include::images/instruction-formats.adoc[]