From 36c4134a26063248a2ef47f5ac8defe50d9476b1 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Wed, 9 Dec 2020 00:51:13 +0200 Subject: refactor: central interrupt handling #38 --- demo/src/execute.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'demo') diff --git a/demo/src/execute.ts b/demo/src/execute.ts index 40cc996..3a065d1 100644 --- a/demo/src/execute.ts +++ b/demo/src/execute.ts @@ -54,6 +54,7 @@ export class AVRRunner { this.timer1.tick(); this.timer2.tick(); this.usart.tick(); + this.cpu.tick(); } callback(this.cpu); -- cgit v1.2.3 From 9c1288f18889ae3bd10869a9f6ebc53defa3024b Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Wed, 9 Dec 2020 15:46:53 +0200 Subject: perf!: centeral timekeeping This should improve performance, especially when running simulations with multiple peripherals. For instance, the demo project now runs at ~322%, up from ~185% in AVR8js 0.13.1. BREAKING CHANGE: `tick()` methods were removed from individual peripherals. You now need to call `cpu.tick()` instead. --- demo/src/execute.ts | 4 ---- 1 file changed, 4 deletions(-) (limited to 'demo') diff --git a/demo/src/execute.ts b/demo/src/execute.ts index 3a065d1..5d5c6b4 100644 --- a/demo/src/execute.ts +++ b/demo/src/execute.ts @@ -50,10 +50,6 @@ export class AVRRunner { const cyclesToRun = this.cpu.cycles + this.workUnitCycles; while (this.cpu.cycles < cyclesToRun) { avrInstruction(this.cpu); - this.timer0.tick(); - this.timer1.tick(); - this.timer2.tick(); - this.usart.tick(); this.cpu.tick(); } -- cgit v1.2.3