coreblocks.telemetry package

Submodules

coreblocks.telemetry.events module

class coreblocks.telemetry.events.ExecComplete

Bases: Event

The instruction finished executing: its result was announced and the ROB entry was marked done.

__init__(rob_id: int) None
event_name: ClassVar[str] = 'backend.exec_complete'

Unique dotted name of the event type, e.g. “fetch.block_started”.

rob_id: int
class coreblocks.telemetry.events.FTQAlloc

Bases: Event

An FTQ entry was allocated for the fetch block at pc.

__init__(ftq_ptr: int, pc: int) None
event_name: ClassVar[str] = 'frontend.ftq_alloc'

Unique dotted name of the event type, e.g. “fetch.block_started”.

ftq_ptr: int
pc: int
class coreblocks.telemetry.events.FTQCommit

Bases: Event

The FTQ commit pointer advanced to ftq_ptr: this entry is now the oldest live one, and all entries strictly before it are fully retired and freed. Emitted per retired instruction, so an entry with several instructions produces multiple commits of the same pointer.

__init__(ftq_ptr: int) None
event_name: ClassVar[str] = 'frontend.ftq_commit'

Unique dotted name of the event type, e.g. “fetch.block_started”.

ftq_ptr: int
class coreblocks.telemetry.events.FTQRollback

Bases: Event

FTQ allocation was rolled back: ftq_ptr is the new allocation pointer, so all entries from ftq_ptr onward are squashed.

__init__(ftq_ptr: int, cause: Static[str]) None
cause: Static[str]
event_name: ClassVar[str] = 'frontend.ftq_rollback'

Unique dotted name of the event type, e.g. “fetch.block_started”.

ftq_ptr: int
class coreblocks.telemetry.events.FetchRequest

Bases: Event

The FTQ issued a request to the instruction fetch unit for the fetch block owned by the FTQ entry.

__init__(ftq_ptr: int, pc: int) None
event_name: ClassVar[str] = 'frontend.fetch_request'

Unique dotted name of the event type, e.g. “fetch.block_started”.

ftq_ptr: int
pc: int
class coreblocks.telemetry.events.FuIssue

Bases: Event

The instruction was issued from a reservation station to a functional unit.

__init__(rob_id: int, unit: Static[str]) None
event_name: ClassVar[str] = 'backend.fu_issue'

Unique dotted name of the event type, e.g. “fetch.block_started”.

rob_id: int
unit: Static[str]
class coreblocks.telemetry.events.InstrDecoded

Bases: Event

An instruction landed in the decode stage. The instruction is identified by its FTQ entry and the slot index within it.

__init__(ftq_ptr: int, ftq_offset: int) None
event_name: ClassVar[str] = 'frontend.instr_decoded'

Unique dotted name of the event type, e.g. “fetch.block_started”.

ftq_offset: int
ftq_ptr: int
class coreblocks.telemetry.events.InstrFetched

Bases: Event

The fetch unit produced a single instruction and sent it towards the decode stage. ftq_offset is the instruction’s slot index within its fetch block.

__init__(ftq_ptr: int, pc: int, instr: int, ftq_offset: Static[int]) None
event_name: ClassVar[str] = 'frontend.instr_fetched'

Unique dotted name of the event type, e.g. “fetch.block_started”.

ftq_offset: Static[int]
ftq_ptr: int
instr: int
pc: int
class coreblocks.telemetry.events.RobAllocate

Bases: Event

A ROB entry was allocated for the instruction; from this point on the instruction is identified by its rob_id.

__init__(ftq_ptr: int, ftq_offset: int, rob_id: int) None
event_name: ClassVar[str] = 'backend.rob_allocate'

Unique dotted name of the event type, e.g. “fetch.block_started”.

ftq_offset: int
ftq_ptr: int
rob_id: int
class coreblocks.telemetry.events.RobFlush

Bases: Event

The instruction was squashed from the ROB without retiring.

__init__(rob_id: int) None
event_name: ClassVar[str] = 'backend.rob_flush'

Unique dotted name of the event type, e.g. “fetch.block_started”.

rob_id: int
class coreblocks.telemetry.events.RobRetire

Bases: Event

The instruction retired.

__init__(rob_id: int) None
event_name: ClassVar[str] = 'backend.rob_retire'

Unique dotted name of the event type, e.g. “fetch.block_started”.

rob_id: int
class coreblocks.telemetry.events.SchedulerEnter

Bases: Event

The instruction entered the scheduler.

__init__(ftq_ptr: int, ftq_offset: int) None
event_name: ClassVar[str] = 'backend.scheduler_enter'

Unique dotted name of the event type, e.g. “fetch.block_started”.

ftq_offset: int
ftq_ptr: int
coreblocks.telemetry.events.func_unit_kind(func_unit) str

A short name for a functional unit instance, derived from its class name: JumpBranchFuncUnit -> jump_branch.

coreblocks.telemetry.konata module

Converter from captured event logs to the Kanata pipeline-visualization format (https://github.com/shioyadan/Konata).

Since Kanata files are append-only with monotonically increasing time, and the concrete instructions of a fetch block are only known when they leave the fetch unit, the converter buffers everything: event handlers build per-instruction stage timelines, and the log is written out at the end, sorted by cycle. This allows backdating an instruction’s fetch stages to the times its fetch block was allocated and requested.

class coreblocks.telemetry.konata.KonataParser

Bases: EventConsumer

Converts instruction lifetime events into a Kanata log.

An instruction’s lifetime starts at the fetch request for its fetch block. Stages:

  • “F” from the fetch request until the instruction leaves the fetch unit,

  • “Q” while it waits in the frontend instruction queue,

  • “D” from landing in the decode stage,

  • “Rn” (rename) from entering the scheduler,

  • “Ds” (dispatch) from ROB allocation (which is where the instruction becomes identified by its ROB id),

  • “Is” (issue) from being issued to a functional unit,

  • “Cm” once execution completes.

The instruction terminates by retiring (RobRetire) or being squashed. Instructions still in flight when the event log ends are left unterminated.

__init__(out: TextIO)
on_alloc(rec: DecodedEvent)
on_commit(rec: DecodedEvent)
on_exec_complete(rec: DecodedEvent)
on_fetch_request(rec: DecodedEvent)
on_fu_issue(rec: DecodedEvent)
on_instr_decoded(rec: DecodedEvent)
on_instr_fetched(rec: DecodedEvent)
on_rob_allocate(rec: DecodedEvent)
on_rob_flush(rec: DecodedEvent)
on_rob_retire(rec: DecodedEvent)
on_rollback(rec: DecodedEvent)
on_scheduler_enter(rec: DecodedEvent)
run(records: Iterable[DecodedEvent])

Dispatches all records, sorted by cycle.

Sorting makes the consumer independent of the capture order, which matters for consumers of formats requiring monotonic timestamps.

coreblocks.telemetry.rvvi module

class coreblocks.telemetry.rvvi.RVVIAggregator

Bases: Component

A module that aggregates multiple RVVIHartCollector modules into a RVVI-TRACE interface.

__init__(rvvi_harts: list[RVVIHartCollector])
class coreblocks.telemetry.rvvi.RVVIHartCollector

Bases: Component

A module that collects information required for RVVI-TRACE interface for a single hart.

Currently doesn’t implement pc_wdata, f_*, v_*, csr_*.

Made as a simulation module, so critical path nor area is not optimized. Either way exposing more than 128k wires is not feasible.

__init__(gen_params: GenParams)
retire_port: View

Single hart worth of data of RVVI-TRACE interface.

class coreblocks.telemetry.rvvi.RVVIRetireInterface

Bases: ComponentInterface

__init__(ilen: int, xlen: int, flen: int = 0, vlen: int = 0)

Module contents