branlwyd / bdcpu16

DCPU-16 simulator based on version 1.7 of the DCPU-16 specification. See http://dcpu.com/.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make hardware cycle-counting

branlwyd opened this issue · comments

All hardware should have cycle-counting functionality, and should be timed against the number of cycles that pass. High-level steps:

  • CPU should track its own clock speed (constant for CPU, set at time of construction, in Hz)
  • Hardware should have standard method to receive a number of cycles that have passed
  • CPU should use this method each time step() is called
  • Existing cycle-counting hardware should be moved over to this functionality
  • CPU should have functionality for running for certain amount of "real time", calculate to cycles

Implemented in 7c42db4.