rcx: create struct for the unit scale factors to avoid duplicated code on 3D pass - #11176
Open
AcKoucher wants to merge 2 commits into
Open
rcx: create struct for the unit scale factors to avoid duplicated code on 3D pass#11176AcKoucher wants to merge 2 commits into
AcKoucher wants to merge 2 commits into
Conversation
…e on 3D pass Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the scale factor handling in extSpef by introducing a ScaleFactors struct to replace the individual _res_unit and _cap_unit member variables, and encapsulates their calculation into a new static method computeScaleFactors. The feedback suggests renaming computeScaleFactors to computeWriteScaleFactors to clarify its specific use for exporting SPEF and to avoid developer confusion during reading operations. Additionally, it is recommended to change the parameter types from const std::string& to const char* to prevent unnecessary string allocations and safely handle potential null pointers.
maliberty
requested changes
Aug 18, 2026
Comment on lines
+1725
to
+1733
| if (capacitance_unit == "PF") { | ||
| scale_factors.capacitance = 0.001; | ||
| } | ||
|
|
||
| if (resistance_unit == "MOHM") { | ||
| scale_factors.resistance = 1000.0; | ||
| } else if (resistance_unit == "KOHM") { | ||
| scale_factors.resistance = 0.001; | ||
| } |
Member
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
We'll use the new struct/method to ensure that all SPEFs have consistent units on #11124.
Type of Change
Impact
None.
Verification
./etc/Build.sh).Related Issues
#11005.