central-arch/pkg/events/events.go

67 lines
913 B
Go
Raw Normal View History

2024-11-01 10:54:59 +00:00
package events
import (
"git.elyanpoujol.fr/elyan/central-arch/pkg/modes"
)
type SimEvent interface{}
type DebugEvent struct {
Msg string
}
func (de *DebugEvent) String() string {
return de.Msg
}
type CpuFetchBeginEvent struct {
Addr uint32
}
type CpuFetchEndEvent struct {
Addr uint32
Value uint32
}
type CpuDecodedEvent struct {
Addr uint32
InstrValue uint32
InstrString string
}
type CpuExecuteEvent struct {
Addr uint32
InstrValue uint32
InstrString string
}
type CpuReadMemoryBeginEvent struct {
Addr uint32
}
type CpuReadMemoryEndEvent struct {
Addr uint32
Value uint32
}
type CpuWriteMemoryBeginEvent struct {
Addr uint32
Value uint32
}
type CpuWriteMemoryEndEvent struct {
Addr uint32
Value uint32
}
type CpuModeTransitionEvent struct {
Prev modes.CpuMode
Next modes.CpuMode
}
// TODO Add more events
type EventLogger interface {
Log(e SimEvent)
}