From eaa87c094189be9d005aa6e9bff3ca1a77724461 Mon Sep 17 00:00:00 2001 From: mlarson Date: Mon, 18 Dec 2023 20:57:16 +0100 Subject: [PATCH 01/10] Reverting changes to unsigned variables causing future SW CI crash --- TrackletAlgorithm/TrackBuilder.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/TrackletAlgorithm/TrackBuilder.h b/TrackletAlgorithm/TrackBuilder.h index 795da904bce..1efe45acb34 100644 --- a/TrackletAlgorithm/TrackBuilder.h +++ b/TrackletAlgorithm/TrackBuilder.h @@ -158,7 +158,7 @@ void TrackBuilder( // object. ap_uint<3> nMatches = 0; // there can be up to eight matches (3 bits) - barrel_stub_association : for (unsigned short j = 0; j < NBarrelStubs; j++) { + barrel_stub_association : for (short j = 0; j < NBarrelStubs; j++) { const unsigned nFM = (j == 0 ? NFMPerStubBarrel0 : NFMPerStubBarrel); const unsigned nFMCumulative = (j == 0 ? 0 : (j == 1 ? NFMPerStubBarrel0 : NFMPerStubBarrel0 + (j - 1) * NFMPerStubBarrel)); @@ -227,10 +227,10 @@ void TrackBuilder( } } - disk_stub_association : for (unsigned short j = 0; j < NDiskStubs; j++) { + disk_stub_association : for (short j = 0; j < NDiskStubs; j++) { ap_uint<1> disk_stub_valid = false; - disk_stub_valid : for (unsigned short k = 0; k < NFMPerStubDisk; k++) + disk_stub_valid : for (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 (unsigned short j = 0 ; j < NBarrelStubs; j++) { + barrel_stub_words: for (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 (unsigned short j = 0 ; j < NDiskStubs; j++) { + disk_stub_words: for (short j = 0 ; j < NDiskStubs; j++) { switch (j) { case 0: diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); From 2777aa061e6c550b71c3c82c7f9573bababee1b3 Mon Sep 17 00:00:00 2001 From: mlarson02 <123397857+mlarson02@users.noreply.github.com> Date: Mon, 18 Dec 2023 19:02:00 -0500 Subject: [PATCH 02/10] Temporarily casting unsigned values to signed to prevent compilation error --- TrackletAlgorithm/TrackBuilder.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/TrackletAlgorithm/TrackBuilder.h b/TrackletAlgorithm/TrackBuilder.h index 1efe45acb34..82eaafc00d2 100644 --- a/TrackletAlgorithm/TrackBuilder.h +++ b/TrackletAlgorithm/TrackBuilder.h @@ -158,7 +158,7 @@ void TrackBuilder( // object. ap_uint<3> 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 (short j = 0; j < int(NBarrelStubs); j++) { // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values const unsigned nFM = (j == 0 ? NFMPerStubBarrel0 : NFMPerStubBarrel); const unsigned nFMCumulative = (j == 0 ? 0 : (j == 1 ? NFMPerStubBarrel0 : NFMPerStubBarrel0 + (j - 1) * NFMPerStubBarrel)); @@ -227,10 +227,10 @@ void TrackBuilder( } } - disk_stub_association : for (short j = 0; j < NDiskStubs; j++) { + disk_stub_association : for (short j = 0; j < int(NDiskStubs); j++) { // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values ap_uint<1> disk_stub_valid = false; - disk_stub_valid : for (short k = 0; k < NFMPerStubDisk; k++) + disk_stub_valid : for (short k = 0; k < int(NFMPerStubDisk); k++) // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values 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 (short j = 0 ; j < int(NBarrelStubs); j++) { // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values 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 (short j = 0 ; j < int(NDiskStubs); j++) { // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values switch (j) { case 0: diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); From f5c736c44eeb7ae6c0153aaf1ebca8f7b9bcb746 Mon Sep 17 00:00:00 2001 From: mlarson02 <123397857+mlarson02@users.noreply.github.com> Date: Mon, 18 Dec 2023 22:06:01 -0500 Subject: [PATCH 03/10] Recast to unsigned to fix CI crash --- TrackletAlgorithm/TrackBuilder.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/TrackletAlgorithm/TrackBuilder.h b/TrackletAlgorithm/TrackBuilder.h index 82eaafc00d2..c285452152e 100644 --- a/TrackletAlgorithm/TrackBuilder.h +++ b/TrackletAlgorithm/TrackBuilder.h @@ -227,10 +227,10 @@ void TrackBuilder( } } - disk_stub_association : for (short j = 0; j < int(NDiskStubs); j++) { // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values + disk_stub_association : for (short j = 0; j < int(NDiskStubs); j++) { // casting NDiskStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values ap_uint<1> disk_stub_valid = false; - disk_stub_valid : for (short k = 0; k < int(NFMPerStubDisk); k++) // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values + disk_stub_valid : for (short k = 0; k < int(NFMPerStubDisk); k++) // casting NFMPerStubDisk as signed for loop to prevent compilation error due to comparing signed and unsigned values disk_stub_valid = (disk_stub_valid || disk_valid[j * NFMPerStubDisk + k]); nMatches += (disk_stub_valid ? 1 : 0); @@ -295,32 +295,32 @@ void TrackBuilder( barrel_stub_words: for (short j = 0 ; j < int(NBarrelStubs); j++) { // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values switch (j) { case 0: - barrelStubWords[j][nTracks] = track.template getStubValid<0>() ? track.template getBarrelStubWord<0>() : typename TrackFit::BarrelStubWord(0); + barrelStubWords[j][nTracks] = track.template getStubValid<0>() ? track.template getBarrelStubWord<0>() : typename TrackFit::BarrelStubWord(0); break; case 1: - barrelStubWords[j][nTracks] = track.template getStubValid<1>() ? track.template getBarrelStubWord<1>() : typename TrackFit::BarrelStubWord(0); + barrelStubWords[j][nTracks] = track.template getStubValid<1>() ? track.template getBarrelStubWord<1>() : typename TrackFit::BarrelStubWord(0); break; case 2: - barrelStubWords[j][nTracks] = track.template getStubValid<2>() ? track.template getBarrelStubWord<2>() : typename TrackFit::BarrelStubWord(0); + barrelStubWords[j][nTracks] = track.template getStubValid<2>() ? track.template getBarrelStubWord<2>() : typename TrackFit::BarrelStubWord(0); break; case 3: - barrelStubWords[j][nTracks] = track.template getStubValid<3>() ? track.template getBarrelStubWord<3>() : typename TrackFit::BarrelStubWord(0); + barrelStubWords[j][nTracks] = track.template getStubValid<3>() ? track.template getBarrelStubWord<3>() : typename TrackFit::BarrelStubWord(0); break; } } - disk_stub_words: for (short j = 0 ; j < int(NDiskStubs); j++) { // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values + disk_stub_words: for (short j = 0 ; j < int(NDiskStubs); j++) { // casting NDiskStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values switch (j) { case 0: - diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); + diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); break; case 1: - diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); + diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); break; case 2: - diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); + diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); break; case 3: - diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); + diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); break; } } From a458822828580cdd419217b1ab9a78dca9bbf44c Mon Sep 17 00:00:00 2001 From: Andrew Hart Date: Tue, 19 Dec 2023 07:50:14 -0500 Subject: [PATCH 04/10] Revert "Recast to unsigned to fix CI crash" This reverts commit f5c736c44eeb7ae6c0153aaf1ebca8f7b9bcb746. --- TrackletAlgorithm/TrackBuilder.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/TrackletAlgorithm/TrackBuilder.h b/TrackletAlgorithm/TrackBuilder.h index c285452152e..82eaafc00d2 100644 --- a/TrackletAlgorithm/TrackBuilder.h +++ b/TrackletAlgorithm/TrackBuilder.h @@ -227,10 +227,10 @@ void TrackBuilder( } } - disk_stub_association : for (short j = 0; j < int(NDiskStubs); j++) { // casting NDiskStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values + disk_stub_association : for (short j = 0; j < int(NDiskStubs); j++) { // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values ap_uint<1> disk_stub_valid = false; - disk_stub_valid : for (short k = 0; k < int(NFMPerStubDisk); k++) // casting NFMPerStubDisk as signed for loop to prevent compilation error due to comparing signed and unsigned values + disk_stub_valid : for (short k = 0; k < int(NFMPerStubDisk); k++) // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values disk_stub_valid = (disk_stub_valid || disk_valid[j * NFMPerStubDisk + k]); nMatches += (disk_stub_valid ? 1 : 0); @@ -295,32 +295,32 @@ void TrackBuilder( barrel_stub_words: for (short j = 0 ; j < int(NBarrelStubs); j++) { // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values switch (j) { case 0: - barrelStubWords[j][nTracks] = track.template getStubValid<0>() ? track.template getBarrelStubWord<0>() : typename TrackFit::BarrelStubWord(0); + barrelStubWords[j][nTracks] = track.template getStubValid<0>() ? track.template getBarrelStubWord<0>() : typename TrackFit::BarrelStubWord(0); break; case 1: - barrelStubWords[j][nTracks] = track.template getStubValid<1>() ? track.template getBarrelStubWord<1>() : typename TrackFit::BarrelStubWord(0); + barrelStubWords[j][nTracks] = track.template getStubValid<1>() ? track.template getBarrelStubWord<1>() : typename TrackFit::BarrelStubWord(0); break; case 2: - barrelStubWords[j][nTracks] = track.template getStubValid<2>() ? track.template getBarrelStubWord<2>() : typename TrackFit::BarrelStubWord(0); + barrelStubWords[j][nTracks] = track.template getStubValid<2>() ? track.template getBarrelStubWord<2>() : typename TrackFit::BarrelStubWord(0); break; case 3: - barrelStubWords[j][nTracks] = track.template getStubValid<3>() ? track.template getBarrelStubWord<3>() : typename TrackFit::BarrelStubWord(0); + barrelStubWords[j][nTracks] = track.template getStubValid<3>() ? track.template getBarrelStubWord<3>() : typename TrackFit::BarrelStubWord(0); break; } } - disk_stub_words: for (short j = 0 ; j < int(NDiskStubs); j++) { // casting NDiskStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values + disk_stub_words: for (short j = 0 ; j < int(NDiskStubs); j++) { // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values switch (j) { case 0: - diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); + diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); break; case 1: - diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); + diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); break; case 2: - diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); + diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); break; case 3: - diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); + diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); break; } } From 6113cad39306a11c53d896e0d6ead52949eeb265 Mon Sep 17 00:00:00 2001 From: Andrew Hart Date: Tue, 19 Dec 2023 07:50:18 -0500 Subject: [PATCH 05/10] Revert "Temporarily casting unsigned values to signed to prevent compilation error" This reverts commit 2777aa061e6c550b71c3c82c7f9573bababee1b3. --- TrackletAlgorithm/TrackBuilder.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/TrackletAlgorithm/TrackBuilder.h b/TrackletAlgorithm/TrackBuilder.h index 82eaafc00d2..1efe45acb34 100644 --- a/TrackletAlgorithm/TrackBuilder.h +++ b/TrackletAlgorithm/TrackBuilder.h @@ -158,7 +158,7 @@ void TrackBuilder( // object. ap_uint<3> nMatches = 0; // there can be up to eight matches (3 bits) - barrel_stub_association : for (short j = 0; j < int(NBarrelStubs); j++) { // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values + barrel_stub_association : for (short j = 0; j < NBarrelStubs; j++) { const unsigned nFM = (j == 0 ? NFMPerStubBarrel0 : NFMPerStubBarrel); const unsigned nFMCumulative = (j == 0 ? 0 : (j == 1 ? NFMPerStubBarrel0 : NFMPerStubBarrel0 + (j - 1) * NFMPerStubBarrel)); @@ -227,10 +227,10 @@ void TrackBuilder( } } - disk_stub_association : for (short j = 0; j < int(NDiskStubs); j++) { // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values + disk_stub_association : for (short j = 0; j < NDiskStubs; j++) { ap_uint<1> disk_stub_valid = false; - disk_stub_valid : for (short k = 0; k < int(NFMPerStubDisk); k++) // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values + disk_stub_valid : for (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 < int(NBarrelStubs); j++) { // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values + barrel_stub_words: for (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 < int(NDiskStubs); j++) { // casting NBarrelStubs as signed for loop to prevent compilation error due to comparing signed and unsigned values + disk_stub_words: for (short j = 0 ; j < NDiskStubs; j++) { switch (j) { case 0: diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); From 8cf136a5e9b516d1453996e3a49aed46b01a173c Mon Sep 17 00:00:00 2001 From: Andrew Hart Date: Tue, 19 Dec 2023 07:40:19 -0500 Subject: [PATCH 06/10] Made template parameters signed. --- TrackletAlgorithm/TrackBuilder.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/TrackletAlgorithm/TrackBuilder.h b/TrackletAlgorithm/TrackBuilder.h index 1efe45acb34..fc70a99cd40 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 unsigned NFMBarrel = NFMPerStubBarrel0 + (NBarrelStubs - 1) * NFMPerStubBarrel; - constexpr unsigned NFMDisk = NDiskStubs * NFMPerStubDisk; + constexpr int NFMBarrel = NFMPerStubBarrel0 + (NBarrelStubs - 1) * NFMPerStubBarrel; + constexpr int NFMDisk = NDiskStubs * NFMPerStubDisk; // Circular buffers for each of the input full-match memories. FullMatch barrel_fm[NFMBarrel][1< barrel_stub_valid = false; - barrel_stub_valid : for (unsigned short k = 0; k < nFM; k++) + barrel_stub_valid : for (short k = 0; k < nFM; k++) barrel_stub_valid = (barrel_stub_valid || barrel_valid[nFMCumulative + k]); nMatches += (barrel_stub_valid ? 1 : 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 (unsigned short j = 0; j < NFMBarrel; j++) { + barrel_circular_buffer_update : for (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 (unsigned short j = 0; j < NFMDisk; j++) { + disk_circular_buffer_update : for (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]); From 51a8ec1e89db55fefd65d8cdc360166b4c2d305f Mon Sep 17 00:00:00 2001 From: mlarson02 <123397857+mlarson02@users.noreply.github.com> Date: Tue, 19 Dec 2023 17:21:15 -0500 Subject: [PATCH 07/10] static cast NDiskStubs to int --- TrackletAlgorithm/TrackBuilder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TrackletAlgorithm/TrackBuilder.h b/TrackletAlgorithm/TrackBuilder.h index fc70a99cd40..f582e84bb1b 100644 --- a/TrackletAlgorithm/TrackBuilder.h +++ b/TrackletAlgorithm/TrackBuilder.h @@ -308,7 +308,7 @@ void TrackBuilder( break; } } - disk_stub_words: for (short j = 0 ; j < NDiskStubs; j++) { + disk_stub_words: for (short j = 0 ; j < static_cast(NDiskStubs); j++) { switch (j) { case 0: diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); From 6980d5cb0e3c08082fac3f9758591f6ac50516bf Mon Sep 17 00:00:00 2001 From: Andrew Hart Date: Wed, 20 Dec 2023 09:24:25 -0500 Subject: [PATCH 08/10] Revert "static cast NDiskStubs to int" This reverts commit 51a8ec1e89db55fefd65d8cdc360166b4c2d305f. --- TrackletAlgorithm/TrackBuilder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TrackletAlgorithm/TrackBuilder.h b/TrackletAlgorithm/TrackBuilder.h index f582e84bb1b..fc70a99cd40 100644 --- a/TrackletAlgorithm/TrackBuilder.h +++ b/TrackletAlgorithm/TrackBuilder.h @@ -308,7 +308,7 @@ void TrackBuilder( break; } } - disk_stub_words: for (short j = 0 ; j < static_cast(NDiskStubs); j++) { + disk_stub_words: for (short j = 0 ; j < NDiskStubs; j++) { switch (j) { case 0: diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); From b817a2bd39ebfd0377ed95fd5f0aca6aefa59710 Mon Sep 17 00:00:00 2001 From: Andrew Hart Date: Wed, 20 Dec 2023 09:22:28 -0500 Subject: [PATCH 09/10] Added checks to allow C-synthesis when parameters are zero. --- TrackletAlgorithm/TrackBuilder.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TrackletAlgorithm/TrackBuilder.h b/TrackletAlgorithm/TrackBuilder.h index fc70a99cd40..9a06c4ddce7 100644 --- a/TrackletAlgorithm/TrackBuilder.h +++ b/TrackletAlgorithm/TrackBuilder.h @@ -68,14 +68,14 @@ void TrackBuilder( #pragma HLS array_partition variable=barrel_write_index complete dim=0 #pragma HLS array_partition variable=disk_write_index complete dim=0 - initialize_barrel_indices : for (short i = 0; i < NFMBarrel; i++) { + initialize_barrel_indices : for (short i = 0; NFMBarrel > 0 && i < NFMBarrel; i++) { #pragma HLS unroll barrel_mem_index[i] = 0; barrel_read_index[i] = 0; barrel_write_index[i] = 0; } - initialize_disk_indices : for (short i = 0; i < NFMDisk; i++) { + initialize_disk_indices : for (short i = 0; NFMDisk > 0 && i < NFMDisk; i++) { #pragma HLS unroll disk_mem_index[i] = 0; disk_read_index[i] = 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 (short j = 0 ; NBarrelStubs > 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 (short j = 0 ; NDiskStubs > 0 && j < NDiskStubs; j++) { switch (j) { case 0: diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0); From 1c2383c680f06e17cbd423d1883425a3091d8d55 Mon Sep 17 00:00:00 2001 From: mlarson02 <123397857+mlarson02@users.noreply.github.com> Date: Wed, 20 Dec 2023 15:48:30 -0600 Subject: [PATCH 10/10] Adding comments explaining weird added logic --- TrackletAlgorithm/TrackBuilder.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/TrackletAlgorithm/TrackBuilder.h b/TrackletAlgorithm/TrackBuilder.h index 9a06c4ddce7..515cca132d2 100644 --- a/TrackletAlgorithm/TrackBuilder.h +++ b/TrackletAlgorithm/TrackBuilder.h @@ -68,14 +68,14 @@ void TrackBuilder( #pragma HLS array_partition variable=barrel_write_index complete dim=0 #pragma HLS array_partition variable=disk_write_index complete dim=0 - initialize_barrel_indices : for (short i = 0; NFMBarrel > 0 && i < NFMBarrel; i++) { + initialize_barrel_indices : for (short i = 0; NFMBarrel > 0 && i < NFMBarrel; i++) { // Note: need to have NFMBarrel > 0 to prevent compilation error due to -Werror=type-limits flag in CMSSW #pragma HLS unroll barrel_mem_index[i] = 0; barrel_read_index[i] = 0; barrel_write_index[i] = 0; } - initialize_disk_indices : for (short i = 0; NFMDisk > 0 && i < NFMDisk; i++) { + initialize_disk_indices : for (short i = 0; NFMDisk > 0 && i < NFMDisk; i++) { // Note: need to have NFMDisk > 0 to prevent compilation error due to -Werror=type-limits flag in CMSSW #pragma HLS unroll disk_mem_index[i] = 0; disk_read_index[i] = 0; @@ -96,7 +96,7 @@ void TrackBuilder( // First determine the minimum tracklet ID from the current set of full // matches. - barrel_min_id : for (short j = 0; j < NFMBarrel; j++) { + barrel_min_id : for (short j = 0; j < NFMBarrel; j++) { const auto &barrel_stub_0 = barrel_fm[j][barrel_read_index[j]]; const auto &barrel_id_0 = barrel_stub_0.getTrackletID(); @@ -292,7 +292,7 @@ void TrackBuilder( // object that was constructed. if (track.getTrackValid()) { trackWord[nTracks] = track.getTrackWord(); - barrel_stub_words: for (short j = 0 ; NBarrelStubs > 0 && j < NBarrelStubs; j++) { + barrel_stub_words: for (short j = 0 ; NBarrelStubs > 0 && j < NBarrelStubs; j++) { // Note: need to have NBarrelStubs > 0 to prevent compilation error due to -Werror=type-limits flag in CMSSW 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 ; NDiskStubs > 0 && j < NDiskStubs; j++) { + disk_stub_words: for (short j = 0 ; NDiskStubs > 0 && j < NDiskStubs; j++) { // Note: need to have NDiskStubs > 0 to prevent compilation error due to -Werror=type-limits flag in CMSSW switch (j) { case 0: diskStubWords[j][nTracks] = track.template getStubValid() ? track.template getDiskStubWord() : typename TrackFit::DiskStubWord(0);