Skip to content

Conversation

@lnestor
Copy link
Contributor

@lnestor lnestor commented Oct 20, 2025

This fixes a bug in the tf_mem_bin module that can occur when a value is written on the same clock cycle that sync_nent goes high. This first occurred when testing with in_fpga1_2.txt, where event 19 (the 2nd event in that file) had TPAR_L1L2F and TPAR_L1L2E signals stored at incorrect memory addresses.

The root cause was the valid bin-mask register (validbinmasktmp) was not being completely reset on the first BX transition. Instead, it is possible for one bit to remain set. On a normal BX transition, this is prevented by setting new_bx=true. However, this was not done for the first BX transition, when sync_nent goes high. This fix addresses that issue.

Also included is a script to run the EMP simulation for FPGA1 over all input files and an update to the latency of the FPGA1 payload. This new latency properly aligns the outgoing metadata and data.

This fixes a bug that occurred on the 2nd event if a tf_mem_bin
module is written to the same clock cycle sync_nent goes high. If
this happened, the binmask wouldn't be completely cleared for the
next BX, and TrackletProcessors would then read stale data.

There exists a guard against this for normal BX transitions, however
this guard wasn't used during the very first BX transition (when
sync_nent goes high).
Copy link
Contributor

@aryd aryd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bug fix in tf_mem_bin was a case I had missed earlier. I don't have much input on the other changes.

@mcoshiro
Copy link
Contributor

Looks good to me. I guess we might eventually want to update the sim script to similarly be able to run 9 events at a time for FPGA2 simulation as well, but we can add this functionality later

@mcoshiro mcoshiro mentioned this pull request Nov 3, 2025
@aehart
Copy link
Contributor

aehart commented Nov 18, 2025

Closing, as this PR is contained in #376.

@aehart aehart closed this Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants