From 0179d35e50fdba6b9a0c9bb3a77dfea16773d3e0 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 31 Jul 2018 08:05:27 +0100 Subject: [PATCH] output cell mux peripheral side --- src/bsv/pinmux_generator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bsv/pinmux_generator.py b/src/bsv/pinmux_generator.py index bcc1b25..79bfc0a 100644 --- a/src/bsv/pinmux_generator.py +++ b/src/bsv/pinmux_generator.py @@ -190,7 +190,7 @@ def write_pmp(pmp, p, ifaces, iocells): with open(pmp, "w") as bsv_file: bsv_file.write(header) - cell_bit_width = 'Bit#(%d)' % p.cell_bitwidth + bwid_template = 'Bit#(%d)' bsv_file.write('''\ (*always_ready,always_enabled*) interface MuxSelectionLines; @@ -201,7 +201,9 @@ def write_pmp(pmp, p, ifaces, iocells): // where each IO will have the same number of muxes.''') for cell in p.muxed_cells: - bsv_file.write(mux_interface.ifacefmt(cell[0], cell_bit_width)) + cellnum = cell[0] + cell_bit_width = bwid_template % p.get_muxwidth(cellnum) + bsv_file.write(mux_interface.ifacefmt(cellnum, cell_bit_width)) bsv_file.write("\n endinterface\n") -- 2.30.2