6 #ifndef EFTRACKING_FPGA_INTEGRATION_F600INTEGRATIONALG_H
7 #define EFTRACKING_FPGA_INTEGRATION_F600INTEGRATIONALG_H
18 #include "GaudiKernel/ServiceHandle.h"
19 #include "GaudiKernel/IChronoSvc.h"
22#include "xrt/xrt_bo.h"
23#include "xrt/xrt_device.h"
24#include "xrt/xrt_kernel.h"
25#include <experimental/xrt_xclbin.h>
26#include <experimental/xrt_ip.h>
27#include <experimental/xrt_queue.h>
30#include "CL/cl2xrt.hpp"
38#define EVENT_COUNT_RST 0x80000000
40#define USER_CTRL_OFFSET 0x10
41#define EVENT_RX_COUNT_OFFSET 0x14
42#define EVENT_TX_COUNT_OFFSET 0x1C
49 using IntegrationBase::IntegrationBase;
50 virtual StatusCode
initialize()
override final;
51 virtual StatusCode
execute(
const EventContext &ctx)
const override final;
52 virtual StatusCode
finalize()
override final;
57 "ChronoStatSvc", name()};
63 "Tool for creating xAOD cluster containers"};
66 this,
"TestVectorTool",
"TestVectorTool",
"Tool for preparing test vectors"};
69 this,
"FPGADataFormatTool",
"FPGADataFormatTool",
"Tool for formatting FPGA data"};
72 this,
"xclbin",
"",
"xclbin path and name"};
77 ToolHandle<OutputConversionTool>
m_outputConversionTool{
this,
"OutputConversionTool",
"OutputConversionTool",
"tool for output conversion"};
82 this,
"PixelClusteringKernelName",
"",
"Name of the pixel clustering kernel (pxl cls)"};
84 this,
"ProcessHitsKernelName",
"",
"Name of the strip clustering kernel (strp cls)"};
86 this,
"PixelL2gKernelName",
"",
"Name of the pixel L2G transformation kernel"};
88 this,
"StripL2gKernelName",
"",
"Name of the strip L2G transformation kernel"};
90 this,
"PixelEdmPrepKernelName",
"",
"Name of the pixel EDM prep kernel"};
92 this,
"StripEdmPrepKernelName",
"",
"Name of the strip EDM prep kernel"};
96 this,
"PixelFirstStageSlicingIPName",
"",
"Name of the slicing engine IP"};
98 this,
"PixelFirstStageInputKernelName",
"",
"Name of the input stage kernel"};
100 this,
"PixelFirstStageOutputKernelName",
"",
"Name of the output stage kernel"};
104 this,
"MemReadKernelName",
"",
"Name of the memory read kernel"};
106 this,
"MemWriteKernelName",
"",
"Name of the memory write kernel"};
110 this,
"SpacepointKernelName",
"",
"Name of the spacepoint kernel"};
114 this,
"LoaderKernelName",
"",
"Name of the loader kernel"};
116 this,
"UnloaderKernelName",
"",
"Name of the unloader kernel"};
120 this,
"NnOverlapDecoratorKernelName",
"",
"Name of the NN overlap decorator kernel"};
124 this,
"RunnerKernelName",
"",
"Name of the duplicate remover runner kernel"};
128 this,
"PixelClusterInputPath",
"",
"Filepath for the pixel clustering input data"};
130 this,
"PixelStageOneSlicingInputPath",
"",
"Filepath for the slicing engine (pixel first stage) input data"};
132 this,
"InsideOutInputPath",
"",
"Filepath for the inside out input data"};
177 std::string
get_cu_name(
const std::string& kernel_name,
int cu);
182 void readTV(
const std::string &filepath,
int n_words, uint64_t *
data)
const;
184 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.