Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Command line

This page lists every command and option, what each command exits with, and what an interrupt does.

Commands

CommandDoes
doris flows [-t [-a]] [-v]Lists each design and the flows it configures. -t nests designs by their FuseSoC dependencies
doris validateLoads 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 gcDrops the GC roots of old runs and deletes the cache entries no root reaches, and removes old measurements
doris gc rootsLists the GC roots
doris gc pin ROOT [--name NAME]Protects a root from collection
doris gc unpin ROOTRemoves the protection
doris clean [FLOW] [DESIGN|JOB...]Removes the working directories that were kept whole (see doris clean)
doris settingsLists 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 COMMANDThe 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

ArgumentChooses
uartThe design with that name. An error listing them if several tops each have their own
TOP/NAMEA top’s own design, such as earlgrey/pwrmgr
TOP/NAMEFor 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@xA 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
@SETThe 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/NAME for 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:

KeyValuesExample
flowtestrig, lintflow=lint
designThe design’s qualified namedesign='earlgrey/*'
topThe 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 intop=darjeeling
scopetop, top-ip for a top’s own design, or sharedscope=shared
toolThe tool in any of the flow’s rolestool=verilator
tool.ROLEThe tool in one role: linter for lint, and dut, reference and coverage for TestRIGtool.reference=sail
tagThe design file’s tags, and the flow config’stag=slow
  • Filters of one key are ORed, and of different keys ANDed. -i tag=dv -i tag=fpv -i top=earlgrey keeps earlgrey’s jobs tagged dv or fpv.
  • 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.ROLE with a role none of the flows has is an error, and so is a key that is none of these. package and variant are 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

ShorthandIs
--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

  • --failed chooses 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-cache isn’t one, and doris gc forgets old ones. If every job passed, the command says so and does nothing.
  • --jobs-from FILE chooses the jobs whose IDs the file lists, one per line, as doris plan --ids prints 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

OptionCommandsMeaning
-C DIRAllRun as if started in DIR
--project FILEAllLoad the project file FILE instead of the one found by walking up
--compat FORMATAllLoad a project made from another tool’s config files: dvsim. See Repos without doris config
--until STEPplan, run, checkKeep only STEP and the steps it depends on. The result file records it as until
--top TOPplan, run, cleanOnly the jobs in this top’s context: -i top=TOP. Can be repeated (see Shorthands)
--sharedplan, run, cleanOnly the jobs of shared designs: -i scope=shared
--tool TOOLplan, run, cleanOnly the jobs that use this tool in one of the flow’s roles: -i tool=TOOL. Can be repeated
-i KEY=GLOB, --includeplan, run, cleanOnly the jobs with an attribute that matches. Can be repeated (see Filters)
-x KEY=GLOB, --excludeplan, run, cleanLeave out the jobs with an attribute that matches. Can be repeated, and wins over -i
--failedplan, runOnly the jobs of the last run that did not pass (see Reruns)
--jobs-from FILEplan, runOnly the jobs whose IDs FILE lists, one per line
--idsplanPrint only the chosen jobs’ IDs, one per line
--explainplanAlso list the jobs the filters left out, and why
--replayplan, run, checkTestRIG: rerun saved traces instead of generating tests
--tests Nplan, runTestRIG: generate N tests per test group, instead of the config’s tests.count
--seed Nplan, runTestRIG: generate from this seed. --seed random picks a new one
-j N, --jobsrunAt most N steps at once, over every job: the setting jobs.max. Default: the number of CPUs
--rerunrunRun every selected step even if it is cached, and replace its cache entry
--rerun=STEP,...runRun only the steps of these names even if they are cached (see The cache)
--no-storerunTake steps from the cache, but store nothing in it
--no-cacherunRun every step, and neither read nor write the cache
--debugrunKeep 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=VALUEAllChange a setting for this command, and no other, after every settings file (see Settings)
--strictAllMake a warning about the project’s files an error: see Strict
--settings FILEAllRead settings from FILE too, after the system, user and checkout files (see Settings)
--older-thangcShort for --set gc.keep_age=AGE
--max-sizegcShort for --set gc.max_size=SIZE
-f, --forcegcDrop 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-rungc, cleanList what would go and the space freed, and change nothing
--failedcleanRemove the directories of steps that failed
--interruptedcleanRemove the directories of steps that did not complete: a step error, a setup error or an interrupt
--debugcleanRemove the directories of steps that passed in a run with --debug. One that failed in it counts as failed
--port PORTreport viewListen on this port of 127.0.0.1. Default: any free port
--no-openreport viewPrint the address without opening a browser
-t, --treeflowsShow designs as a tree: each under the designs whose cores depend on it, with its flows
-a, --all-coresflowsWith -t, show every FuseSoC core, not only designs. A core shown before is marked (*)
-v, --verboseflows, planflows: 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.

KeyMeaning
jobs.maxThe most steps running at once. -j sets it
pools.NAMEThe size of a resource pool
resources.enforcesystemd or cgroup to enforce what a step holds, off to only reserve it
resources.cgroupThe cgroup cgroup enforcement makes a cgroup per step in
resources.pintrue to pin each step to CPUs of its own
resources.measureHow steps are measured: auto, systemd, cgroup or off
resources.min_samples, resources.min_changeWhat doris resources needs to suggest a value
measurements.dir, measurements.max_ageWhere the measurement store is, and how long it keeps a run
dirs.keep_failedKeep the whole working directory of a step that failed
dirs.work_max_ageHow long a working directory that was kept whole is kept
tools.NAME.pathWhere a tool that is not on PATH is, for its own commands
plugins.pathDirectories 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. --failed here is a kind of directory, not the jobs of the last run.
  • --failed, --interrupted and --debug pick the kinds, and can be combined. With none of them, every kind is removed.
  • --dry-run lists 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 core is not under the cores roots, as doris flows -t finds 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.

CodeNameIn short
0OKIt did what was asked, and everything passed
1FAILEDIt ran, and the design or the environment failed
2CANNOT_RUNIt could not do what was asked at all
3ERRORA run went wrong in a way that is not the design’s

What each means for each command:

Command0 OK1 FAILED2 CANNOT_RUN3 ERROR
runEvery job passedThe worst job outcome is failedSee belowA job ended in an error or a skip, or was interrupted
validateNo errors. Warnings don’t count, unless --strictA config file has an error, or a warning with --strictNo project file was found—
checkEvery precheck holdsA precheck failedSee below—
Any other commandIt 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 default target’s filesets are followed, or every fileset if a core has no default target.
  • 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 -a shows a virtual core with several providers as (virtual).
  • A directory holding a FUSESOC_IGNORE file 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 run prints 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.log and stderr.log in 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: and error:.

Interrupting a run

Ctrl-C during doris run stops the run without losing its record:

  1. Each running command is sent SIGTERM, and SIGKILL if it has not exited after 10 seconds. Its services are stopped the same way.
  2. Each step that was running ends as a step error with the message interrupted. Nothing is cached for it, and its working directory is kept whole.
  3. Every step that had not started is skipped, in this job and in every job after it.
  4. Each job’s result.json and the reports are still written, and the run’s GC root keeps the entries used so far.
  5. 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.