Wrapper Port¶
The class WrapperPort
is an extension to Amaranth’s Signal
.
It wraps a port, adding a new name and optionally slicing the signal.
It adds these attributes:
WrapperPort.internal_name # name of the port in internal source to be wrapped
WrapperPort.direction # DIR_FANIN, DIR_FANOUT or DIR_NONE
WrapperPort.interface_name # name of the group of ports (interface)
WrapperPort.bounds # range of bits that belong to the port
# and the range which is sliced from the port
See IP core port-slicing to know more about bounds
.
This is used in the IPWrapper
class implementation and there should be no need to use WrapperPort
individually.
Warning
WrapperPort
is scheduled to be replaced in favor of Amaranth’s Signal
so it should not be used in any new functionality.
- class WrapperPort(shape=None, src_loc_at=0, **kwargs)¶
- __init__(shape=None, src_loc_at=0, *, bounds: List[int], name: str, internal_name: str, interface_name: str | None = None, direction: PortDirection)¶
Wraps a port, adding a new name and optionally slicing the signal
- Parameters:¶
- bounds: List[int]¶
4-element list where: [0:1] - upper and lower bounds of reference signal, [2:3] - upper and lower bounds of internal port, which are either the same as reference port, or a slice of the reference port
- name: str¶
a new name for the signal
- internal_name: str¶
name of the port to be wrapped/sliced
- interface_name: str | None = None¶
name of the interface the port belongs to
- direction: PortDirection¶
one of PortDirection, e.g. DIR_OUT