Skip to content

Commit 70c2635

Browse files
committed
[config] Timeframe length set on bar0
1 parent f97fcac commit 70c2635

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

src/CommandLineUtilities/ProgramConfig.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class ProgramConfig : public Program
101101
po::value<uint32_t>(&mOptions.triggerWindowSize),
102102
"The size of the trigger window in GBT words");
103103
options.add_options()("tf-length",
104-
po::value<uint32_t>(&mOptions.timeFrameLength),
104+
po::value<uint32_t>(&mOptions.timeFrameLength)->default_value(0x100),
105105
"Sets the length of the Time Frame");
106106
options.add_options()("no-tf-detection",
107107
po::bool_switch(&mOptions.timeFrameDetectionDisabled),

src/Cru/CruBar.cxx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,13 +1173,21 @@ std::map<int, Cru::LoopbackStats> CruBar::getGbtLoopbackStats(bool reset)
11731173

11741174
uint16_t CruBar::getTimeFrameLength()
11751175
{
1176-
uint32_t timeFrameLength = readRegister(Cru::Registers::TIME_FRAME_LENGTH.index);
1177-
return (uint16_t)Utilities::getBits(timeFrameLength, 12, 20);
1176+
// temporary hack to access the timeframe length register from bar0
1177+
auto params = Parameters::makeParameters(SerialId{ mSerial, mEndpoint }, 0);
1178+
auto bar0 = ChannelFactory().getBar(params);
1179+
1180+
uint32_t timeFrameLength = bar0->readRegister(Cru::Registers::TIME_FRAME_LENGTH.index);
1181+
return (uint16_t)Utilities::getBits(timeFrameLength, 20, 31);
11781182
}
11791183

11801184
void CruBar::setTimeFrameLength(uint16_t timeFrameLength)
11811185
{
1182-
modifyRegister(Cru::Registers::TIME_FRAME_LENGTH.index, 20, 12, timeFrameLength);
1186+
// temporary hack to access the timeframe length register from bar0
1187+
auto params = Parameters::makeParameters(SerialId{ mSerial, mEndpoint }, 0);
1188+
auto bar0 = ChannelFactory().getBar(params);
1189+
1190+
bar0->modifyRegister(Cru::Registers::TIME_FRAME_LENGTH.index, 20, 12, timeFrameLength);
11831191
}
11841192

11851193
} // namespace roc

src/Cru/CruBar.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
#include "ReadoutCard/PatternPlayer.h"
3232
#include "Utilities/Util.h"
3333

34+
// Needed for a temporary hack, to be removed
35+
#include "ReadoutCard/ChannelFactory.h"
36+
3437
namespace o2
3538
{
3639
namespace roc

0 commit comments

Comments
 (0)