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
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
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
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()))
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 ---