ATLAS Offline Software
SlicingEngineConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 
3 if __name__ == "__main__":
4  from argparse import ArgumentParser
5  argumentParser = ArgumentParser()
6  argumentParser.add_argument(
7  "--xclbinPath",
8  required = True,
9  )
10 
11  argumentParser.add_argument(
12  "--inputTestVectorPath",
13  default = "/eos/project/a/atlas-eftracking/TestVectors/FPGATrackSim_TVs/Test_Vectors_v0-6-3d/F150_Region34_SingleMuon/stripL2G_output.txt",
14  )
15 
16  argumentParser.add_argument(
17  "--outputPath",
18  default = "slicing_engine_output.txt",
19  )
20 
21  argumentParser.add_argument(
22  "--bufferSize",
23  type = int,
24  default = 8192,
25  )
26 
27  argumentParser.add_argument(
28  "--events",
29  type = int,
30  default = 2,
31  )
32 
33  argumentParser.add_argument(
34  "--verbose",
35  action = "store_true",
36  )
37 
38  arguments = argumentParser.parse_args()
39 
40  from AthenaConfiguration.AllConfigFlags import initConfigFlags
41  flags = initConfigFlags()
42 
43  if arguments.verbose:
44  from AthenaCommon.Constants import DEBUG
45  flags.Exec.OutputLevel = DEBUG
46 
47  flags.lock()
48 
49  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
50  acc = MainServicesCfg(flags)
51 
52  from AthenaConfiguration.ComponentFactory import CompFactory
53  acc.addService(CompFactory.ChronoStatSvc(
54  PrintUserTime = True,
55  PrintSystemTime = True,
56  PrintEllapsedTime = True,
57  ))
58 
59  acc.addService(CompFactory.AthXRT.DeviceMgmtSvc(XclbinPathsList = [arguments.xclbinPath]))
60 
61  from EFTrackingFPGAUtility.EFTrackingDataStreamLoaderAlgorithmConfig import EFTrackingDataStreamLoaderAlgorithmCfg
63  flags,
64  name = "inputDataStreamLoader",
65  bufferSize = arguments.bufferSize,
66  GHITZTxtInputPaths = [
67  arguments.inputTestVectorPath,
68  ],
69  GHITZTxtInputKeys = [
70  "stripL2G_output",
71  ],
72  ))
73 
74  from EFTrackingFPGAPipeline.EFTrackingXrtAlgorithmConfig import EFTrackingXrtAlgorithmCfg
75  acc.merge(EFTrackingXrtAlgorithmCfg(
76  flags,
77  bufferSize = arguments.bufferSize,
78  inputInterfaces = [
79  ["configurableLengthWideLoader:{configurableLengthWideLoader_1}", "stripL2G_output", 0],
80  ],
81  outputInterfaces = [
82  ["dynamicLengthWideUnloader:{dynamicLengthWideUnloader_1}", "slicing_engine_output", 1],
83  ],
84  vSizeInterfaces = [
85  ["configurableLengthWideLoader:{configurableLengthWideLoader_1}", "stripL2G_output", 2],
86  ],
87  kernelOrder = [
88  [
89  "configurableLengthWideLoader:{configurableLengthWideLoader_1}",
90  "dynamicLengthWideUnloader:{dynamicLengthWideUnloader_1}",
91  ],
92  ]
93  ))
94 
96  flags,
97  name = "outputDataStreamLoader",
98  bufferSize = arguments.bufferSize,
99  GHITZTxtOutputPaths = [
100  arguments.outputPath,
101  ],
102  GHITZTxtOutputKeys = [
103  "slicing_engine_output",
104  ],
105  ))
106 
107  acc.run(arguments.events)
108 
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:310
Constants
some useful constants -------------------------------------------------—
EFTrackingXrtAlgorithmConfig.EFTrackingXrtAlgorithmCfg
def EFTrackingXrtAlgorithmCfg(flags, **kwargs)
Definition: EFTrackingXrtAlgorithmConfig.py:3
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
EFTrackingDataStreamLoaderAlgorithmConfig.EFTrackingDataStreamLoaderAlgorithmCfg
def EFTrackingDataStreamLoaderAlgorithmCfg(flags, **kwargs)
Definition: EFTrackingDataStreamLoaderAlgorithmConfig.py:4