Skip to content

Commit

Permalink
Merge pull request #188 from ycorrales/master
Browse files Browse the repository at this point in the history
ycm enable assert in mvtx decoding
  • Loading branch information
mpurschke authored Sep 3, 2024
2 parents ee6c6bd + 85d6c79 commit 50379b8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
30 changes: 15 additions & 15 deletions newbasic/mvtx_decoder/GBTLink.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ inline GBTLink::CollectedDataStatus GBTLink::collectROFCableData(/*const Mapping
{
log_error << "Wrong dataOffset value " << dataOffset << " at the start of a HBF" << std::endl;
decoder_error_vector.push_back(std::make_pair(-1,2));
//assert(false);
assert(false);
return CollectedDataStatus::AbortedOnError;
}
statistics.clear();
Expand All @@ -347,7 +347,7 @@ inline GBTLink::CollectedDataStatus GBTLink::collectROFCableData(/*const Mapping
{
log_error << "Previous event was already completed" << std::endl;
decoder_error_vector.push_back(std::make_pair(-1,3));
//assert(false);
assert(false);
return CollectedDataStatus::AbortedOnError;
}
}
Expand Down Expand Up @@ -387,7 +387,7 @@ inline GBTLink::CollectedDataStatus GBTLink::collectROFCableData(/*const Mapping
log_error << "Expected all active lanes for links, but " << gbtWord.activeLanes << "found in HBF " << hbfEntry << ", " \
<< gbtWord.asString().data() << std::endl;
decoder_error_vector.push_back(std::make_pair(-1,5));
//assert(false);
assert(false);
return CollectedDataStatus::AbortedOnError;
}
}
Expand Down Expand Up @@ -436,7 +436,7 @@ inline GBTLink::CollectedDataStatus GBTLink::collectROFCableData(/*const Mapping
log_error << "TDT packet done before TDH no continuation " << n_no_continuation \
<< " != " << n_packet_done << std::endl;
decoder_error_vector.push_back(std::make_pair(-1,6));
//assert(false);
assert(false);
return CollectedDataStatus::AbortedOnError;
}
}
Expand All @@ -452,7 +452,7 @@ inline GBTLink::CollectedDataStatus GBTLink::collectROFCableData(/*const Mapping
{
log_error << "" << std::endl;
decoder_error_vector.push_back(std::make_pair(-1,7));
//assert(false);
assert(false);
return CollectedDataStatus::AbortedOnError;
}
}
Expand All @@ -469,7 +469,7 @@ inline GBTLink::CollectedDataStatus GBTLink::collectROFCableData(/*const Mapping
{
log_error << "Trigger header not found before chip data" << std::endl;
decoder_error_vector.push_back(std::make_pair(-1,8));
//assert(false);
assert(false);
return CollectedDataStatus::AbortedOnError;
}
auto lane = ( gbtWord.data8[9] & 0x1F ) % 3;
Expand Down Expand Up @@ -511,7 +511,7 @@ inline int GBTLink::decode_lane( const uint8_t chipId, PayLoadCont& buffer)
{
log_error << "chip data is too short: " << buffer.getSize() << std::endl;
decoder_error_vector.push_back(std::make_pair(static_cast<int>(chipId),9));
//assert(false);
assert(false);
return -1;
}

Expand Down Expand Up @@ -559,7 +559,7 @@ inline int GBTLink::decode_lane( const uint8_t chipId, PayLoadCont& buffer)
{
log_error << "Error laneId " << laneId << " (" << (dataC & 0xF) << ") and chipId " << chipId << std::endl;
decoder_error_vector.push_back(std::make_pair(static_cast<int>(chipId),24));
//assert(false);
assert(false);
return -1;
}
buffer.next(bc);
Expand All @@ -575,7 +575,7 @@ inline int GBTLink::decode_lane( const uint8_t chipId, PayLoadCont& buffer)
{
log_error << "No data short would fit (at least a data short after region header!)" << std::endl;
decoder_error_vector.push_back(std::make_pair(static_cast<int>(chipId),25));
//assert(false);
assert(false);
return -1;
}
// TODO: move first region header out of loop, asserting its existence
Expand All @@ -586,14 +586,14 @@ inline int GBTLink::decode_lane( const uint8_t chipId, PayLoadCont& buffer)
if( buffer.isEmpty() )
{
log_error << "data short do not fit" << std::endl;
//assert(false);
assert(false);
return -1;
}
if ( reg == 0xFF )
{
log_error << "data short at " << buffer.getOffset() << " before region header" << std::endl;
decoder_error_vector.push_back(std::make_pair(static_cast<int>(chipId),26));
//assert(false);
assert(false);
return -1;
}
dataS = (dataC << 8);
Expand All @@ -607,14 +607,14 @@ inline int GBTLink::decode_lane( const uint8_t chipId, PayLoadCont& buffer)
{
log_error << "No data long would fit (at least a data short after region header!)" << std::endl;
decoder_error_vector.push_back(std::make_pair(static_cast<int>(chipId),27));
//assert(false);
assert(false);
return -1;
}
if ( reg == 0xFF )
{
log_error << "data short at " << buffer.getOffset() << " before region header" << std::endl;
decoder_error_vector.push_back(std::make_pair(static_cast<int>(chipId),28));
//assert(false);
assert(false);
return -1;
}
buffer.next(dataS);
Expand All @@ -625,7 +625,7 @@ inline int GBTLink::decode_lane( const uint8_t chipId, PayLoadCont& buffer)
{
log_error << "Wrong bit before DATA LONG bit map" << std::endl;
decoder_error_vector.push_back(std::make_pair(static_cast<int>(chipId),29));
//assert(false);
assert(false);
return -1;
}
while( hit_map != 0x00 )
Expand Down Expand Up @@ -662,7 +662,7 @@ inline int GBTLink::decode_lane( const uint8_t chipId, PayLoadCont& buffer)
{
log_error << "Error laneId " << laneId << " (" << (dataC & 0xF) << ") and chipId " << chipId << std::endl;
decoder_error_vector.push_back(std::make_pair(static_cast<int>(chipId),23));
//assert(false);
assert(false);
return -1;
}
buffer.next(bc);
Expand Down
8 changes: 4 additions & 4 deletions newbasic/oncsSub_idmvtxv3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ int oncsSub_idmvtxv3::iValue(const int i_feeid, const int idx, const char *what)
if (mFeeId2LinkID.find(feeId) == mFeeId2LinkID.cend())
{
log_error << "FeeId " << feeId << " was not found in the feeId mapping for this packet" << std::endl;
//assert(false);
assert(false);
return -1;
}
uint32_t lnkId = mFeeId2LinkID[feeId].entry;
Expand Down Expand Up @@ -300,7 +300,7 @@ int oncsSub_idmvtxv3::iValue(const int i_feeid, const int i_trg, const int i_hit
if (mFeeId2LinkID.find(feeId) == mFeeId2LinkID.cend())
{
log_error << "FeeId " << feeId << "was not found in the feeId mapping for this packet" << std::endl;
//assert(false);
assert(false);
return -1;
}
uint32_t lnkId = mFeeId2LinkID[feeId].entry;
Expand Down Expand Up @@ -345,7 +345,7 @@ long long int oncsSub_idmvtxv3::lValue(const int i_feeid, const char *what)
if (mFeeId2LinkID.find(feeId) == mFeeId2LinkID.cend())
{
log_error << "FeeId " << feeId << "was not found in the feeId mapping for this packet" << std::endl;
//assert(false);
assert(false);
return -1;
}
uint32_t lnkId = mFeeId2LinkID[feeId].entry;
Expand Down Expand Up @@ -381,7 +381,7 @@ long long int oncsSub_idmvtxv3::lValue(const int i_feeid, const int idx, const c
if (mFeeId2LinkID.find(feeId) == mFeeId2LinkID.cend())
{
log_error << "FeeId " << feeId << "was not found in the feeId mapping for this packet" << std::endl;
//assert(false);
assert(false);
return -1;
}
uint32_t lnkId = mFeeId2LinkID[feeId].entry;
Expand Down

0 comments on commit 50379b8

Please sign in to comment.