The-OpenROAD-Project / The-OpenROAD-Project/OpenSTA

Refactor PortDirection.cc to minimize manual memory allocation

Open
#389 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Verilog
Stars
619
Forks
270
Avg merge
5d 15h
Merged PRs (30d)
4

Description

Patterns that rely on the user knowing and managing the proper initialization and destruction sequence of objects such as

https://github.com/The-OpenROAD-Project/OpenSTA/blob/master/network/PortDirection.cc#L29-L53

cause issues with code sanitizer tools and when using OpenSTA as a library -- especially when attempting to create and use multiple instances of OpenSTA.

This issue is to refactor PortDirection to reduce the need for careful management of its memory. Several options exist:

  1. Replace with an enum
  2. Replace heap allocation with static allocation and use of NoDestructor pattern

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with PortDirection.cc, especially lines 29-53, and trace how initialization and destruction are currently managed. Compare the enum and static-allocation options; done means PortDirection no longer requires careful user-managed memory sequencing and works safely with sanitizers and multiple OpenSTA instances.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.