Skip to content

Commit 7c194f0

Browse files
committed
[roc-status] Absorb roc-onu-status
1 parent e3b8574 commit 7c194f0

File tree

4 files changed

+63
-114
lines changed

4 files changed

+63
-114
lines changed

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ if(PDA_FOUND)
229229
ProgramFlashRead.cxx
230230
ProgramListCards.cxx
231231
ProgramMetrics.cxx
232-
ProgramOnuStatus.cxx
233232
ProgramPacketMonitor.cxx
234233
ProgramPatternPlayer.cxx
235234
ProgramSiuStatus.cxx
@@ -245,7 +244,6 @@ if(PDA_FOUND)
245244
roc-flash-read
246245
roc-list-cards
247246
roc-metrics
248-
roc-onu-status
249247
roc-pkt-monitor
250248
roc-pat-player
251249
roc-siu-status

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,14 +479,29 @@ metric format for the CRORC and the CRU is different, as different parameters ar
479479
| `tags::Key::ID` | ID of the card |
480480
| `tags::Key::Type` | `tags::Value::CRU` |
481481
482+
###### Metric: `"onu"`
483+
484+
| Value name | Value | Type |
485+
| -------------------| -----------------| ------ |
486+
| `"onuAddress"` | ONU Address | string |
487+
| `"rx40Locked"` | 0/1 (False/True) | int |
488+
| `"phaseGood"` | 0/1 (False/True) | int |
489+
| `"rxLocked"` | 0/1 (False/True) | int |
490+
| `"operational"` | 0/1 (False/True) | int |
491+
| `"mgtTxReady"` | 0/1 (False/True) | int |
492+
| `"mgtRxReady"` | 0/1 (False/True) | int |
493+
| `"mgtTxPllLocked"` | 0/1 (False/True) | int |
494+
| `"mgtRxPllLocked"` | 0/1 (False/True) | int |
495+
496+
482497
###### Metric: `"link"`
483498
484499
| Value name | Value | Type |
485500
| ---------------- | ----------------------------------------------------------------- | ------ |
486501
| `"pciAddress"` | - | string |
487502
| `"gbtMode"` | "GBT/GBT" or "GBT/WB" | string |
488503
| `"loopback"` | 0/1 (Enabled/Disabled) | int |
489-
| `"gbtMux"` | "DDG", "SWT", "TTC:CTP", "TTC:PATTERN", "TTC:MIDTRG", or "TTCUP" | string |
504+
| `"gbtMux"` | "DDG", "SWT", "TTC:CTP", "TTC:PATTERN", "TTC:MIDTRG", or "TTCUP" | string |
490505
| `"datapathMode"` | "PACKET" or "CONTINUOUS" | string |
491506
| `"datapath"` | 0/1 (Disabled/Enabled) | int |
492507
| `"rxFreq"` | - | double |

src/CommandLineUtilities/ProgramOnuStatus.cxx

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

src/CommandLineUtilities/ProgramStatus.cxx

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ class ProgramStatus : public Program
5959
options.add_options()("monitoring",
6060
po::bool_switch(&mOptions.monitoring),
6161
"Toggle monitoring metrics sending");
62+
options.add_options()("onu-status",
63+
po::bool_switch(&mOptions.onu),
64+
"Toggle ONU status output");
6265
}
6366

6467
virtual void run(const boost::program_options::variables_map& map)
@@ -217,7 +220,7 @@ class ProgramStatus : public Program
217220
auto csvLine = ",,,,,,,,,," + clock + "," + offset + "," + userLogic + "," + runStats + "\n";
218221
std::cout << csvLine;
219222
} else {
220-
std::cout << "----------------------------" << std::endl;
223+
std::cout << "-----------------------------" << std::endl;
221224
std::cout << "CRU ID: " << reportInfo.cruId << std::endl;
222225
std::cout << clock << " clock | ";
223226
std::cout << offset << " offset" << std::endl;
@@ -230,9 +233,50 @@ class ProgramStatus : public Program
230233
if (reportInfo.userAndCommonLogicEnabled) {
231234
std::cout << "User and Common logic enabled" << std::endl;
232235
}
233-
std::cout << "----------------------------" << std::endl;
234236
}
235237

238+
/* ONU PARAMETERS */
239+
if (mOptions.onu) {
240+
Cru::OnuStatus onuStatus = cruBar2->reportOnuStatus();
241+
242+
if (mOptions.monitoring) {
243+
monitoring->send(Metric{ "onu" }
244+
.addValue(std::to_string(onuStatus.onuAddress), "onuAddress")
245+
.addValue(onuStatus.rx40Locked, "rx40Locked")
246+
.addValue(onuStatus.phaseGood, "phaseGood")
247+
.addValue(onuStatus.rxLocked, "rxLocked")
248+
.addValue(onuStatus.operational, "operational")
249+
.addValue(onuStatus.mgtTxReady, "mgtTxReady")
250+
.addValue(onuStatus.mgtRxReady, "mgtRxReady")
251+
.addValue(onuStatus.mgtTxPllLocked, "mgtTxPllLocked")
252+
.addValue(onuStatus.mgtRxPllLocked, "mgtRxPllLocked"));
253+
} else if (mOptions.jsonOut) {
254+
root.put("ONU address", onuStatus.onuAddress);
255+
root.put("ONU RX40 locked", onuStatus.rx40Locked);
256+
root.put("ONU phase good", onuStatus.phaseGood);
257+
root.put("ONU RX locked", onuStatus.rxLocked);
258+
root.put("ONU operational", onuStatus.operational);
259+
root.put("ONU MGT TX ready", onuStatus.mgtTxReady);
260+
root.put("ONU MGT RX ready", onuStatus.mgtRxReady);
261+
root.put("ONU MGT TX PLL locked", onuStatus.mgtTxPllLocked);
262+
root.put("ONU MGT RX PLL locked", onuStatus.mgtRxPllLocked);
263+
} else {
264+
std::cout << "=============================" << std::endl;
265+
std::cout << "ONU address: \t\t0x" << std::hex << onuStatus.onuAddress << std::endl;
266+
std::cout << "-----------------------------" << std::endl;
267+
std::cout << "ONU RX40 locked: \t" << std::boolalpha << onuStatus.rx40Locked << std::endl;
268+
std::cout << "ONU phase good: \t" << std::boolalpha << onuStatus.phaseGood << std::endl;
269+
std::cout << "ONU RX locked: \t\t" << std::boolalpha << onuStatus.rxLocked << std::endl;
270+
std::cout << "ONU operational: \t" << std::boolalpha << onuStatus.operational << std::endl;
271+
std::cout << "ONU MGT TX ready: \t" << std::boolalpha << onuStatus.mgtTxReady << std::endl;
272+
std::cout << "ONU MGT RX ready: \t" << std::boolalpha << onuStatus.mgtRxReady << std::endl;
273+
std::cout << "ONU MGT TX PLL locked: \t" << std::boolalpha << onuStatus.mgtTxPllLocked << std::endl;
274+
std::cout << "ONU MGT RX PLL locked: \t" << std::boolalpha << onuStatus.mgtRxPllLocked << std::endl;
275+
}
276+
}
277+
278+
279+
236280
/* PARAMETERS PER LINK */
237281
for (const auto& el : reportInfo.linkMap) {
238282
auto link = el.second;
@@ -333,6 +377,7 @@ class ProgramStatus : public Program
333377
bool jsonOut = false;
334378
bool csvOut = false;
335379
bool monitoring = false;
380+
bool onu = false;
336381
} mOptions;
337382
};
338383

0 commit comments

Comments
 (0)