Skip to content

Add OR_SINGLESHOT_MODE_BITS instruction to CFO compiler#129

Draft
Copilot wants to merge 2 commits intodevelopfrom
copilot/add-orsingleshotmode-bits
Draft

Add OR_SINGLESHOT_MODE_BITS instruction to CFO compiler#129
Copilot wants to merge 2 commits intodevelopfrom
copilot/add-orsingleshotmode-bits

Conversation

Copy link
Contributor

Copilot AI commented Mar 15, 2026

Companion to otsdaq-mu2e#280. Adds OR_SINGLESHOT_MODE_BITS (opcode 111) as a new CFO instruction — a single-shot OR that fires only once in hardware, with identical argument syntax and parameter encoding as OR_MODE_BITS (opcode 103).

Changes

  • CFO_Compiler.hh — new enum value OR_SINGLESHOT_MODE_BITS = 111 in CFO_INSTR
  • CFO_Compiler.cpp
    • Added to OP_to_CODE_TRANSLATION and CODE_to_OP_TRANSLATION maps
    • Added to outer case block in calculateParameterAndErrorCheck() (fall-through with OR_MODE_BITS to share 7-argument parsing)
    • Added to inner switch via fall-through from OR_MODE_BITS (shared encoding logic)
// Outer switch: shares argument validation with OR_MODE_BITS
case CFO_INSTR::OR_MODE_BITS:
case CFO_INSTR::OR_SINGLESHOT_MODE_BITS: {
    // ... 7-arg parsing (start_bit, bit_count, value) ...
    
    // Inner switch: shared calculation
    case CFO_INSTR::OR_MODE_BITS:
    case CFO_INSTR::OR_SINGLESHOT_MODE_BITS:
        value <<= startBit;
        value &= bitmask;
        return value;  // OR / OR (single-shot)
}

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: rrivera747 <107584474+rrivera747@users.noreply.github.com>
Copilot AI changed the title [WIP] [280] Add OR_SINGLESHOT_MODE_BITS for CFO_INSTR Add OR_SINGLESHOT_MODE_BITS instruction to CFO compiler Mar 15, 2026
Copilot AI requested a review from rrivera747 March 15, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants