From: Luke Kenneth Casson Leighton Date: Wed, 4 Apr 2018 08:38:54 +0000 (+0100) Subject: split bsv generator into functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d1159de30f20996209e0763f9ab7ba5218996767;p=pinmux.git split bsv generator into functions --- diff --git a/src/bsv/pinmux_generator.py b/src/bsv/pinmux_generator.py index 3431bf1..dae7f94 100644 --- a/src/bsv/pinmux_generator.py +++ b/src/bsv/pinmux_generator.py @@ -77,6 +77,12 @@ def pinmuxgen(pth=None, verify=True): ptp = os.path.join(bp, 'PinTop.bsv') bvp = os.path.join(bp, 'bus.bsv') + write_pmp(pmp, p, ifaces) + write_ptp(pmp, p, ifaces) + write_bvp(pmp, p, ifaces) + + +def write_pmp(pmp, p, ifaces): # package and interface declaration followed by # the generic io_cell definition with open(pmp, "w") as bsv_file: @@ -162,6 +168,8 @@ def pinmuxgen(pth=None, verify=True): print("BSV file successfully generated: bsv_src/pinmux.bsv") # ====================================================================== + +def write_ptp(ptp, p, ifaces): with open(ptp, 'w') as bsv_file: bsv_file.write(copyright + ''' package PinTop; @@ -235,6 +243,8 @@ package PinTop; endpackage ''') + +def write_bvp(bvp, p, ifaces): # ######## Generate bus transactors ################ with open(bvp, 'w') as bsv_file: bsv_file.write(axi4_lite.format(p.ADDR_WIDTH, p.DATA_WIDTH))