Skip to content

Commit f7a4daf

Browse files
authored
Merge pull request #408 from sy-c/master
readoutcard
2 parents dfde2ba + a4ce146 commit f7a4daf

File tree

6 files changed

+43
-29
lines changed

6 files changed

+43
-29
lines changed

README.md

Lines changed: 10 additions & 4 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
@@ -750,7 +755,7 @@ Dependencies
750755
-------------------
751756
### Compatibility
752757
753-
In order to use a CRU the package versions have to adhere to the following table.
758+
In order to use a CRU/CRORC the package versions have to adhere to the following table.
754759
755760
| ReadoutCard | CRU firmware | CRORC firmware | PDA Driver | PDA Library |
756761
| ----------- | --------------- | -------------- | ----------- | ------------ |
@@ -775,6 +780,7 @@ In order to use a CRU the package versions have to adhere to the following table
775780
| v0.34.0 | v3.13.0 | v2.7.0-v2.8.1 | v1.1.0+ | v12.0.0 |
776781
| v0.35.0 | v3.13.0 | v2.9.0-v2.9.1 | v1.1.0+ | v12.0.0 |
777782
| v0.36.0 | v3.13.0/v3.14.0 | v2.9.0-v2.9.1 | v1.1.0+ | v12.0.0 |
783+
| v0.41.0 | v3.13.0/v3.17.1 | v2.9.0-v2.11.0 | v1.1.0+ | v12.0.0 |
778784
779785
The _PDA Driver_ entry refers to the `pda-kadapter-dkms-*.rpm` package which is availabe through the [o2-daq-yum](http://alice-daq-yum-o2.web.cern.ch/alice-daq-yum-o2/cc7_64/) repo as an RPM.
780786

doc/releaseNotes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,7 @@ 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.
42+
- o2-roc-list-cards is able to identify previous versions of the firmware. Their version number is displayed and they are flagged as "old", when not on the compatibility list any more.

include/ReadoutCard/FirmwareChecker.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class FirmwareChecker
4141
void checkFirmwareCompatibilityWrapped(Parameters::CardIdType cardId);
4242
std::string getFirmwareCompatibilityList();
4343
std::unordered_map<std::string, std::string> mCompatibleFirmwareList;
44+
std::unordered_map<std::string, std::string> mOtherFirmwareList;
4445
static constexpr char kFirmwareListFile[] = "json:///etc/o2.d/readoutcard/o2-roc-fw-list.json";
4546
};
4647

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");

src/CommandLineUtilities/ProgramListCards.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ class ProgramListCards : public Program
5656
{
5757
std::ostringstream table;
5858

59-
auto formatHeader = " %-3s %-6s %-10s %-8s %-10s %-5s %-12s %-12s\n";
60-
auto formatRow = " %-3s %-6s %-10s %-8s %-10s %-5s %-12s %-12s\n";
59+
auto formatHeader = " %-3s %-6s %-10s %-8s %-10s %-5s %-15s %-12s\n";
60+
auto formatRow = " %-3s %-6s %-10s %-8s %-10s %-5s %-15s %-12s\n";
6161
auto header = (boost::format(formatHeader) % "#" % "Type" % "PCI Addr" % "Serial" % "Endpoint" % "NUMA" % "FW Version" % "UL Version").str();
6262
auto lineFat = std::string(header.length(), '=') + '\n';
6363
auto lineThin = std::string(header.length(), '-') + '\n';

src/FirmwareChecker.cxx

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,34 @@ FirmwareChecker::FirmwareChecker() : mCompatibleFirmwareList({
3232
{ "82b4662d", "MFT PSU" },
3333
{ "6838510f", "v3.17.0" },
3434
{ "8e74a7f8", "v3.17.1" },
35-
/*{ "6a85d30c", "v3.12.0" },
36-
{ "7be5aa1c", "v3.11.0" },
37-
{ "e4a5a46e", "v3.10.0" },
38-
{ "f71faa86", "v3.9.1" },
39-
{ "8e0d2ffa", "v3.9.0" },
40-
{ "e8e58cff", "v3.8.0" },
41-
{ "f8cecade", "v3.7.0" },
42-
{ "75b96268", "v3.6.1" },
43-
{ "6955404", "v3.6.0" },
44-
{ "d458317e", "v3.5.2" },
45-
{ "6baf11da", "v3.5.1" },*/
4635
/* CRORC */
4736
{ "267f8e5", "v2.9.1" },
4837
{ "cecc295", "v2.9.0" },
4938
{ "221ff280", "v2.10.0" },
5039
{ "cfa0bc9c", "2.10.1" },
5140
{ "2d4c9028", "2.11.0" },
52-
/*{ "59e9955", "v2.8.1" },
41+
})
42+
43+
// second list for older firmware
44+
, mOtherFirmwareList({
45+
/* CRU */
46+
{ "6a85d30c", "v3.12.0" },
47+
{ "7be5aa1c", "v3.11.0" },
48+
{ "e4a5a46e", "v3.10.0" },
49+
{ "f71faa86", "v3.9.1" },
50+
{ "8e0d2ffa", "v3.9.0" },
51+
{ "e8e58cff", "v3.8.0" },
52+
{ "f8cecade", "v3.7.0" },
53+
{ "75b96268", "v3.6.1" },
54+
{ "6955404", "v3.6.0" },
55+
{ "d458317e", "v3.5.2" },
56+
{ "6baf11da", "v3.5.1" },
57+
/* CRORC */
58+
{ "59e9955", "v2.8.1" },
5359
{ "f086417", "v2.8.0" },
54-
{ "474f9e1", "v2.7.0" }
60+
{ "474f9e1", "v2.7.0" },
5561
{ "8e3a98e", "v2.6.1" },
56-
{ "72cdb92", "v2.4.1" }*/
62+
{ "72cdb92", "v2.4.1" }
5763
})
5864
{
5965
std::unordered_map<std::string, std::string> parsedList;
@@ -80,6 +86,8 @@ std::string FirmwareChecker::resolveFirmwareTag(std::string firmware)
8086
//firmware = firmware.substr(firmware.find_last_of("-") + 1);
8187
if (mCompatibleFirmwareList.find(firmware) != mCompatibleFirmwareList.end()) {
8288
return mCompatibleFirmwareList.at(firmware);
89+
} else if (mOtherFirmwareList.find(firmware) != mOtherFirmwareList.end()) {
90+
return mOtherFirmwareList.at(firmware) + " (old)";
8391
} else {
8492
return firmware;
8593
}

0 commit comments

Comments
 (0)