Skip to content

Commit e694af9

Browse files
committed
[params] Remove ReadoutMode
1 parent d09f48c commit e694af9

File tree

11 files changed

+9
-187
lines changed

11 files changed

+9
-187
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ add_library(ReadoutCard SHARED
110110
src/ParameterTypes/PciAddress.cxx
111111
src/ParameterTypes/PciSequenceNumber.cxx
112112
src/ParameterTypes/ResetLevel.cxx
113-
src/ParameterTypes/ReadoutMode.cxx
114113
src/Utilities/Hugetlbfs.cxx
115114
src/Utilities/MemoryMaps.cxx
116115
src/Utilities/Numa.cxx

include/ReadoutCard/ParameterTypes/ReadoutMode.h

Lines changed: 0 additions & 44 deletions
This file was deleted.

include/ReadoutCard/Parameters.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "ReadoutCard/ParameterTypes/LoopbackMode.h"
2828
#include "ReadoutCard/ParameterTypes/PciAddress.h"
2929
#include "ReadoutCard/ParameterTypes/PciSequenceNumber.h"
30-
#include "ReadoutCard/ParameterTypes/ReadoutMode.h"
3130
#include "ReadoutCard/ParameterTypes/Hex.h"
3231

3332
// CRU Specific
@@ -90,9 +89,6 @@ class Parameters
9089
/// Type for the generator data size parameter
9190
using GeneratorRandomSizeEnabledType = bool;
9291

93-
/// Type for the readout mode parameter
94-
using ReadoutModeType = ReadoutMode::type;
95-
9692
/// Type for the link mask parameter
9793
using LinkMaskType = std::set<uint32_t>;
9894

@@ -276,14 +272,6 @@ class Parameters
276272
/// \return Reference to this object for chaining calls
277273
auto setBufferParameters(BufferParametersType value) -> Parameters&;
278274

279-
/// Sets the ReadoutMode parameter
280-
///
281-
/// This is a work-in-progress feature. Currently, only the C-RORC is supported in continuous readout mode.
282-
///
283-
/// \param value The value to set
284-
/// \return Reference to this object for chaining calls
285-
auto setReadoutMode(ReadoutModeType value) -> Parameters&;
286-
287275
/// Sets the LinkMask parameter
288276
///
289277
/// The BAR channel may transfer data from multiple links.
@@ -431,10 +419,6 @@ class Parameters
431419
/// \return The value wrapped in an optional if it is present, or an empty optional if it was not
432420
auto getBufferParameters() const -> boost::optional<BufferParametersType>;
433421

434-
/// Gets the ReadoutMode parameter
435-
/// \return The value wrapped in an optional if it is present, or an empty optional if it was not
436-
auto getReadoutMode() const -> boost::optional<ReadoutModeType>;
437-
438422
/// Gets the LinkMask parameter
439423
/// \return The value wrapped in an optional if it is present, or an empty optional if it was not
440424
auto getLinkMask() const -> boost::optional<LinkMaskType>;
@@ -534,11 +518,6 @@ class Parameters
534518
/// \return The value
535519
auto getBufferParametersRequired() const -> BufferParametersType;
536520

537-
/// Gets the ReadoutMode parameter
538-
/// \exception ParameterException The parameter was not present
539-
/// \return The value
540-
auto getReadoutModeRequired() const -> ReadoutModeType;
541-
542521
/// Gets the LinkMask parameter
543522
/// \exception ParameterException The parameter was not present
544523
/// \return The value

src/CommandLineUtilities/ProgramDmaBench.cxx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,6 @@ class ProgramDmaBench : public Program
196196
options.add_options()("random-pause",
197197
po::bool_switch(&mOptions.randomPause),
198198
"Randomly pause readout");
199-
options.add_options()("readout-mode",
200-
po::value<std::string>(&mOptions.readoutModeString),
201-
"Set readout mode [CONTINUOUS]");
202199
options.add_options()("stbrd",
203200
po::bool_switch(&mOptions.stbrd),
204201
"Set the STBRD trigger command for the CRORC");
@@ -266,11 +263,6 @@ class ProgramDmaBench : public Program
266263
mOptions.generatorPattern = GeneratorPattern::fromString(mOptions.generatorPatternString);
267264
}
268265

269-
// Handle readout mode option
270-
if (!mOptions.readoutModeString.empty()) {
271-
mOptions.readoutMode = ReadoutMode::fromString(mOptions.readoutModeString);
272-
}
273-
274266
// Log IOMMU status
275267
getLogger() << "IOMMU " << (AliceO2::Common::Iommu::isEnabled() ? "enabled" : "not enabled") << endm;
276268

@@ -302,10 +294,6 @@ class ProgramDmaBench : public Program
302294
mInfinitePages = (mOptions.maxBytes <= 0);
303295
mMaxPages = mOptions.maxBytes / mPageSize;
304296

305-
if (mOptions.readoutMode) {
306-
params.setReadoutMode(*mOptions.readoutMode);
307-
}
308-
309297
if (!Utilities::isMultiple(mSuperpageSize, mPageSize)) {
310298
throw ParameterException() << ErrorInfo::Message("Superpage size not a multiple of page size");
311299
}
@@ -1126,11 +1114,9 @@ class ProgramDmaBench : public Program
11261114
bool barHammer = false;
11271115
bool noRemovePagesFile = false;
11281116
std::string generatorPatternString;
1129-
std::string readoutModeString;
11301117
std::string fileOutputPathBin;
11311118
std::string fileOutputPathAscii;
11321119
GeneratorPattern::type generatorPattern = GeneratorPattern::Incremental;
1133-
b::optional<ReadoutMode::type> readoutMode;
11341120
std::string links;
11351121
bool generatorEnabled = false;
11361122
bool bufferFullCheck = false;

src/Crorc/Crorc.cxx

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -993,39 +993,6 @@ void Crorc::pushRxFreeFifo(uintptr_t blockAddress, uint32_t blockLength, uint32_
993993
write(Rorc::C_RAFL, (blockLength << 8) | readyFifoIndex);
994994
}
995995

996-
void Crorc::initReadoutContinuous(RegisterReadWriteInterface& bar2)
997-
{
998-
// Based on:
999-
// https://gitlab.cern.ch/costaf/grorc_sw/blob/master/script/grorc_cont_readout.sh
1000-
1001-
// this script works with the G-RORC firmware 3.16
1002-
// SET the card in CONT MODE
1003-
bar2.writeRegister(0x190 / 4, 0x02000000);
1004-
// s_send_wide <= s_reg(0);
1005-
// s_gbt_tx_pol <= s_reg(1);
1006-
// s_gbt_tx_sel <= s_reg(3 downto 2);
1007-
// s_gbt_reset <= s_reg(4);
1008-
// s_rx_encoding <= s_reg(8);
1009-
// s_tx_encoding <= s_reg(9);
1010-
// s_read_gate <= s_reg(12);
1011-
// s_disable_bank <= s_reg(17 downto 16);
1012-
// s_bar_rd_ch(2).reg_194 <= s_reg;
1013-
// Choose only BANK0
1014-
bar2.writeRegister(0x194 / 4, 0x21005);
1015-
// number of GBT words per event
1016-
bar2.writeRegister(0x18c / 4, 0x1f);
1017-
}
1018-
1019-
void Crorc::startReadoutContinuous(RegisterReadWriteInterface& bar2)
1020-
{
1021-
// Based on:
1022-
// https://gitlab.cern.ch/costaf/grorc_sw/blob/master/script/grorc_send_IDLE_SYNC.sh
1023-
1024-
// SET IT AS CUSTOM PATTERN FOR 1 CC and open the GATE READOUT
1025-
bar2.writeRegister(0x198 / 4, 0x60000001);
1026-
bar2.writeRegister(0x198 / 4, 0x0);
1027-
}
1028-
1029996
void Crorc::initReadoutTriggered(RegisterReadWriteInterface&)
1030997
{
1031998
BOOST_THROW_EXCEPTION(std::runtime_error("not implemented"));

src/Crorc/Crorc.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,6 @@ class Crorc
164164

165165
static ScaReadResult scaGpioWrite(RegisterReadWriteInterface& bar2, uint32_t data);
166166

167-
/// Set C-RORC for continuous readout
168-
static void initReadoutContinuous(RegisterReadWriteInterface& bar2);
169-
170-
/// Enable (or re-enable) continuous readout
171-
static void startReadoutContinuous(RegisterReadWriteInterface& bar2);
172-
173167
/// Set C-RORC for triggered readout
174168
static void initReadoutTriggered(RegisterReadWriteInterface& bar2);
175169

src/Crorc/CrorcDmaChannel.cxx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,11 @@ CrorcDmaChannel::CrorcDmaChannel(const Parameters& parameters)
4848
mLoopbackMode(parameters.getGeneratorLoopback().get_value_or(LoopbackMode::Internal)), // Internal loopback by default
4949
mGeneratorEnabled(parameters.getGeneratorEnabled().get_value_or(true)), // Use data generator by default
5050
mGeneratorPattern(parameters.getGeneratorPattern().get_value_or(GeneratorPattern::Incremental)),
51-
mGeneratorMaximumEvents(0), // Infinite events
52-
mGeneratorInitialValue(0), // Start from 0
53-
mGeneratorInitialWord(0), // First word
54-
mGeneratorSeed(mGeneratorPattern == GeneratorPattern::Random ? 1 : 0), // We use a seed for random only
55-
mGeneratorDataSize(parameters.getGeneratorDataSize().get_value_or(mPageSize)), // Can use page size
56-
mUseContinuousReadout(parameters.getReadoutMode().is_initialized() ? parameters.getReadoutModeRequired() == ReadoutMode::Continuous : false)
51+
mGeneratorMaximumEvents(0), // Infinite events
52+
mGeneratorInitialValue(0), // Start from 0
53+
mGeneratorInitialWord(0), // First word
54+
mGeneratorSeed(mGeneratorPattern == GeneratorPattern::Random ? 1 : 0), // We use a seed for random only
55+
mGeneratorDataSize(parameters.getGeneratorDataSize().get_value_or(mPageSize)) // Can use page size
5756
{
5857
// Check that the DMA page is valid
5958
if (mPageSize != DMA_PAGE_SIZE) {
@@ -116,11 +115,6 @@ CrorcDmaChannel::~CrorcDmaChannel()
116115

117116
void CrorcDmaChannel::deviceStartDma()
118117
{
119-
if (mUseContinuousReadout) {
120-
log("Initializing continuous readout");
121-
Crorc::Crorc::initReadoutContinuous(*(getBar()));
122-
}
123-
124118
// Find DIU version, required for armDdl()
125119
mDiuConfig = getCrorc().initDiuVersion();
126120

src/Crorc/CrorcDmaChannel.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,6 @@ class CrorcDmaChannel final : public DmaChannelPdaBase
218218
/// Length of data written to each page
219219
const size_t mGeneratorDataSize;
220220

221-
/// Use continuous readout mode
222-
const bool mUseContinuousReadout;
223-
224221
Crorc::Crorc::DiuConfig mDiuConfig;
225222
};
226223

src/ParameterTypes/ReadoutMode.cxx

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/Parameters.cxx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ namespace roc
3232

3333
/// Variant used for internal storage of parameters
3434
using Variant = boost::variant<size_t, int32_t, bool, Parameters::BufferParametersType, Parameters::CardIdType,
35-
Parameters::GeneratorLoopbackType, Parameters::GeneratorPatternType, Parameters::ReadoutModeType,
36-
Parameters::LinkMaskType, Parameters::AllowRejectionType, Parameters::ClockType, Parameters::CruIdType,
37-
Parameters::DatapathModeType, Parameters::DownstreamDataType, Parameters::GbtModeType, Parameters::GbtMuxType,
38-
Parameters::GbtMuxMapType, Parameters::PonUpstreamEnabledType, Parameters::OnuAddressType>;
35+
Parameters::GeneratorLoopbackType, Parameters::GeneratorPatternType, Parameters::LinkMaskType,
36+
Parameters::AllowRejectionType, Parameters::ClockType, Parameters::CruIdType,
37+
Parameters::DatapathModeType, Parameters::DownstreamDataType, Parameters::GbtModeType,
38+
Parameters::GbtMuxType, Parameters::GbtMuxMapType, Parameters::PonUpstreamEnabledType, Parameters::OnuAddressType>;
3939

4040
using KeyType = const char*;
4141

@@ -123,7 +123,6 @@ _PARAMETER_FUNCTIONS(GeneratorLoopback, "generator_loopback")
123123
_PARAMETER_FUNCTIONS(GeneratorDataSize, "generator_data_size")
124124
_PARAMETER_FUNCTIONS(GeneratorPattern, "generator_pattern")
125125
_PARAMETER_FUNCTIONS(GeneratorRandomSizeEnabled, "generator_random_size_enabled")
126-
_PARAMETER_FUNCTIONS(ReadoutMode, "readout_mode")
127126
_PARAMETER_FUNCTIONS(LinkMask, "link_mask")
128127
_PARAMETER_FUNCTIONS(AllowRejection, "allow_rejection")
129128
_PARAMETER_FUNCTIONS(Clock, "clock")

0 commit comments

Comments
 (0)