StateMachine.py (11108:6342ddf6d733) | StateMachine.py (11111:6da33e720481) |
---|---|
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 2# Copyright (c) 2009 The Hewlett-Packard Development Company 3# Copyright (c) 2013 Advanced Micro Devices, Inc. 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 566 unchanged lines hidden (view full) --- 575 576 assert (vnet, network) not in vnet_dir_set 577 vnet_dir_set.add((vnet,network)) 578 579 code(''' 580m_net_ptr->set${network}NetQueue(m_version + base, $vid->getOrdered(), $vnet, 581 "$vnet_type", $vid); 582''') | 1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood 2# Copyright (c) 2009 The Hewlett-Packard Development Company 3# Copyright (c) 2013 Advanced Micro Devices, Inc. 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 566 unchanged lines hidden (view full) --- 575 576 assert (vnet, network) not in vnet_dir_set 577 vnet_dir_set.add((vnet,network)) 578 579 code(''' 580m_net_ptr->set${network}NetQueue(m_version + base, $vid->getOrdered(), $vnet, 581 "$vnet_type", $vid); 582''') |
583 # Set the end 584 if network == "To": 585 code('$vid->setSender(this);') 586 else: 587 code('$vid->setReceiver(this);') 588 | |
589 # Set Priority 590 if "rank" in var: 591 code('$vid->setPriority(${{var["rank"]}})') 592 | 583 # Set Priority 584 if "rank" in var: 585 code('$vid->setPriority(${{var["rank"]}})') 586 |
593 else: 594 if var.type_ast.type.c_ident == "MessageBuffer": 595 code('$vid->setReceiver(this);') 596 if var.ident.find("triggerQueue") >= 0: 597 code('$vid->setSender(this);') 598 elif var.ident.find("optionalQueue") >= 0: 599 code('$vid->setSender(this);') 600 | |
601 code.dedent() 602 code(''' 603} 604 605void 606$c_ident::init() 607{ 608 // initialize objects --- 23 unchanged lines hidden (view full) --- 632 code('assert($vid != NULL);') 633 634 if "default" in var: 635 code('*$vid = ${{var["default"]}}; // Object default') 636 elif "default" in vtype: 637 comment = "Type %s default" % vtype.ident 638 code('*$vid = ${{vtype["default"]}}; // $comment') 639 | 587 code.dedent() 588 code(''' 589} 590 591void 592$c_ident::init() 593{ 594 // initialize objects --- 23 unchanged lines hidden (view full) --- 618 code('assert($vid != NULL);') 619 620 if "default" in var: 621 code('*$vid = ${{var["default"]}}; // Object default') 622 elif "default" in vtype: 623 comment = "Type %s default" % vtype.ident 624 code('*$vid = ${{vtype["default"]}}; // $comment') 625 |
640 if vtype.c_ident == "TimerTable": 641 code('$vid->setClockObj(this);') 642 | |
643 # Set the prefetchers 644 code() 645 for prefetcher in self.prefetchers: 646 code('${{prefetcher.code}}.setController(this);') 647 648 code() 649 for port in self.in_ports: 650 # Set the queue consumers --- 637 unchanged lines hidden (view full) --- 1288 actions = trans.actions 1289 request_types = trans.request_types 1290 1291 # Check for resources 1292 case_sorter = [] 1293 res = trans.resources 1294 for key,val in res.iteritems(): 1295 val = ''' | 626 # Set the prefetchers 627 code() 628 for prefetcher in self.prefetchers: 629 code('${{prefetcher.code}}.setController(this);') 630 631 code() 632 for port in self.in_ports: 633 # Set the queue consumers --- 637 unchanged lines hidden (view full) --- 1271 actions = trans.actions 1272 request_types = trans.request_types 1273 1274 # Check for resources 1275 case_sorter = [] 1276 res = trans.resources 1277 for key,val in res.iteritems(): 1278 val = ''' |
1296if (!%s.areNSlotsAvailable(%s)) | 1279if (!%s.areNSlotsAvailable(%s, clockEdge())) |
1297 return TransitionResult_ResourceStall; 1298''' % (key.code, val) 1299 case_sorter.append(val) 1300 1301 # Check all of the request_types for resource constraints 1302 for request_type in request_types: 1303 val = ''' 1304if (!checkResourceAvailable(%s_RequestType_%s, addr)) { --- 249 unchanged lines hidden --- | 1280 return TransitionResult_ResourceStall; 1281''' % (key.code, val) 1282 case_sorter.append(val) 1283 1284 # Check all of the request_types for resource constraints 1285 for request_type in request_types: 1286 val = ''' 1287if (!checkResourceAvailable(%s_RequestType_%s, addr)) { --- 249 unchanged lines hidden --- |