p14

package
v0.0.0-...-a065128 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const INSN_MASK = uint(1)
View Source
const INSN_WRITE = uint(2)

Variables

This section is empty.

Functions

func Main

func Main(input_path string, verbose bool, args []string) error

Types

type BitInsn

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

type BitMemory

type BitMemory interface {
	Write(address uint64, value uint64, setMask uint64, clrMask uint64)
	Sum() uint64
	Addresses() uint64
}

type BitSystem

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

Bit system.

Can execute simple instructions such as INSN_WRITE and INSN_MASK. The backing Memory decides what to do with the current mask on writes.

func NewBitSystem

func NewBitSystem(memory interface{ BitMemory }) *BitSystem

func (*BitSystem) Exec

func (s *BitSystem) Exec(insn *BitInsn) error

func (*BitSystem) ExecAll

func (s *BitSystem) ExecAll(insns []BitInsn) error

func (*BitSystem) MemorySum

func (s *BitSystem) MemorySum() uint64

func (*BitSystem) SetMask

func (s *BitSystem) SetMask(setMask uint64, clrMask uint64)

func (*BitSystem) Write

func (s *BitSystem) Write(address uint64, value uint64)

type FlatMemory

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

Flat sparse memory.

Writes will mask the value being written.

func NewFlatMemory

func NewFlatMemory() *FlatMemory

func (*FlatMemory) Addresses

func (m *FlatMemory) Addresses() uint64

func (*FlatMemory) Sum

func (m *FlatMemory) Sum() uint64

func (*FlatMemory) Write

func (m *FlatMemory) Write(addr uint64, value uint64, set uint64, clr uint64)

type FloatMemory

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

Floating-address sparse memory.

Writes will mask the address, potentially causing writes to many addresses. The don't-care bits cause the address to assume all possible combinations.

func NewFloatMemory

func NewFloatMemory(maskWidth int) *FloatMemory

func (*FloatMemory) Addresses

func (m *FloatMemory) Addresses() uint64

func (*FloatMemory) Sum

func (m *FloatMemory) Sum() uint64

func (*FloatMemory) Write

func (m *FloatMemory) Write(addr uint64, value uint64, set uint64, clr uint64)

Jump to

Keyboard shortcuts

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