sonar/interfaces/axi4_stream.py
def init_signals(self, mode, data_width, upper_case=True):
        """
        Initialize the signals associated with this AXI4Stream interface. Initialize
        means to specify the names, types and widths of all the signals.

        Args:
            mode (str): Name of a signal preset to use. Options are:
                'default': tdata, tvalid, tready, tlast
                'tkeep': tdata, tvalid, tready, tlast, tkeep
                'min': tdata, tvalid
            data_width (number): Width of the tdata field
            upper_case (bool, optional): Defaults to True. Assume that
                the signal names are the uppercase versions of their type,
                which is the default for an HLS module. Setting it to False
                sets the name identical to the type (i.e. lowercase)
        """

        if mode == "default":
            signals = {
                "tdata": sonar.base_types.Signal("tdata", data_width),
                "tvalid": sonar.base_types.Signal("tvalid", 1),
                "tready": sonar.base_types.Signal("tready", 1),
                "tlast": sonar.base_types.Signal("tlast", 1),
            }
        elif mode == "tkeep":
            signals = {
                "tdata": sonar.base_types.Signal("tdata", data_width),
                "tvalid": sonar.base_types.Signal("tvalid", 1),
                "tready": sonar.base_types.Signal("tready", 1),
                "tlast": sonar.base_types.Signal("tlast", 1),
                "tkeep": sonar.base_types.Signal("tkeep", data_width / 8),
            }
        elif mode == "min":
            signals = {
                "tdata": sonar.base_types.Signal("tdata", data_width),
                "tvalid": sonar.base_types.Signal("tvalid", 1),
            }
        if upper_case:
            signals = base.to_upper_case(signals)
        self.add_signals(signals)

        Initialize the signals associated with this AXI4Stream interface. Initialize
        means to specify the names, types and widths of all the signals.

        Args:
            mode (str): Name of a signal preset to use. Options are:
                'default': tdata, tvalid, tready, tlast
                'tkeep': tdata, tvalid, tready, tlast, tkeep
                'min': tdata, tvalid
            data_width (number): Width of the tdata field
            upper_case (bool, optional): Defaults to True. Assume that
                the signal names are the uppercase versions of their type,
                which is the default for an HLS module. Setting it to False
                sets the name identical to the type (i.e. lowercase)
        
Initialize the signals associated with this AXI4Stream interface. Initialize
means to specify the names, types and widths of all the signals.
Initialize the signals associated with this AXI4Stream interface . Initialize means to specify the names types and widths of all the signals .
def init_signals(self, mode, data_width, upper_case=True):
        if mode == "default":
            signals = {
                "tdata": sonar.base_types.Signal("tdata", data_width),
                "tvalid": sonar.base_types.Signal("tvalid", 1),
                "tready": sonar.base_types.Signal("tready", 1),
                "tlast": sonar.base_types.Signal("tlast", 1),
            }
        elif mode == "tkeep":
            signals = {
                "tdata": sonar.base_types.Signal("tdata", data_width),
                "tvalid": sonar.base_types.Signal("tvalid", 1),
                "tready": sonar.base_types.Signal("tready", 1),
                "tlast": sonar.base_types.Signal("tlast", 1),
                "tkeep": sonar.base_types.Signal("tkeep", data_width / 8),
            }
        elif mode == "min":
            signals = {
                "tdata": sonar.base_types.Signal("tdata", data_width),
                "tvalid": sonar.base_types.Signal("tvalid", 1),
            }
        if upper_case:
            signals = base.to_upper_case(signals)
        self.add_signals(signals)
def init_signals ( self , mode , data_width , upper_case = True ) : if mode == "default" : signals = { "tdata" : sonar . base_types . Signal ( "tdata" , data_width ) , "tvalid" : sonar . base_types . Signal ( "tvalid" , 1 ) , "tready" : sonar . base_types . Signal ( "tready" , 1 ) , "tlast" : sonar . base_types . Signal ( "tlast" , 1 ) , } elif mode == "tkeep" : signals = { "tdata" : sonar . base_types . Signal ( "tdata" , data_width ) , "tvalid" : sonar . base_types . Signal ( "tvalid" , 1 ) , "tready" : sonar . base_types . Signal ( "tready" , 1 ) , "tlast" : sonar . base_types . Signal ( "tlast" , 1 ) , "tkeep" : sonar . base_types . Signal ( "tkeep" , data_width / 8 ) , } elif mode == "min" : signals = { "tdata" : sonar . base_types . Signal ( "tdata" , data_width ) , "tvalid" : sonar . base_types . Signal ( "tvalid" , 1 ) , } if upper_case : signals = base . to_upper_case ( signals ) self . add_signals ( signals )
Initialize the signals associated with this AXI4Stream interface.
Initialize the signals associated with this AXI4Stream interface .
"""
        Initialize the signals associated with this AXI4Stream interface. Initialize
        means to specify the names, types and widths of all the signals.

        Args:
            mode (str): Name of a signal preset to use. Options are:
                'default': tdata, tvalid, tready, tlast
                'tkeep': tdata, tvalid, tready, tlast, tkeep
                'min': tdata, tvalid
            data_width (number): Width of the tdata field
            upper_case (bool, optional): Defaults to True. Assume that
                the signal names are the uppercase versions of their type,
                which is the default for an HLS module. Setting it to False
                sets the name identical to the type (i.e. lowercase)
        """
self
mode
Name of a signal preset to use. Options are:
'default': tdata, tvalid, tready, tlast
'tkeep': tdata, tvalid, tready, tlast, tkeep
'min': tdata, tvalid
Name of a signal preset to use . Options are : ' default ' : tdata tvalid tready tlast ' tkeep ' : tdata tvalid tready tlast tkeep ' min ' : tdata tvalid
data_width
Width of the tdata field
Width of the tdata field
upper_case
Defaults to True. Assume that
the signal names are the uppercase versions of their type,
which is the default for an HLS module. Setting it to False
sets the name identical to the type
Defaults to True . Assume that the signal names are the uppercase versions of their type which is the default for an HLS module . Setting it to False sets the name identical to the type