12.4 CPU Lifecycle

<< Click to Display Table of Contents >>

Navigation:  ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 12 – AlphaCPU Core >

12.4 CPU Lifecycle

12.4.1 Creation

 

AlphaCPUs are created by the ExecutionCoordinator (as CPUWorker instances). The constructor AlphaCPU(cpuId, cBox, parent) performs: CPUId assignment, FaultDispatcher binding (globalFaultDispatcher(cpuId)), subsystem reference injection (ReservationManager, IPIManager, MemoryBarrierCoordinator, TLB manager), IRQPendingState and InterruptRouter creation, all six execution box creation (PalBox, EBox, FBox, MBox, IBox, CBox injection), and Ev6Translator creation. No execution occurs during construction. Pipeline state is not initialized until executeLoop() begins.

 

12.4.2 Startup

 

Execution begins when executeLoop() is called from the CPU's QThread. The first action is injecting boxes into the pipeline: m_alphaPipeline→injectOtherBoxes(m_eBox, m_fBox, m_mBox, m_pBox, m_cBox). The main loop then begins executing instructions.

 

12.4.3 Shutdown

 

AlphaCPU exits its run loop when m_stopRequested becomes true (external shutdown signal), a fatal exception is thrown, or the HALT instruction retires. Shutdown is graceful via shutdownGracefully(): pipeline is flushed, pending events are cleared, halted signal is emitted, and m_running is set to false. Other CPUs continue unless directed otherwise.

 

See Also: 9.3 CPU Instantiation and Identity (ExecutionCoordinator creates CPUWorkers).