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

Zephyr DTS and Renode LiteEth address mismatch #42

Closed
kaolpr opened this issue Sep 21, 2019 · 4 comments
Closed

Zephyr DTS and Renode LiteEth address mismatch #42

kaolpr opened this issue Sep 21, 2019 · 4 comments

Comments

@kaolpr
Copy link

kaolpr commented Sep 21, 2019

I recently started my adventure with Renode and one of my first attempts was to get working samples/net/echo from Zephyr on litex_vexriscv CPU with Renode LiteEth simulation. Unfortunately that was not as straightforward as one could expect.

It turns out that there are different addresses hardcoded for LiteEth in Zephyr DTS and here:

sysbus <0xE0007800, +0x100>; // shadow

It's hard to say it's a bug, but for me, as a newcomer, it was challenging (yet very educational) to figure out what's wrong. Maybe you could make it compatible out-of-the-box?

@mithro
Copy link

mithro commented Sep 23, 2019

@kaolpr There is a tool for generating a renode configuration from a LiteX CSV file here -> https://github.com/litex-hub/litex-renode

@kaolpr
Copy link
Author

kaolpr commented Sep 23, 2019

I know and it's very handy, already checked it out.

The only think I wanted to point out with this issue is that Renode + Litex + Zephyr simulation looks like a great match and would be nice if it could work out-of-the-box.

But I fully understand it's not a bug and one can not consider it a reason for any modifications (yet, this discussion will be here if anyone was looking for Zephyr + LiteEth + Renode).

@mateusz-holenko
Copy link
Member

Thanks for the comment, @kaolpr!

As you probably already know, LiteX is in fact a SoC builder which means it can generate many different configurations.
Those configurations can differ in many aspects, including base addresses of internal components.
That flexibility is great, but as a result you don't have one LiteX platform.

Renode, due to its modularity, is great to simulate such situation as platform configuration is described in a simple text repl file.
All you need to do to simulate another instance of LiteX is to prepare a custom version of repl platform.
As mithro has already mentioned, there is a generator that can help you with that.

You are totally right though, that it might be surprising at first.
Renode provides LiteX platform definition, but it cannot run mainline Zephyr out-of-the-box.
I want to make it clear (also for others that might stumble upon this thread in the future) that this is not a bug, what Renode comes with is just one-of-many possible LiteX platforms.

There is, however, a solution to your problem that should satisfy everyone.
I will simply add a new repl and a script that explicitly targets Zephyr OS, so that it's easier for newcomers to play with Renode + Zephyr.

@mateusz-holenko
Copy link
Member

I added the Zephyr-specific platform and script in 8383ccf.

Hope it solves the problem!

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