Skip to content

Add the ability to read config values from a multi-line file #28

@thoughtpolice

Description

@thoughtpolice

While __SetConfig and __ListConfig are undocumented, they're very useful in my RV32 emulator. However, one thing I'd like to do is be able to set multiple configuration values at once in a file, e.g.

debug.disasm_ops=1
cpu.has_ext_m=1
cpu.has_ext_c=0
cpu.has_ext_a=0
cpu.has_ext_f=0

This could be inside the file rv32im-debug.conf, with the simulator being executed e.g.

./build/emu -e build/test.elf --config-file ./rv32im-debug.conf

The semantics would be as if the -C flag was used on the command line multiple times, and config options are applied sequentially (just the same as on the CLI).


This would also dovetail nicely with the ability to read a config file from an environment variable; for example,

export SAIL_EMULATOR_CONFIG=$(pwd)/rv32im-debug.conf
./build/emu -e build/test.elf

But maybe that's not useful unless someone needs it.

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