diff --git a/TrackletAlgorithm/TrackBuilder.h b/TrackletAlgorithm/TrackBuilder.h index fc70a99cd40..795da904bce 100644 --- a/TrackletAlgorithm/TrackBuilder.h +++ b/TrackletAlgorithm/TrackBuilder.h @@ -32,7 +32,7 @@ getFM(const BXType bx, const FullMatchMemory &fullMatches, const uns } // TrackBuilder top template function -template +template void TrackBuilder( const BXType bx, const TrackletParameterMemory trackletParameters[], @@ -45,8 +45,8 @@ void TrackBuilder( ) { - constexpr int NFMBarrel = NFMPerStubBarrel0 + (NBarrelStubs - 1) * NFMPerStubBarrel; - constexpr int NFMDisk = NDiskStubs * NFMPerStubDisk; + constexpr unsigned NFMBarrel = NFMPerStubBarrel0 + (NBarrelStubs - 1) * NFMPerStubBarrel; + constexpr unsigned NFMDisk = NDiskStubs * NFMPerStubDisk; // Circular buffers for each of the input full-match memories. FullMatch barrel_fm[NFMBarrel][1< nMatches = 0; // there can be up to eight matches (3 bits) - barrel_stub_association : for (short j = 0; j < NBarrelStubs; j++) { + barrel_stub_association : for (unsigned short j = 0; j < NBarrelStubs; j++) { - const int nFM = (j == 0 ? NFMPerStubBarrel0 : NFMPerStubBarrel); + const unsigned nFM = (j == 0 ? NFMPerStubBarrel0 : NFMPerStubBarrel); const unsigned nFMCumulative = (j == 0 ? 0 : (j == 1 ? NFMPerStubBarrel0 : NFMPerStubBarrel0 + (j - 1) * NFMPerStubBarrel)); ap_uint<1> barrel_stub_valid = false; - barrel_stub_valid : for (short k = 0; k < nFM; k++) + barrel_stub_valid : for (unsigned short k = 0; k < nFM; k++) barrel_stub_valid = (barrel_stub_valid || barrel_valid[nFMCumulative + k]); nMatches += (barrel_stub_valid ? 1 : 0); @@ -227,10 +227,10 @@ void TrackBuilder( } } - disk_stub_association : for (short j = 0; j < NDiskStubs; j++) { + disk_stub_association : for (unsigned short j = 0; j < NDiskStubs; j++) { ap_uint<1> disk_stub_valid = false; - disk_stub_valid : for (short k = 0; k < NFMPerStubDisk; k++) + disk_stub_valid : for (unsigned short k = 0; k < NFMPerStubDisk; k++) disk_stub_valid = (disk_stub_valid || disk_valid[j * NFMPerStubDisk + k]); nMatches += (disk_stub_valid ? 1 : 0); @@ -292,7 +292,7 @@ void TrackBuilder( // object that was constructed. if (track.getTrackValid()) { trackWord[nTracks] = track.getTrackWord(); - barrel_stub_words: for (short j = 0 ; j < NBarrelStubs; j++) { + barrel_stub_words: for (unsigned short j = 0 ; j < NBarrelStubs; j++) { switch (j) { case 0: barrelStubWords[j][nTracks] = track.template getStubValid<0>() ? track.template getBarrelStubWord<0>() : typename TrackFit::BarrelStubWord(0); @@ -308,7 +308,7 @@ void TrackBuilder( break; } } - disk_stub_words: for (short j = 0 ; j < NDiskStubs; j++) { + disk_stub_words: for (unsigned short j = 0 ; j < NDiskStubs; j++) { switch (j) { case 0: diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); @@ -329,7 +329,7 @@ void TrackBuilder( // Update the circular buffer indices and read a new element from each of // the input full-match memories. - barrel_circular_buffer_update : for (short j = 0; j < NFMBarrel; j++) { + barrel_circular_buffer_update : for (unsigned short j = 0; j < NFMBarrel; j++) { barrel_read_index[j] += (barrel_valid[j] ? 1 : 0); const ap_uint barrel_next_write_index = barrel_write_index[j] + 1; const ap_uint<1> barrel_not_full = (barrel_next_write_index != barrel_read_index[j]); @@ -338,7 +338,7 @@ void TrackBuilder( barrel_write_index[j] += ((empty || barrel_not_full) ? 1 : 0); } - disk_circular_buffer_update : for (short j = 0; j < NFMDisk; j++) { + disk_circular_buffer_update : for (unsigned short j = 0; j < NFMDisk; j++) { disk_read_index[j] += (disk_valid[j] ? 1 : 0); const ap_uint disk_next_write_index = disk_write_index[j] + 1; const ap_uint<1> disk_not_full = (disk_next_write_index != disk_read_index[j]);