Skip to content

Commit

Permalink
Revert "Remove move LUTs"
Browse files Browse the repository at this point in the history
This reverts commit 662069c.
  • Loading branch information
bryates committed Dec 7, 2023
1 parent 73c6e6b commit 9d736da
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
4 changes: 2 additions & 2 deletions TrackletAlgorithm/MatchEngineUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ inline void step(const VMStubMECM<VMSMEType> stubmem[4][1<<(kNbitsrzbinMP+kNbits
#endif

inline void set_empty() {
empty_ = emptyUnitBool<MatchEngineUnitBase<VMProjType>::kNBitsBuffer>(readindex_,writeindex_);
empty_ = emptyUnit<MatchEngineUnitBase<VMProjType>::kNBitsBuffer>()[(readindex_,writeindex_)];
}

inline bool empty() const {
Expand All @@ -293,7 +293,7 @@ inline void step(const VMStubMECM<VMSMEType> stubmem[4][1<<(kNbitsrzbinMP+kNbits
}

inline bool nearFull() {
return nearFull3UnitBool<MatchEngineUnitBase<VMProjType>::kNBitsBuffer>(readindex_,writeindex_);
return nearFull3Unit<MatchEngineUnitBase<VMProjType>::kNBitsBuffer>()[(readindex_,writeindex_)];
}

inline bool idle() {
Expand Down
10 changes: 0 additions & 10 deletions TrackletAlgorithm/MatchEngineUnit_parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// each MEU and that come directly from the wiring.
//

/* REPLACED BY bool version
template<int kNBitsBuffer>
static const ap_uint<(1 << (2 * kNBitsBuffer))> nearFullUnit() {
ap_uint<(1 << (2 * kNBitsBuffer))> lut;
Expand All @@ -21,7 +20,6 @@ static const ap_uint<(1 << (2 * kNBitsBuffer))> nearFullUnit() {
}
return lut;
}
*/

template<int kNBitsBuffer>
static bool nearFullUnitBool(ap_uint<kNBitsBuffer> rptr, ap_uint<kNBitsBuffer> wptr) {
Expand All @@ -30,7 +28,6 @@ static bool nearFullUnitBool(ap_uint<kNBitsBuffer> rptr, ap_uint<kNBitsBuffer> w
return wptr1==rptr || wptr2==rptr;
}

/* REPLACED BY bool version
template<int kNBitsBuffer>
static const ap_uint<(1 << (2 * kNBitsBuffer))> nearFull3Unit() {
ap_uint<(1 << (2 * kNBitsBuffer))> lut;
Expand All @@ -47,7 +44,6 @@ static const ap_uint<(1 << (2 * kNBitsBuffer))> nearFull3Unit() {
}
return lut;
}
*/

template<int kNBitsBuffer>
static bool nearFull3UnitBool(ap_uint<kNBitsBuffer> rptr, ap_uint<kNBitsBuffer> wptr) {
Expand All @@ -57,7 +53,6 @@ static bool nearFull3UnitBool(ap_uint<kNBitsBuffer> rptr, ap_uint<kNBitsBuffer>
return wptr1==rptr || wptr2==rptr || wptr3==rptr;
}

/* REPLACED BY bool version
template<int kNBitsBuffer>
static const ap_uint<(1 << (2 * kNBitsBuffer))> nearFull4Unit() {
ap_uint<(1 << (2 * kNBitsBuffer))> lut;
Expand All @@ -75,7 +70,6 @@ static const ap_uint<(1 << (2 * kNBitsBuffer))> nearFull4Unit() {
}
return lut;
}
*/

template<int kNBitsBuffer>
static bool nearFull4UnitBool(ap_uint<kNBitsBuffer> rptr, ap_uint<kNBitsBuffer> wptr) {
Expand All @@ -86,7 +80,6 @@ static bool nearFull4UnitBool(ap_uint<kNBitsBuffer> rptr, ap_uint<kNBitsBuffer>
return wptr1==rptr || wptr2==rptr || wptr3==rptr || wptr4==rptr;
}

/* REPLACED BY bool version
template<int kNBitsBuffer>
static const ap_uint<(1 << (2 * kNBitsBuffer))> emptyUnit() {
ap_uint<(1 << (2 * kNBitsBuffer))> lut;
Expand All @@ -100,7 +93,6 @@ static const ap_uint<(1 << (2 * kNBitsBuffer))> emptyUnit() {
}
return lut;
}
*/

template<int kNBitsBuffer>
static bool emptyUnitBool(ap_uint<kNBitsBuffer> wptr, ap_uint<kNBitsBuffer> rptr) {
Expand Down Expand Up @@ -152,7 +144,6 @@ static const ap_uint<1 << nbits> isLessThanSize() {
return tab;
}

/* REPLACED BY bool version
template<int nbits, int max, bool lessThan, int proj, int stub>
static const ap_uint<1 << 2*nbits> isLessThanSize() {
ap_uint<1 << 2*nbits> tab(0);
Expand All @@ -174,7 +165,6 @@ static const ap_uint<1 << 2*nbits> isLessThanSize() {
}
return tab;
}
*/

template<int nbits, int max, bool lessThan, int proj, int stub>
static bool isLessThanSizeBool(ap_uint<nbits> projphi, ap_uint<nbits> stubphi) {
Expand Down
4 changes: 2 additions & 2 deletions TrackletAlgorithm/MatchProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1302,8 +1302,8 @@ void MatchProcessor(BXType bx,

auto readptr = projbufferarray.getReadPtr();
auto writeptr = projbufferarray.getWritePtr();
bool empty = emptyUnitBool<nPRBAbits>(readptr,writeptr);
bool projBuffNearFull = nearFull3UnitBool<nPRBAbits>(readptr,writeptr);
bool empty = emptyUnit<nPRBAbits>()[(readptr,writeptr)];
bool projBuffNearFull = nearFull3Unit<nPRBAbits>()[(readptr,writeptr)];

ap_uint<3> iphi = 0;

Expand Down
2 changes: 2 additions & 0 deletions TrackletAlgorithm/ProjectionRouterBufferArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ template<int kNBitsBuffer, int VMProjType, int AllProjectionType> class Projecti
ap_uint<kNBitsBuffer> readptr_ = 0;
ap_uint<kNBitsBuffer> writeptr_ = 0;
ProjectionRouterBuffer<VMProjType,AllProjectionType> projbuffer_[1<<kNBitsBuffer];
ap_uint<(1 << (2 * kNBitsBuffer))> nearFullLUT = nearFullUnit<kNBitsBuffer>();
ap_uint<(1 << (2 * kNBitsBuffer))> emptyLUT = emptyUnit<kNBitsBuffer>();

};

Expand Down

0 comments on commit 9d736da

Please sign in to comment.