67 lines
913 B
Go
67 lines
913 B
Go
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)
|
|
}
|