Project Layout
A Fiducia project is one directory. The compiler is given that directory and reads these files from it:
datadiode/
datadiode.fis the system: one per project
eth_outer.fi the program of protection domain eth_outer
dd.fi the program of protection domain dd
eth_inner.fi the program of protection domain eth_inner
fire.toml read by fire, not by fic
The .fis
The directory holds exactly one .fis; it is the project. Its name is
free, and a directory with none, or with two, is an error. Everything the
system declares (the data layer, regions, protection
domains, channels and the System composition) is in it.
The .fi files
Each protection domain p is implemented by p.fi, in the same directory
as the .fis: the file name is the binding, and nothing inside either file
names the other. The directory is read for .fi files, not searched below:
- A protection domain with no
p.fiis an error at its declaration in the.fis, and so is a protection domain declared twice. - A
.fithat no protection domain names is a warning, and the file is never parsed. - A
.fiin a subdirectory is not seen.
Imports
An import path is relative to the
project directory, not to the .fi that writes it, so import "include/eth.h" as eth; reads datadiode/include/eth.h from any program in
the project. The extension picks the reader: .c and .h are C, .pnk
is Pancake.
Generated files
Compiling writes under the project directory, and nothing outside it
unless -o says so:
| Path | Written by | Holds |
|---|---|---|
include/gen/types.h | fic, --check included | the data layer as C: structs with _Static_assert layout checks, constants |
include/gen/types.pnk | the same, when a program imports Pancake | the same constants for Pancake |
include/gen/mem.h | the same, when a program imports C | the memory routines of a PD’s runtime, with their contracts |
build/ | --emit=c, fire build | the generated C (build/gen/), the image and the UPPAAL model |
<dir>.xta, <dir>.dot | fic --emit=xta, --emit=dot | the UPPAAL model and the topology graph, named after the project directory <dir> |
Both are generated on every run and are not to be edited or committed.
fire clean removes build/ and include/gen/, and include/ if that
leaves it empty; sources are never touched.
fire adds fire.toml beside the sources and hand-written query files
spec/*.q for verification. Their contents, and the commands, are in the
user manual.