Reduce spurious refreshes in the payload
Reduce spurious refreshes in the payload

Use the least common multiple between the number of rows
and the number of activates that fit in a single refresh interval.
If we put together this many activates and corresponding refreshes, we
should be able to loop them, since the sequence is repeatable without
violating the refresh contract.  This is better than the previous
approach of always refreshing when we cycle back to the first row
in the set.

Example:

(tREFI - rRFC)/(tRAS + tRP) = 116.
tREFW = 64ms = 8192 * tREFI
pick nr_aggressors = 2
So, choose read count of 116*8192 / nr_aggressors = 475136
This should yield ~8192 refreshes and ~64ms of execution time.

$ python hw_rowhammer.py  --nrows 10 --read_count 475136 --pattern 01_per_row --row-pairs const --const-rows-pair 0 2 --payload-executor  --data-inversion 2 0b10  --no-refresh
...
Generating payload:
  tRAS = 5
  tRP = 3
  tREFI = 977
  tRFC = 45
Repeatable unit: 116
Repetitions: 58
  Payload size =  1.84KB / 100.00KB
  Payload per-row toggle count = 475.136K  x2 rows
  Payload refreshes (if enabled) = 8190
  Expected execution time = 7970879 cycles = 63.767 ms

antmicro/litex-rowhammer-tester,antmicro/litex-rowhammer-tester,antmicro/litex-rowhammer-tester