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

How to get top levels of a project? #60

Open
RasmusGOlsen opened this issue Oct 5, 2023 · 3 comments
Open

How to get top levels of a project? #60

RasmusGOlsen opened this issue Oct 5, 2023 · 3 comments
Labels
Enhancement New feature or request

Comments

@RasmusGOlsen
Copy link
Contributor

The TopLevel attribute is declared in the following classes, Project, Design, and FileSet. How should the project.TopLevel be returned? Currently, it just returns project.TopLevel even if it's None. Shouldn't it search down the hierarchy for a value different than None?

@RasmusGOlsen RasmusGOlsen changed the title How to get top levels of a project How to get top levels of a project? Oct 5, 2023
@Paebbels Paebbels added the Question Further information is requested label Oct 6, 2023
@Paebbels
Copy link
Member

Paebbels commented Oct 6, 2023

Is there a typo in your questions?

How should the project.TopLevel be returned? Currently, it just returns project.TopLevel even if it's None.

Or I didn't fully get the question.

At least Design and FileSet have indenpendent TopLevel attributes. The use case I have in mind for it is from Vivado. Here you have e.g. a VHDL design with a toplevel, but this includes IP cores. The IP core is encapsulated in a fileset and that IP core can be precompiled standalone as a netlist, which is then loaded by the main design. Such an IP core has its own local toplevel.

TopLevel.vhdl (global toplevel)
o- System.vhdl
   o- IPCore1.vhdl (local VHDL toplevel)
      o- Source1.vhdl
      o- Source2.vhdl
      o- Source3.vhdl
   o- IPCore2.v (local Verilog toplevel)
      o- Source1.v
      o- Source2.v
o- Clocking.vhdl

Right now, when writing these lines, I don't remember why a project has a toplevel, as there might be different design in a project with individual toplevels.

@RasmusGOlsen
Copy link
Contributor Author

I agree that every FileSet can have a top-level. A top-level of a child FileSet should not propagate to its parent. But I think that for a top FileSet of a Design, the top levels should propagate to the Design. The Designs top level should propagate to the Project. I also think the Projects top-level type should be List[str] as multiple top levels should be possible. This is e.g. needed in simulation.

  • Project [topA, topB, topC, topD]
    • Design1 [topA, topB]
      • FileSetA TopA
        • FileSetA1 TopA1
      • FileSetB TopB
    • Design2 [topC, topD]
      • FileSetC TopC
      • FileSetD TopD

@Paebbels
Copy link
Member

Paebbels commented Oct 8, 2023

This sounds reasonable, I'll modify it.

Might need some time, because another Python library needs some fixes first. It's blocking releases on many other things.

@Paebbels Paebbels added Enhancement New feature or request and removed Question Further information is requested labels Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Development

No branches or pull requests

2 participants