pub struct Cpu {
pub parent: Option<Rc<Cpu>>,
pub config: CpuConfiguration,
pub state: CpuState,
pub output: MessageQueue,
/* private fields */
}
Expand description
Cpu is a facade to a virtual processor : register control and instructions_sets, and memory.
Fields§
§parent: Option<Rc<Cpu>>
§config: CpuConfiguration
§state: CpuState
§output: MessageQueue
Implementations§
Source§impl Cpu
impl Cpu
pub fn new(memory: RefCell<Memory>, operation_set: Rc<OperationSet>) -> Self
pub fn fork(self, fork_target: Address) -> (Self, Rc<Self>)
pub fn debug(&self, label: &str, value: String, symbol: String)
pub fn memory(&self) -> RefCell<Memory>
pub fn ram(&self) -> Ref<'_, Memory>
pub fn ram_mut(&self) -> RefMut<'_, Memory>
pub fn stack_push(&mut self, word: Word)
pub fn stack_pop(&mut self) -> Option<Word>
pub fn bank_get(&self, register_id: RegisterId) -> Word
pub fn bank_set(&mut self, register_id: RegisterId, word: Word)
pub fn bank_store( &mut self, register_id: RegisterId, address: Address, ) -> MemoryResult<()>
pub fn bank_load( &mut self, register_id: RegisterId, address: Address, ) -> MemoryResult<()>
pub fn bank_apply( &mut self, target: RegisterId, range: RegisterRange, application: BankApplication, )
pub fn bank_push(&mut self, register_id: RegisterId)
pub fn bank_pop(&mut self, register_id: RegisterId)
pub fn vector_get(&self, register_id: RegisterId) -> Number
pub fn vector_set(&mut self, register_id: RegisterId, number: Number)
pub fn vector_store( &mut self, register_id: RegisterId, address: Address, ) -> MemoryResult<()>
pub fn vector_load( &mut self, register_id: RegisterId, address: Address, ) -> MemoryResult<()>
pub fn vector_apply( &mut self, target: RegisterId, range: RegisterRange, application: VectorApplication, )
pub fn vector_push(&mut self, register_id: RegisterId)
pub fn vector_pop(&mut self, register_id: RegisterId)
pub fn next_instruction(&mut self)
pub fn stack_size(&self) -> usize
pub fn memory_size(&self) -> usize
pub fn current_instruction(&self) -> Instruction
pub fn point_instruction(&mut self, new_address: Address) -> MemoryResult<()>
pub fn decrease_loop_counter(&mut self)
pub fn halt(&mut self)
pub fn tick(&mut self) -> OperationResult<TickState>
pub fn next_instant(&self) -> Instant
pub fn advance(&mut self)
pub fn until_halt(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Cpu
impl !RefUnwindSafe for Cpu
impl !Send for Cpu
impl !Sync for Cpu
impl Unpin for Cpu
impl !UnwindSafe for Cpu
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more