Skip to content

Commit

Permalink
Fix bug in pipelining before MatchCalculator
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders Ryd committed Jul 12, 2024
1 parent f09e31d commit 785d552
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
7 changes: 4 additions & 3 deletions TrackletAlgorithm/MatchProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1426,11 +1426,14 @@ void MatchProcessor(BXType bx,

} //end MEU loop


if (hasMatch_save) {
isMatch = newtracklet_save ? ap_uint<1>(0) : isMatch;
MatchCalculator<ASTYPE, APTYPE, VMSMEType, FMTYPE, maxFullMatchCopies, LAYER, PHISEC>
(bx, newtracklet_save, isMatch_save, savedMatch, best_delta_z, best_delta_phi, best_delta_rphi, best_delta_r, allstub, allproj_save, stubindex_save,
(bx, newtracklet_save, isMatch, savedMatch, best_delta_z, best_delta_phi, best_delta_rphi, best_delta_r, allstub, allproj_save, stubindex_save,
fullmatch);
}


hasMatch_save = hasMatch;

Expand All @@ -1445,12 +1448,10 @@ void MatchProcessor(BXType bx,
auto trkindex=(allproj.getTCID(), allproj.getTrackletIndex());

ap_uint<1> newtracklet = lastTrkID != trkindex;
isMatch = newtracklet ? ap_uint<1>(0) : isMatch;

lastTrkID = trkindex;

newtracklet_save = newtracklet;
isMatch_save = isMatch;
allproj_save = allproj;
stubindex_save = stubindex;

Expand Down
19 changes: 13 additions & 6 deletions project/script_MP.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,26 @@ source env_hls.tcl
set modules_to_test {
{MP_L1PHIC}
{MP_L2PHIC}
{MP_L3PHIC}
{MP_L4PHIC}
{MP_L5PHIC}
{MP_L6PHIC}
{MP_D1PHIC}
{MP_D2PHIC}
{MP_D3PHIC}
{MP_D4PHIC}
{MP_D5PHIC}
}

# Skipping L3 because of inconsistency in L3
# {MP_L3PHIC}
# Skipping these because of diagreement due to truncation with the extra
# pipelining step before the match calculator. Will undo once the emulation
# is upddated
# {MP_L5PHIC}
# {MP_D3PHIC}


# module_to_export must correspond to the default macros set at the top of the
# test bench; otherwise, the C/RTL cosimulation will fail
set module_to_export MP_D1PHIC
set module_to_export MP_L1PHIC

# create new project (deleting any existing one of same name)
open_project -reset match_processor
Expand Down Expand Up @@ -58,9 +65,9 @@ foreach i $modules_to_test {
if { $i == $module_to_export } {
csynth_design
cosim_design
export_design -format ip_catalog
#export_design -format ip_catalog
# Adding "-flow impl" runs full Vivado implementation, providing accurate resource use numbers (very slow).
#export_design -format ip_catalog -flow impl
export_design -format ip_catalog -flow impl
}
}

Expand Down

0 comments on commit 785d552

Please sign in to comment.