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

Defining C# models with multiple register banks #554

Closed
WybrenAkker opened this issue Nov 21, 2023 · 2 comments
Closed

Defining C# models with multiple register banks #554

WybrenAkker opened this issue Nov 21, 2023 · 2 comments

Comments

@WybrenAkker
Copy link

Hi,

I am currently trying to create a C# model of the ICM-42688-P (High precision 6-axis motion tracking device with a gyroscope and accelerometer).

I am facing a problem defining the registers, as this sensor has 5 different register banks. These all have a unique address space so some registers between banks "share" addresses.

Does Renode have a way of implementing multiple register banks/maps within a single sensor/peripheral? I can't find anything in the docs on this.

If not, I was thinking about mapping the "real" register addresses to faked Renode addresses, as if all registers were in a single bank. However, it would be great if Renode had something for this scenario.

Thanks!

@PiotrZierhoffer
Copy link
Member

Hi @WybrenAkker , thanks for reaching out.

I assume what you mean is that you can switch between banks by setting some configuration register?

What we are currently working on is a way to provide a selector to register definition to be able to define this in a single data structure. Right now you can follow this example: https://github.com/renode/renode-infrastructure/blob/master/src/Emulator/Peripherals/Peripherals/Sensors/OV2640.cs#L78

Here we switch the RegistersCollection to point to different banks. For now this should address your issue, until we have a more idiomatic way of defining banks.

@WybrenAkker
Copy link
Author

That's exactly what I was looking for, thanks!

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