18 return StatusCode::SUCCESS;
26 if (
inputFile.find(
".txt") == std::string::npos &&
inputFile.find(
".bin") == std::string::npos)
29 return StatusCode::FAILURE;
36 if (
inputFile.find(
".txt") != std::string::npos)
42 return StatusCode::FAILURE;
46 while (
file >> std::hex >> cache)
48 testVector.push_back(cache);
60 return StatusCode::FAILURE;
64 while (
file.read(
reinterpret_cast<char *
>(&cache),
sizeof(
uint64_t)))
67 cache = __builtin_bswap64(cache);
68 testVector.push_back(cache);
75 return StatusCode::SUCCESS;
82 std::vector<uint64_t>::size_type
size = -1;
84 if (tv_1.size() != tv_2.size())
86 ATH_MSG_WARNING(
"The two test vectors have different sizes: " << tv_1.size() <<
" and " << tv_2.size());
88 size = tv_1.size() < tv_2.size() ? tv_1.size() : tv_2.size();
92 ATH_MSG_DEBUG(
"The two test vectors have the same size: " << tv_1.size());
97 for (std::vector<uint64_t>::size_type
i = 0;
i <
size;
i++)
99 if (tv_1[
i] != tv_2[
i])
101 ATH_MSG_DEBUG(
"The two test vectors are different at index " <<
i);
115 return StatusCode::SUCCESS;
120 ATH_MSG_INFO(
"Comparing the FPGA output to the reference vector for " << tvHolder.
name);
122 std::vector<uint64_t>::size_type
size = -1;
124 if (tvHolder.
refTV.size() != tv_comp.size())
126 ATH_MSG_WARNING(
"The two test vectors have different sizes: " << tvHolder.
refTV.size() <<
" and " << tv_comp.size());
128 size = tvHolder.
refTV.size() < tv_comp.size() ? tvHolder.
refTV.size() : tv_comp.size();
137 for (std::vector<uint64_t>::size_type
i = 0;
i <
size;
i++)
139 if (tvHolder.
refTV[
i] != tv_comp[
i])
141 ATH_MSG_DEBUG(
"The two test vectors are different at index " <<
i);
155 return StatusCode::SUCCESS;