29 lines
677 B
Go
29 lines
677 B
Go
package cpu
|
|
|
|
import (
|
|
"git.elyanpoujol.fr/elyan/central-arch/pkg/events"
|
|
"git.elyanpoujol.fr/elyan/central-arch/pkg/memory"
|
|
"git.elyanpoujol.fr/elyan/central-arch/pkg/simcontext"
|
|
"git.elyanpoujol.fr/elyan/central-arch/pkg/simstate"
|
|
"git.elyanpoujol.fr/elyan/central-arch/pkg/simstep"
|
|
)
|
|
|
|
type Cpu struct {
|
|
state simstate.CpuState
|
|
stepper simstep.SimStepper
|
|
eventLogger events.EventLogger
|
|
memory memory.Memory
|
|
}
|
|
|
|
func New(context simcontext.SimContext, memory memory.Memory) *Cpu {
|
|
return &Cpu{
|
|
stepper: context.Stepper,
|
|
eventLogger: context.EventLogger,
|
|
memory: memory,
|
|
}
|
|
}
|
|
|
|
func (c *Cpu) State() *simstate.CpuState {
|
|
return &c.state
|
|
}
|