ATLAS Offline Software
Functions | Variables
python.L1.Config.LegacyTopoMergerMap Namespace Reference

Functions

def createMergerBoard (legacyBoard0, legacyBoard1)
 

Variables

 log
 
 MC
 
 __mapping
 
 target_bit
 
 topo_board
 
 source_bit
 
 signals
 

Function Documentation

◆ createMergerBoard()

def python.L1.Config.LegacyTopoMergerMap.createMergerBoard (   legacyBoard0,
  legacyBoard1 
)

Definition at line 48 of file LegacyTopoMergerMap.py.

48 def createMergerBoard(legacyBoard0, legacyBoard1):
49 
50  legacyOccupation = [[32*[None],32*[None]],[32*[None],32*[None]]]
51  for boardNumber, board in enumerate([legacyBoard0, legacyBoard1]):
52  for conn in board["connectors"][0]["algorithmGroups"]:
53  fpga = conn['fpga']
54  clock = conn['clock']
55  for topoAlgDef in conn['algorithms']:
56  lines = topoAlgDef.outputlines
57  if len(lines)==1:
58  legacyOccupation[boardNumber][clock][ 16*fpga + topoAlgDef.outputbits] = lines[0]
59  else:
60  for bit,line in enumerate(lines):
61  legacyOccupation[boardNumber][clock][ 16*fpga + bit + topoAlgDef.outputbits[0]] = line
62 
63  signals = [32*[None], 32*[None]]
64  for mc in __mapping:
65  for clock in [0,1]:
66  algFromMapping = mc.signals[clock]
67  if algFromMapping is None:
68  continue
69  signals[clock][mc.target_bit] = "R2TOPO_"+algFromMapping
70  algFromLegacyBoardDef = legacyOccupation[mc.topo_board][clock][mc.source_bit]
71  if algFromMapping != algFromLegacyBoardDef:
72  fpga = mc.source_bit // 16
73  bit = mc.source_bit % 16
74  msg = f"Legacy board mapping expects line {algFromMapping} on LegacyBoard{mc.topo_board}, fpga {fpga}, " +\
75  f"clock {clock}, bit {bit} but board defines {algFromLegacyBoardDef}"
76  log.error(msg)
77  raise RuntimeError("Mapping doesn't match LegacyBoard definition")
78 
79 
80  board = odict()
81  board["connectors"] = []
82  board["type"] = "merger"
83  board["connectors"].append({
84  "name" : "LegacyTopoMerged",
85  "format" : "simple",
86  "nbitsDefault" : 1,
87  "type" : "electrical",
88  "legacy" : False,
89  "signalGroups" : [
90  {
91  "clock" : 0,
92  "signals" : signals[0]
93  },
94  {
95  "clock" : 1,
96  "signals" : signals[1]
97  }
98  ]
99  })
100  return odict( [("LegacyTopoMerger", board)] )

Variable Documentation

◆ __mapping

python.L1.Config.LegacyTopoMergerMap.__mapping
private

Definition at line 12 of file LegacyTopoMergerMap.py.

◆ log

python.L1.Config.LegacyTopoMergerMap.log

Definition at line 6 of file LegacyTopoMergerMap.py.

◆ MC

python.L1.Config.LegacyTopoMergerMap.MC

Definition at line 8 of file LegacyTopoMergerMap.py.

◆ signals

python.L1.Config.LegacyTopoMergerMap.signals

Definition at line 13 of file LegacyTopoMergerMap.py.

◆ source_bit

python.L1.Config.LegacyTopoMergerMap.source_bit

Definition at line 13 of file LegacyTopoMergerMap.py.

◆ target_bit

python.L1.Config.LegacyTopoMergerMap.target_bit

Definition at line 13 of file LegacyTopoMergerMap.py.

◆ topo_board

python.L1.Config.LegacyTopoMergerMap.topo_board

Definition at line 13 of file LegacyTopoMergerMap.py.

dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
python.L1.Config.LegacyTopoMergerMap.createMergerBoard
def createMergerBoard(legacyBoard0, legacyBoard1)
Definition: LegacyTopoMergerMap.py:48