Skip to content

Commit

Permalink
Merge pull request #1163 from SpiNNakerManchester/double_monitor_no_f…
Browse files Browse the repository at this point in the history
…ixed

Limit use of advance monitors for loading
  • Loading branch information
Christian-B authored Jul 24, 2024
2 parents a378375 + 314d22e commit 66b5d15
Showing 1 changed file with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ public class FastExecuteDataSpecification extends ExecuteDataSpecification {

private static final int TIMEOUT_RETRY_LIMIT = 100;

/** Cutoff to switch to fast Writer vs plain one.
50 packets of 256 bytes
**/
private static final int MONITOR_CUTOFF = 12800;

/** flag for saying missing all SEQ numbers. */
private static final int FLAG_FOR_MISSING_ALL_SEQUENCES = 0xFFFFFFFE;

Expand Down Expand Up @@ -466,12 +472,17 @@ protected int writeRegion(HasCoreLocation core, ByteBuffer content,
MemoryLocation baseAddress)
throws IOException, ProcessException, InterruptedException {
int written = content.remaining();
try (var recorder = new MissingRecorder()) {
long start = nanoTime();
fastWrite(core, baseAddress, content);
long end = nanoTime();
recorder.report(
if (written < MONITOR_CUTOFF) {
var data = content.duplicate();
txrx.writeMemory(core.getScampCore(), baseAddress, data);
} else {
try (var recorder = new MissingRecorder()) {
long start = nanoTime();
fastWrite(core, baseAddress, content);
long end = nanoTime();
recorder.report(
core, end - start, content.limit(), baseAddress);
}
}
if (SPINNAKER_COMPARE_UPLOAD != null) {
var readBack = txrx.readMemory(
Expand Down

0 comments on commit 66b5d15

Please sign in to comment.