Skip to content

Commit c54ce6e

Browse files
committed
handling crorcId in config file
1 parent dfde2ba commit c54ce6e

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ The `Data Source` parameter for the CRU DMA Channel should be used as follows:
171171

172172
Card Configurator
173173
-------------------
174-
The `CardConfigurator` class offers an interface to configure the Readout Card (_currently only implemented for the CRU_). In
175-
order to configure the CRU one has to create a `CardConfigurator` object. The constructor can either be called with a list of
174+
The `CardConfigurator` class offers an interface to configure the Readout Card. In
175+
order to configure the CRU or CRORC, one has to create a `CardConfigurator` object. The constructor can either be called with a list of
176176
parameters, or a path to a configuration file, specifying these parameters.
177177

178-
### Parameters
178+
### CRU Parameters
179179

180180
The `CardConfigurator` utilizes the `Parameters` class, the same class where Parameters are specified for DMA channels. For the
181181
Card Configurator, the parameters need to be initialized for the card on BAR2. The command that
@@ -244,6 +244,11 @@ Likewise for `OnuAddress`, passing the int is enough.
244244
params.setOnuAddress(42)
245245
```
246246

247+
### CRORC Parameters
248+
249+
The CRORC parameters which can be defined from configuration file are: `crorcId`, `dynamicOffset`, `timeframeLength`.
250+
251+
247252
### Configuration File
248253

249254
The string containing the path to the configuration file has to start with "file:", otherwise the

doc/releaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ This file describes the main feature changes for released versions of ReadoutCar
3636

3737
## v0.42.1 - 06/03/2023
3838
- Fixed bug with roc-config JSON: crorc-id wrongly set in "cru" section. Now named crorcId and to be set under "crorc" section.
39+
40+
## next version
41+
- Fix for crorId field in configuration file.

src/CardConfigurator.cxx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ void CardConfigurator::parseConfigUriCrorc(std::string configUri, Parameters& pa
8686
{
8787
bool dynamicOffset = false;
8888
uint16_t timeFrameLength = 0x100;
89+
uint16_t crorcId = 0x0;
8990

9091
std::unique_ptr<o2::configuration::ConfigurationInterface> conf;
9192
try {
@@ -104,10 +105,13 @@ void CardConfigurator::parseConfigUriCrorc(std::string configUri, Parameters& pa
104105
if (group == "crorc") { // Configure the CRORC
105106
dynamicOffset = subtree.get<bool>("dynamicOffset");
106107
timeFrameLength = subtree.get<int>("timeFrameLength");
108+
std::string parsedString = subtree.get<std::string>("crorcId");
109+
crorcId = Hex::fromString(parsedString);
107110
}
108111

109112
parameters.setDynamicOffsetEnabled(dynamicOffset);
110113
parameters.setTimeFrameLength(timeFrameLength);
114+
parameters.setCrorcId(crorcId);
111115
}
112116
} catch (...) {
113117
BOOST_THROW_EXCEPTION(ParseException() << ErrorInfo::ConfigParse(group));
@@ -129,7 +133,6 @@ void CardConfigurator::parseConfigUriCru(std::string configUri, Parameters& para
129133
bool dynamicOffset = false;
130134
uint32_t onuAddress = 0x0;
131135
uint16_t cruId = 0x0;
132-
uint16_t crorcId = 0x0;
133136
GbtMode::type gbtMode = GbtMode::type::Gbt;
134137
DownstreamData::type downstreamData = DownstreamData::type::Ctp;
135138
uint32_t triggerWindowSize = 1000;
@@ -213,14 +216,6 @@ void CardConfigurator::parseConfigUriCru(std::string configUri, Parameters& para
213216
parameters.setUserAndCommonLogicEnabled(userAndCommonLogicEnabled);
214217
parameters.setSystemId(systemId);
215218
parameters.setTimeFrameLength(timeFrameLength);
216-
217-
} else if (group == "crorc") {
218-
219-
parsedString = subtree.get<std::string>("crorcId");
220-
crorcId = Hex::fromString(parsedString);
221-
222-
parameters.setCrorcId(crorcId);
223-
224219
} else if (group == "links") { // Configure all links with default values
225220

226221
enabled = subtree.get<bool>("enabled");

0 commit comments

Comments
 (0)