Rrivera/add orsingleshotmode bits#132
Merged
rrivera747 merged 13 commits intodevelopfrom Mar 23, 2026
Merged
Conversation
Co-authored-by: rrivera747 <[email protected]>
…DTC does not get the launch, like 25% of the time)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the CFO run-plan toolchain to support a new single-shot mode-bits OR instruction, updates related opcode translation/logging, and adjusts CFO counter register exposure/formatting to align with updated firmware register semantics.
Changes:
- Add
OR_SINGLESHOT_MODE_BITSinstruction support in the CFO compiler (parsing + opcode translation). - Update run-plan validation to tolerate expected readback differences for single-shot mode-bit operations.
- Replace SERDES byte/packet counters with new marker/heartbeat counter registers and add a new
__COUTS__logging macro alias.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| dtcInterfaceLib/otsStyleCoutMacros.h | Adds __COUTS__(LVL) alias for level-based logging. |
| cfoInterfaceLib/CFO_Registers.h | Updates counter register enum entries and adds new counter read/format APIs. |
| cfoInterfaceLib/CFO_Registers.cpp | Implements new counters; modifies run-plan write/verify logging and validation behavior. |
| cfoInterfaceLib/CFO_Compiler.hh | Adds OR_SINGLESHOT_MODE_BITS opcode; changes opcode translation map key type. |
| cfoInterfaceLib/CFO_Compiler.cpp | Adds opcode parsing/translation for new instruction; adjusts logging; updates mode-bit instruction handling. |
Comments suppressed due to low confidence (1)
cfoInterfaceLib/CFO_Compiler.cpp:946
- Same out-of-bounds issue here:
__COUTVS__(2, number[1])is executed even whennumber.size() < 2. Please guard the index or lognumberdirectly to avoid undefined behavior.
else // just try!
{
__COUTVS__(2, number[1]);
if (number.size() > 2 && number[1] == 'x') // assume hex value
tmpValue = (T)strtol(number.c_str(), 0, 16);
else if (number.size() > 1 && number[0] == 'b') // assume binary value
tmpValue = (T)strtol(number.substr(1).c_str(), 0, 2); // skip first 'b' character
else
tmpValue = (T)strtol(number.c_str(), 0, 10);
// __SS__ << "Invalid type '" << StringMacros::demangleTypeName(typeid(retValue).name()) << "' requested for a numeric string. Data was '" << number
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
@rrivera747 I've opened a new pull request, #133, to work on those changes. Once the pull request is ready, I'll request review from you. |
…[1]` Co-authored-by: rrivera747 <[email protected]> Agent-Logs-Url: https://github.com/Mu2e/mu2e-pcie-utils/sessions/91176b2e-cf96-4cf0-9331-3b5323080ce8
Fix out-of-bounds UB in `getNumber`: log full `number` string instead of `number[1]`
eflumerf
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.