Skip to content

Commit

Permalink
ITS: Adding partial error handling in the verifier
Browse files Browse the repository at this point in the history
This patch adds the support for the following errors:
 - APE_STRIP_START
 - APE_ILLEGAL_CHIPID
 - APE_DET_TIMEOUT
 - APE_OOT
 - APE_PROTOCOL_ERROR
 - APE_LANE_FIFO_OVERFLOW_ERROR
 - APE_FSM_ERROR
 - APE_PENDING_DETECTOR_EVENT_LIMIT
 - APE_PENDING_LANE_EVENT_LIMIT
 - APE_O2N_ERROR
 - APE_RATE_MISSING_TRG_ERROR
  • Loading branch information
Kirill Naumov authored and shahor02 committed Jul 23, 2024
1 parent aa2411a commit b7abf54
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@ class AlpideCoder
case ChipStat::UnknownWord:
case ChipStat::RepeatingPixel:
case ChipStat::WrongRow:
break;
case ChipStat::APE_STRIP_START:
case ChipStat::APE_ILLEGAL_CHIPID:
case ChipStat::APE_DET_TIMEOUT:
Expand All @@ -669,7 +670,24 @@ class AlpideCoder
case ChipStat::APE_PENDING_DETECTOR_EVENT_LIMIT:
case ChipStat::APE_PENDING_LANE_EVENT_LIMIT:
case ChipStat::APE_O2N_ERROR:
case ChipStat::APE_RATE_MISSING_TRG_ERROR:
case ChipStat::APE_RATE_MISSING_TRG_ERROR: {
uint8_t errorByte = ChipStat::getAPEByte((ChipStat::DecErrors)errIdx);
if (dataRaw == errorByte) {
buffer.next(dataRaw); // Skipping error byte
// If we encountered the byte corresponding to the APE error,
// check that the rest of the raw stream consists of only
// padding.
while (buffer.next(dataRaw)) {
if (dataRaw != 0x00) {
break;
}
}
if (buffer.isEmpty()) {
res = VerifierMismatchResult::EXPECTED_MISMATCH;
}
}
break;
}
case ChipStat::APE_PE_DATA_MISSING:
case ChipStat::APE_OOT_DATA_MISSING:
case ChipStat::WrongDColOrder:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ struct ChipStat {
ft = c >= 0xf2 && c <= 0xfe;
return APE_STRIP_START + c - 0xf2;
}

// return APE byte that corresponds to the given APE DecErrors
static uint8_t getAPEByte(DecErrors c)
{
if (c < APE_STRIP_START || c > APE_OOT_DATA_MISSING) {
return 0xFF;
}
return 0xF2 + c - APE_STRIP_START;
}
uint32_t getNErrors() const;
uint32_t addErrors(const ChipPixelData& d, int verbosity);
void print(bool skipNoErr = true, const std::string& pref = "FEEID") const;
Expand Down

0 comments on commit b7abf54

Please sign in to comment.