vemulator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package vemulator provides objects for bulding a RISC-V emulator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicCore

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

BasicCore executes instructions from memory and updates its own state.

func NewBasicCores

func NewBasicCores(coreCnt int, xlen riscv.Xlen, initPC uint64, mem memory.Mem) []*BasicCore

NewBasicCores returns a list of cores representing execution of the same processor.

func (*BasicCore) String

func (b *BasicCore) String() string

String returns the current state of the module.

func (*BasicCore) Tick

func (b *BasicCore) Tick() (execRsp protocol.ExecRsp, err error)

Tick increments core state by one cycle.

type Builder

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

Builder can be used to set emulation parameters beyond their defaults.

func (Builder) Build

func (b Builder) Build() *Vemulator

Build generates a Vemulator using the builder's values.

func (Builder) WithCoreCount

func (b Builder) WithCoreCount(cnt int) Builder

WithCoreCount defines the numbers of cores to emulate.

func (Builder) WithElf

func (b Builder) WithElf(path string) Builder

WithElf defines the path to the file to be emulated.

func (Builder) WithLog

func (b Builder) WithLog(log bool) Builder

WithLog decides whether the emulator will generate an register value log.

func (Builder) WithMemCap

func (b Builder) WithMemCap(capacity uint64) Builder

WithMemCap defines the memory capacity.

func (Builder) WithXlen

func (b Builder) WithXlen(xlen riscv.Xlen) Builder

WithXlen specifies the Xlen of the simulation.

type Logable

type Logable interface {
	String() string
}

Logable is a struct that prints its current state as a string.

type Vemulator

type Vemulator struct {
	Logger *baseLog
	// contains filtered or unexported fields
}

Vemulator is the parent class containing the architectural state described by the RISC-V spec.

func (*Vemulator) Run

func (v *Vemulator) Run() (rv int, err error)

Run starts the emulator.

Jump to

Keyboard shortcuts

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