Skip to content

Give a better error message on a silly --tool value #233

Description

@rswarbrick

This was originally reported in OpenTitan in 2020.

The basic problem is that dvsim tries too hard to load tool-specific files. For example:

Image

I think it's kind of nice that dvsim doesn't care what tools you have installed, but surely we can spit out a more helpful error message. That file is getting loaded because OpenTitan has this in common_sim_cfg.hjson:

  import_cfgs:      ["{proj_root}/hw/data/common_project_cfg.hjson",
                     "{dv_root}/tools/dvsim/common_modes.hjson",
                     "{dv_root}/tools/dvsim/fusesoc.hjson",
                     "{dv_root}/tools/dvsim/bazel.hjson",
                     "{dv_root}/tools/dvsim/{tool}.hjson"]

I wonder whether we should add a magic "test_files" key or similar that would allow the tool die with a message saying "The file path/to/foobar.hjson does not exist. The path was computed from the following wildcards: is one of them wrong?"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions