data

package
v0.0.0-...-cf2a200 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(width int, buf []byte, write func(int, uint64)) int

Types

type AddrOffset

type AddrOffset struct {
	Offset  int
	Handler BusHandler
}

AddrOffset is a BusHandler that subtracts Offset from the address before passing it off to a sub-handler

func (*AddrOffset) HandleBus

func (off *AddrOffset) HandleBus(bus Bus) Bus

type Bus

type Bus uint64

func (Bus) Ack

func (b Bus) Ack() bool

func (Bus) Address

func (b Bus) Address() int

func (Bus) Data

func (b Bus) Data() int

func (Bus) SetAck

func (b Bus) SetAck(v bool) Bus

func (Bus) SetAddress

func (b Bus) SetAddress(v int) Bus

func (Bus) SetData

func (b Bus) SetData(v int) Bus

func (Bus) SetWE

func (b Bus) SetWE(v bool) Bus

func (Bus) WE

func (b Bus) WE() bool

type BusHandler

type BusHandler interface {
	HandleBus(bus Bus) Bus
}

BusHandler handles a bus transaction

type BusHandlerFunc

type BusHandlerFunc func(bus Bus) Bus

BusHandlerFunc implements BusHandler with a func

var StdoutWriter BusHandlerFunc = stdoutWriter

func (BusHandlerFunc) HandleBus

func (fn BusHandlerFunc) HandleBus(bus Bus) Bus

type Device

type Device struct {
	Addr, Size int
	Handler    BusHandler
}

Device is a memory mapped device

type MemMap

type MemMap []Device

MemMap is a BusHandler for a list of Devices

func (MemMap) HandleBus

func (mm MemMap) HandleBus(bus Bus) Bus

type Memory

type Memory struct {
	// contains filtered or unexported fields
}

func NewMemory

func NewMemory(addrBits int) *Memory

func (*Memory) Clear

func (mem *Memory) Clear(address int, len int)

func (*Memory) HandleBus

func (mem *Memory) HandleBus(bus Bus) Bus

func (*Memory) Load

func (mem *Memory) Load(address int, buf []byte) int

func (*Memory) Read

func (mem *Memory) Read(address int) uint16

func (*Memory) Write

func (mem *Memory) Write(address int, data uint16)

func (*Memory) WriteField

func (mem *Memory) WriteField(address, bits, shift int, data uint16)

type ROM

type ROM struct {
	*Memory
}

ROM ignores (but acks) writes but handles reads

func (*ROM) HandleBus

func (rom *ROM) HandleBus(bus Bus) Bus

type ShadowMem

type ShadowMem struct {
	*Memory
}

ShadowMem writes to a memory but does not ack the request, expecting another memory to do that.

func (*ShadowMem) HandleBus

func (mem *ShadowMem) HandleBus(bus Bus) Bus

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL