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

Add rapidwright.util.VivadoTools #684

Merged
merged 10 commits into from
Jun 5, 2023

Conversation

zakn-amd
Copy link
Contributor

Small utility class that contains a method to spawn a vivado process that consumes a tcl script, and a method to parse vivado's stdout. Also includes a basic testcase to exercise these methods.

Similar to com.xilinx.rapidwright.ipi.BlockUpdater.runVivadoTasks, but more generic and could probably be used to replace this (and possibly others)

Copy link
Collaborator

@eddieh-xlnx eddieh-xlnx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for building this! This is a great start, but I think we can take this PR even further to be useful right out of the box.

zakn-amd added 5 commits May 25, 2023 15:55
plus some formatting fixes

Signed-off-by: Zak Nafziger <[email protected]>
also overload runTcl s.t. to support running either a signle tcl command
or a script.

Signed-off-by: Zak Nafziger <[email protected]>
also some cleanup of javadoc

Signed-off-by: Zak Nafziger <[email protected]>
also some formatting/comment clean up

Signed-off-by: Zak Nafziger <[email protected]>
@eddieh-xlnx eddieh-xlnx changed the title Generic vivado task Add rapidwright.util.VivadoTools Jun 2, 2023
@eddieh-xlnx eddieh-xlnx requested a review from clavin-xlnx June 2, 2023 15:47
Copy link
Member

@clavin-xlnx clavin-xlnx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for developing this!

* @author zakn
*
*/
public class VivadoTools {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the idea to have multiple classes going forward dedicated to each task? If so, I would suggest that we create a dedicated package for Vivado instead of putting them all into the same class. We have tried to avoid inner classes because they tend to complicate compilation and a few other areas.

Alternatively, the class could be converted into a static method and just return a Map<String,Integer> that contains the results. This would be simpler and would probably be the preferred method in my opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddieh-xlnx has been directing some of the architecture decisions here, but I think the idea is to add classes for future vivado tasks, so maybe a separate package is warranted.

Returning a Map<String,Integer> is perhaps little more awkward, since the user then needs to know exactly what vivado output log key phrase they want (i.e. "# of unrouted nets"). I was mostly following the proposed system from here: #684 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddieh-xlnx has been directing some of the architecture decisions here, but I think the idea is to add classes for future vivado tasks, so maybe a separate package is warranted.

Ok, sure. Let's keep it the way it is for now and we can revisit it in the future if the file seems becomes unwieldly.

Returning a Map<String,Integer> is perhaps little more awkward, since the user then needs to know exactly what vivado output log key phrase they want (i.e. "# of unrouted nets"). I was mostly following the proposed system from here: #684 (comment)

Sure, I can see how that is a bit cumbersome and error prone. For simplicity, let's keep it as is.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've modelled this package under the "Tools" packages like DesignTools. It's also feels a little unweildy to do VivadoTools.<tool>.<method>(). I do agree that the inner class should be moved outside (though I don't necessarily agree they are a bad thing entirely -- they can be used for class-level (as opposed to package-level) encapsulation and do appear in the standard Java library too.

The problem with returning a Map is that I can't attach a method to it -- like a isFullyRouted() query.

Co-authored-by: Chris Lavin <[email protected]>
Signed-off-by: zakn-amd <[email protected]>
* @author zakn
*
*/
public class VivadoTools {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddieh-xlnx has been directing some of the architecture decisions here, but I think the idea is to add classes for future vivado tasks, so maybe a separate package is warranted.

Ok, sure. Let's keep it the way it is for now and we can revisit it in the future if the file seems becomes unwieldly.

Returning a Map<String,Integer> is perhaps little more awkward, since the user then needs to know exactly what vivado output log key phrase they want (i.e. "# of unrouted nets"). I was mostly following the proposed system from here: #684 (comment)

Sure, I can see how that is a bit cumbersome and error prone. For simplicity, let's keep it as is.

@eddieh-xlnx eddieh-xlnx merged commit e8bffbf into Xilinx:master Jun 5, 2023
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

Successfully merging this pull request may close these issues.

3 participants