<commit_before>from hwt.code import connect, log2ceil
from hwt.synthesizer.interfaceLevel.unit import Unit
from hwt.synthesizer.param import evalParam
from hwtLib.handshaked.joinFair import HsJoinFairShare
from hwtLib.handshaked.streamNode import streamSync
from hwtLib.logic.oneHotToBin import oneHotToBin


def getSizeWidth(maxLen, dataWidth):
    alignBits = log2ceil(dataWidth // 8 - 1).val
    lenBits = log2ceil(maxLen).val
    return lenBits + alignBits

class AxiInterconnectBase(Unit):
    def getDpIntf(self, unit):
        raise NotImplementedError("Implement this function in your implementation")

    def configureFromDrivers(self, drivers, datapump, byInterfaces=False):
        """<commit_msg>fix getSizeWidth for axi interconnects<commit_after>from hwt.code import connect, log2ceil
from hwt.synthesizer.interfaceLevel.unit import Unit
from hwt.synthesizer.param import evalParam
from hwtLib.handshaked.joinFair import HsJoinFairShare
from hwtLib.handshaked.streamNode import streamSync
from hwtLib.logic.oneHotToBin import oneHotToBin


def getSizeWidth(maxLen, dataWidth):
    alignBits = log2ceil(dataWidth // 8 - 1).val
    lenBits = log2ceil(maxLen).val + 1
    return lenBits + alignBits


class AxiInterconnectBase(Unit):
    def getDpIntf(self, unit):
        raise NotImplementedError("Implement this function in your implementation")

    def configureFromDrivers(self, drivers, datapump, byInterfaces=False):
        """
{'fraction_non_alphanumeric': 0.0738950276243094, 'fraction_numerical': 0.007596685082872928, 'mean_word_length': 5.0375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6807893', 'n_tokens_mistral': 458, 'n_tokens_neox': 435, 'n_words': 113}