LEON4

@Leon4 Reference

Properties

Name Type Description

Class

*void

Class object

Component

*void

Pointer to component object if part of component

LoggingFlags

uint64_t

Flags for logging info

Name

*char

Object name

TimeSource

*void

Time source object

Commands

Name Description

delete

Dispose instance of @Leon4

new

Create new instance of Leon4

Command new Arguments

Name Type Required Description

cpuid

int

no

cpuid in multiprocessor config

cputype

string

no

CPU type (none, ngmp, gr740)

freq

double

no

frequency in Hz

name

string

yes

Name of object to create

Leon4 Reference

Properties

Name Type Description

CPUId

uint32_t

CPUType

int32_t

Class

*void

Class object

Component

*void

Pointer to component object if part of component

LoggingFlags

uint64_t

Flags for logging info

Name

*char

Object name

TimeSource

*void

Time source object

asr

[uint32_t; 32]

cwp

*void

cycles

int64_t

dCache

temu_IfaceRef/ <unknown>

L1 data cache (optional)

devices

temu_IfaceRefArray

extraRegs

[uint32_t; 32]

fprs

[uint32_t; 32]

freq

uint64_t

fsr

uint32_t

g

[uint32_t; 8]

gprs

[uint32_t; 128]

iCache

temu_IfaceRef/ <unknown>

L1 instruction cache (optional)

i_npc

uintptr_t

Intermediate code nPC

i_pc

uintptr_t

Intermediate code PC

irq

int8_t

irqClient

temu_IfaceRef/ <unknown>

Interrupt controller (for ACKs)

machine

temu_IfaceRef/ <unknown>

Machine interface

memAccess

temu_IfaceRef/ <unknown>

Level 1 memory access interface (MMU)

memAccessL2

temu_IfaceRef/ <unknown>

Level 2 memory access interface (physical)

memSpace

*void

.

memory

temu_IfaceRef/ <unknown>

Memory interface

mmuCtrl

uint32_t

mmuCtxt

uint32_t

mmuCtxtPtr

uint32_t

mmuFaultAddr

uint32_t

mmuFaultStat

uint32_t

nextEvent

int64_t

npc

uint32_t

Next program counter register (%npc)

pc

uint32_t

Program counter register (%pc)

pdcManager

temu_IfaceRef/ <unknown>

Pre-decode cache manager (normally memory space)

powerState

uint32_t

psr

uint32_t

resetNpc

uint32_t

Reset nPC (for LEON4)

resetPc

uint32_t

Reset PC (for LEON4)

state

int32_t

steps

int64_t

stickyFlags

uint32_t

Set bit 0 to 1 to not exit CPU on halted mode.

targetExec

temu_IfaceRef/ <unknown>

Target execution interface

tbr

uint32_t

wim

uint32_t

Interfaces

Name Type Description

AhbIface

AhbIface

ClockIface

ClockIface

CpuIface

CpuIface

DCacheCtrlIface

CacheCtrlIface

DynamicResetAddressIface

temu::DynamicResetAddressIface

EventIface

EventIface

ICacheCtrlIface

CacheCtrlIface

InvalidMemAccessIface

MemAccessIface

IrqIface

IrqCtrlIface

MemoryIface

MemoryIface

MmuMemAccessIface

MemAccessIface

ObjectIface

ObjectIface

PowerIface

PowerIface

ResetIface

ResetIface

SparcIface

SparcIface

Ports

Prop Iface Description

irqClient

IrqIface

interrupt controller interface

Commands

Name Description

assemble

Assemble instruction

delete

Dispose instance of Leon4

disableProfiling

Disable profiling mode

disableTraps

Disable traps.

disassemble

Disassemble code

enableProfiling

Enable profiling mode

enableTraps

Enable traps.

flushProfile

Flush profile data

pregs

Print registers for CPU

pstat

Print CPU stats

pwin

Print register window.

resetStats

Reset statistics counters

setPC

Set PC (and nPC)

setReg

Set register

Command assemble Arguments

Name Type Required Description

inst

string

yes

Instruction to assemble.

pa

int

no

Physical address

va

int

no

Virtual address

Command disassemble Arguments

Name Type Required Description

count

int

no

Number of instructions

pa

int

no

Physical address

va

int

no

Virtual address

Command pwin Arguments

Name Type Required Description

win

int

no

Window ID (-1 = default == current window).

Command setPC Arguments

Name Type Required Description

npc

int

no

New %npc (note if omitted %npc = %pc + 4)

pc

int

yes

New %pc

Command setReg Arguments

Name Type Required Description

reg

string

yes

Register name

value

int

yes

Value