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.
| dvsim | doris |
|---|---|
| A top’s batch | A design with scope: top, named after the top’s directory |
| The job named after the top, if any | The 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 job | A 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> batch | The 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 run | The design’s core |
--target | The lint config’s target |
Each --mapping | The lint config’s mappings, in order |
--cores-root | The project’s cores_root |
A tool with a config, {tool}.hjson | A 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 itsbuild_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.
--tooland--work-rootare 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 asrel_pathandreport_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/uartandtop_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
linttarget 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.
| dvsim | doris |
|---|---|
sv_flist_gen_opts: --target, --mapping | The config’s target and mappings, as a lint job’s are read |
sdc_file | constraints |
cdc_env_file, env_file | env_files |
cdc_config_file | config_scripts |
cdc_waiver_file, rdc_waiver_file | waivers, and the <kind>_waivers.*.tcl files beside them as reads, since the main one sources them |
reset_scenario_file | reset_scenarios |
tool: meridiancdc, meridianrdc | The project’s tool.cdc.checker and tool.rdc.checker |
| An empty path | None |
- doris runs its checker’s script, not OpenTitan’s. What
run-cdc.tclandrun-rdc.tclhard-code is written into the configs: the synchronizer cells, the black boxes, OpenTitan’sprim_fifo_asyncintent, RDC’sAST_BYPASS_CLKdefine andri_settings, andIS_CDC_RUN, which the constraints read. RDC’smodules, which its waivers loop over, is read fromrun-rdc.tcl. A change to those scripts is only followed formodules. paramsandfoundry_rootare 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
dvandfpvbatches with Verible only, and Verilator can’t lint a UVM testbench. Pick linters with--tool, as indoris --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.