central-arch/pkg/cpu/cpu.go

29 lines
677 B
Go
Raw Permalink Normal View History

2024-11-01 10:54:59 +00:00
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
}