From 234a92d5e0fa8c823addf14f2588316cc00d91cd Mon Sep 17 00:00:00 2001 From: Elyan Date: Sat, 12 Oct 2024 23:18:36 +0200 Subject: [PATCH] Initial commit --- Makefile | 66 ++++++++++++++++++++++++++ README.md | 9 ++++ src/central-execution-engine-spec.adoc | 8 ++++ src/glossary.adoc | 7 +++ 4 files changed, 90 insertions(+) create mode 100644 Makefile create mode 100644 README.md create mode 100644 src/central-execution-engine-spec.adoc create mode 100644 src/glossary.adoc diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..653ad29 --- /dev/null +++ b/Makefile @@ -0,0 +1,66 @@ +# Taken and adapted from https://github.com/riscv/riscv-isa-manual/blob/main/Makefile +# vim: noexpandtab:tabstop=4:shiftwidth=4 + +DOCS := central-execution-engine-spec + +DOCKER_IMG := asciidoctor/docker-asciidoctor:latest + +ENV := LANG=C.utf8 + +OPTIONS := -D build \ + --trace \ + --failure-level=ERROR + +REQUIRES := --require=asciidoctor-diagram + +DOCKER_IS_ROOTLESS = \ + $(shell ! ps ux | grep -v grep | grep dockerd-rootless >/dev/null ; echo $$?) +ifneq "$(DOCKER_IS_ROOTLESS)" "1" + # Rooted Docker requires this flag so that the files it creates are + # owned by the current user instead of root. Rootless docker does not + # require it, and Podman doesn't either since it is always rootless. + DOCKER_USER_ARG := --user $(shell id -u) + SUDO_PREFIX := sudo +endif + +DOCKER_CMD = \ +$(SUDO_PREFIX) docker run --rm \ + -v $(PWD)/$@.workdir:/build \ + -w /build \ + $(DOCKER_USER_ARG) \ + $(DOCKER_IMG) \ + /bin/sh -c + +WORKDIR_SETUP = \ + rm -rf $@.workdir && \ + mkdir -p $@.workdir && \ + cp -r src $@.workdir + +WORKDIR_TEARDOWN = \ + mv $@.workdir/$@ $@ && \ + rm -rf $@.workdir + +SRC_DIR := src +BUILD_DIR := build + +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 + +all: build-pdf + +build-pdf: $(DOCS_PDF) + +$(BUILD_DIR)/%.pdf: $(SRC_DIR)/%.adoc $(ALL_SRC) + $(WORKDIR_SETUP) + $(DOCKER_CMD) '$(ENV) asciidoctor-pdf $(OPTIONS) $(REQUIRES) $<' + $(WORKDIR_TEARDOWN) + +docker-pull-latest: + $(SUDO_PREFIX) docker pull $(DOCKER_IMG) + +clean: + @echo "Cleaning up generated files..." + rm -rf $(BUILD_DIR) + @echo "Cleanup completed." diff --git a/README.md b/README.md new file mode 100644 index 0000000..9c7b028 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# This repo +This repository contains the documentation on the Central(Architecture). + +# Building from sources +To build the documentation, `make` and `docker` should be installed in the build environment. + +```bash +make clean && make +``` diff --git a/src/central-execution-engine-spec.adoc b/src/central-execution-engine-spec.adoc new file mode 100644 index 0000000..a01c890 --- /dev/null +++ b/src/central-execution-engine-spec.adoc @@ -0,0 +1,8 @@ += Central(Execution Engine): Public Interface Specification +:reproducible: +:doctype: book +:lang: en +:toc: left +:toclevels: 5 + +include::glossary.adoc[] diff --git a/src/glossary.adoc b/src/glossary.adoc new file mode 100644 index 0000000..934ec74 --- /dev/null +++ b/src/glossary.adoc @@ -0,0 +1,7 @@ +[glossary] +== Glossary + +[glossary] +Central Processing Unit:: An hardware unit containing one or more *Execution Engines*, a memory controller, an interrupt controller, an operator facility controller and various other minor components. + +Execution Engine:: The hardware responsible for the execution of user-written code, be it kernel code or user program code. An *Execution Engine* contains a fetch unit, a decode unit, a micro-instruction sequencer, an Arithmetic & Logic Unit, various registers and subsystems. An *Execution Engine* is analogous to an *hart* in the RISC-V nomenclature or to a *core* in other CPU specifications.