ram, instr reel, runtime, etc
This commit is contained in:
73
src/spider/runtime/Runtime.hpp
Normal file
73
src/spider/runtime/Runtime.hpp
Normal file
@@ -0,0 +1,73 @@
|
||||
#pragma once
|
||||
|
||||
#include <spider/runtime/cpu/CPU.hpp>
|
||||
#include <spider/runtime/memory/RAM.hpp>
|
||||
|
||||
namespace spider {
|
||||
|
||||
/**
|
||||
* The main runtime class.
|
||||
* This is where the Spider VM (Runtime) lives
|
||||
*/
|
||||
class Runtime {
|
||||
private:
|
||||
|
||||
CPU cpu;
|
||||
RAM ram;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Creates a new runtime, with no memory.
|
||||
*/
|
||||
Runtime();
|
||||
|
||||
/**
|
||||
* Creates a new runtime, with a specific
|
||||
* amount of memory.
|
||||
*/
|
||||
Runtime(u64 ramSize);
|
||||
|
||||
/**
|
||||
* Runtime Destructor.
|
||||
*/
|
||||
~Runtime();
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Steps the clock of the VM once.
|
||||
*/
|
||||
void step();
|
||||
|
||||
/**
|
||||
* Steps n-times the clock of the VM.
|
||||
*/
|
||||
void step(u64 n);
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Sets the machine to run continously.
|
||||
* If interrupts occur, they will be handled
|
||||
* automatically.
|
||||
*/
|
||||
void run();
|
||||
|
||||
/**
|
||||
* Runs this machine for a set amount of
|
||||
* milliseconds.
|
||||
*/
|
||||
void run(u64 ms);
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Resizes the ram, which will preserve
|
||||
* data inside the next length.
|
||||
*/
|
||||
void resizeRAM(u64 length);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user