6#ifndef EFTRACKING_FPGA_INTEGRATION_F150KERNELTESTERALG_H
7#define EFTRACKING_FPGA_INTEGRATION_F150KERNELTESTERALG_H
20#include "xrt/xrt_device.h"
21#include "xrt/xrt_kernel.h"
22#include <experimental/xrt_ip.h>
25#include "CL/cl2xrt.hpp"
28#include "GaudiKernel/ServiceHandle.h"
29#include "GaudiKernel/IChronoSvc.h"
35#define EVENT_COUNT_RST 0x80000000
36#define USER_CTRL_OFFSET 0x10
43 using IntegrationBase::IntegrationBase;
44 virtual StatusCode
initialize()
override final;
45 virtual StatusCode
execute(
const EventContext &ctx)
const override final;
46 virtual StatusCode
finalize()
override final;
51 "ChronoStatSvc", name()};
57 "Tool for creating xAOD cluster containers"};
60 this,
"TestVectorTool",
"TestVectorTool",
"Tool for preparing test vectors"};
63 this,
"FPGADataFormatTool",
"FPGADataFormatTool",
"Tool for formatting FPGA data"};
65 Gaudi::Property<std::string>
m_xclbin{
this,
"xclbin",
"",
"xclbin path and name"};
67 Gaudi::Property<bool>
m_runSE{
this,
"RunSlicing",
"",
"Whether to run slicing engine or not"};
68 Gaudi::Property<bool>
m_runIO{
this,
"RunInsideOut",
"",
"Whether to run inside out or not"};
69 Gaudi::Property<bool>
m_runIOOnSE{
this,
"RunInsideOutOnSlicingEngine",
"",
"Whether to run inside out on the output of the slicing engine"};
70 Gaudi::Property<bool>
m_runFull150{
this,
"RunFullF150",
"",
"Whether to run Full 150 chain"};
71 Gaudi::Property<bool>
m_outputTextFile{
this,
"outputTextFile",
"",
"Whether to output text file"};
80 ToolHandle<OutputConversionTool>
m_outputConversionTool{
this,
"OutputConversionTool",
"OutputConversionTool",
"tool for output conversion"};
83 Gaudi::Property<std::string>
m_slicingEngineInputName{
this,
"SlicingEngineInputName",
"",
"Name of the slicing engine input kernel"};
84 Gaudi::Property<std::string>
m_slicingEngineOutputName{
this,
"SlicingEngineOutputName",
"",
"Name of the slicing engine output kernel"};
85 Gaudi::Property<std::string>
m_insideOutInputName{
this,
"InsideOutInputName",
"",
"Name of the inside out input kernel"};
86 Gaudi::Property<std::string>
m_insideOutOutputName{
this,
"InsideOutOutputName",
"",
"Name of the inside out output kernel"};
89 Gaudi::Property<std::string>
m_pixelEdmKernelName{
this,
"PixelEDMPrepKernelName",
"",
"Name of the FPGA kernel"};
90 Gaudi::Property<std::string>
m_stripEdmKernelName{
this,
"StripEDMPrepKernelName",
"",
"Name of the FPGA kernel"};
91 Gaudi::Property<std::string>
m_pixelClusterKernelName{
this,
"PixelClusterKernelName",
"",
"Name of the pixel clustering kernel"};
92 Gaudi::Property<std::string>
m_stripClusterKernelName{
this,
"StripClusterKernelName",
"",
"Name of the strip clustering kernel"};
93 Gaudi::Property<std::string>
m_stripL2GKernelName{
this,
"StripL2GKernelName",
"",
"Name of the strip L2G kernel"};
160 std::string
get_cu_name(
const std::string& kernel_name,
int cu);
162 void dumpHexData(std::span<const uint64_t>
data,
const std::string &dataDescriptor,
const EventContext &ctx)
const;
163 void dumpHexData(std::span<const uint32_t>
data,
const std::string &dataDescriptor,
const EventContext &ctx)
const;
char data[hepevt_bytes_allocation_ATLAS]
Gaudi::Property< bool > m_outputTextFile
Whether to run SE or not.
Gaudi::Property< std::string > m_slicingEngineInputName
Gaudi::Property< std::string > m_pixelEdmKernelName
Name of the FPGA kernel.
Gaudi::Property< bool > m_runIO
Whether to run inside out or not.
virtual StatusCode execute(const EventContext &ctx) const override final
Should be overriden by derived classes to perform meaningful work.
SG::ReadHandleKey< int > m_FPGAStripRDOSize
SG::WriteHandleKey< std::vector< uint32_t > > m_FPGAPixelOutput
ToolHandle< FPGADataFormatTool > m_FPGADataFormatTool
Tool for formatting FPGA data.
Gaudi::Property< std::string > m_slicingEngineOutputName
SG::ReadHandleKey< FPGATrackSimHitCollection > m_FPGASlicedHitKey
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGAStripRDO
SG::WriteHandleKey< std::vector< uint64_t > > m_FPGATrackOutput
Gaudi::Property< std::string > m_insideOutOutputName
std::atomic< cl_ulong > m_IO_kernelTime
Time for kernel execution.
Gaudi::Property< std::string > m_stripL2GKernelName
Name of the strip L2G kernelS.
Gaudi::Property< bool > m_runFull150
Whether to run the Full F150 include F100 on hy.
Gaudi::Property< std::string > m_xclbin
Path and name of the xclbin file.
virtual StatusCode finalize() override final
ToolHandle< xAODClusterMaker > m_xaodClusterMaker
Tool for creating xAOD containers.
virtual StatusCode initialize() override final
Detect the OpenCL devices and prepare OpenCL context.
std::atomic< cl_ulong > m_SE_kernelTime
Sum for the average time of the kernel execution.
Gaudi::Property< std::string > m_pixelClusterKernelName
Name of the pixel clustering kernel.
Gaudi::Property< std::string > m_insideOutInputName
std::atomic< ulonglong > m_numEvents
Number of events for the average time of the kernel execution.
ToolHandle< TestVectorTool > m_testVectorTool
Tool for preparing test vectors.
SG::ReadHandleKey< FPGATrackSimTrackCollection > m_FPGATrackKey
SG::ReadHandleKey< FPGATrackSimHitCollection > m_FPGAHitKey
ToolHandle< OutputConversionTool > m_outputConversionTool
Gaudi::Property< bool > m_runIOOnSE
Whether to run inside out on the output of slicing engine.
std::string get_cu_name(const std::string &kernel_name, int cu)
Gaudi::Property< bool > m_runSE
Whether to run SE or not.
xrt::device m_xrt_accelerator
ServiceHandle< IChronoSvc > m_chronoSvc
Service for timing the algorithm.
void dumpHexData(std::span< const uint64_t > data, const std::string &dataDescriptor, const EventContext &ctx) const
SG::WriteHandleKey< std::vector< uint32_t > > m_FPGAStripOutput
Gaudi::Property< std::string > m_stripClusterKernelName
Name of the strip clustering kernel.
SG::ReadHandleKey< int > m_FPGAPixelRDOSize
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGAPixelRDO
Gaudi::Property< std::string > m_stripEdmKernelName
Name of the FPGA kernel.
cl::Event m_slicingEngineInputEndEvent ATLAS_THREAD_SAFE
The base class for the EFTracking FPGA integration development.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
The class for enconding RDO to FPGA format.