Widen the columns for the metric width tables#4202
Conversation
Accomodate bigger values like: | Metric | Old | New | Type | | ------ | --- | --- | ---- | | cts__timing__setup__tns | -341000.0 | -331000.0 | Tighten | Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
There was a problem hiding this comment.
Code Review
This pull request updates the table formatting string in genRuleFile.py to increase column widths. The review feedback suggests using explicit alignment and a larger width of 12 characters to ensure consistent alignment between headers and numeric values, especially for large metrics like Total Negative Slack.
| ) | ||
|
|
||
| format_str = "| {:45} | {:8} | {:8} | {:8} |\n" | ||
| format_str = "| {:45} | {:10} | {:10} | {:8} |\n" |
There was a problem hiding this comment.
The current format string uses default alignment, which differs between strings (left-aligned) and numbers (right-aligned). This causes the headers ("Old", "New") to be misaligned with the numeric values in the table. Adding explicit right-alignment ({:>12}) ensures that both headers and numeric data are consistently aligned.
Additionally, while 10 characters accommodate the example value, Total Negative Slack (TNS) values in larger designs can easily exceed this width (e.g., -10000000.0 is 11 characters). Using a width of 12 provides better coverage for such cases.
| format_str = "| {:45} | {:10} | {:10} | {:8} |\n" | |
| format_str = "| {:<45} | {:>12} | {:>12} | {:<8} |\n" |
Accomodate bigger values like: