6 #ifndef EFTRACKING_FPGA_INTEGRATION_F600INTEGRATIONALG_H
7 #define EFTRACKING_FPGA_INTEGRATION_F600INTEGRATIONALG_H
19 #include "GaudiKernel/ServiceHandle.h"
20 #include "GaudiKernel/IChronoSvc.h"
23#include "xrt/xrt_bo.h"
24#include "xrt/xrt_device.h"
25#include "xrt/xrt_kernel.h"
26#include <experimental/xrt_xclbin.h>
27#include <experimental/xrt_ip.h>
28#include <experimental/xrt_queue.h>
31#include "CL/cl2xrt.hpp"
39#define EVENT_COUNT_RST 0x80000000
41#define USER_CTRL_OFFSET 0x10
42#define EVENT_RX_COUNT_OFFSET 0x14
43#define EVENT_TX_COUNT_OFFSET 0x1C
50 using IntegrationBase::IntegrationBase;
51 virtual StatusCode
initialize()
override final;
52 virtual StatusCode
execute(
const EventContext &ctx)
const override final;
53 virtual StatusCode
finalize()
override final;
58 "ChronoStatSvc", name()};
64 "Tool for creating xAOD cluster containers"};
67 this,
"TestVectorTool",
"TestVectorTool",
"Tool for preparing test vectors"};
70 this,
"FPGADataFormatTool",
"FPGADataFormatTool",
"Tool for formatting FPGA data"};
73 this,
"xclbin",
"",
"xclbin path and name"};
78 ToolHandle<OutputConversionTool>
m_outputConversionTool{
this,
"OutputConversionTool",
"OutputConversionTool",
"tool for output conversion"};
83 this,
"PixelClusteringKernelName",
"",
"Name of the pixel clustering kernel (pxl cls)"};
85 this,
"ProcessHitsKernelName",
"",
"Name of the strip clustering kernel (strp cls)"};
87 this,
"PixelL2gKernelName",
"",
"Name of the pixel L2G transformation kernel"};
89 this,
"StripL2gKernelName",
"",
"Name of the strip L2G transformation kernel"};
91 this,
"PixelEdmPrepKernelName",
"",
"Name of the pixel EDM prep kernel"};
93 this,
"StripEdmPrepKernelName",
"",
"Name of the strip EDM prep kernel"};
97 this,
"PixelFirstStageSlicingIPName",
"",
"Name of the slicing engine IP"};
99 this,
"PixelFirstStageInputKernelName",
"",
"Name of the input stage kernel"};
101 this,
"PixelFirstStageOutputKernelName",
"",
"Name of the output stage kernel"};
105 this,
"MemReadKernelName",
"",
"Name of the memory read kernel"};
107 this,
"MemWriteKernelName",
"",
"Name of the memory write kernel"};
111 this,
"SpacepointKernelName",
"",
"Name of the spacepoint kernel"};
115 this,
"LoaderKernelName",
"",
"Name of the loader kernel"};
117 this,
"UnloaderKernelName",
"",
"Name of the unloader kernel"};
121 this,
"NnOverlapDecoratorKernelName",
"",
"Name of the NN overlap decorator kernel"};
125 this,
"RunnerKernelName",
"",
"Name of the duplicate remover runner kernel"};
129 this,
"PixelClusterInputPath",
"",
"Filepath for the pixel clustering input data"};
131 this,
"PixelStageOneSlicingInputPath",
"",
"Filepath for the slicing engine (pixel first stage) input data"};
133 this,
"InsideOutInputPath",
"",
"Filepath for the inside out input data"};
178 std::string
get_cu_name(
const std::string& kernel_name,
int cu);
183 void readTV(
const std::string &filepath,
int n_words, uint64_t *
data)
const;
185 void outputHexData(
size_t dataLen, uint64_t *
data,
const std::string &dataDescriptor)
const;
char data[hepevt_bytes_allocation_ATLAS]
int readTVLength(std::string filepath) const
Gaudi::Property< std::string > m_pixelFirstStageInputKernelName
std::mutex m_fpgaHandleMtx ATLAS_THREAD_SAFE
std::atomic< cl_ulong > m_sum_kernelTime
Sum for the average time of the kernel execution.
void outputHexData(size_t dataLen, uint64_t *data, const std::string &dataDescriptor) const
Gaudi::Property< std::string > m_pixelStageOneSlicingInputPath
Gaudi::Property< std::string > m_pixelClusteringKernelName
virtual StatusCode initialize() override final
Detect the OpenCL devices and prepare OpenCL context.
std::atomic< cl_ulong > m_kernelTime
Time for kernel execution.
Gaudi::Property< std::string > m_insideOutInputPath
std::string get_cu_name(const std::string &kernel_name, int cu)
ToolHandle< xAODClusterMaker > m_xaodClusterMaker
Tool for creating xAOD containers.
Gaudi::Property< std::string > m_pixelFirstStageOutputKernelName
Gaudi::Property< std::string > m_memReadKernelName
virtual StatusCode finalize() override final
std::atomic< ulonglong > m_num_Events
Number of events for the average time of the kernel execution.
virtual StatusCode execute(const EventContext &ctx) const override final
Should be overriden by derived classes to perform meaningful work.
Gaudi::Property< std::string > m_stripL2gKernelName
Gaudi::Property< std::string > m_processHitsKernelName
ToolHandle< TestVectorTool > m_testVectorTool
Tool for preparing test vectors.
Gaudi::Property< std::string > m_xclbin
Path and name of the xclbin file.
Gaudi::Property< std::string > m_memWriteKernelName
ToolHandle< FPGADataFormatTool > m_FPGADataFormatTool
Tool for formatting FPGA data.
Gaudi::Property< std::string > m_pixelClusterInputPath
Gaudi::Property< std::string > m_pixelEdmPrepKernelName
xrt::device m_xrt_accelerator
Gaudi::Property< std::string > m_loaderKernelName
Gaudi::Property< std::string > m_pixelFirstStageSlicingIPName
Gaudi::Property< std::string > m_runnerKernelName
Gaudi::Property< std::string > m_pixelL2gKernelName
Gaudi::Property< std::string > m_nnOverlapDecoratorKernelName
Gaudi::Property< std::string > m_stripEdmPrepKernelName
Gaudi::Property< std::string > m_unloaderKernelName
Gaudi::Property< std::string > m_spacepointKernelName
ToolHandle< OutputConversionTool > m_outputConversionTool
SG::ReadHandleKey< FPGATrackSimTrackCollection > m_FPGATrackKey
void readTV(const std::string &filepath, int n_words, uint64_t *data) const
ServiceHandle< IChronoSvc > m_chronoSvc
Service for timing the algorithm.
The base class for the EFTracking FPGA integration development.
Property holding a SG store/key/clid from which a ReadHandle is made.
The class for enconding RDO to FPGA format.