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

Using renode API in C# #578

Open
asmitaj08 opened this issue Jan 16, 2024 · 2 comments
Open

Using renode API in C# #578

asmitaj08 opened this issue Jan 16, 2024 · 2 comments

Comments

@asmitaj08
Copy link

Hi,
The renode doc shows how we can access its APIs like Start, setHooks, etc. either via executing these within that renode terminal or passing it though a .resc or a python script. Is there any doc , which exposes its APIs that can be natively used within any c# script?
Also, is the breakpoint set possible only via gdb?
Thank you!!

@PiotrZierhoffer
Copy link
Member

Hi @asmitaj08

I assume that by C# script you mean .resc scripts? They are not strictly C#, as they also support our internal Python engine and have their own syntax/grammar .

Unfortunately, it's almost impossible to describe the whole API, as we try to expose the whole interface - it's not hand written, but rather autogenerated.

For now I have to refer you to our documentation and scripts for samples.

Regarding breakpoints, look for AddHook in https://renode.readthedocs.io/en/latest/basic/using-python.html#cpu-hooks

A short snippet would be cpu AddHook 0xYOURADDRESS "self.Pause()"

And then resume with cpu Resume.

Having said that, GDB interface is typically easier to use.

@mateusz-holenko
Copy link
Member

mateusz-holenko commented Mar 21, 2024

You can also use hook to change execution mode of the CPU at given address:

cpu AddHook 0x80009000 "self.ExecutionMode = Antmicro.Renode.Peripherals.CPU.ExecutionMode.SingleStepNonBlocking"

This will make CPU stop at 0x80009000 and switch to the single stepping mode. Now you can use cpu Step to iterate over instructions.

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