183 def __init__(self, name, cformat, legacy, connDef):
185 @param name name of the connector
186 @param cformat can be 'topological' or 'simple'
188 super(ElectricalConnector,self).
__init__(connDef = connDef)
195 currentTopoCategory = AlgCategory.getCategoryFromBoardName(self.
boardName)
196 for thrG
in connDef[
"algorithmGroups"]:
197 fpga,clock =
map(thrG.__getitem__,[
"fpga",
"clock"])
198 for topo
in thrG[
"algorithms"]:
199 bit = topo.outputbits[0]
if isinstance(topo.outputbits, tuple)
else topo.outputbits
200 for (i, tl)
in enumerate(topo.outputlines):
202 tlname = currentTopoCategory.prefix + tl
204 flatindex = 32*fpga + 2*startbit + clock
205 self.
addTriggerLine(
TriggerLine( name = tlname, startbit = startbit, flatindex = flatindex, nbits = 1, fpga = fpga, clock = clock ), fpga, clock )
206 elif self.
cformat == CFormat.SIMPLE:
207 for sigG
in connDef[
"signalGroups"]:
208 clock = sigG[
"clock"]
210 for signal
in sigG[
"signals"]:
211 nbits = connDef[
"nbitsDefault"]
212 if type(signal)==tuple:
213 (signal,nbits) = signal
218 flatindex = 2*startbit + clock
219 tl =
TriggerLine( name = signal, startbit = startbit, flatindex = flatindex, nbits = nbits, fpga =
None, clock = clock)
223 raise RuntimeError(
"Property 'format' of connector %s is '%s' but must be either 'simple' or 'topological'" % (name,connDef[
"format"]))