Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed disk bits #299

Merged
merged 3 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions TrackletAlgorithm/MatchEngineUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ inline void step(const VMStubMECM<VMSMEType> stubmem[4][1<<(kNbitsrzbinMP+kNbits

constexpr bool isDisk = LAYER > TF::L6;

constexpr unsigned int kNBitBin = !isDisk ? 3 : 4;
constexpr auto kNBitBinPS = 3;
constexpr auto kNBitBin2S = 4;
const unsigned int kNBitBin = isPSStub ? kNBitBinPS : kNBitBin2S;
constexpr unsigned int kRInvSteps = 32;
constexpr unsigned int kRInvBits = BITS_TO_REPRESENT(kRInvSteps - 1);

Expand All @@ -242,10 +244,9 @@ inline void step(const VMStubMECM<VMSMEType> stubmem[4][1<<(kNbitsrzbinMP+kNbits

//here we always use the larger number of bits for the bend
// Check if stub bend and proj rinv consistent
auto const index_part1 = (VMProjType == DISK && isPSseed____) ? projrinv____.concat(stubbendReduced) : projrinv____.concat(stubbend);
auto const index_part2 = ((VMProjType == DISK && isPSseed____) ? (1 << (kRInvBits + kNBitBin)) : 0);
const ap_int<1> diskps = isDisk && isPSStub;
auto const index = diskps ? (diskps,projrinv____,stubbendReduced) : (diskps,projrinv____,stubbend);
ap_uint<kNBitBin2S+kRInvBits+1> diskps = isDisk && isPSStub;
ap_uint<kRInvBits+kNBitBin2S> projrinv_long = projrinv____;
const ap_uint<1+kNBitBin2S+kRInvBits> index = (diskps << (kNBitBin2S + kRInvBits)) + (projrinv_long << kNBitBin) + (diskps ? ap_uint<kNBitBin2S>(stubbendReduced) : ap_uint<kNBitBin2S>(stubbend));

//Check if stub bend and proj rinv consistent
projseqs_[writeindex_] = projseq____;
Expand Down
2 changes: 1 addition & 1 deletion TrackletAlgorithm/MatchProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ void MatchProcessor(BXType bx,
constexpr regionType APTYPE = TF::layerDiskType[LAYER];

//Initialize table for bend-rinv consistency
ap_uint<1> table[kNMatchEngines][(LAYER<TF::L4)?256:512]; //FIXME Need to figure out how to replace 256 with meaningful const.
ap_uint<1> table[kNMatchEngines][LAYER<TF::D1 ? (LAYER<TF::L4 ? 256 : 512) : 768]; //FIXME Need to figure out how to replace 256 with meaningful const.
//Use of dim=0 seems to have small improvement on timing - not sure why
#pragma HLS ARRAY_PARTITION variable=table dim=0 complete
readtable: for(int iMEU = 0; iMEU < kNMatchEngines; ++iMEU) {
Expand Down
4 changes: 2 additions & 2 deletions emData/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ memprints_url_reduced="https://cernbox.cern.ch/remote.php/dav/public-files/4jZdh
luts_url_reduced="https://cernbox.cern.ch/remote.php/dav/public-files/mcGz25JNu19Oqzm/LUTs.tar.gz"
# Combined modules
# Updated files from Jason for TP disk with extra sign bit for disks in AllInnerStubs memories. This is in cmssw PR #230
memprints_url_cm="https://aryd.web.cern.ch/aryd/MemPrintsCM_230822.tgz"
luts_url_cm="https://cernbox.cern.ch/remote.php/dav/public-files/uoKcrxMXtjVHagL/LUTs.tar.gz"
memprints_url_cm="https://cernbox.cern.ch/remote.php/dav/public-files/Gfv0lbIVWBdFsoa/MemPrints_10242023.tar.gz"
luts_url_cm="https://cernbox.cern.ch/remote.php/dav/public-files/CfDiIlwterSBOSZ/LUTs.tar.gz"
# Reduced Combined modules
memprints_url_reducedcm="https://cernbox.cern.ch/remote.php/dav/public-files/g0EIkgWgie5mBob/MemPrints.tar.gz"
luts_url_reducedcm="https://cernbox.cern.ch/remote.php/dav/public-files/HT8q7fk4UvhpdPK/LUTs.tar.gz"
Expand Down