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

Repos without doris config

A repo that has no doris config but has another tool’s can still be run with doris. --compat FORMAT makes a doris project from the other tool’s config files, and every command then works on it as on any other project. The one format is dvsim, for OpenTitan’s dvsim lint, CDC and RDC configs.

cd opentitan
doris --compat dvsim flows                                  # the designs it found
doris --compat dvsim run lint top_earlgrey/uart              # one block, with every linter
doris --compat dvsim run lint --top top_earlgrey --tool verilator
doris --compat dvsim run lint -i tag=dv --tool verible       # the testbenches
doris --compat dvsim run cdc                                 # each top's CDC check

This is a bridge until a repo has its own doris config, and is meant to be removed then. The repo’s files are not changed.

How it works

On every command, doris reads the other tool’s files and writes a project from them to scratch/doris-compat/<format>/: a project file, and design files and flow config files as a repo of its own would have. It then loads that project file as --project would. The project file’s root is the repo, so the cores, the jobs’ working directories in scratch/doris/ and the cache are the repo’s, as they would be with its own config.

The project is made again on every command, so it follows the other tool’s files. A file is only rewritten when its text changes, and files of designs that are gone are removed. Don’t edit them: edit the files they are made from.

The generated files are a starting point for a repo’s own config. Copy them out of scratch/doris-compat/ and edit them.

dvsim

Each top’s lint batch, hw/<top>/lint/<top>_lint_cfgs.hjson, lists its lint jobs in use_cfgs. Each job names a FuseSoC core, and imports the configs that build its fusesoc run command. A top’s other lint batches, <top>_<kind>_lint_cfgs.hjson, such as dv for its testbenches and fpv for its formal harnesses, add jobs to the top. They are only read for a top with a batch of its own. The project root is the git checkout’s root, which is dvsim’s proj_root.

dvsimdoris
A top’s batchA design with scope: top, named after the top’s directory
The job named after the top, if anyThe top’s own lint config. The top’s core is its core, or otherwise the core of a job’s --mapping that has the top’s name, such as lowrisc:systems:top_earlgrey
Each other jobA design of the top’s own, named after the job, with a lint config. Its job is lint/<top>/<job>@<linter>
Each job of a <kind> batchThe same, with _<kind> added to its name unless it ends in it: aes in the dv batch is top_earlgrey/aes_dv, and prim_arbiter_ppc_fpv keeps its name. Its design has the kind as a tag, so -i tag=dv selects the testbenches
The job’s fusesoc_core, as runThe design’s core
--targetThe lint config’s target
Each --mappingThe lint config’s mappings, in order
--cores-rootThe project’s cores_root
A tool with a config, {tool}.hjsonA linter in the project’s tool.lint.linter: verilator, veriblelint as verible, slang, ascentlint
  • The FuseSoC command is built as dvsim builds it. The job’s own keys and those of every config it imports, through import_cfgs, make its build_opts, with each {name} replaced by its value. A list in an importing config and an imported one is joined.
  • Only what decides what is linted is translated. --tool and --work-root are doris’s to set. Any other FuseSoC option is an error, as is a command that is not the same for every tool, or that names a variable with no value. Keys dvsim reads only for its reports, such as rel_path and report_severities, are not read.
  • A job is linted in its top’s context, as dvsim lints it. A block that two tops list, such as uart, is two designs: top_earlgrey/uart and top_darjeeling/uart. Each has its top’s mappings. Where they resolve to the same sources, the second job is taken from the cache.
  • Waivers and options are the core’s, from its lint target and the cores it depends on, as they are for dvsim. See What the core file controls.

CDC and RDC

A top’s CDC config, hw/<top>/cdc/<name>_cdc_cfg.hjson, and its RDC config, hw/<top>/rdc/<name>_rdc_cfg.hjson, each check one design, name, elaborated as dut. Each becomes a cdc.hjson or rdc.hjson of the top’s design of that name: the lint job’s, such as top_earlgrey/chip_earlgrey_asic, which is given the dut as its top, or a design of its own if no lint job has the name. A lint job’s design must have the core the check names.

dvsimdoris
sv_flist_gen_opts: --target, --mappingThe config’s target and mappings, as a lint job’s are read
sdc_fileconstraints
cdc_env_file, env_fileenv_files
cdc_config_fileconfig_scripts
cdc_waiver_file, rdc_waiver_filewaivers, and the <kind>_waivers.*.tcl files beside them as reads, since the main one sources them
reset_scenario_filereset_scenarios
tool: meridiancdc, meridianrdcThe project’s tool.cdc.checker and tool.rdc.checker
An empty pathNone
  • doris runs its checker’s script, not OpenTitan’s. What run-cdc.tcl and run-rdc.tcl hard-code is written into the configs: the synchronizer cells, the black boxes, OpenTitan’s prim_fifo_async intent, RDC’s AST_BYPASS_CLK define and ri_ settings, and IS_CDC_RUN, which the constraints read. RDC’s modules, which its waivers loop over, is read from run-rdc.tcl. A change to those scripts is only followed for modules.
  • params and foundry_root are errors if set: doris takes parameters by name, and has no foundry setup to translate to.
  • What the configs say is what runs, including what looks wrong in them. OpenTitan’s CDC config gives no waiver file, so its waivers are not applied, and its RDC config gives only chip_earlgrey_asic.sdc, without the setup file its CDC config reads first.

Limits

  • Lint, CDC and RDC only. dvsim’s simulation, formal and synthesis configs are not read.
  • Every batch is linted with every linter. dvsim leaves the choice to whoever runs it: OpenTitan’s CI lints the dv and fpv batches with Verible only, and Verilator can’t lint a UVM testbench. Pick linters with --tool, as in doris --compat dvsim run lint -i tag=dv -i tag=fpv --tool verible, which lints what that CI does.
  • Each command reads every batch. A batch that can’t be translated stops every command, naming the job and why.
  • Messages and counts are doris’s, not dvsim’s report parsers’. See the lint step for how each linter’s are read.