Skip to content

Commit

Permalink
Fixed errors missed in first pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
aehart committed Dec 6, 2023
1 parent 2e2f5d8 commit e785bf0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
1 change: 0 additions & 1 deletion TestBenches/ProjectionRouter_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ int main()
err += compareMemWithFile<AllProjectionMemory<projMemType> >(allproj, fout_aproj.at(0), ievt, "AllProjection", truncation);

for (unsigned int i = 0; i < vmproj_names.size(); i++) {
const auto &vmproj_name = vmproj_names.at(i);
auto &fout = fout_vmproj.at(i);
string label = "VMProjection " + to_string(i);
err += compareMemWithFile<VMProjectionMemory<vmProjMemType> >
Expand Down
36 changes: 18 additions & 18 deletions TestBenches/TrackBuilder_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@ using namespace std;
#endif

#if SEED_ == L1L2_
constexpr unsigned kNBarrelStubs = 4;
constexpr unsigned kNDiskStubs = 4;
constexpr int kNBarrelStubs = 4;
constexpr int kNDiskStubs = 4;
#elif SEED_ == L2L3_
constexpr unsigned kNBarrelStubs = 3;
constexpr unsigned kNDiskStubs = 4;
constexpr int kNBarrelStubs = 3;
constexpr int kNDiskStubs = 4;
#elif SEED_ == L3L4_
constexpr unsigned kNBarrelStubs = 4;
constexpr unsigned kNDiskStubs = 2;
constexpr int kNBarrelStubs = 4;
constexpr int kNDiskStubs = 2;
#elif SEED_ == L5L6_
constexpr unsigned kNBarrelStubs = 4;
constexpr unsigned kNDiskStubs = 0;
constexpr int kNBarrelStubs = 4;
constexpr int kNDiskStubs = 0;
#elif SEED_ == D1D2_
constexpr unsigned kNBarrelStubs = 2;
constexpr unsigned kNDiskStubs = 3;
constexpr int kNBarrelStubs = 2;
constexpr int kNDiskStubs = 3;
#elif SEED_ == D3D4_
constexpr unsigned kNBarrelStubs = 1;
constexpr unsigned kNDiskStubs = 3;
constexpr int kNBarrelStubs = 1;
constexpr int kNDiskStubs = 3;
#elif SEED_ == L1D1_
constexpr unsigned kNBarrelStubs = 0;
constexpr unsigned kNDiskStubs = 4;
constexpr int kNBarrelStubs = 0;
constexpr int kNDiskStubs = 4;
#elif SEED_ == L2D1_
constexpr unsigned kNBarrelStubs = 1;
constexpr unsigned kNDiskStubs = 3;
constexpr int kNBarrelStubs = 1;
constexpr int kNDiskStubs = 3;
#else
# error "Undefined seed"
#endif
Expand Down Expand Up @@ -138,9 +138,9 @@ int main()
// Clear all output memories before starting.
for (unsigned short i = 0; i < kMaxProc; i++) {
trackWord[i] = TrackFit_t::TrackWord(0);
for (unsigned short j = 0; j < kNBarrelStubs; j++)
for (short j = 0; j < kNBarrelStubs; j++)
barrelStubWords[j][i] = TrackFit_t::BarrelStubWord(0);
for (unsigned short j = 0; j < kNDiskStubs; j++)
for (short j = 0; j < kNDiskStubs; j++)
diskStubWords[j][i] = TrackFit_t::DiskStubWord(0);
}
tracksMem.clear();
Expand Down
6 changes: 3 additions & 3 deletions TrackletAlgorithm/ProjectionRouter.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ void ProjectionRouter(BXType bx,
ap_uint<kNBits_MemAddr> numbersin[nINMEM];
ap_uint<kNBits_MemAddr> mem_read_addr;

PROC_LOOP: for (int istep = 0; istep < kMaxProc - kMaxProcOffset(module::PR); ++istep) {
PROC_LOOP: for (unsigned int istep = 0; istep < kMaxProc - kMaxProcOffset(module::PR); ++istep) {
#pragma HLS PIPELINE II=1 rewind
if (istep == 0) {

// reset output memories & counters
nallproj = 0;
#pragma HLS ARRAY_PARTITION variable=nvmprojout complete dim=0
for (int i=0; i<nOUTMEM; i++) {
for (unsigned int i=0; i<nOUTMEM; i++) {
#pragma HLS unroll
nvmprojout[i] = 0;
}
Expand All @@ -98,7 +98,7 @@ void ProjectionRouter(BXType bx,
// fill the bit mask indicating if memories are empty or not
mem_hasdata = 0;
#pragma HLS ARRAY_PARTITION variable=numbersin complete dim=0
for (int i=0; i<nINMEM; i++) {
for (unsigned int i=0; i<nINMEM; i++) {
#pragma HLS unroll
numbersin[i] = projin[i].getEntries(bx);
if (numbersin[i] > 0) mem_hasdata.set(i);
Expand Down
4 changes: 2 additions & 2 deletions TrackletAlgorithm/TrackletEngineUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class TrackletEngineUnit {
kNBitsRZFine=3,
kNBitsPhiBins=3,
kNBitsNegDiskSize=1,
kNBitsPTLutInner=(Seed==TF::L5L6||Seed==TF::L1D1||Seed==TF::L2D1||Seed==TF::D1D2||Seed==TF::D3D4)?1024:(Seed==TF::L1L2||Seed==TF::L2L3)?256:512,
kNBitsPTLutOuter=(Seed==TF::L5L6||Seed==TF::L1D1||Seed==TF::L2D1||Seed==TF::D1D2||Seed==TF::D3D4)?1024:(Seed==TF::L1L2||Seed==TF::L2L3||Seed==TF::L3L4)?256:512
kNBitsPTLutInner=(Seed==TF::L5L6||Seed==TF::L1D1||Seed==TF::L2D1||Seed==TF::D1D2||Seed==TF::D3D4)?1024:(Seed==TF::L1L2||Seed==TF::L2L3||Seed==TF::L3L4)?256:512,
kNBitsPTLutOuter=(Seed==TF::L5L6||Seed==TF::L1D1||Seed==TF::L2D1||Seed==TF::D1D2||Seed==TF::D3D4)?1024:(Seed==TF::L1L2||Seed==TF::L2L3)?256:512
};

typedef ap_uint<VMStubTEOuter<VMSTEType>::kVMSTEOIDSize+kNBits_MemAddr+AllStub<innerRegion>::kAllStubSize> STUBID;
Expand Down

0 comments on commit e785bf0

Please sign in to comment.