coreblocks.frontend package

Submodules

coreblocks.frontend.frontend module

class coreblocks.frontend.frontend.CoreFrontend

Bases: Elaboratable

Frontend of the core.

Attributes
consume_instr: Method

Consume a single decoded instruction.

resume_from_exception: Method

Resume the frontend from the given PC after an exception.

stall: Method

Stall and flush the frontend.

__init__(*, gen_params: GenParams, instr_bus: BusMasterInterface)

coreblocks.frontend.frontend_params module

class coreblocks.frontend.frontend_params.FrontendParams

Bases: object

__init__(gen_params: GenParams)
fb_addr(pc: amaranth.hdl._ast.Value | int | enum.Enum | amaranth.hdl._ast.ValueCastable) Value

Returns the fetch block address of a given PC.

fb_instr_idx(pc: amaranth.hdl._ast.Value | int | enum.Enum | amaranth.hdl._ast.ValueCastable) Value

Returns the index of an instruction in a fetch block for a given instruction PC.

pc_from_fb(fb_addr: amaranth.hdl._ast.Value | int | enum.Enum | amaranth.hdl._ast.ValueCastable, fb_instr_idx: int | amaranth.hdl._ast.Value) Value

For a given fetch block address and an instruction index, returns the instruction’s PC.

coreblocks.frontend.stall_controller module

class coreblocks.frontend.stall_controller.StallController

Bases: Elaboratable

The stall controller is responsible for managing all stall/unstall signals that may be triggered in the core and based on them deciding if and where the frontend should be resumed.

Attributes
stall_unsafeMethod

Signals that the frontend should be stalled because an unsafe (i.e. causing difficult to handle side effects) instruction was just fetched.

stall_exceptionMethod

Signals that the frontend should be stalled because of an exception.

stall_guardMethod

A non-exclusive method whose readiness denotes if the frontend is currently stalled.

resume_from_exception: Method

Signals that the backend handled the exception and the frontend can be resumed.

redirect_frontendMethod (bodyless)

A method that will be called when the frontend needs to be redirected. Should be always ready.

__init__(gen_params: GenParams)

Module contents