Exemplo n.º 1
0
def main():
    hex_common.read_semantics_file(sys.argv[1])
    hex_common.read_attribs_file(sys.argv[2])
    hex_common.read_overrides_file(sys.argv[3])
    hex_common.calculate_attribs()
    tagregs = hex_common.get_tagregs()
    tagimms = hex_common.get_tagimms()

    with open(sys.argv[4], 'w') as f:
        f.write("#ifndef HEXAGON_TCG_FUNCS_H\n")
        f.write("#define HEXAGON_TCG_FUNCS_H\n\n")

        for tag in hex_common.tags:
            ## Skip the priv instructions
            if ("A_PRIV" in hex_common.attribdict[tag]):
                continue
            ## Skip the guest instructions
            if ("A_GUEST" in hex_common.attribdict[tag]):
                continue
            ## Skip the diag instructions
            if (tag == "Y6_diag"):
                continue
            if (tag == "Y6_diag0"):
                continue
            if (tag == "Y6_diag1"):
                continue

            gen_def_tcg_func(f, tag, tagregs, tagimms)

        f.write("#endif    /* HEXAGON_TCG_FUNCS_H */\n")
Exemplo n.º 2
0
def main():
    hex_common.read_semantics_file(sys.argv[1])
    hex_common.read_attribs_file(sys.argv[2])
    hex_common.read_overrides_file(sys.argv[3])
    hex_common.read_overrides_file(sys.argv[4])
    hex_common.calculate_attribs()
    tagregs = hex_common.get_tagregs()
    tagimms = hex_common.get_tagimms()

    with open(sys.argv[5], 'w') as f:
        for tag in hex_common.tags:
            ## Skip the priv instructions
            if ("A_PRIV" in hex_common.attribdict[tag]):
                continue
            ## Skip the guest instructions
            if ("A_GUEST" in hex_common.attribdict[tag]):
                continue
            ## Skip the diag instructions
            if (tag == "Y6_diag"):
                continue
            if (tag == "Y6_diag0"):
                continue
            if (tag == "Y6_diag1"):
                continue
            if (hex_common.skip_qemu_helper(tag)):
                continue

            gen_helper_function(f, tag, tagregs, tagimms)