Skip to content

Commit 256ab4c

Browse files
committed
[fw-check] Add roc-fw-check utility
1 parent 7b2a233 commit 256ab4c

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ list(APPEND EXE_SRCS
216216
ProgramCtpEmulator.cxx
217217
ProgramCleanup.cxx
218218
../Example.cxx
219+
ProgramFirmwareCheck.cxx
219220
ProgramFlash.cxx
220221
ProgramFlashRead.cxx
221222
ProgramListCards.cxx
@@ -234,6 +235,7 @@ list(APPEND EXE_NAMES
234235
roc-ctp-emulator
235236
roc-cleanup
236237
roc-example
238+
roc-fw-check
237239
roc-flash
238240
roc-flash-read
239241
roc-list-cards
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
/// \file ProgramFirmwareCheck.cxx
12+
/// \brief Tool that checks the FW compatibility of the ReadoutCards.
13+
///
14+
/// \author Kostas Alexopoulos ([email protected])
15+
16+
#include "CommandLineUtilities/Options.h"
17+
#include "CommandLineUtilities/Program.h"
18+
#include "ReadoutCard/FirmwareChecker.h"
19+
#include "RocPciDevice.h"
20+
21+
using namespace AliceO2::roc::CommandLineUtilities;
22+
using namespace AliceO2::roc;
23+
namespace po = boost::program_options;
24+
25+
class ProgramFirmwareCheck : public Program
26+
{
27+
public:
28+
ProgramFirmwareCheck() : Program()
29+
{
30+
}
31+
32+
virtual Description getDescription()
33+
{
34+
return { "Firmware Check", "Check firmware compatibility of the ReadoutCard(s)",
35+
"roc-fw-check\n" };
36+
}
37+
38+
virtual void addOptions(boost::program_options::options_description&)
39+
{
40+
}
41+
42+
virtual void run(const boost::program_options::variables_map&)
43+
{
44+
auto cardsFound = RocPciDevice::findSystemDevices();
45+
for (auto const& card : cardsFound) {
46+
auto params = Parameters::makeParameters(card.pciAddress, 2);
47+
FirmwareChecker().checkFirmwareCompatibility(params);
48+
}
49+
return;
50+
}
51+
};
52+
53+
int main(int argc, char** argv)
54+
{
55+
return ProgramFirmwareCheck().execute(argc, argv);
56+
}

0 commit comments

Comments
 (0)