hwtLib.abstract.frame_utils.join package

Submodules

hwtLib.abstract.frame_utils.join.fsm module

hwtLib.abstract.frame_utils.join.fsm.input_B_dst_to_fsm(word_bytes: int, input_cnt: int, input_B_dst: List[List[Set[Tuple[Tuple[int, int], int, int, int]]]], can_be_zero_len_frame: List[bool])[source]
Parameters
  • word_bytes – number of bytes in output word

  • input_cnt – number of input streams

  • input_B_dst – list with mapping of input bytes to a output bytes in each state

Format of input_B_dst is: List for each input
    in this list there are lists for each input byte
        in this list there are sets of byte destinations for each input byte
            byte destination is a tuple:
                state label, input index, time index, output byte index, input last flag
Note

input_B_dst is produced by hwtLib.amba.axis_comp.frame_utils.join.FrameJoinUtils.resolve_input_bytes_destinations()

hwtLib.abstract.frame_utils.join.fsm.is_from_different_input(a: Tuple[int, int, int, int], b: Tuple[int, int, int, int])[source]
hwtLib.abstract.frame_utils.join.fsm.is_next_byte_from_same_input(a: Tuple[int, int, int, int], b: Tuple[int, int, int, int])[source]

hwtLib.abstract.frame_utils.join.input_reg_val module

class hwtLib.abstract.frame_utils.join.input_reg_val.InputRegInputVal(parent_state_trans: StateTransItem)[source]

Bases: object

Container of values for FrameJoin input register

Variables
  • ~.parent – the StateTransItem instance which is owning this object

  • ~.keep – list of keep bits

  • ~.relict – flag for word which was partially consumed

  • ~.last – flag for end of frame

__init__(parent_state_trans: StateTransItem)[source]
__repr__()[source]

Return repr(self).

as_tuple()[source]
classmethod from_dict(parent_state_trans, d: Dict)[source]
is_exactly_different(other)[source]
hwtLib.abstract.frame_utils.join.input_reg_val.val__repr__None_as_X(v)[source]
hwtLib.abstract.frame_utils.join.input_reg_val.val_replace_X_with_None(v)[source]

hwtLib.abstract.frame_utils.join.state_trans_info module

class hwtLib.abstract.frame_utils.join.state_trans_info.StateTransInfo(label, word_bytes, input_cnt)[source]

Bases: object

Variables
  • ~.label – tuple(frame id, word id)

  • ~.outputs – list of tuples (input index, input time, input byte index)

  • ~.last_per_input – last flags for each input if last=1 the the input word is end of the actual frame (None = don’t care value)

__eq__(other)[source]

Return self==value.

__hash__ = None
__init__(label, word_bytes, input_cnt)[source]
__repr__()[source]

Return repr(self).

get_next_substate(sub_states: Dict[Tuple[int, int], StateTransInfo]) Optional[StateTransInfo][source]
get_state_i() int[source]
Returns

source state index for this state transition, min input index used when this state transition can happen

set_output(out_B_i, in_i, time, in_B_i, B_from_last_input_word)[source]

hwtLib.abstract.frame_utils.join.state_trans_item module

class hwtLib.abstract.frame_utils.join.state_trans_item.StateTransItem(parent_table: StateTransTable, st_i: int, state_next_i: int, out_last: int)[source]

Bases: object

Variables
  • state – state label

  • input – specifies the input to a state transition

  • input_keep_mask – mask which will be applied to keep signal on input to the register

  • input_rd – ready for a input channel (if 1 the input stream will be shifted in)

  • output_keep – output keep values

  • out_byte_mux_sel – list of

Note

input_keep_mask[0][0] = [1, 0] means reg0.in.keep = reg0.out.keep & 0b01

__deepcopy__(memo)[source]

Deepcopy, but do not copy the parent

__eq__(other)[source]

Return self==value.

__hash__()[source]

Return hash(self).

__init__(parent_table: StateTransTable, st_i: int, state_next_i: int, out_last: int)[source]
__lt__(other)[source]

Return self<value.

__repr__(as_dict=False)[source]

Return repr(self).

as_tuple()[source]
classmethod from_dict(parent, d: Dict)[source]
inputs_exactly_different(other: StateTransItem) bool[source]
hwtLib.abstract.frame_utils.join.state_trans_item._cmp_with_None_as_2(o0, o1)[source]
Returns

0 if o0 == o1, -1 if o0 < o1, 1 if o0 > o1

hwtLib.abstract.frame_utils.join.state_trans_table module

class hwtLib.abstract.frame_utils.join.state_trans_table.StateTransTable(word_bytes: int, max_lookahead_for_input: List[int], state_cnt: int)[source]

Bases: object

__init__(word_bytes: int, max_lookahead_for_input: List[int], state_cnt: int)[source]
assert_transitions_deterministic()[source]
filter_unique_state_trans()[source]