StateMachine.py (9499:b03b556a8fbb) | StateMachine.py (9508:dde110931867) |
---|---|
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 2# Copyright (c) 2009 The Hewlett-Packard Development Company 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 504 unchanged lines hidden (view full) --- 513 514 code(''' 515m_dma_sequencer_ptr->setController(this); 516''') 517 518 code('m_num_controllers++;') 519 for var in self.objects: 520 if var.ident.find("mandatoryQueue") >= 0: | 1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 2# Copyright (c) 2009 The Hewlett-Packard Development Company 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 504 unchanged lines hidden (view full) --- 513 514 code(''' 515m_dma_sequencer_ptr->setController(this); 516''') 517 518 code('m_num_controllers++;') 519 for var in self.objects: 520 if var.ident.find("mandatoryQueue") >= 0: |
521 code('m_${{var.c_ident}}_ptr = new ${{var.type.c_ident}}();') | 521 code(''' 522m_${{var.c_ident}}_ptr = new ${{var.type.c_ident}}(); 523m_${{var.c_ident}}_ptr->setReceiver(this); 524''') |
522 523 code.dedent() 524 code(''' 525} 526 527void 528$c_ident::init() 529{ --- 38 unchanged lines hidden (view full) --- 568 569 if "default" in var: 570 code('*$vid = ${{var["default"]}}; // Object default') 571 elif "default" in vtype: 572 comment = "Type %s default" % vtype.ident 573 code('*$vid = ${{vtype["default"]}}; // $comment') 574 575 # Set ordering | 525 526 code.dedent() 527 code(''' 528} 529 530void 531$c_ident::init() 532{ --- 38 unchanged lines hidden (view full) --- 571 572 if "default" in var: 573 code('*$vid = ${{var["default"]}}; // Object default') 574 elif "default" in vtype: 575 comment = "Type %s default" % vtype.ident 576 code('*$vid = ${{vtype["default"]}}; // $comment') 577 578 # Set ordering |
576 if "ordered" in var and "trigger_queue" not in var: | 579 if "ordered" in var: |
577 # A buffer 578 code('$vid->setOrdering(${{var["ordered"]}});') 579 580 # Set randomization 581 if "random" in var: 582 # A buffer 583 code('$vid->setRandomization(${{var["random"]}});') 584 585 # Set Priority | 580 # A buffer 581 code('$vid->setOrdering(${{var["ordered"]}});') 582 583 # Set randomization 584 if "random" in var: 585 # A buffer 586 code('$vid->setRandomization(${{var["random"]}});') 587 588 # Set Priority |
586 if vtype.isBuffer and \ 587 "rank" in var and "trigger_queue" not in var: | 589 if vtype.isBuffer and "rank" in var: |
588 code('$vid->setPriority(${{var["rank"]}});') 589 | 590 code('$vid->setPriority(${{var["rank"]}});') 591 |
592 # Set sender and receiver for trigger queue 593 if var.ident.find("triggerQueue") >= 0: 594 code('$vid->setSender(this);') 595 code('$vid->setReceiver(this);') 596 elif vtype.c_ident == "TimerTable": 597 code('$vid->setClockObj(this);') 598 |
|
590 else: 591 # Network port object 592 network = var["network"] 593 ordered = var["ordered"] 594 vnet = var["virtual_network"] 595 vnet_type = var["vnet_type"] 596 597 assert var.machine is not None 598 code(''' 599$vid = m_net_ptr->get${network}NetQueue(m_version + base, $ordered, $vnet, "$vnet_type"); 600''') 601 602 code('assert($vid != NULL);') 603 | 599 else: 600 # Network port object 601 network = var["network"] 602 ordered = var["ordered"] 603 vnet = var["virtual_network"] 604 vnet_type = var["vnet_type"] 605 606 assert var.machine is not None 607 code(''' 608$vid = m_net_ptr->get${network}NetQueue(m_version + base, $ordered, $vnet, "$vnet_type"); 609''') 610 611 code('assert($vid != NULL);') 612 |
613 # Set the end 614 if network == "To": 615 code('$vid->setSender(this);') 616 else: 617 code('$vid->setReceiver(this);') 618 |
|
604 # Set ordering 605 if "ordered" in var: 606 # A buffer 607 code('$vid->setOrdering(${{var["ordered"]}});') 608 609 # Set randomization 610 if "random" in var: 611 # A buffer --- 30 unchanged lines hidden (view full) --- 642 code('${{prefetcher.code}}.setController(this);') 643 644 code() 645 for port in self.in_ports: 646 # Set the queue consumers 647 code('${{port.code}}.setConsumer(this);') 648 # Set the queue descriptions 649 code('${{port.code}}.setDescription("[Version " + to_string(m_version) + ", $ident, $port]");') | 619 # Set ordering 620 if "ordered" in var: 621 # A buffer 622 code('$vid->setOrdering(${{var["ordered"]}});') 623 624 # Set randomization 625 if "random" in var: 626 # A buffer --- 30 unchanged lines hidden (view full) --- 657 code('${{prefetcher.code}}.setController(this);') 658 659 code() 660 for port in self.in_ports: 661 # Set the queue consumers 662 code('${{port.code}}.setConsumer(this);') 663 # Set the queue descriptions 664 code('${{port.code}}.setDescription("[Version " + to_string(m_version) + ", $ident, $port]");') |
650 # Set the clock object 651 code('${{port.code}}.setClockObj(this);') | |
652 653 # Initialize the transition profiling 654 code() 655 for trans in self.transitions: 656 # Figure out if we stall 657 stall = False 658 for action in trans.actions: 659 if action.ident == "z_stall": --- 1066 unchanged lines hidden --- | 665 666 # Initialize the transition profiling 667 code() 668 for trans in self.transitions: 669 # Figure out if we stall 670 stall = False 671 for action in trans.actions: 672 if action.ident == "z_stall": --- 1066 unchanged lines hidden --- |