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

[Prepacker] Removed Valid Flag From Molecules #2796

Conversation

AlexandreSinger
Copy link
Contributor

Pack molecules originally contained a flag called "valid" which signified that the molecule has not been clustered yet. This flag is not necessary since the Cluster Legalizer maintains this information internally. Removed the valid flag from the pack molecule struct.

See issue #2791

@github-actions github-actions bot added VPR VPR FPGA Placement & Routing Tool lang-cpp C/C++ code labels Nov 2, 2024
@AlexandreSinger
Copy link
Contributor Author

@vaughnbetz This has passed CI. Please review and merge when you have a moment. This removed the "valid" flag within the pack molecules which really should be part of the Cluster Legalizer object.

@@ -997,11 +997,70 @@ static void update_molecule_chain_info(t_pack_molecule* chain_molecule, const t_
VTR_ASSERT(false);
}

/**
* @brief Revalidate the molecules associated with this pb. The mol_validated
Copy link
Contributor

Choose a reason for hiding this comment

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

If you know anything more about what this routine does (how does it record that molecules are valid? what does it do if mol_validated is true?) it would be good to expand this comment. If you don't know (you're just moving the code), then we can leave the comment as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I actually knew very little about this routine. In all honesty it made no sense. I added the "mol_validated" flag as a hot fix to keep the behaviour exactly the same. I agree that it was a rough fix. I decided to dig into this method in detail and found that it was completely not necessary anymore (given my recent changes). I greatly simplified the method and turned it into a "reset_molecule_info" method, which does basically the same thing.

}
}
}

/*
* @brief Revert trial atom block iblock and free up memory space accordingly.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Good to expand this comment with as much as you know; you should at least know what mol_validated does so it could be commented.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See previous response. I agree that the mol_validated variable was confusing and reworked the function to make it better.

Copy link
Contributor

@vaughnbetz vaughnbetz left a comment

Choose a reason for hiding this comment

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

Looks good; two minor commenting suggestions. Merge whenever you are ready.

static void reset_molecule_info(t_pack_molecule* mol) {
// when invalidating a molecule check if it's a chain molecule
// that is part of a long chain. If so, check if this molecule
// have modified the chain_id value based on the stale packing
Copy link
Contributor

Choose a reason for hiding this comment

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

have -> has

Copy link
Contributor

Choose a reason for hiding this comment

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

Want to add a TODO to say this code may be removable?

Pack molecules originally contained a flag called "valid" which
signified that the molecule has not been clustered yet. This flag is not
necessary since the Cluster Legalizer maintains this information
internally. Removed the valid flag from the pack molecule struct.

See issue verilog-to-routing#2791
Found that the revalid molecules method was more complicated than it
needed to be in the context of the Cluster Legalizer. Simplified its
code so that it makes more sense.
@AlexandreSinger AlexandreSinger merged commit 92babb5 into verilog-to-routing:master Nov 6, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-cpp C/C++ code VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants