From: Florent Kermarrec Date: Mon, 24 Feb 2020 12:37:38 +0000 (+0100) Subject: integration/soc: improve presentation of SoCLocHandler's locations. X-Git-Tag: 24jan2021_ls180~638 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0c7e0bf02571230aa48e75d99ee1ccc73ccf59bc;p=litex.git integration/soc: improve presentation of SoCLocHandler's locations. --- diff --git a/litex/soc/integration/soc.py b/litex/soc/integration/soc.py index 127aecec..df1e1e1d 100755 --- a/litex/soc/integration/soc.py +++ b/litex/soc/integration/soc.py @@ -418,8 +418,11 @@ class SoCLocHandler(Module): def __str__(self): r = "{} Locations: ({})\n".format(self.name, len(self.locs.keys())) if len(self.locs.keys()) else "" locs = {k: v for k, v in sorted(self.locs.items(), key=lambda item: item[1])} + length = 0 for name in locs.keys(): - r += "- {}{}: {}\n".format(colorer(name, color="underline"), " "*(20-len(name)), colorer(self.locs[name])) + if len(name) > length: length = len(name) + for name in locs.keys(): + r += "- {}{}: {}\n".format(colorer(name, color="underline"), " "*(length + 1 - len(name)), colorer(self.locs[name])) return r # SoCCSRHandler ------------------------------------------------------------------------------------