Build system
Overview
${FIAT_PATH_REPO}/Makefile can be used to drive the build process, e.g., via
Command |
Description |
|---|---|
|
clean the Python virtual environment |
|
build the Python virtual environment |
|
clean Docker-based container |
|
build Docker-based container |
|
clean Sphinx-based documentation |
|
build Sphinx-based documentation |
|
clean the target implementation |
|
build the target implementation |
|
fetch (i.e., download) the target implementation dependencies |
|
patch the target implementation dependencies |
|
build the target implementation dependencies |
|
clean the target implementation dependencies |
|
selectively remove artefacts produced by the build system |
|
aggressively remove artefacts produced by the build system |
with configuration options for it outlined in the following.
The FIAT_CONTEXT environment variable
The
FIAT_CONTEXT
environment variable specifies the
build context
within which the build process is executed.
The options are
nativeis a native build context,dockeris a containerised build context,
noting that:
using the
nativebuild context implies the tool-chain, and any software dependencies (e.g., libraries) need to be installed manually,using the
dockerbuild context implies the tool-chain, and any software dependencies (e.g., libraries) are installed within the associated container.
The
Docker
image which supports the
docker
build context for a given board type is built using
board-agnostic content in
${FIAT_PATH_REPO}/src/docker, plusboard-specific content in
${FIAT_PATH_REPO}/src/target/board/imp/${FIAT_BOARD}/Dockerfile.in.
However, there is no need to do this manually: a pre-built image can (and will) be pulled from Docker Hub by the build process as needed. If you do want to build such an image, note that
FIAT_CONTEXT="native" make docker/clean
FIAT_CONTEXT="native" make docker/build
will clean (or remove) and build the image for one board type
(specified using ${FIAT_BOARD})
${FIAT_PATH_REPO}/bin/docker.sh clean
${FIAT_PATH_REPO}/bin/docker.sh build
will clean (or remove) and build the images for all board types
(identified by searching for instances of Dockerfile.in in ${FIAT_PATH_REPO}/src/fiat/target/board/imp).
The FIAT_DRIVER environment variable
The
FIAT_DRIVER
environment variable specifies the
driver type.
The options are
binaryuses a binary protocol,textuses a text protocol.
The FIAT_BOARD environment variable
The
FIAT_BOARD
environment variable specifies the
board type.
The options are
|
Class |
Vendor |
Core |
Model |
ISA |
Host |
|---|---|---|---|---|---|---|
|
Simulation |
|||||
|
ASIC |
AVR |
||||
|
ASIC |
AVR |
||||
|
ASIC |
ARMv6-M |
||||
|
ASIC |
ARMv7-M |
||||
|
ASIC |
ARMv7-M |
||||
|
ASIC |
ARMv7-M |
||||
|
ASIC |
ARMv7E-M |
||||
|
ASIC |
E31 |
RV32IMAC |
|||
|
FPGA |
RV32IMC |
The FIAT_PATH_BUILD and FIAT_PATH_IMP environment variables
By default, the workflow assumes you first clone the FIAT repository then develop a target implementation within that clone, i.e., “in-tree”. However, it can be useful to do so “out-of-tree”: example scenarios include when the target implementation is part of another project, with resources in the repository simply used to build it.
The
FIAT_PATH_BUILDenvironment variable specifies where artefacts produced by the build system will be located: by default it is set “in-tree” to equal${FIAT_PATH_REPO}/build, but this can be overridden.The
FIAT_PATH_IMPenvironment variable specifies where the target implementation is located: by default it is set “in-tree” to equal${FIAT_PATH_REPO}/src/fiat/target/kernel/imp, but this can be overridden.