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 can I specify File attributes? #53

Open
RasmusGOlsen opened this issue Jul 28, 2023 · 2 comments
Open

How can I specify File attributes? #53

RasmusGOlsen opened this issue Jul 28, 2023 · 2 comments
Labels
Enhancement New feature or request Question Further information is requested

Comments

@RasmusGOlsen
Copy link

RasmusGOlsen commented Jul 28, 2023

How can I register attributes to a File object? I want to register an attribute to specify which scopes I want to use the file in. It could e.g. be in a simulation or synthesis scope or both. Maybe there is another way to specify this, that I have missed.

@RasmusGOlsen RasmusGOlsen changed the title File attributes How can I specify File attributes? Jul 28, 2023
@Paebbels Paebbels added Enhancement New feature or request Question Further information is requested labels Jul 29, 2023
@Paebbels
Copy link
Member

This is related to:

Currently, only one UsedIn attribute called UsedInAttribute is implemented for AMD (former Xilinx) Vivado. Vivado uses that attribute like you describe to mention if a file is used in: synthesis, simulation. In addition if the dialog is used with ..., there are dozens of used in options like for routing, placement, drc, ...

The attribute is used via Pythons element syntax:

usedInAttr = vhdlFile[UsedInAttribute]

Example: https://github.com/edaa-org/pyEDAA.ProjectModel/blob/main/pyEDAA/ProjectModel/Xilinx/Vivado.py?ts=2#L157

So if you're looking to solve the problem for Vivado, I did already implement it. If you think this should be generally available, we can talk about it and also about possible values.

While the Vivado solution is oriented on high-level and low-level steps in one toolchain, I can also read your question to distinguish files for separate toolchains like synthesis and simulation, where some files are shared and others are disjunct.

@Paebbels
Copy link
Member

Paebbels commented Aug 14, 2023

On dev branch, I implemented first improvements for this.

Unfortunately, I used __len__() for number of files and number of filesets. This dunder method is now repurposed to the number of attributes on a file, fileset, design, or project.

As a replacement, FileCount, TotalFileCount, FileSetCount and TotalFileSetCount are added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Question Further information is requested
Development

No branches or pull requests

2 participants