Struct acs::arch::fast::cpu::Cpu

source · []
pub struct Cpu {
    pub in_m: Signal16,
    pub instruction: Signal16,
    pub reset: Signal,
    pub out_m: Signal16,
    pub write_m: Signal,
    pub address_m: Signal15,
    pub pc: Signal16,
    pub a_register: Register16,
    pub d_register: Register16,
    /* private fields */
}
Expand description

Fast Central Processing Unit able to execute a given instruction and to determine which instruction should be fetched and executed next

Fields

in_m: Signal16instruction: Signal16reset: Signalout_m: Signal16write_m: Signaladdress_m: Signal15pc: Signal16a_register: Register16d_register: Register16

Implementations

Carries out the simulation, taking as input:

  • in_m: data from memory
  • instruction: fetched from ROM
  • reset: whether to set the program counter to zero

It returns the following:

  • write_m: whether to write to memory
  • out_m: data going to memory
  • address_m: memory address
  • pc: program counter

Trait Implementations

Returns the “default value” for a type. Read more
Carries out the tock-phase of a clock cycle: HIGH
Carries out the tick-phase of a clock cycle: LOW
Evaluates the logic expression as we do with arithmetic without advancing the time. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.