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

RFDC needs to be on top-level of Simulink diagram #194

Open
jack-h opened this issue Jan 15, 2023 · 3 comments
Open

RFDC needs to be on top-level of Simulink diagram #194

jack-h opened this issue Jan 15, 2023 · 3 comments

Comments

@jack-h
Copy link
Member

jack-h commented Jan 15, 2023

The RFDC mask uses the sysgen block to determine hardware-specific capabilities. The original RFDC mask searched for the sysgen block from the same level in the model as the RFDC yellow block. This fails if the RFDC is in a subsystem.

I "fixed" this with realtimeradio/mlib_devel@6c67275

However, it turns out that unless the RFDC is on the top-level of the design, the RFDC .dtsi file never gets created. It's not really clear to me how this file gets generated, and whether the top-level requirement is fundamental or can be relaxed with a simple script change (maybe name to fullname in some generation script somewhere?).
If the latter, it would be good to implement this.

@jack-h
Copy link
Member Author

jack-h commented Jan 15, 2023

@mitchburnett -- happy to implement this if you can point me in the right direction. (Or happy to close if you tell me this is harder to fix than it looks)

@mitchburnett
Copy link
Contributor

mitchburnett commented Jan 16, 2023

The thinking was that yellow blocks supporting use of a device tree implement gen_dt_node(). Then in VitisBackend it would inherit from Toolflow and keep the frontend parsed information and iterate over the list of periph_objs and if that name is in the mmap it will call gen_dt_node() for the periph_obj. https://github.com/casper-astro/mlib_devel/blob/m2021a/jasper_library/toolflow.py#L1600

@jack-h, I am not super familiar with how simulink subsystem hierarchy works and gets tracked in the frontend and what information is available for reconciling that. You would know that better than me. But you are right, allowing the rfdc to be in a subsystem should be allowed. Thanks for getting this started with the mask updates!

If the change from name to fullname on that check is enough to match what is placed in the mmap this would be enough to get the dtsi fragment to generate. Short of testing it to see what explodes, I cannot think of any issues this will raise because the formatted string in the include directive where name is used to identify the fragment file is just a convention. All that matters is that whatver the name of the fragment file is, that it is included by that name in the top-level jasper.dtsi. That way when the device tree compiler runs it can include the fragments.

I would say give it this a shot at and if it doesn't work we should keep looking at this.

The underlying information that is placed in the device tree fragment and used to actually do any work by the rfdc driver is contained in the implementation of gen_rfdc_dt and not dependent on this name. The only thing the node generation should need is the information in the memory map. If this requirement will be true in general for anything wanting to support/use a device tree I was not sure. I do not know enough to really say. Which is a bit why I made any needed name string separate (e.g., compatible keyword required by the driver). I was not sure how the requirements for such functionality could grow.

The rfdc is certainly the odd ball YB here in that it is the only one right now that uses any of this. But I do believe there is potential in general for broader support and reuse of software/drivers that an IP provides.

@jack-h
Copy link
Member Author

jack-h commented Jan 16, 2023 via email

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