soc/picorv32/common/localBusAddressMap.py
def write_addrmap(addrmap, ifname, ofname):
    """
    Iterate through all sorted keys of the addrmap dict and genereate #define strings
    """
    hf = """// Automatically generated register map of the local bus
// Source:    {0}
// Generated: {1}

""".format(os.path.abspath(ifname), datetime.datetime.now().strftime("%D, %T"))

    header = ofname.replace('.', '_').upper()
    hf += "#ifndef " + header + "\n"
    hf += "#define " + header + "\n\n"
    for addr in sorted(addrmap.keys()):
        hf += "#define {0:32s} 0x{1:08x}\n".format(addrmap[addr].upper(), addr)
    hf += "\n#endif\n"

    with open(ofname, "w") as f:
        f.write(hf)

    Iterate through all sorted keys of the addrmap dict and genereate #define strings
    
Iterate through all sorted keys of the addrmap dict and genereate #define strings
Iterate through all sorted keys of the addrmap dict and genereate #define strings
def write_addrmap(addrmap, ifname, ofname):
    hf = """// Automatically generated register map of the local bus
// Source:    {0}
// Generated: {1}
""".format(os.path.abspath(ifname), datetime.datetime.now().strftime("%D, %T"))
    header = ofname.replace('.', '_').upper()
    hf += "#ifndef " + header + "\n"
    hf += "#define " + header + "\n\n"
    for addr in sorted(addrmap.keys()):
        hf += "#define {0:32s} 0x{1:08x}\n".format(addrmap[addr].upper(), addr)
    hf += "\n#endif\n"
    with open(ofname, "w") as f:
        f.write(hf)
def write_addrmap ( addrmap , ifname , ofname ) : hf = """// Automatically generated register map of the local bus
// Source:    {0}
// Generated: {1}

""" . format ( os . path . abspath ( ifname ) , datetime . datetime . now ( ) . strftime ( "%D, %T" ) ) header = ofname . replace ( '.' , '_' ) . upper ( ) hf += "#ifndef " + header + "\n" hf += "#define " + header + "\n\n" for addr in sorted ( addrmap . keys ( ) ) : hf += "#define {0:32s} 0x{1:08x}\n" . format ( addrmap [ addr ] . upper ( ) , addr ) hf += "\n#endif\n" with open ( ofname , "w" ) as f : f . write ( hf )
Iterate through all sorted keys of the addrmap dict and genereate #define strings
Iterate through all sorted keys of the addrmap dict and genereate #define strings
"""
    Iterate through all sorted keys of the addrmap dict and genereate #define strings
    """
addrmap
ifname
ofname