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

Command line for testing output of the plugin device #1

Open
xzj478 opened this issue Jul 27, 2023 · 7 comments
Open

Command line for testing output of the plugin device #1

xzj478 opened this issue Jul 27, 2023 · 7 comments

Comments

@xzj478
Copy link

xzj478 commented Jul 27, 2023

I used the test drive which posted in this repo: "https://github.com/vexingcodes/spike-plugin" to test the output

With this command line:
"spike -m1 --extlib=/tmp/riscvtoolchain/lib/libspikedevices.so --device=sifive_uart,0x10000000,argument /tmp/spike-devices/plugin_test"

but it reports:
"terminate called after throwing an instance of 'std::runtime_error'
what(): Plugin "sifive_uart,0x10000000,argument" not found in loaded extlibs.
Aborted (core dumped)"

Could you please show me the right way of testing the output? Thanks.

@jerryz123
Copy link
Contributor

It should just be --device=sifive_uart.

@xzj478
Copy link
Author

xzj478 commented Jul 31, 2023

I tried "spike -m1 --extlib=/tmp/riscvtoolchain/lib/libspikedevices.so --device=sifive_uart /tmp/spike-devices/plugin_test", but nothing happened, and if I press Ctrl+C right after, it will be in spike debugging mode (I guess).

It should just be --device=sifive_uart.

@xzj478
Copy link
Author

xzj478 commented Aug 1, 2023

Okay, after I tried "spike --extlib=/home/zijianxie/riscvtoolchain/lib/libspikedevices.so --device=sifive_uart --isa=RV64GC --dtb /home/zijianxie/spike-devices/test.dtb /home/zijianxie/spike-devices/plugin_test"

it printed "Found uart at 10000000"; which means spike could recognize the mmio device?

Then how could I pass a string argument to the plugin device to test the store/load function? Since the original command of "--device=<P,B,A>; P -- Name of MMIO plugin, B -- Base memory addr. of the device, A -- String arguments to pass to the plugin" is no longer available in spike.cc.

@xzj478
Copy link
Author

xzj478 commented Aug 1, 2023

All I want to ask is how to access the device with memory load/store? Should I write an assembly file like they did in repo: https://github.com/vexingcodes/spike-plugin?

Or I write a simple function C code to do that(after compilation)?

@jerryz123
Copy link
Contributor

You should write a test program, whether in C or assembly, and execute it.

@xzj478
Copy link
Author

xzj478 commented Aug 1, 2023

Any simple example (in C) for that would be appreciated.

@xzj478
Copy link
Author

xzj478 commented Aug 8, 2023

Ping :-) I am really struggling to put together a working code, could you by any chance provide a c or asm example?

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

2 participants