From 66d56be7d9acd7c5d7b7f2d3605aecf22a91602c Mon Sep 17 00:00:00 2001 From: Terry Greeniaus Date: Tue, 15 Feb 2022 01:48:55 -0800 Subject: [PATCH] stm_layout_tk: Include max frequency in the display. --- stm_layout/tk/tk_bga.py | 2 ++ stm_layout/tk/tk_lqfp.py | 3 ++- stm_layout/tk/tk_tssop.py | 3 ++- stm_layout/tk/tk_workspace.py | 6 ++++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/stm_layout/tk/tk_bga.py b/stm_layout/tk/tk_bga.py index a685c8a..e271295 100644 --- a/stm_layout/tk/tk_bga.py +++ b/stm_layout/tk/tk_bga.py @@ -51,5 +51,7 @@ def __init__(self, *args): package_name = chip_db.package(self.chip.part) c.add_text(m.x, m.y, font=self.label_font, text=self.chip.name, anchor='sw') + c.add_text(m.x + m.width / 2, m.y, font=self.label_font, + text=self.max_freq_mhz, anchor='s') c.add_text(m.rx, m.y, font=self.label_font, text=package_name, anchor='se') diff --git a/stm_layout/tk/tk_lqfp.py b/stm_layout/tk/tk_lqfp.py index 81a5c2a..3d47325 100644 --- a/stm_layout/tk/tk_lqfp.py +++ b/stm_layout/tk/tk_lqfp.py @@ -45,7 +45,8 @@ def __init__(self, *args): c.add_text( m.x + m.width / 2, m.y + m.height / 2, font=self.label_font, - text='%s\n%s' % (self.chip.name, package_name), + text='%s\n%s\n%s' % (self.chip.name, package_name, + self.max_freq_mhz), anchor='c') if 'LQFP' not in package_name: diff --git a/stm_layout/tk/tk_tssop.py b/stm_layout/tk/tk_tssop.py index 5573118..07a46c1 100644 --- a/stm_layout/tk/tk_tssop.py +++ b/stm_layout/tk/tk_tssop.py @@ -41,5 +41,6 @@ def __init__(self, *args): c.add_text( m.x + m.width / 2, m.y + m.height / 2, font=self.label_font, - text='%s\n%s' % (self.chip.name, package_name), + text='%s\n%s\n%s' % (self.chip.name, package_name, + self.max_freq_mhz), anchor='c') diff --git a/stm_layout/tk/tk_workspace.py b/stm_layout/tk/tk_workspace.py index 7290cc8..ccf276b 100644 --- a/stm_layout/tk/tk_workspace.py +++ b/stm_layout/tk/tk_workspace.py @@ -37,6 +37,12 @@ def __init__(self, chip, elem_fill, hilite_fill, select_fill, re_fill): self.pin_elems = [] self.regex = None + d = chip.part.get_driver('rcc') + if d and 'max-frequency' in d: + self.max_freq_mhz = '%.0f MHz' % (int(d['max-frequency'][-1]) / 1e6) + else: + self.max_freq_mhz = '' + self.label_font = tkinter.font.Font(family=xplat.LABEL_FONT[0], size=xplat.LABEL_FONT[1]) self.pin_font = tkinter.font.Font(family=xplat.PIN_FONT[0],