soc/picorv32/common/localBusAddressMap.py
def gen_addrmap(regmap):
    """
    Collect all addresses as keys to the addrmap dict. Values are the names.
    """
    addrmap = dict()
    for key, item in regmap.items():
        if "base_addr" in item:
            addr = item["base_addr"]
            aw = item["addr_width"]
            addri = int(str(addr), 0)
            if addri in addrmap:
                raise ValueError("Double assigned localbus address!")
            if addri >= (0x01000000 >> 2):
                raise ValueError("Localbus address outside valid range!")

            if 0 < aw <= 6:  # cutoff array generation if length > 32.
                for ix in range(1 << aw):
                    addrmap[addri + ix] = key + '_' + str(ix)
            elif aw == 0:
                addrmap[addri] = key
            else:
                print("Large array ignored (len>32), key: {}".format(key))
    return addrmap

    Collect all addresses as keys to the addrmap dict. Values are the names.
    
Collect all addresses as keys to the addrmap dict. Values are the names.
Collect all addresses as keys to the addrmap dict . Values are the names .
def gen_addrmap(regmap):
    addrmap = dict()
    for key, item in regmap.items():
        if "base_addr" in item:
            addr = item["base_addr"]
            aw = item["addr_width"]
            addri = int(str(addr), 0)
            if addri in addrmap:
                raise ValueError("Double assigned localbus address!")
            if addri >= (0x01000000 >> 2):
                raise ValueError("Localbus address outside valid range!")
            if 0 < aw <= 6:  
                for ix in range(1 << aw):
                    addrmap[addri + ix] = key + '_' + str(ix)
            elif aw == 0:
                addrmap[addri] = key
            else:
                print("Large array ignored (len>32), key: {}".format(key))
    return addrmap
def gen_addrmap ( regmap ) : addrmap = dict ( ) for key , item in regmap . items ( ) : if "base_addr" in item : addr = item [ "base_addr" ] aw = item [ "addr_width" ] addri = int ( str ( addr ) , 0 ) if addri in addrmap : raise ValueError ( "Double assigned localbus address!" ) if addri >= ( 0x01000000 >> 2 ) : raise ValueError ( "Localbus address outside valid range!" ) if 0 < aw <= 6 : for ix in range ( 1 << aw ) : addrmap [ addri + ix ] = key + '_' + str ( ix ) elif aw == 0 : addrmap [ addri ] = key else : print ( "Large array ignored (len>32), key: {}" . format ( key ) ) return addrmap
Collect all addresses as keys to the addrmap dict.
Collect all addresses as keys to the addrmap dict .
"""
    Collect all addresses as keys to the addrmap dict. Values are the names.
    """ # cutoff array generation if length > 32.
regmap