coreblocks.func_blocks.fu package

Submodules

coreblocks.func_blocks.fu.alu module

class coreblocks.func_blocks.fu.alu.ALUComponent

Bases: FunctionalComponentParams

__init__(zba_enable=False, zbb_enable=False)
get_module(gen_params: GenParams) FuncUnit
get_optypes() set[coreblocks.arch.optypes.OpType]
class coreblocks.func_blocks.fu.alu.AluFuncUnit

Bases: FuncUnit, Elaboratable

__init__(gen_params: ~coreblocks.params.genparams.GenParams, alu_fn=<coreblocks.func_blocks.fu.alu.AluFn object>)

coreblocks.func_blocks.fu.div_unit module

class coreblocks.func_blocks.fu.div_unit.DivComponent

Bases: FunctionalComponentParams

__init__(*, ipc: int = 3) None
div_fn = <coreblocks.func_blocks.fu.div_unit.DivFn object>
get_module(gen_params: GenParams) FuncUnit
get_optypes() set[coreblocks.arch.optypes.OpType]
ipc: int = 3
class coreblocks.func_blocks.fu.div_unit.DivFn

Bases: DecoderManager

class Fn

Bases: IntFlag

DIV = 1
DIVU = 2
REM = 4
REMU = 8
__new__(value)
get_instructions() Sequence[tuple]

Method providing list of valid instruction.

Returns
returnSequence[tuple]

List of implemented instructions, each following format: (IntFlag, OpType, Funct3 (optional), Funct7 (optional))

class coreblocks.func_blocks.fu.div_unit.DivUnit

Bases: FuncUnit, Elaboratable

__init__(gen_params: ~coreblocks.params.genparams.GenParams, ipc: int = 4, div_fn=<coreblocks.func_blocks.fu.div_unit.DivFn object>)
coreblocks.func_blocks.fu.div_unit.get_input(arg: View) tuple[amaranth.hdl._ast.Value, amaranth.hdl._ast.Value]

coreblocks.func_blocks.fu.exception module

class coreblocks.func_blocks.fu.exception.ExceptionFuncUnit

Bases: FuncUnit, Elaboratable

__init__(gen_params: ~coreblocks.params.genparams.GenParams, unit_fn=<coreblocks.func_blocks.fu.exception.ExceptionUnitFn object>)
class coreblocks.func_blocks.fu.exception.ExceptionUnitComponent

Bases: FunctionalComponentParams

__init__()
get_module(gen_params: GenParams) FuncUnit
get_optypes() set[coreblocks.arch.optypes.OpType]

coreblocks.func_blocks.fu.jumpbranch module

class coreblocks.func_blocks.fu.jumpbranch.JumpBranchFuncUnit

Bases: FuncUnit, Elaboratable

__init__(gen_params: ~coreblocks.params.genparams.GenParams, jb_fn=<coreblocks.func_blocks.fu.jumpbranch.JumpBranchFn object>)
class coreblocks.func_blocks.fu.jumpbranch.JumpComponent

Bases: FunctionalComponentParams

__init__()
get_module(gen_params: GenParams) FuncUnit
get_optypes() set[coreblocks.arch.optypes.OpType]

coreblocks.func_blocks.fu.mul_unit module

class coreblocks.func_blocks.fu.mul_unit.MulComponent

Bases: FunctionalComponentParams

__init__(mul_unit_type: MulType, *, dsp_width: int = 32) None
dsp_width: int = 32
get_module(gen_params: GenParams) FuncUnit
get_optypes() set[coreblocks.arch.optypes.OpType]
mul_fn = <coreblocks.func_blocks.fu.mul_unit.MulFn object>
mul_unit_type: MulType
class coreblocks.func_blocks.fu.mul_unit.MulFn

Bases: DecoderManager

Hot wire enum of 5 different multiplication operations.

class Fn

Bases: IntFlag

MUL = 1
MULH = 2
MULHSU = 8
MULHU = 4
__new__(value)
get_instructions() Sequence[tuple]

Method providing list of valid instruction.

Returns
returnSequence[tuple]

List of implemented instructions, each following format: (IntFlag, OpType, Funct3 (optional), Funct7 (optional))

class coreblocks.func_blocks.fu.mul_unit.MulType

Bases: IntEnum

Enum of different multiplication units types

RECURSIVE_MUL = 2

Fastest way of multiplying using only one cycle, but costly in terms of resources.

SEQUENCE_MUL = 1

Uses single DSP unit for multiplication, which makes balance between performance and cost.

SHIFT_MUL = 0

The cheapest multiplication unit in terms of resources, it uses Russian Peasants Algorithm.

__new__(value)
class coreblocks.func_blocks.fu.mul_unit.MulUnit

Bases: FuncUnit, Elaboratable

Module responsible for handling every kind of multiplication based on selected unsigned integer multiplication module. It uses standard FuncUnitLayout.

Attributes
issue: Method(i=gen.get(FuncUnitLayouts).issue)

Method used for requesting computation.

accept: Method(i=gen.get(FuncUnitLayouts).accept)

Method used for getting result of requested computation.

__init__(gen_params: ~coreblocks.params.genparams.GenParams, mul_type: ~coreblocks.func_blocks.fu.mul_unit.MulType, dsp_width: int = 32, mul_fn=<coreblocks.func_blocks.fu.mul_unit.MulFn object>)
Parameters
gen_params: GenParams

Core generation parameters.

coreblocks.func_blocks.fu.priv module

class coreblocks.func_blocks.fu.priv.PrivilegedFn

Bases: DecoderManager

class Fn

Bases: IntFlag

FENCEI = 2
MRET = 1
WFI = 4
__new__(value)
classmethod get_instructions() Sequence[tuple]

Method providing list of valid instruction.

Returns
returnSequence[tuple]

List of implemented instructions, each following format: (IntFlag, OpType, Funct3 (optional), Funct7 (optional))

class coreblocks.func_blocks.fu.priv.PrivilegedFuncUnit

Bases: Elaboratable

__init__(gen_params: GenParams)
class coreblocks.func_blocks.fu.priv.PrivilegedUnitComponent

Bases: FunctionalComponentParams

get_module(gp: GenParams) FuncUnit
get_optypes() set[coreblocks.arch.optypes.OpType]

coreblocks.func_blocks.fu.shift_unit module

class coreblocks.func_blocks.fu.shift_unit.ShiftFuncUnit

Bases: FuncUnit, Elaboratable

__init__(gen_params: ~coreblocks.params.genparams.GenParams, shift_unit_fn=<coreblocks.func_blocks.fu.shift_unit.ShiftUnitFn object>)
class coreblocks.func_blocks.fu.shift_unit.ShiftUnitComponent

Bases: FunctionalComponentParams

__init__(zbb_enable=False)
get_module(gen_params: GenParams) FuncUnit
get_optypes() set[coreblocks.arch.optypes.OpType]

coreblocks.func_blocks.fu.zbc module

class coreblocks.func_blocks.fu.zbc.ClMultiplier

Bases: Elaboratable

Module for computing carry-less product

Attributes
i1: Signal(unsigned(n)), in

First factor.

i2: Signal(unsigned(n)), in

Second factor.

result: Signal(unsigned(n * 2)), out

Result.

reset: Signal(1), in

Setting this signal to 1 will start a new computation with provided inputs

busy: Signal(1), out

Set to 1 while a computation is in progress

__init__(bit_width: int, recursion_depth: int)
Parameters
bit_width: int

Bit width of inputs

recursion_depth: int

Depth of recursive submodules for parallel computation (assumes bit_width to be a power of 2)

iterative_module()
recursive_module()
class coreblocks.func_blocks.fu.zbc.ZbcComponent

Bases: FunctionalComponentParams

__init__(recursion_depth: int = 3) None
get_module(gen_params: GenParams) FuncUnit
get_optypes() set[coreblocks.arch.optypes.OpType]
recursion_depth: int = 3
zbc_fn = <coreblocks.func_blocks.fu.zbc.ZbcFn object>
class coreblocks.func_blocks.fu.zbc.ZbcFn

Bases: DecoderManager

class Fn

Bases: IntFlag

CLMUL = 1
CLMULH = 2
CLMULR = 4
__new__(value)
classmethod get_instructions() Sequence[tuple]

Method providing list of valid instruction.

Returns
returnSequence[tuple]

List of implemented instructions, each following format: (IntFlag, OpType, Funct3 (optional), Funct7 (optional))

class coreblocks.func_blocks.fu.zbc.ZbcUnit

Bases: Elaboratable

Module responsible for executing Zbc instructions (carry-less multiplication)

Attributes
issue: Method(i=FuncUnitLayouts.issue)

Method used for requesting computation.

accept: Method(i=FuncUnitLayouts.accept)

Method used for getting result of requested computation.

__init__(gen_params: GenParams, recursion_depth: int, zbc_fn: ZbcFn)

coreblocks.func_blocks.fu.zbs module

class coreblocks.func_blocks.fu.zbs.Zbs

Bases: Elaboratable

Module responsible for executing Zbs instructions.

Attributes
function: ZbsFunction, in

Function to be executed.

in1: Signal(xlen), in

First input.

in2: Signal(xlen), in

Second input.

__init__(gen_params: ~coreblocks.params.genparams.GenParams, function=<coreblocks.func_blocks.fu.zbs.ZbsFunction object>)
Parameters
gen_paramsGenParams

Core generation parameters.

functionZbsFunction

Decoder manager to decode instruction.

class coreblocks.func_blocks.fu.zbs.ZbsComponent

Bases: FunctionalComponentParams

__init__()
get_module(gen_params: GenParams) FuncUnit
get_optypes() set[coreblocks.arch.optypes.OpType]
class coreblocks.func_blocks.fu.zbs.ZbsFunction

Bases: DecoderManager

Enum of Zbs functions.

class Fn

Bases: IntFlag

BCLR = 1
BEXT = 2
BINV = 4
BSET = 8
__new__(value)
get_instructions() Sequence[tuple]

Method providing list of valid instruction.

Returns
returnSequence[tuple]

List of implemented instructions, each following format: (IntFlag, OpType, Funct3 (optional), Funct7 (optional))

class coreblocks.func_blocks.fu.zbs.ZbsUnit

Bases: FuncUnit, Elaboratable

Module responsible for executing Zbs instructions.

Attributes
issue: Method(i=FuncUnitLayouts.issue)

Method used for requesting computation.

accept: Method(i=FuncUnitLayouts.accept)

Method used for getting result of requested computation.

__init__(gen_params: ~coreblocks.params.genparams.GenParams, zbs_fn=<coreblocks.func_blocks.fu.zbs.ZbsFunction object>)

Module contents