sonar/interfaces/axi4_stream.py
def _f2s_tkeep(self, file_size, tdata_bytes, beat, endian):
        """
        Calculates tkeep for a particular beat for file_to_stream since the last
        beat may be smaller than a word.

        Args:
            file_size (int): Size of data in bytes to send over tdata
            tdata_bytes (int): Width of tdata in bytes
            beat (int): Beat counter
            endian (str): little|big

        Returns:
            str: Tkeep value for the current beat
        """

        if beat < ((ceil(file_size / 8.0) - 1) * 8.0):
            tkeep = (2 ** self.get_signal("tkeep").size) - 1
        else:
            size_last_transaction = file_size % tdata_bytes
            if size_last_transaction != 0:
                tkeep = ""
                for _ in range(size_last_transaction):
                    tkeep = tkeep + "1"
                if endian != "little":
                    for _ in range(tdata_bytes - size_last_transaction):
                        tkeep = tkeep + "0"
                tkeep = int(tkeep, 2)
            else:
                tkeep = (2 ** self.get_signal("tkeep").size) - 1
        return int(tkeep)

        Calculates tkeep for a particular beat for file_to_stream since the last
        beat may be smaller than a word.

        Args:
            file_size (int): Size of data in bytes to send over tdata
            tdata_bytes (int): Width of tdata in bytes
            beat (int): Beat counter
            endian (str): little|big

        Returns:
            str: Tkeep value for the current beat
        
Calculates tkeep for a particular beat for file_to_stream since the last
beat may be smaller than a word.
Calculates tkeep for a particular beat for file_to_stream since the last beat may be smaller than a word .
def _f2s_tkeep(self, file_size, tdata_bytes, beat, endian):
        if beat < ((ceil(file_size / 8.0) - 1) * 8.0):
            tkeep = (2 ** self.get_signal("tkeep").size) - 1
        else:
            size_last_transaction = file_size % tdata_bytes
            if size_last_transaction != 0:
                tkeep = ""
                for _ in range(size_last_transaction):
                    tkeep = tkeep + "1"
                if endian != "little":
                    for _ in range(tdata_bytes - size_last_transaction):
                        tkeep = tkeep + "0"
                tkeep = int(tkeep, 2)
            else:
                tkeep = (2 ** self.get_signal("tkeep").size) - 1
        return int(tkeep)
def _f2s_tkeep ( self , file_size , tdata_bytes , beat , endian ) : if beat < ( ( ceil ( file_size / 8.0 ) - 1 ) * 8.0 ) : tkeep = ( 2 ** self . get_signal ( "tkeep" ) . size ) - 1 else : size_last_transaction = file_size % tdata_bytes if size_last_transaction != 0 : tkeep = "" for _ in range ( size_last_transaction ) : tkeep = tkeep + "1" if endian != "little" : for _ in range ( tdata_bytes - size_last_transaction ) : tkeep = tkeep + "0" tkeep = int ( tkeep , 2 ) else : tkeep = ( 2 ** self . get_signal ( "tkeep" ) . size ) - 1 return int ( tkeep )
Calculates tkeep for a particular beat for file_to_stream since the last
beat may be smaller than a word.
Calculates tkeep for a particular beat for file_to_stream since the last beat may be smaller than a word .
"""
        Calculates tkeep for a particular beat for file_to_stream since the last
        beat may be smaller than a word.

        Args:
            file_size (int): Size of data in bytes to send over tdata
            tdata_bytes (int): Width of tdata in bytes
            beat (int): Beat counter
            endian (str): little|big

        Returns:
            str: Tkeep value for the current beat
        """
Tkeep value for the current beat
Tkeep value for the current beat
str
self
file_size
Size of data in bytes to send over tdata
Size of data in bytes to send over tdata
tdata_bytes
Width of tdata in bytes
Width of tdata in bytes
beat
None
endian
None