Changeset 100aaf5 in mainline for contrib/arch/hadlbppp.py
- Timestamp:
- 2009-10-07T10:44:21Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0a1a313
- Parents:
- f563126
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/arch/hadlbppp.py
rf563126 r100aaf5 42 42 "Print usage syntax" 43 43 44 print "%s <-- dumpbp|--dumpadl|--noop>+ <OUTPUT>" % prname44 print "%s <--bp|--epb|--adl|--nop>+ <OUTPUT>" % prname 45 45 46 46 def tabs(cnt): … … 371 371 return output 372 372 373 def parse_ebp(component, name, tokens, base_indent): 374 "Parse Behavior Protocol and generate Extended Behavior Protocol output" 375 376 return "component %s {\n\tbehavior {\n\t\t%s\n\t}\n}" % (component, parse_bp(name, tokens, base_indent + 2)) 377 373 378 def get_iface(name): 374 379 "Get interface by name" … … 401 406 402 407 global opt_bp 403 404 fname = "%s.bp" % frame['name'] 408 global opt_ebp 409 410 if (opt_ebp): 411 fname = "%s.ebp" % frame['name'] 412 else: 413 fname = "%s.bp" % frame['name'] 405 414 406 415 if (archf != None): … … 439 448 outf.write(parse_bp(outname, merge_bp(initialization, finalization, protocols), 0)) 440 449 outf.close() 450 451 if (opt_ebp): 452 outf = file(outname, "w") 453 outf.write(parse_ebp(frame['name'], outname, merge_bp(initialization, finalization, protocols), 0)) 454 outf.close() 441 455 442 456 def get_system_arch(): … … 475 489 476 490 global opt_bp 491 global opt_ebp 477 492 478 493 if (archf != None): … … 484 499 outf = file(outname, "w") 485 500 outf.write("NULL") 501 outf.close() 502 503 if (opt_ebp): 504 outf = file(outname, "w") 505 outf.write("component null {\n\tbehavior {\n\t\tNULL\n\t}\n}") 486 506 outf.close() 487 507 … … 570 590 571 591 global opt_bp 592 global opt_ebp 572 593 573 594 arch = get_system_arch() … … 614 635 615 636 outname = os.path.join(outdir, "%s.archbp" % arch['name']) 616 if ( opt_bp):637 if ((opt_bp) or (opt_ebp)): 617 638 outf = file(outname, "w") 618 639 else: … … 1564 1585 global arch_properties 1565 1586 global opt_bp 1587 global opt_ebp 1566 1588 global opt_adl 1567 1589 … … 1571 1593 1572 1594 opt_bp = False 1595 opt_ebp = False 1573 1596 opt_adl = False 1574 1597 1575 1598 for arg in sys.argv[1:(len(sys.argv) - 1)]: 1576 if (arg == "-- dumpbp"):1599 if (arg == "--bp"): 1577 1600 opt_bp = True 1578 elif (arg == "--dumpadl"): 1601 elif (arg == "--ebp"): 1602 opt_ebp = True 1603 elif (arg == "--adl"): 1579 1604 opt_adl = True 1580 elif (arg == "--no op"):1605 elif (arg == "--nop"): 1581 1606 pass 1582 1607 else: … … 1584 1609 return 1585 1610 1611 if ((opt_bp) and (opt_ebp)): 1612 print "Error: Cannot dump both original Behavior Protocols and Extended Behavior Protocols" 1613 return 1614 1586 1615 path = os.path.abspath(sys.argv[-1]) 1587 1616 if (not os.path.isdir(path)):
Note:
See TracChangeset
for help on using the changeset viewer.