riscv-rv32 riscv-rv64
RISC-V CPU Reference Manual  /  4 Classes  / 

riscv-rv32ema

Description
generic RISC-V RV32E core
Interfaces Implemented
callback_info, concurrency_group, concurrency_mode, conf_object, context_handler, cpu_cached_instruction, cpu_cached_instruction_once, cpu_cached_stream, cpu_exception_query, cpu_instruction_decoder, cpu_instruction_query, cpu_instrumentation_stream, cpu_instrumentation_subscribe, cpu_memory_query, cycle, decoder, describe_registers, direct_memory_update, event_delta, exception, exec_trace, execute, execute_control, freerun, frequency, frequency_listener, icode, instruction_fetch, instrumentation_order, int_register, internal_cached_instruction, jit_control, log_object, opcode_info, processor_cli, processor_gui, processor_info, processor_info_v2, processor_internal, register_breakpoint, save_state, simulator_cache, stall, stc, step, step_cycle_ratio, step_event_instrumentation, step_info, virtual_data_breakpoint, virtual_instruction_breakpoint
Port Objects
extensions : RISC-V extension
port.CLOCK_DISABLE (signal) : Disable clock signal, when high core will not execute instructions or react to other incoming signals
port.HRESET (signal) : Reset signal
port.IRQ <index-map> : internal - provides object arrays
port.IRQ[0..15] (signal) : interrupt request input signal
port.MEIP (signal) : External machine mode interrupt request.
port.MSIP (signal) : Software interrupt request.
port.MTIP (signal) : Timer interrupt request.
port.SEIP (signal) : External supervisor mode interrupt request.
port.reset_vector (uint64_state) : Used to set reset vector.
vtime.cycles <cycle-counter> : cycle queue
vtime.ps <ps-clock> : event queue (ps)
vtime <vtime> : event handler
Port Interfaces
cpu_frequency (simple_dispatcher) : Broadcasts changes in CPU frequency.
cpu_internal_counters (probe_index) : Port for internal counters
cpu_internal_intensity_counters (probe_index) : Port for internal intensity counters
step_event_probes (probe_index, probe_subscribe) : Port for event probes.
Notifiers
freerunning-mode-change, frequency-change
Provided By
riscv-rv32

Attributes

IALIGN

Pseudo attribute; read-only access; type: integer. Minimal instruction alignment in bits.

XLEN

Pseudo attribute; read-only access; type: integer. Size in bits of the X-registers.

aprof_views

Pseudo attribute; read/write access; type: [[o,i]*]. ((address profiler, view)*) Address profiler views selected for this processor. Affects only the display of profiling information, and has nothing to do with collecting it.

This attribute should contain a list of lists: one list for each address profiler view you want to select (in the order they are to appear), each containing first the address profiler object, then the index of the desired view.

auto_hyper_enabled

Pseudo attribute; read/write access; type: boolean. Enables automatic detection of loops which can be hypersimulated.

auto_hyper_loops

Pseudo attribute; read-only access; type: [[iis]*]. {ffwd_steps, addr, precond} Information on automatically found hypersim loops.

cell

Optional attribute; read/write access; type: object or nil. Cell

clint

Optional attribute; read/write access; type: [os], object, or nil. CLINT target. Access to the CLINT are done via the io_memory interface.

core_disabled_state

Optional attribute; read/write access; type: [b*]. Core disabled state

core_interrupt_pending_state

Optional attribute; read/write access; type: [iiiii]. Core internal clic interrupt state

cpu_mode

Optional attribute; read/write access; type: integer. Current mode of the cpu [0-3]

current_context

Pseudo attribute; read/write access; type: object or nil. Current context object

cycle

Pseudo attribute; read-only access; type: integer. Cycle counter for RDCYCLE instruction

cycleh

Pseudo attribute; read-only access; type: integer. Upper 32 bits of cycle

cycles

Pseudo attribute; read/write access; type: integer. Time measured in cycles from machine start.

do_not_schedule

Optional attribute; read/write access; type: boolean. Set to TRUE to prevent this object from being scheduled by the cell.

enabled_flag

Optional attribute; read/write access; type: boolean. TRUE if the processor is enabled. If FALSE, it will see time (cycles) pass but not execute steps.

event_desc

Pseudo attribute; read-only access; integer indexed; indexed type: [[o|n,s,i]*]. ((object, description, time)*). All events in queue with a human-readable description. The attribute is indexed by queue (Sim_Queue_Step/Time).

exception_for_unaligned_data_access

Optional attribute; read/write access; type: boolean. If set to False, the core handles unaligned data accesses internally without exception. If set to True unaligned data accesses will cause exceptions.

exclusive_local

Optional attribute; read/write access; type: [iii]. Exclusive lock for atomic instructions LR and SC

extensions.A

Pseudo attribute; read/write access; type: boolean. Standard Extension for Atomic Instructions

extensions.I

Pseudo attribute; read/write access; type: boolean. RV32I or RV32E Base Instruction Set.

extensions.M

Pseudo attribute; read/write access; type: boolean. Standard Extension for Integer Multiplication and Division

extensions.Zba

Pseudo attribute; read/write access; type: boolean. Bit-Manipulation ISA-extension, Address generation instructions

extensions.Zbb

Pseudo attribute; read/write access; type: boolean. Bit-Manipulation ISA-extension, Basic bit-manipulation

extensions.Zbc

Pseudo attribute; read/write access; type: boolean. Bit-Manipulation ISA-extension, Carry-less multiplication

extensions.Zbs

Pseudo attribute; read/write access; type: boolean. Bit-Manipulation ISA-extension, Single-bit instructions

external_signals_state

Optional attribute; read/write access; type: [b*]. State of the external signals

freerun_enabled

Optional attribute; read/write access; type: boolean. Freerun mode enabled

freerun_max_ips

Optional attribute; read/write access; type: float. Maximum allowed value for the number of instructions executed per virtual second, expressed as a fraction of the current CPU frequency.

freerun_min_ips

Optional attribute; read/write access; type: float. Minimum allowed value for the number of instructions executed per virtual second, expressed as a fraction of the current CPU frequency.

freerun_speed

Optional attribute; read/write access; type: float. Freerun speed. A value of 1.0 means realtime.

freq_mhz

Pseudo attribute; read/write access; type: float or integer. Processor clock frequency in MHz.

frequency

Optional attribute; read/write access; type: [ii], [os], or object. Processor clock frequency in Hz, as a rational number [numerator, denominator], or as a frequency provider implementing the frequency. The legacy simple_dispatcher is also supported.

gprs

Optional attribute; read/write access; type: [i{32}]. (r0, i1, ..., r31) General purpose registers

hypervisor_mode_supported

Pseudo attribute; read-only access; type: integer. Hypervisor mode supported in the cpu

ignore_page_failed_before

Pseudo attribute; read/write access; type: boolean. If TRUE, the model will keep trying to cache memory through direct memory even if it fails.

instret

Pseudo attribute; read-only access; type: integer. Instructions-retired counter for RDINSTRET instruction

internal_interrupt_status

Optional attribute; read/write access; type: integer. Status of the core's internal interrupts.

interrupt_pending

Pseudo attribute; read-only access; type: integer. Current interrupt pending or -1 if no interrupt is pending.

is_stalling

Optional attribute; read/write access; type: boolean. TRUE if the processor is currently stalling by request of a timing-model.

isa_variants

Optional attribute; read/write access; type: [[sb]*]. List of available ISA-variants coupled with if they are enabled or not. To be able to use a variant the corresponding extension also needs to be supported and enabled. Note, isa_variants are not affected by reset.

ma_prot

Optional attribute; read/write access; type: string. MP protocol. One of {'msi', 'ww', 'wwp'}

marchid

Optional attribute; read/write access; type: integer. Architecture ID

mca_concurrency_mode

Optional attribute; read/write access; type: integer. Multicore Accelerator mode used by processor. One of Sim_Concurrency_Mode_Serialized (1), Sim_Concurrency_Mode_Serialized_Memory (2), or Sim_Concurrency_Mode_Full (4)

mcause

Optional attribute; read/write access; type: integer. Machine trap cause

mcounteren

Optional attribute; read/write access; type: integer. Machine counter enable

mcycle

Optional attribute; read/write access; type: integer. Machine cycle counter

mcycleh

Pseudo attribute; read/write access; type: integer. Upper 32 bits of mcycle

mepc

Optional attribute; read/write access; type: integer. Machine exception program counter

mhartid

Optional attribute; read/write access; type: integer. Hardware thread ID

mie

Optional attribute; read/write access; type: integer. Machine interrupt-enable

mimpid

Optional attribute; read/write access; type: integer. Implementation ID

min_cacheline_size

Pseudo attribute; read-only access; type: integer. The minimum size (in bytes) of a cache line that can be represented by Simics (when connecting a cache memhier).

minstret

Optional attribute; read/write access; type: integer. Machine instructions-retired counter

minstreth

Pseudo attribute; read/write access; type: integer. Upper 32 bits of mcycle

mip

Pseudo attribute; read/write access; type: integer. Machine interrupt pending

misa

Pseudo attribute; read/write access; type: integer. ISA and extensions

mscratch

Optional attribute; read/write access; type: integer. Scratch register for machine trap handlers

mstatus

Optional attribute; read/write access; type: integer. Machine Status

mtval

Optional attribute; read/write access; type: integer. Machine bad address or instruction

mtvec

Optional attribute; read/write access; type: integer. Machine trap-handler base address

multicore_accelerator_enabled

Pseudo attribute; read/write access; type: boolean. Multicore Accelerator enabled for processor.

mvendorid

Optional attribute; read/write access; type: integer. Vendor ID

non_architecturally_disabled

Optional attribute; read/write access; type: boolean. If true, the processor is disabled by explicit user action and will not execute instructions until re-enabled by user. No architectural transitions, such as resets, will re-enable it on their own.

outside_memory_whitelist

Optional attribute; read/write access; type: [i|[ii]|[iii]*]. ((address, length, hits)*).

List of physical address ranges that do not map to anything. length is the length of each interval in bytes. An interval with both address and length being 0 denotes the entire address space. hits is the number of times that particular interval has been accessed, and can be omitted when set.

Accesses to physical addresses with no targets will trigger a specific hap whose default action is to break the simulation. However, if the address falls into one of the ranges specified in this whitelist, the hap will not be triggered (but still being counted). The behavior in this scenario is architecture dependent. It may or may not trigger an architecture specific exception, and the simulation may or may not be interrupted.

See also the Core_Address_Not_Mapped hap.

pc

Optional attribute; read/write access; type: integer. Program counter

physical_memory

Required attribute; read/write access; type: object. Physical memory space. Must implement memory-space, breakpoint and breakpoint_query interfaces.

processor_number

Optional attribute; read/write access; type: integer. Simics internal number for an instance of the 'processor_info' interface. Each instance must have a unique number. This attribute can only be set as part of an initial configuration.

reset_config_clear_fprs

Optional attribute; read/write access; type: boolean. Controls if fprs will be cleared at reset

reset_config_clear_gprs

Optional attribute; read/write access; type: boolean. Controls if gprs will be cleared at reset

reset_config_reset_all_csrs

Optional attribute; read/write access; type: boolean. Controls if all csrs will be reset to startup value at reset

reset_misa

Optional attribute; read/write access; type: integer. Value used for misa after reset

reset_vector

Optional attribute; read/write access; type: integer. Address core starts executing from after reset

shared_physical_memory

Optional attribute; read/write access; type: object or nil. This is the main program memory-space shared with other processors. In the chain of memory-spaces starting from the physical_memory attribute, this is the first memory-space that also is accessible by other processors. A value of Nil means the physical_memory attribute is used as main program memory-space.

signal_status

Optional attribute; read/write access; type: integer. Status of the core's external signals.

simulation_mode

Pseudo attribute; read-only access; type: integer. The simulation mechanism used for the processor. One of the values of the simulation_mode_t enum.

stall_time

Optional attribute; read/write access; type: integer. The number of cycles the processor will stall

stalling_info

Optional attribute; read/write access; type: [iii]. If is_stalling is set, this contains information about the current memory operation.

step_per_cycle_mode

Optional attribute; read/write access; type: string. "constant" indicates a constant finite step/cycle factor; "infinite" means that steps are run without advancing time.

step_queue

Optional attribute; read/write access; type: [[o|n,s,a,s,i]*]. ((object, evclass, value, slot, step)*). Pending step queue events.

steps

Optional attribute; read/write access; type: integer. Number steps executed since machine start.

supervisor_mode_supported

Pseudo attribute; read-only access; type: integer. Supervisor mode supported in the cpu

tdata1

Pseudo attribute; read/write access; type: integer. First Debug/Trace trigger data register

tdata2

Pseudo attribute; read/write access; type: integer. Second Debug/Trace trigger data register

tdata3

Pseudo attribute; read/write access; type: integer. Third Debug/Trace trigger data register

time

Pseudo attribute; read-only access; type: integer. Timer for RDTIME instruction

time_queue

Pseudo attribute; read/write access; type: [[o|n,s,a,s|n,i]*]. ((object, evclass, value, slot, cycle)*). Pending time queue events.

timeh

Pseudo attribute; read-only access; type: integer. Upper 32 bits of time

tselect

Pseudo attribute; read/write access; type: integer. Debug/Trace trigger register select

user_mode_supported

Pseudo attribute; read-only access; type: integer. User mode supported in the cpu

wait_for_interrupt

Pseudo attribute; read/write access; type: boolean. Processor in WFI-state.

wfi_signal_target

Optional attribute; read/write access; type: [os], object, or nil. Target to raise or lower a signal to when core goes into wait for interrupt state. Object must implement the signal interface. A signal will be raised when wfi instruction is executed and not interrupt is active. The signal will be lowered when the CPU resumes execution. The signal will be lowered when the CPU is reset

writable_misa

Optional attribute; read/write access; type: integer. Controls which bits in the misa csr that can be written by instructions. Default is 0.

Class Attributes

architecture

Pseudo class attribute; read-only access; type: string. Implemented architecture (risc-v)

Command List

Commands
aprof-viewsmanipulate list of selected address profiling views
infoprint information about the object
statusprint status of the object

riscv-rv32 riscv-rv64