class PinSpec(Pinouts):
def __init__(self, pinbanks, fixedpins, function_names, fast=None):
self.fastbus = fast or []
- self.pinbanks = pinbanks
+ self.pinbanks = {}
+ self.muxwidths = {}
+ for bank, (sz, muxwidth) in pinbanks.items():
+ self.pinbanks[bank] = sz
+ self.muxwidths[bank] = muxwidth
self.fixedpins = fixedpins
self.function_names = function_names
bankspec = {}
self.offs = 0
- pkeys = sorted(pinbanks.keys())
+ pkeys = sorted(self.pinbanks.keys())
+ print self.pinbanks
for kn in pkeys:
bankspec[kn] = self.offs
- self.offs += pinbanks[kn]
+ self.offs += self.pinbanks[kn]
self.scenarios = []
bk = sorted(self.pinbanks.keys())
for bank in bk:
of.write(
- "\n## Bank %s (%d pins)\n\n" %
- (bank, self.pinbanks[bank]))
+ "\n## Bank %s (%d pins, width %d)\n\n" %
+ (bank, self.pinbanks[bank], self.muxwidths[bank]))
display(of, self, bank)
of.write("\n# Pinouts (Fixed function)\n\n")
def pinspec():
pinbanks = {
- 'A': 28,
+ 'A': (28, 4),
+ 'B': (4, 1),
}
fixedpins = {
'CTRL_SYS': [
ps.gpio("", ('A', 0), 0, 0, 28)
ps.rgbttl("", ('A', 0), 1, limit=22)
ps.mspi("0", ('A', 10), 2)
- ps.mquadspi("", ('A', 4), 2)
+ ps.mquadspi("0", ('A', 4), 2)
ps.uart("0", ('A', 16), 2)
ps.i2c("1", ('A', 18), 2)
ps.pwm("", ('A', 21), 2, 0, 3)
ps.uart("1", ('A', 2), 2)
ps.uart("2", ('A', 14), 2)
+ ps.mquadspi("1", ('B', 0), 0)
+
# Scenarios below can be spec'd out as either "find first interface"
# by name/number e.g. SPI1, or as "find in bank/mux" which must be
# spec'd as "BM:Name" where B is bank (A-F), M is Mux (0-3)