From f8c2f673cd6101f86e30d65832b455d45333d6a8 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 28 Sep 2020 13:45:36 +0000 Subject: [PATCH] iopad pads.instances mapping --- experiments9/coriolis2/ioring.py | 57 +++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 9 deletions(-) diff --git a/experiments9/coriolis2/ioring.py b/experiments9/coriolis2/ioring.py index c0dfafc..b7cbf4f 100644 --- a/experiments9/coriolis2/ioring.py +++ b/experiments9/coriolis2/ioring.py @@ -44,9 +44,14 @@ for (padnum, name, _), bank in zip(p.muxed_cells, p.muxed_cells_bank): name = 'p_sys_clk_0' elif name == 'sys_rst': #name = 'p_sys_rst_1' - pass + iopads.append([name, name, name]) + padbank[banknum] = name + print "sys_rst add", bank, banknum, name + name = None else: name = '' + #if name: + # iopads.append([pname, name, name]) # SPI Card elif name.startswith('mspi0') or name.startswith('mspi1'): suffix = name[6:] @@ -59,60 +64,94 @@ for (padnum, name, _), bank in zip(p.muxed_cells, p.muxed_cells_bank): else: prefix = 'spisdcard_' name = prefix + suffix + iopads.append(['p_' + name, name, name]) # SD/MMC elif name.startswith('sd0'): if name.startswith('sd0_d'): i = name[5:] name = 'sdcard_data' + i name2 = 'sdcard_data_%%s(%s)' % i - pad = [name, name, name2 % 'o', name2 % 'i', 'sdcard_data_oe'] + pad = ['p_' + name, name, name2 % 'o', name2 % 'i', + 'sdcard_data_oe'] iopads.append(pad) elif name.startswith('sd0_cmd'): name = 'sdcard_cmd' name2 = 'sdcard_cmd_%s' - pad = [name, name, name2 % 'o', name2 % 'i', name2 % 'oe'] + pad = ['p_' + name, name, name2 % 'o', name2 % 'i', name2 % 'oe'] iopads.append(pad) else: name = 'sdcard_' + name[4:] + iopads.append(['p_' + name, name, name]) # SDRAM elif name.startswith('sdr'): if name == 'sdr_clk': name = 'sdram_clock' + iopads.append(['p_' + name, name, name]) elif name.startswith('sdr_ad'): - name = 'sdram_a_' + name[6:] + i = name[6:] + name = 'sdram_a_' + i + name2 = 'sdram_a(%s)' % i + iopads.append(['p_' + name, name2, name2]) elif name.startswith('sdr_ba'): - name = 'sdram_ba_' + name[-1] + i = name[-1] + name = 'sdram_ba_' + i + name2 = 'sdram_ba(%s)' % i + iopads.append(['p_' + name, name2, name2]) elif name.startswith('sdr_dqm'): - name = 'sdram_dm_' + name[-1] + i = name[-1] + name = 'sdram_dm_' + i if name[-1] == '1': # XXX skip sdram_dm_1 for now name = '' + else: + name2 = 'sdram_dm(%s)' % i + iopads.append(['p_' + name, name2, name2]) elif name.startswith('sdr_d'): i = name[5:] name = 'sdram_dq_' + i name2 = 'sdram_dq_%%s(%s)' % i - pad = [name, name, name2 % 'o', name2 % 'i', 'sdram_dq_oe'] + pad = ['p_' + name, name, name2 % 'o', name2 % 'i', 'sdram_dq_oe'] iopads.append(pad) elif name == 'sdr_csn0': name = 'sdram_cs_n' + iopads.append(['p_' + name, name, name]) elif name[-1] == 'n': name = 'sdram_' + name[4:-1] + '_n' + iopads.append(['p_' + name, name, name]) else: name = 'sdram_' + name[4:] + iopads.append(['p_' + name, name, name]) # UART elif name.startswith('uart'): name = 'uart_' + name[6:] + iopads.append(['p_' + name, name, name]) # GPIO elif name.startswith('gpio'): i = name[7:] name = 'gpio_' + i name2 = 'gpio_%%s(%s)' % i - pad = [name, name, name2 % 'o', name2 % 'i', name2 % 'oe'] + pad = ['p_' + name, name, name2 % 'o', name2 % 'i', name2 % 'oe'] print ("GPIO pad", name, pad) iopads.append(pad) + # EINT + elif name.startswith('eint'): + i = name[-1] + name = 'eint_%s' % i + name2 = 'eint(%s)' % i + pad = ['p_' + name, name2, name2] + iopads.append(pad) # PWM elif name.startswith('pwm'): name = name[:-4] - padbank[banknum] = name + pad = ['p_' + name, name, name] + iopads.append(pad) + else: + pad = ['p_' + name, name, name] + iopads.append(pad) + print ("GPIO pad", name, pad) + if name and not name.startswith('p_'): + name = 'p_' + name + if name is not None: + padbank[banknum] = name # couple of unknown signals #pw[25] = 'p_sys_rst_1' -- 2.30.2