Changeset f1fb1d1 in mainline
- Timestamp:
- 2009-09-17T00:01:46Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0e8ad0b
- Parents:
- 51d4040
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/arch/hadlbppp.py
r51d4040 rf1fb1d1 422 422 outf.close() 423 423 424 def flatten_binds(binds, delegates, subsumes): 425 "Remove bindings which are replaced by delegation or subsumption" 426 427 result = [] 428 stable = True 429 430 for bind in binds: 431 keep = True 432 433 for delegate in delegates: 434 if (bind['to'] == delegate['to']): 435 keep = False 436 result.append({'from': bind['from'], 'to': delegate['rep']}) 437 438 for subsume in subsumes: 439 if (bind['from'] == subsume['from']): 440 keep = False 441 result.append({'from': subsume['rep'], 'to': bind['to']}) 442 443 if (keep): 444 result.append(bind) 445 else: 446 stable = False 447 448 if (stable): 449 return result 450 else: 451 return flatten_binds(result, delegates, subsumes) 452 424 453 def merge_subarch(prefix, arch, outdir): 425 454 "Merge subarchitecture into architexture" … … 512 541 dump_frame(inst['frame'], outdir, inst['var'], outf) 513 542 514 for bind in binds: 515 for delegate in delegates: 516 if (bind['to'] == delegate['to']): 517 bind['to'] = delegate['rep'] 518 break 519 520 for subsume in subsumes: 521 if (bind['from'] == subsume['from']): 522 bind['from'] = subsume['rep'] 523 break 524 543 for bind in flatten_binds(binds, delegates, subsumes): 525 544 outf.write("bind %s to %s\n" % (bind['from'], bind['to'])) 526 545
Note:
See TracChangeset
for help on using the changeset viewer.