From 8f2ee738da74032fbe9e361f689f21d32c504b59 Mon Sep 17 00:00:00 2001 From: Elyan Date: Sun, 13 Oct 2024 01:27:08 +0200 Subject: [PATCH] Added Wavedrom register diagrams for the instruction encoding formats --- Makefile | 13 ++--- README.md | 2 +- docker/Dockerfile | 4 ++ src/central-execution-engine-spec.adoc | 4 +- .../images/instruction-formats.adoc | 48 +++++++++++++++++++ src/execution-engine-spec/instructions.adoc | 5 ++ 6 files changed, 68 insertions(+), 8 deletions(-) create mode 100644 docker/Dockerfile create mode 100644 src/execution-engine-spec/images/instruction-formats.adoc create mode 100644 src/execution-engine-spec/instructions.adoc diff --git a/Makefile b/Makefile index 653ad29..d20d32c 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ DOCS := central-execution-engine-spec -DOCKER_IMG := asciidoctor/docker-asciidoctor:latest +DOCKER_IMG := docker-asciidoctor-wavedrom:latest ENV := LANG=C.utf8 @@ -40,13 +40,14 @@ WORKDIR_TEARDOWN = \ mv $@.workdir/$@ $@ && \ rm -rf $@.workdir -SRC_DIR := src -BUILD_DIR := build +SRC_DIR := src +BUILD_DIR := build +DOCKER_DIR := docker ALL_SRC := $(shell find $(SRC_DIR) -type f -name '*.adoc' -print) 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 @@ -57,8 +58,8 @@ $(BUILD_DIR)/%.pdf: $(SRC_DIR)/%.adoc $(ALL_SRC) $(DOCKER_CMD) '$(ENV) asciidoctor-pdf $(OPTIONS) $(REQUIRES) $<' $(WORKDIR_TEARDOWN) -docker-pull-latest: - $(SUDO_PREFIX) docker pull $(DOCKER_IMG) +create-docker-image: + $(SUDO_PREFIX) docker build -t $(DOCKER_IMG) $(DOCKER_DIR) clean: @echo "Cleaning up generated files..." diff --git a/README.md b/README.md index 9c7b028..ae935b1 100644 --- a/README.md +++ b/README.md @@ -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. ```bash -make clean && make +make create-docker-image && make ``` diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..e1314c3 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,4 @@ +FROM asciidoctor/docker-asciidoctor:latest + +RUN apk add npm +RUN npm install -g wavedrom-cli bytefield-svg diff --git a/src/central-execution-engine-spec.adoc b/src/central-execution-engine-spec.adoc index f6768e9..98fca56 100644 --- a/src/central-execution-engine-spec.adoc +++ b/src/central-execution-engine-spec.adoc @@ -8,4 +8,6 @@ This means that the amount of information pertaining to the internals of an _Exe include::execution-engine-spec/glossary.adoc[] -include::execution-engine-spec/data-manipulation.adoc[] \ No newline at end of file +include::execution-engine-spec/data-manipulation.adoc[] + +include::execution-engine-spec/instructions.adoc[] \ No newline at end of file diff --git a/src/execution-engine-spec/images/instruction-formats.adoc b/src/execution-engine-spec/images/instruction-formats.adoc new file mode 100644 index 0000000..c30f0de --- /dev/null +++ b/src/execution-engine-spec/images/instruction-formats.adoc @@ -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'}}} +.... \ No newline at end of file diff --git a/src/execution-engine-spec/instructions.adoc b/src/execution-engine-spec/instructions.adoc new file mode 100644 index 0000000..e0906f6 --- /dev/null +++ b/src/execution-engine-spec/instructions.adoc @@ -0,0 +1,5 @@ +== Instructions + +=== Instruction Encoding Formats + +include::images/instruction-formats.adoc[] \ No newline at end of file