Skip to content

Commit

Permalink
Test done: all tests passing!
Browse files Browse the repository at this point in the history
  • Loading branch information
Shachar committed Sep 22, 2023
1 parent 54fab3d commit 6adad79
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions verify_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <unordered_map>
#include <unordered_set>

class TestDone {};

class TestBus : public Bus {
static constexpr size_t StartGraceCycles = 50;

Expand Down Expand Up @@ -87,7 +89,7 @@ class TestBus : public Bus {
if( (address>>8) == 0x02 ) {
switch( address & 0xff ) {
case 0x00:
// Test done
throw TestDone();
break;
case 0x81:
delayed_actions.try_emplace( cycle_num+value-1 ).first->second.emplace(Signals::ReadyOn);
Expand Down Expand Up @@ -187,5 +189,10 @@ int main(int argc, char *argv[]) {

cpu.setReset(true);

cpu.runCpu();
try {
cpu.runCpu();
} catch(TestDone ex) {
}

std::cout<<"Test finished successfully\n";
}

0 comments on commit 6adad79

Please sign in to comment.