From 5b1784cb89c6ccadcb20ae6548763052b1fbf993 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 22 Mar 2018 18:46:44 +0000 Subject: [PATCH] whitespace, autopep8 --- src/actual_pinmux.py | 2 ++ src/interface_decl.py | 11 +++++++---- src/parse.py | 3 +++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/actual_pinmux.py b/src/actual_pinmux.py index 4d00d34..ce1797d 100644 --- a/src/actual_pinmux.py +++ b/src/actual_pinmux.py @@ -39,9 +39,11 @@ dedicated_wire = ''' # ============================================================ digits = maketrans('0123456789', ' '*10) # delete space later + def cn(idx): return "cell%s_mux" % str(idx) + def init(p): p.pinmux = ' ' global dedicated_wire diff --git a/src/interface_decl.py b/src/interface_decl.py index c532a84..c3e6418 100644 --- a/src/interface_decl.py +++ b/src/interface_decl.py @@ -1,7 +1,8 @@ from UserDict import UserDict -from wire_def import generic_io # special case -from wire_def import muxwire # special case +from wire_def import generic_io # special case +from wire_def import muxwire # special case + class Pin(object): """ pin interface declaration. @@ -160,11 +161,13 @@ class Interface(object): res = res.format(*args) return '\n' + res + '\n' + class MuxInterface(Interface): def wirefmt(self, *args): return muxwire.format(*args) + class IOInterface(Interface): def ifacefmtoutfn(self, name): @@ -242,8 +245,8 @@ class Interfaces(UserDict): # ========= Interface declarations ================ # mux_interface = MuxInterface('cell', [{'name': 'mux', 'ready': False, - 'enabled': False, - 'bitspec': '{1}', 'action': True}]) + 'enabled': False, + 'bitspec': '{1}', 'action': True}]) io_interface = IOInterface('io', [{'name': 'outputval', 'enabled': False}, diff --git a/src/parse.py b/src/parse.py index b9acbd6..d935877 100644 --- a/src/parse.py +++ b/src/parse.py @@ -1,10 +1,12 @@ import math + def missing_numbers(num_list): original_list = [x for x in range(num_list[0], num_list[-1] + 1)] num_list = set(num_list) return (list(num_list ^ set(original_list))) + class Parse(object): # == Parameters == # N_MUX = 1 # number of selection lines for the mux per io @@ -83,6 +85,7 @@ class Parse(object): print("Dedicated IOs: " + str(len(dedicated_cells))) # ============================================ # + if __name__ == '__main__': p = Parse() print p.N_IO -- 2.30.2