Command line
This page lists every command and option, what each command exits with, and what an interrupt does.
Commands
| Command | Does |
|---|---|
doris flows [-t [-a]] [-v] | Lists each design and the flows it configures. -t nests designs by their FuseSoC dependencies |
doris validate | Loads every config file and reports every error and warning |
doris check [FLOW [DESIGN...]] | Runs the prechecks of a run’s steps and lists each as ok or failed. Every configured flow if none |
doris plan [FLOW] [DESIGN|JOB...] | Prints a tree of jobs and their steps, each cached, will run or no cache key. Runs nothing. -v for full detail, --ids for the IDs, --explain for what was left out |
doris run [FLOW] [DESIGN|JOB...] | Runs the jobs, writes each result file and the reports (see Choosing jobs) |
doris report FLOW [DESIGN...] | Writes the report pages again from the result files |
doris report view [RUN] | Serves the reports and opens the browser (see Viewing reports) |
doris gc | Drops the GC roots of old runs and deletes the cache entries no root reaches, and removes old measurements |
doris gc roots | Lists the GC roots |
doris gc pin ROOT [--name NAME] | Protects a root from collection |
doris gc unpin ROOT | Removes the protection |
doris clean [FLOW] [DESIGN|JOB...] | Removes the working directories that were kept whole (see doris clean) |
doris settings | Lists every setting, its value and where it came from (see Settings) |
doris resources FLOW [DESIGN...] | Says what each step should hold from the resource pools, from the measurement store (see Suggested resources) |
doris measurements import FILE... | Copies measurement files, or each in a directory, into the store |
doris --version, doris help COMMAND | The version, and a command’s options |
FLOW is testrig or lint. The flows are a fixed list in doris. plan, run and clean take designs, job IDs and filters, and can leave the flow out (see Choosing jobs).
Finding the repo
doris walks up from the current directory to the first project.hjson whose schema is dv/project/1. That directory is the repo root. -C DIR, before or after the command, starts the walk at DIR instead. --project FILE loads FILE instead, relative to that directory. A project file’s root can put the repo root elsewhere.
A repo with no doris config, but another tool’s, can be run from a project made from those: --compat dvsim does this for OpenTitan’s dvsim lint configs. See Repos without doris config.
The doris gc commands, doris settings and doris report view need no repo. The cache is per user, so they work from any directory. Inside a repo they also read its checkout settings. Outside one, doris report view serves the runs of every repo in the cache.
Everything a run writes goes under scratch/doris/ in the repo root, and nowhere else in the repo. The directory can’t be changed.
Choosing jobs
Config describes the largest run, and the command line narrows it. doris plan, doris run and doris clean take the same arguments:
doris run [FLOW] [DESIGN | JOB | @SET]... [-i KEY=GLOB]... [-x KEY=GLOB]... [--top TOP] [--tool TOOL] [--shared] [--failed | --jobs-from FILE]
Every job of the chosen flows is planned, and then chosen from: by the designs and jobs named, then by the filters. A job is one design in one flow, with a tool bound to each of the flow’s roles, and for lint in one context (see Config and the repo model).
doris run lint # every lint job
doris run lint 'earlgrey/*' # earlgrey's designs, and the shared ones in its context
doris run lint/earlgrey/uart@verilator # one job, by its ID
doris run lint --top earlgrey -x tag=slow # earlgrey's lint jobs, without the slow ones
doris run -i tag=nightly # the nightly jobs of every flow
doris run @pr # the project file's `pr` filter set
doris run --failed # what did not pass last time
The flow
FLOW is testrig or lint, as the first argument. It can be left out:
- A job ID names its flow, as its first part. With only job IDs, the run is of their flows.
- Otherwise every flow a design configures is chosen from, narrowed by
-i flow=GLOB. A run of several flows writes each flow’s results and reports in its own directory.
A flow name in another place is the flow too, unless a design has that name. Naming a flow no design configures is an error.
Designs and job IDs
| Argument | Chooses |
|---|---|
uart | The design with that name. An error listing them if several tops each have their own |
TOP/NAME | A top’s own design, such as earlgrey/pwrmgr |
TOP/NAME | For a shared design, that design in one top’s context only |
'earlgrey/*' | A glob on design names: the qualified name, or TOP/NAME as a job ID names a shared design in a context |
lint/uart@x | A job, by its ID as doris plan --ids prints it |
'lint/*@x*' | A glob on job IDs. One that starts with a glob, such as '*/uart@*', is matched in every chosen flow |
@SET | The project file’s filter set of that name |
- The arguments are ORed. A job any of them matches is kept, for the filters to narrow. With none, every job of the chosen flows.
- An argument that matches no job is an error, and so is a name no design has, which lists the designs.
- A design named exactly with no config for the flow is an error.
TOP/NAMEfor a top that does not use the design is an error.- Globs are
*,?and[...], with*matching/too. Quote them, so the shell leaves them alone.
A design gets all of its jobs. For lint that is one job per linter bound for it, in each of its contexts. For TestRIG it is one job per simulator bound for it. Where another role is bound to several tools too, there is one job for each combination. The tools are bound in the design’s flow config or, for a role it leaves out, in the project file (see Tools and roles).
Filters
-i KEY=GLOB (--include) keeps only the jobs with an attribute that matches. -x KEY=GLOB (--exclude) leaves out the jobs with one that matches. Every job has these attributes:
| Key | Values | Example |
|---|---|---|
flow | testrig, lint | flow=lint |
design | The design’s qualified name | design='earlgrey/*' |
top | The top the job belongs to: a top’s own, the top a design is its own design of, or the top whose context a shared design is run in | top=darjeeling |
scope | top, top-ip for a top’s own design, or shared | scope=shared |
tool | The tool in any of the flow’s roles | tool=verilator |
tool.ROLE | The tool in one role: linter for lint, and dut, reference and coverage for TestRIG | tool.reference=sail |
tag | The design file’s tags, and the flow config’s | tag=slow |
- Filters of one key are ORed, and of different keys ANDed.
-i tag=dv -i tag=fpv -i top=earlgreykeeps earlgrey’s jobs taggeddvorfpv. - Excludes are applied last and always win.
- The glob is matched against each of a job’s values. A job with no value for a key, such as no tags, or the top of a shared design that no top uses, matches no include and no exclude of it.
- An include that matches no job is an error that lists the values the key has, so a typo doesn’t run nothing. So is a design or job named exactly that the filters leave out, and filters that leave out every job. A glob the filters narrow to nothing of its own is not an error.
- A
tool.ROLEwith a role none of the flows has is an error, and so is a key that is none of these.packageandvariantare planned, and are errors until doris has vendored packages and variants. - Filters only choose. No attribute is part of any cache key, so adding a tag reruns nothing.
doris flows shows each design’s tags in a TAGS column, with a flow config’s as FLOW:TAG. Each job’s result file records its tags.
Shorthands
| Shorthand | Is |
|---|---|
--top TOP | -i top=TOP |
--tool TOOL | -i tool=TOOL |
--shared | -i scope=shared |
They combine with the filters of the same key as filters do: --tool verilator --tool verible keeps the jobs of either.
Named filter sets
The project file can name filter sets that are used often, such as a quick set for pull requests (see The project file):
filters: {
pr: {
exclude: [
tag=slow
]
}
}
@pr on the command line adds its includes and excludes to the command line’s own, as in doris run lint @pr. A set only filters: it never changes what a job does. A name the project file doesn’t have is an error that lists the sets.
Reruns
--failedchooses the jobs of the last run in this checkout that did not pass: failed, a step error, or no result because the run stopped. With a flow, the last run that had jobs of it. The runs are read from the GC roots in the cache, so a run with--no-cacheisn’t one, anddoris gcforgets old ones. If every job passed, the command says so and does nothing.--jobs-from FILEchooses the jobs whose IDs the file lists, one per line, asdoris plan --idsprints them. Blank lines and lines that start with#are skipped.
Both are lists of jobs to narrow with filters, so a listed job the filters leave out is not an error. They take no designs or job IDs of their own, and a listed job that is no longer planned is an error.
Checking a choice
doris plan takes the same arguments and prints the chosen jobs. --ids prints only their IDs, one per line, for --jobs-from. --explain also lists every job the filters left out and the filter that did it, and counts the jobs no argument named.
$ doris plan lint 'earlgrey/u*' -x tool=slang --explain
...
left out by the filters:
lint/earlgrey/uart@slang -x tool=slang
lint/earlgrey/usbdev@slang -x tool=slang
and 640 other jobs of the flows, which no design or job named matches
Options
| Option | Commands | Meaning |
|---|---|---|
-C DIR | All | Run as if started in DIR |
--project FILE | All | Load the project file FILE instead of the one found by walking up |
--compat FORMAT | All | Load a project made from another tool’s config files: dvsim. See Repos without doris config |
--until STEP | plan, run, check | Keep only STEP and the steps it depends on. The result file records it as until |
--top TOP | plan, run, clean | Only the jobs in this top’s context: -i top=TOP. Can be repeated (see Shorthands) |
--shared | plan, run, clean | Only the jobs of shared designs: -i scope=shared |
--tool TOOL | plan, run, clean | Only the jobs that use this tool in one of the flow’s roles: -i tool=TOOL. Can be repeated |
-i KEY=GLOB, --include | plan, run, clean | Only the jobs with an attribute that matches. Can be repeated (see Filters) |
-x KEY=GLOB, --exclude | plan, run, clean | Leave out the jobs with an attribute that matches. Can be repeated, and wins over -i |
--failed | plan, run | Only the jobs of the last run that did not pass (see Reruns) |
--jobs-from FILE | plan, run | Only the jobs whose IDs FILE lists, one per line |
--ids | plan | Print only the chosen jobs’ IDs, one per line |
--explain | plan | Also list the jobs the filters left out, and why |
--replay | plan, run, check | TestRIG: rerun saved traces instead of generating tests |
--tests N | plan, run | TestRIG: generate N tests per test group, instead of the config’s tests.count |
--seed N | plan, run | TestRIG: generate from this seed. --seed random picks a new one |
-j N, --jobs | run | At most N steps at once, over every job: the setting jobs.max. Default: the number of CPUs |
--rerun | run | Run every selected step even if it is cached, and replace its cache entry |
--rerun=STEP,... | run | Run only the steps of these names even if they are cached (see The cache) |
--no-store | run | Take steps from the cache, but store nothing in it |
--no-cache | run | Run every step, and neither read nor write the cache |
--debug | run | Keep every step’s working directory whole, and its debug outputs in the cache. A step whose cache entry has no debug outputs runs again (see Working directories) |
--set KEY=VALUE | All | Change a setting for this command, and no other, after every settings file (see Settings) |
--strict | All | Make a warning about the project’s files an error: see Strict |
--settings FILE | All | Read settings from FILE too, after the system, user and checkout files (see Settings) |
--older-than | gc | Short for --set gc.keep_age=AGE |
--max-size | gc | Short for --set gc.max_size=SIZE |
-f, --force | gc | Drop roots by age alone, even the newest root of a job or branch. Pinned roots are still kept. Short for --set gc.keep_latest=none |
--dry-run | gc, clean | List what would go and the space freed, and change nothing |
--failed | clean | Remove the directories of steps that failed |
--interrupted | clean | Remove the directories of steps that did not complete: a step error, a setup error or an interrupt |
--debug | clean | Remove the directories of steps that passed in a run with --debug. One that failed in it counts as failed |
--port PORT | report view | Listen on this port of 127.0.0.1. Default: any free port |
--no-open | report view | Print the address without opening a browser |
-t, --tree | flows | Show designs as a tree: each under the designs whose cores depend on it, with its flows |
-a, --all-cores | flows | With -t, show every FuseSoC core, not only designs. A core shown before is marked (*) |
-v, --verbose | flows, plan | flows: show the design file and config files. plan: show each step’s directory, key, inputs, command and outputs |
Flow options sit on the shared commands. --replay, --tests and --seed belong to TestRIG but are options of plan and run. Giving one when no TestRIG job is chosen is an error that says so. --until applies to every chosen job, so a step only one flow has is an error in a run of several. --replay can’t be combined with --tests or --seed. With doris check, --until and --replay need a flow.
-j counts steps, over every job. doris run schedules the steps of all its jobs together, so steps of different jobs run at the same time. A step also waits for the resource pools to have the threads, memory, disk space and licences it holds. doris run ends with the run’s metrics.
Settings
Settings come from layered settings files, then --settings FILE, -j and --set KEY=VALUE, which change a setting for one command. Every command reads them. Settings has the layers, the keys, limits and doris settings. A key that is not one of them is an error.
| Key | Meaning |
|---|---|
jobs.max | The most steps running at once. -j sets it |
pools.NAME | The size of a resource pool |
resources.enforce | systemd or cgroup to enforce what a step holds, off to only reserve it |
resources.cgroup | The cgroup cgroup enforcement makes a cgroup per step in |
resources.pin | true to pin each step to CPUs of its own |
resources.measure | How steps are measured: auto, systemd, cgroup or off |
resources.min_samples, resources.min_change | What doris resources needs to suggest a value |
measurements.dir, measurements.max_age | Where the measurement store is, and how long it keeps a run |
dirs.keep_failed | Keep the whole working directory of a step that failed |
dirs.work_max_age | How long a working directory that was kept whole is kept |
tools.NAME.path | Where a tool that is not on PATH is, for its own commands |
plugins.path | Directories of tool plugins beside the built-in ones, as DIR[:DIR...] |
gc.* | What a collection keeps, and whether a run collects |
doris check
doris check plans the jobs as doris run would, and runs every precheck their steps declare. No step is run.
lint
ok program `fusesoc` on PATH /usr/bin/fusesoc
failed program `slang` on PATH not on PATH; needed by lint/uart@slang: lint
error: 1 of 2 prechecks failed; is the project's dev shell active?
Under each flow there is a line for each precheck, once, in the order the steps first need it. ok is followed by how the check is met: the path a program was found at, set for a variable, there for a file, the first line of a tool’s version, or exits with code 0 for a command. failed is followed by why, and by the steps that need it, as JOB: STEP, STEP; JOB: STEP. With --until, only the steps kept are checked, and with --replay the run step’s replay directory is.
After the prechecks, every step is checked against the sizes of the resource pools the settings give, as doris run checks them: a step that needs more of a pool than the pool has could never start, and is an error that names it. Either kind of failure makes doris check exit 1, FAILED.
doris clean
doris clean [FLOW] [DESIGN|JOB|@SET]... [-i KEY=GLOB] [-x KEY=GLOB] [--top TOP] [--tool TOOL] [--shared] [--failed] [--interrupted] [--debug] [--dry-run]
Removes the working directories that were kept whole: those with a .doris-kept marker, which a step that failed, did not complete or ran in a debug run leaves. See Working directories.
- With nothing but a flow, that flow’s. With nothing at all, every flow’s.
- Designs, job IDs, filter sets and filters choose jobs as they do for
doris run(see Choosing jobs): the jobs are planned, and only their directories are looked in. An argument or include that chooses nothing is an error, as it is for a run.--failedhere is a kind of directory, not the jobs of the last run. --failed,--interruptedand--debugpick the kinds, and can be combined. With none of them, every kind is removed.--dry-runlists what would go and removes nothing.- Each directory is listed with its kind, its size and its path, and the last line has the count and the total size.
It never removes the directory of a step that left only its outputs, a result file or anything in the cache.
Strict
--strict makes a warning about the project’s files an error:
- a config pattern that matches no file;
- a core file under the cores roots that does not parse;
- a design whose
coreis not under the cores roots, asdoris flows -tfinds it.
Each is printed as error:. doris validate counts them as errors and exits 1, FAILED. Any other command that reads the project’s config does nothing and exits 2, CANNOT_RUN, as for an error in a config file; doris run therefore runs no step. Use it in CI, so a stale pattern or a broken core file fails the build rather than going unread in the log.
Other warnings are not affected: a setting lowered to a site’s limit, and what a command could not write after it ran, such as a report or the measurements.
Exit codes
doris exits with one of four codes. Each has a name, which these docs use beside the number; a script sees only the number.
| Code | Name | In short |
|---|---|---|
| 0 | OK | It did what was asked, and everything passed |
| 1 | FAILED | It ran, and the design or the environment failed |
| 2 | CANNOT_RUN | It could not do what was asked at all |
| 3 | ERROR | A run went wrong in a way that is not the design’s |
What each means for each command:
| Command | 0 OK | 1 FAILED | 2 CANNOT_RUN | 3 ERROR |
|---|---|---|---|---|
run | Every job passed | The worst job outcome is failed | See below | A job ended in an error or a skip, or was interrupted |
validate | No errors. Warnings don’t count, unless --strict | A config file has an error, or a warning with --strict | No project file was found | — |
check | Every precheck holds | A precheck failed | See below | — |
| Any other command | It did what was asked | — | See below | — |
Exit code 2, CANNOT_RUN, means doris could not do what was asked at all: a config file did not load, a design or step name is wrong, an option is invalid, or a file could not be written. doris run also exits 2, before any step starts, if a precheck of its steps fails, such as a program that is not on PATH, or if a step needs more of a resource pool than the pool has. Those are the checks doris check makes, and it exits 1, FAILED, for either.
A job’s outcome is the worst of its steps, and the run’s exit code comes from the worst job. From worst to best: setup error, step error, failed, skipped, passed. A job cut short by a failed step therefore reports failed, not skipped, and a run exits 3, ERROR, only when something other than the design went wrong.
doris flows -t
The tree shows each design under the designs whose FuseSoC cores depend on it, directly or through cores that aren’t designs. Flows are in brackets, such as [lint], and come before the designs under a design. On a terminal, designs are bold, flows cyan, and other cores and paths dimmed; set NO_COLOR to turn colour off. A design nothing depends on is a root. A shared IP appears under every design that uses it. With -a, every core is shown, and a core that has been shown already is marked (*) and not expanded again.
doris reads the .core files under cores_root itself, without running FuseSoC, so the tree is quick but approximate:
- Only the
defaulttarget’s filesets are followed, or every fileset if a core has nodefaulttarget. - Every
flag ? (...)condition is taken as true. - Version constraints are ignored, and the highest version of a core is used.
- A virtual core resolves only if exactly one core provides it. Mappings are not applied, so
-ashows a virtual core with several providers as(virtual). - A directory holding a
FUSESOC_IGNOREfile is skipped, as FuseSoC skips it.
A design whose core isn’t found under the cores roots is a warning, and shows with no dependencies. With --strict it is an error.
Output
- Paths are relative to the repo root, wherever doris was started. A path outside the root is shown in full. In a printed command the root is written
<root>, because commands run in their own directories. - Result files hold paths relative to the job’s directory, except a TestRIG counterexample’s
file, which is absolute. - Progress lines start with the local time of day.
doris runprints one when a step starts, one for each thing it does, such as starting a service, and one with the step’s outcome and time. - A status table stays below them on a terminal, counting the steps of each name by where they are. See How a step runs.
- A step’s own output is not printed. It goes to
stdout.logandstderr.login the step’s directory, and the progress line names the file. A step that passes keeps those files only if they are outputs of the step, or the run has--debug. - Warnings and errors go to stderr, prefixed
warning:anderror:.
Interrupting a run
Ctrl-C during doris run stops the run without losing its record:
- Each running command is sent SIGTERM, and SIGKILL if it has not exited after 10 seconds. Its services are stopped the same way.
- Each step that was running ends as a
step errorwith the messageinterrupted. Nothing is cached for it, and its working directory is kept whole. - Every step that had not started is
skipped, in this job and in every job after it. - Each job’s
result.jsonand the reports are still written, and the run’s GC root keeps the entries used so far. - doris exits 3,
ERROR.
A step that finished before the interrupt keeps its cache entry, so the next run starts from where this one stopped. A second Ctrl-C does nothing more: wait for the commands to stop.
Where doris runs
doris runs on Linux only. It reads /proc/net/tcp to see when a service is listening, puts each command in its own process group, and locks the cache with flock.
It needs git on PATH and expects the repo to be a git checkout. Git decides which files of an input directory are hashed and copied: tracked files, plus untracked files that aren’t ignored. Outside a git checkout, or in a directory git ignores entirely, every file counts. The revision in a result file, and the branch and commit in a GC root, are left out if git can’t give them.