Deleted Added
sdiff udiff text old ( 8839:eeb293859255 ) new ( 8840:b62d40514d98 )
full compact
1# Copyright (c) 2004-2006 The Regents of The University of Michigan
2# Copyright (c) 2010 Advanced Micro Devices, Inc.
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;

--- 13 unchanged lines hidden (view full) ---

22# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28# Authors: Steve Reinhardt
29# Nathan Binkert
30
31import sys
32from types import FunctionType, MethodType, ModuleType
33
34try:
35 import pydot
36except:
37 pydot = False

--- 343 unchanged lines hidden (view full) ---

381 classname = class_path[-1]
382 namespaces = class_path[:-1]
383
384 # The 'local' attribute restricts us to the params declared in
385 # the object itself, not including inherited params (which
386 # will also be inherited from the base class's param struct
387 # here).
388 params = cls._params.local.values()
389
390 code('%module(package="m5.internal") param_$cls')
391 code()
392 code('%{')
393 code('#include "params/$cls.hh"')
394 for param in params:
395 param.cxx_predecls(code)
396 cls.export_method_cxx_predecls(code)

--- 39 unchanged lines hidden (view full) ---

436 # Generate the C++ declaration (.hh file) for this SimObject's
437 # param struct. Called from src/SConscript.
438 def cxx_param_decl(cls, code):
439 # The 'local' attribute restricts us to the params declared in
440 # the object itself, not including inherited params (which
441 # will also be inherited from the base class's param struct
442 # here).
443 params = cls._params.local.values()
444 try:
445 ptypes = [p.ptype for p in params]
446 except:
447 print cls, p, p.ptype_str
448 print params
449 raise
450
451 class_path = cls._value_dict['cxx_class'].split('::')

--- 24 unchanged lines hidden (view full) ---

476#endif
477
478#include <string>
479
480class EventQueue;
481''')
482 for param in params:
483 param.cxx_predecls(code)
484 code()
485
486 if cls._base:
487 code('#include "params/${{cls._base.type}}.hh"')
488 code()
489
490 for ptype in ptypes:
491 if issubclass(ptype, Enum):

--- 20 unchanged lines hidden (view full) ---

512 virtual ~SimObjectParams() {}
513
514 std::string name;
515 PyObject *pyobj;
516 EventQueue *eventq;
517 ''')
518 for param in params:
519 param.cxx_decl(code)
520 code.dedent()
521 code('};')
522
523 code()
524 code('#endif // __PARAMS__${cls}__')
525 return code
526
527

--- 427 unchanged lines hidden (view full) ---

955 else:
956 setattr(cc_params, param, value)
957
958 port_names = self._ports.keys()
959 port_names.sort()
960 for port_name in port_names:
961 port = self._port_refs.get(port_name, None)
962 if port != None:
963 setattr(cc_params, port_name, port)
964 self._ccParams = cc_params
965 return self._ccParams
966
967 # Get C++ object corresponding to this object, calling C++ if
968 # necessary to construct it. Does *not* recursively create
969 # children.
970 def getCCObject(self):
971 if not self._ccObject:

--- 152 unchanged lines hidden ---