Skip to content

Routing Reference

AddrRange

Bases: BaseModel

Address range class.

Attributes:

Name Type Description
start int

Absolute start address of the range.

end int

Absolute end address of the range.

size int

Size of the address range.

base Optional[int]

Base address used for calculating ranges in endpoint arrays.

en_collective bool

If true, marks this range as a multicast/collective destination.

set_arr(arr_idx, arr_dim)

Update the address range with the given index.

validate_input()

Validate the address range.

validate_output()

Validate the address range.

CollectiveCfg

Bases: BaseModel

User-facing collective operation configuration.

The five high-level knobs map to collective_cfg_t in floo_pkg.

Attributes:

Name Type Description
en_narrow_multicast bool

Enables multicast on the narrow link (OpCfg.EnNarrowMulticast).

en_wide_multicast bool

Enables multicast on the wide link (OpCfg.EnWideMulticast).

en_barrier bool

Enables barrier synchronization (OpCfg.EnLsbAnd).

en_narrow_reduction Optional[NarrowReductionCfg]

Configuration for integer ALU reduction operations available on the narrow router (OpCfg.EnA_{Add,Mul,MinS,MinU,MaxS,MaxU}).

en_wide_reduction Optional[WideReductionCfg]

Configuration for floating-point reduction operations available on the wide router (OpCfg.EnF_{Add,Mul,Min,Max}).

Reduction Configuration Options

For en_narrow_reduction and en_wide_reduction, the following YAML values are supported:

  • false / omitted: Disabled (default)
  • true: All operations enabled, default hardware configuration
  • [Add, Mul, ...]: Only the listed operations enabled, default hardware configuration
  • {ops: [...], rd_pipeline_depth: N, cut_offload_intf: true}: Full per-channel control

en_collective property

True when any collective feature is enabled (multicast, barrier, or reduction).

get_collective_cfg property

Return a dict representing collective_cfg_t for sv_struct_render.

render_reduction_typedefs(cfg_n, cfg_w)

Render offload reduction channel/link typedefs for enabled channels.

Coord

Bases: BaseModel

2D coordinate class.

from_dict(coord_dict) staticmethod

Create a Coord object from a dictionary.

get_dir(node, neighbor) staticmethod

Get the direction from node to neighbor.

render(as_index=False)

Render the SystemVerilog coordinate.

NarrowReductionCfg

Bases: ReductionCfg

Reduction configuration for the narrow link.

get_reduction_cfg()

Return a dict representing reduction_cfg_t for sv_struct_render.

NarrowReductionOp

Bases: Enum

Integer ALU reduction operations available on the narrow router.

ReductionCfg

Bases: BaseModel

Base reduction hardware configuration shared by narrow and wide channels.

get_reduction_cfg()

Return a dict representing reduction_cfg_t for sv_struct_render.

RouteAlgo

Bases: Enum

Routing algorithm enum.

Attributes:

Name Type Description
XY

Dimension-ordered XY routing algorithm.

YX

Dimension-ordered YX routing algorithm.

ID

Routing algorithm based on router ID tables.

SRC

Source-based routing algorithm.

RouteMap

Bases: BaseModel

Route Map class, which can represent the system address map (SAM), or a routing table of a router.

check_no_overlapping_ranges()

Check if there are no overlapping ranges.

pprint()

Pretty print the routing table.

render(aw=None)

Render the SystemVerilog routing table.

render_rdl(rdl_as_mem=False, rdl_memwidth=8)

Render the SystemRDL addrmap internals.

render_rdl_inc()

Render the SystemRDL include header.

rule_type()

Return the type of the rules.

trim()

Optimize the routing table.

RouteMapRule

Bases: BaseModel

Routing rule class.

get_rdl(instance_name, rdl_as_mem=False, rdl_memwidth=8)

Render the SystemRDL routing rule.

render(aw=None)

Render the SystemVerilog routing rule.

render_desc()

Render the description of the routing rule.

RouteMapRuleCollective

Bases: RouteMapRule

Routing rule class for collective operations (multicast, reduction, barrier).

get_rdl(instance_name, rdl_as_mem=False, rdl_memwidth=8)

Render the SystemRDL routing rule.

render(aw=None)

Render the SystemVerilog routing rule.

render_desc()

Render the description of the routing rule.

RouteRule

Bases: BaseModel

Routing rule class.

render(num_route_bits)

Render the SystemVerilog route.

RouteTable

Bases: BaseModel

Route Table class, which can hold the route entries to each destination

render(num_route_bits, no_decl=False)

Render the SystemVerilog route table.

sort_and_pad()

Sort by destination and fill in missing entries.

Routing

Bases: BaseModel

The class that holds essentially all the routing information needed.

Attributes:

Name Type Description
route_algo RouteAlgo

This determines the routing algorithm to use. You can find more information about the different routing algorithms in the routing algorithms documentation.

use_id_table bool

A boolean flag indicating that if set to true, a system address table will be generated in the package which is used to translate system addresses to endpoint IDs or coordinates. This is always used in table-based routing and can be used in XYRouting to translate system addresses to XY-coordinates. If XYRouting is used and this field is set to false, the XY coordinates are automatically derived as address offsets. This is much simpler but requires that all endpoint addresses are contiguous and of the same size.

rob_idx_bits int

The number of bits to allocate for the rob_idx field in the packet header. This is only relevant if reordering buffers are used in the network.

collective CollectiveCfg

Collective operation configuration (multicast, barrier, reduction).

addr_offset_bits = None class-attribute instance-attribute

The number of bits to decode the X and Y coordinates from the address. Only used if use_id_table is False and route_algo is XY.

addr_width = None class-attribute instance-attribute

The width of the address bus.

collective_sam = None class-attribute instance-attribute

The collective system address map. Only used if collective is enabled.

en_collective property

True when any collective feature is enabled (multicast, barrier, or reduction).

num_endpoints = None class-attribute instance-attribute

The number of endpoints in the network.

num_id_bits = None class-attribute instance-attribute

The number of bits to represent the ID. Only used if route_algo is ID or SRC.

num_route_bits = None class-attribute instance-attribute

The number of bits to represent the route. Only used if route_algo is SRC.

num_x_bits = None class-attribute instance-attribute

The number of bits to represent the X coordinate. Only used if route_algo is XY.

num_y_bits = None class-attribute instance-attribute

The number of bits to represent the Y coordinate. Only used if route_algo is XY.

port_id_bits = 1 class-attribute instance-attribute

The number of bits to represent the local port ID.

sam = None class-attribute instance-attribute

The system address map.

table = None class-attribute instance-attribute

The routing table of the router.

xy_id_offset = None class-attribute instance-attribute

A constant offset to add to the X and Y coordinates. Only used if route_algo is XY.

render_hdr_typedef(network_type)

Render the SystemVerilog flit header.

render_param_decl()

Render the SystemVerilog parameter declaration.

render_route_cfg(name)

Render the SystemVerilog routing configuration.

render_typedefs()

Render the SystemVerilog typedefs.

render_vc_impl()

Render WideRwDecouple and VcImpl localparam declarations.

validate_collective_route_algo()

Collective operations are supported with XY routing only.

validate_decouple_rw(v) classmethod

Accept bool (False→NONE) or string/enum name.

validate_route_algo(v) classmethod

Validate the routing algorithm.

validate_vc_impl(v) classmethod

Accept both enum members and string names.

SimpleId

Bases: BaseModel

ID class.

__add__(other)

Add the ID.

__lt__(other)

Less than comparison.

__sub__(other)

Subtract the ID.

render(as_index=False)

Render the SystemVerilog ID.

validate_id(v) classmethod

Validate the ID.

VcImpl

Bases: Enum

Virtual channel implementation enum (mirrors vc_impl_e in floo_pkg).

Only relevant when decouple_rw == WideRwDecouple.VC.

WideReductionCfg

Bases: ReductionCfg

Reduction configuration for the wide link.

get_reduction_cfg()

Return a dict representing reduction_cfg_t for sv_struct_render.

WideReductionOp

Bases: Enum

Floating-point reduction operations available on the wide router.

WideRwDecouple

Bases: Enum

Read/write decoupling mode for the wide link (mirrors wide_rw_decouple_e in floo_pkg).

NONE — shared wide link, no decoupling (default) VC — decouple using virtual channels (requires vc_impl) PHYS — decouple using separate physical wide links

XYDirections

Bases: Enum

XY directions enum.

reverse(direction) classmethod

Reverse the direction.

to_coords(direction) classmethod

Convert the direction to coordinates.