- if conn._iotype == IOType.In:
- m.d.posjtag += io_sr[idx].eq(conn.pad.i)
- idx += 1
- elif conn._iotype == IOType.Out:
- m.d.posjtag += io_sr[idx].eq(conn.core.o)
- idx += 1
- elif conn._iotype == IOType.TriOut:
- m.d.posjtag += [
- io_sr[idx].eq(conn.core.o),
- io_sr[idx+1].eq(conn.core.oe),
- ]
- idx += 2
- elif conn._iotype == IOType.InTriOut:
- m.d.posjtag += [
- io_sr[idx].eq(conn.pad.i),
- io_sr[idx+1].eq(conn.core.o),
- io_sr[idx+2].eq(conn.core.oe),
- ]
- idx += 3
- else:
- raise("Internal error")
+ # in appropriate sequence: In/TriOut has pad.i,
+ # Out.InTriOut has everything, Out and TriOut have core.o
+ if conn._iotype in [IOType.In, IOType.InTriOut]:
+ iol.append(conn.pad.i)
+ if conn._iotype in [IOType.Out, IOType.InTriOut]:
+ iol.append(conn.core.o)
+ if conn._iotype in [IOType.TriOut, IOType.InTriOut]:
+ iol.append(conn.core.oe)
+ # length double-check
+ idx += IOConn.lengths[conn._iotype] # fails if wrong type