Skip to content

Add functions to p_tb_type for checking if it's root or primitive #3013

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

Merged
merged 4 commits into from
May 2, 2025

Conversation

AmirhosseinPoolad
Copy link
Contributor

This PR adds two new functions to the p_tb_type struct, is_root and is_primitive and changes the users to use these new functions instead of writing the logic every time. There's now less code duplication and the code a bit cleaner and more understandable.

I did have two questions about this part of code:

  1. What is the meaning of a t_pb without a name? There's a couple of places that call is_primitive and see if the associated t_pb doesn't have a name which could be cleaned up further
  2. Regarding the added TODO comment in cluster_legalizer.cpp:836 of this PR: Should it be an assert?

@github-actions github-actions bot added VPR VPR FPGA Placement & Routing Tool libarchfpga Library for handling FPGA Architecture descriptions lang-cpp C/C++ code labels Apr 30, 2025
@AmirhosseinPoolad AmirhosseinPoolad force-pushed the pb_type_helper_func branch 2 times, most recently from dbcfb3d to 5cda635 Compare April 30, 2025 17:45
Copy link
Contributor

@AlexandreSinger AlexandreSinger left a comment

Choose a reason for hiding this comment

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

LGTM, some minor comments on documentation.

Regarding t_pb's being unnamed, t_pb's are a heirarchical structure based on the pb_type. I am not exactly sure, but I think there may be pb_types in the heirarchy which are unnamed. You can try to investigate by seeing how t_pbs are constructed if you have the energy for it.

@AmirhosseinPoolad AmirhosseinPoolad merged commit c60f967 into master May 2, 2025
36 checks passed
@AmirhosseinPoolad AmirhosseinPoolad deleted the pb_type_helper_func branch May 2, 2025 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-cpp C/C++ code libarchfpga Library for handling FPGA Architecture descriptions VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants