Changeset 41eca31 in mainline


Ignore:
Timestamp:
2009-09-17T00:42:09Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
810860a
Parents:
0e8ad0b
Message:

output directed bindings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • contrib/arch/hadlbppp.py

    r0e8ad0b r41eca31  
    451451                return flatten_binds(result, delegates, subsumes)
    452452
     453def direct_binds(binds):
     454        "Convert bindings matrix to set of sources by destination"
     455       
     456        result = {}
     457       
     458        for bind in binds:
     459                if (not bind['to'] in result):
     460                        result[bind['to']] = set()
     461               
     462                result[bind['to']].add(bind['from'])
     463       
     464        return result
     465
    453466def merge_subarch(prefix, arch, outdir):
    454467        "Merge subarchitecture into architexture"
     
    541554                dump_frame(inst['frame'], outdir, inst['var'], outf)
    542555       
    543         for bind in flatten_binds(binds, delegates, subsumes):
    544                 outf.write("bind %s to %s\n" % (bind['from'], bind['to']))
     556        directed_binds = direct_binds(flatten_binds(binds, delegates, subsumes))
     557       
     558        for dst, src in directed_binds.items():
     559                outf.write("bind %s to %s\n" % (", ".join(src), dst))
    545560       
    546561        outf.close()
Note: See TracChangeset for help on using the changeset viewer.