chipsalliance / fpga-tool-perf

FPGA tool performance profiling
https://chipsalliance.github.io/fpga-tool-perf
Apache License 2.0
101 stars 30 forks source link

Fix usage of lstrip and rstrip #556

Closed rw1nkler closed 1 year ago

rw1nkler commented 1 year ago

Recently we noticed that part of the instability in nextpnr-fpga_interchange toolchains was caused by incorrect usage of str.lstrip() and str.rstrip() functions during log parsing.

This PR changes the wrong occurrences of those function calls to removeprefix() and removesuffix() functions respectively. The functions from the python library (str.removeprefix(), str.removesuffix()) are not used because they were introduced in Python 3.9 and we want to be compatible with older versions of python.

The incorrect usage of str.lstrip() and str.rstrip() led to incorrect calculations of execution times in the nextpnr-fpga_interchange toolchain (most notably in the routing time results).