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

drt: deleteUniqueInst #6731

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bnmfw
Copy link
Contributor

@bnmfw bnmfw commented Feb 18, 2025

Supports #5867.
Branched of #6721.

This PR has an ISPD and Secure CI associated an will be opened once it passes. Although deleteUniqueInst() has not use on this PR, it is tested by, after creating all Unique Instances in computeUnique(), deleting them all and adding them again.

deleteUniqueInsts()

This function is responsible for deleting an unique inst and relocating all the unique insts data structures. Now that there needs to exist support for deleting unique insts, something that was not predicted by the original code, there might be a question to wether or not the current structures are the best. I've invited discussion about this structures, so here is a detailed explanation of how work, currently:

What is an Unique Instance?

Two instances of the same cell (same master) that have the same orientation and have the same offset from their preferred track pattern will have the same access pattern solution. This means that it is only necessary to solve it for one of those instances, and use that solution for the other, we say that they are the same unique instance.

A group of all instances that fall under the same unique instance is called an unique class. Currently, we elect the first instance of its class to represent the unique instance, this is referred as the head on the new code.

Here is a list of all current structures that manage unique instances:

  • unique_: a simple vector of every unique instance, thus, a vector of the head of every unique class.
  • unique_to_idx_: a map that inverts the above relation, maps an unique instance to its position on the unique_ vector.
  • inst_to_class_: maps an inst to its class (the class is implemented as a set).
  • inst_to_unique_: maps an inst to its unique inst (class head).
  • inst_to_pa_idx_: maps an unique inst to the number of pin access it has.

Problems with the current structures:

Now that deleting is supported a few problem arise.

Deleting the last instance of its class:

This means that the class itself has to be deleted, implying that unique_ will have a deletion (O(|uniques|) and that unique_to_idx_ has to change to accommodate for that (O(|uniques|). There might be a better way to make this reciprocal data structures that are so unfriendly to deletion.

Deleting the head of a class:

This means that a new head has to be elected, and that every value of inst_to_unique_ of instance on that class have to be adjusting (O(|class|)).

@bnmfw bnmfw added the drt Detailed Routing label Feb 18, 2025
@bnmfw bnmfw requested a review from LucasYuki February 18, 2025 19:21
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
drt Detailed Routing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant