Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thoughtpolice opened this issue Jan 29, 2019 · 2 comments
Open

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

thoughtpolice opened this issue Jan 29, 2019 · 2 comments

Comments

@thoughtpolice
Copy link
Contributor

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.

@Alasdair
Copy link
Collaborator

Hi,

That's probably quite useful. I'll look into adding it.

The __SetConfig and __ListConfig functions so far only exist for command-line compatability with ARM's internal tools for when we run the AVS tests, but that's something we want to continue to be able to do so they won't be going away

@rmn30
Copy link
Contributor

rmn30 commented Feb 25, 2020

This overlaps with the functionality of riscv-config as used by the compliance group. I've implemented support for that in this PR: riscv/sail-riscv#43 but it requires recompiling the model to change the config so something like you propose might be simpler and preferable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants