From: Luke Kenneth Casson Leighton Date: Fri, 23 Mar 2018 14:26:56 +0000 (+0000) Subject: whitespace cleanup X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2519cdb76968e9cb710fef201aa2efe062ce864b;p=pinmux.git whitespace cleanup --- diff --git a/src/actual_pinmux.py b/src/actual_pinmux.py index 82a0ef2..76a0e2e 100644 --- a/src/actual_pinmux.py +++ b/src/actual_pinmux.py @@ -66,9 +66,9 @@ def init(p): temp = temp.replace(' ', '') x = dictionary.get(temp) assert x is not None, "ERROR: The signal : " + \ - str(cell[i + 1]) + \ - " of pinmap.txt isn't present \nin the current" + \ - " dictionary. Update dictionary or fix-typo." + str(cell[i + 1]) + \ + " of pinmap.txt isn't present \nin the current" + \ + " dictionary. Update dictionary or fix-typo." if x == "input": p.pinmux += \ mux_wire.format(cell[0], i, "wr" + cell[i + 1]) + "\n" diff --git a/src/parse.py b/src/parse.py index aeb0c8b..a02ff8f 100644 --- a/src/parse.py +++ b/src/parse.py @@ -56,7 +56,7 @@ class Parse(object): self.pinnumbers = sorted(self.pinnumbers) self.upper_offset = self.lower_offset + \ - int(math.log(len(self.muxed_cells), 2)) + int(math.log(len(self.muxed_cells), 2)) if verify: self.do_checks() @@ -100,6 +100,7 @@ class Parse(object): # TODO + if __name__ == '__main__': p = Parse() print p.N_IO diff --git a/src/pinmux_generator.py b/src/pinmux_generator.py index e8d629d..661060f 100644 --- a/src/pinmux_generator.py +++ b/src/pinmux_generator.py @@ -59,6 +59,7 @@ footer = ''' endpackage ''' + def pinmuxgen(pth=None, verify=True): """ populating the file with the code """ @@ -92,8 +93,8 @@ def pinmuxgen(pth=None, verify=True): // where each IO will have the same number of muxes.''') for cell in p.muxed_cells: - bsv_file.write(mux_interface.ifacefmt(cell[0], - int(math.log(len(cell) - 1, 2)))) + cnum = int(math.log(len(cell) - 1, 2)) + bsv_file.write(mux_interface.ifacefmt(cell[0], cnum)) bsv_file.write(''' endinterface @@ -238,6 +239,7 @@ endpackage bsv_file.write(axi4_lite.format(p.ADDR_WIDTH, p.DATA_WIDTH)) # ################################################## + def printhelp(): print ('''pinmux_generator.py [-o outputdir] [-v|--validate] [-h|--help] -o outputdir : defaults to bsv_src. also location for reading pinmux.txt @@ -246,6 +248,7 @@ def printhelp(): -h | --help : this help message ''') + if __name__ == '__main__': try: options, remainder = getopt.getopt( @@ -273,4 +276,3 @@ if __name__ == '__main__': sys.exit(0) pinmuxgen(output_dir, validate) -