SimObject.py (13675:afeab32b3655) | SimObject.py (13683:7a688f15e7b5) |
---|---|
1# Copyright (c) 2017-2018 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 667 unchanged lines hidden (view full) --- 676 namespaces, classname = class_path[:-1], class_path[-1] 677 py_class_name = '_COLONS_'.join(class_path) if namespaces else \ 678 classname; 679 680 # The 'local' attribute restricts us to the params declared in 681 # the object itself, not including inherited params (which 682 # will also be inherited from the base class's param struct 683 # here). Sort the params based on their key | 1# Copyright (c) 2017-2018 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 667 unchanged lines hidden (view full) --- 676 namespaces, classname = class_path[:-1], class_path[-1] 677 py_class_name = '_COLONS_'.join(class_path) if namespaces else \ 678 classname; 679 680 # The 'local' attribute restricts us to the params declared in 681 # the object itself, not including inherited params (which 682 # will also be inherited from the base class's param struct 683 # here). Sort the params based on their key |
684 params = map(lambda (k, v): v, sorted(cls._params.local.items())) | 684 params = map(lambda k_v: k_v[1], sorted(cls._params.local.items())) |
685 ports = cls._ports.local 686 687 code('''#include "pybind11/pybind11.h" 688#include "pybind11/stl.h" 689 690#include "params/$cls.hh" 691#include "python/pybind11/core.hh" 692#include "sim/init.hh" --- 79 unchanged lines hidden (view full) --- 772 773 # Generate the C++ declaration (.hh file) for this SimObject's 774 # param struct. Called from src/SConscript. 775 def cxx_param_decl(cls, code): 776 # The 'local' attribute restricts us to the params declared in 777 # the object itself, not including inherited params (which 778 # will also be inherited from the base class's param struct 779 # here). Sort the params based on their key | 685 ports = cls._ports.local 686 687 code('''#include "pybind11/pybind11.h" 688#include "pybind11/stl.h" 689 690#include "params/$cls.hh" 691#include "python/pybind11/core.hh" 692#include "sim/init.hh" --- 79 unchanged lines hidden (view full) --- 772 773 # Generate the C++ declaration (.hh file) for this SimObject's 774 # param struct. Called from src/SConscript. 775 def cxx_param_decl(cls, code): 776 # The 'local' attribute restricts us to the params declared in 777 # the object itself, not including inherited params (which 778 # will also be inherited from the base class's param struct 779 # here). Sort the params based on their key |
780 params = map(lambda (k, v): v, sorted(cls._params.local.items())) | 780 params = map(lambda k_v: k_v[1], sorted(cls._params.local.items())) |
781 ports = cls._ports.local 782 try: 783 ptypes = [p.ptype for p in params] 784 except: 785 print(cls, p, p.ptype_str) 786 print(params) 787 raise 788 --- 886 unchanged lines hidden --- | 781 ports = cls._ports.local 782 try: 783 ptypes = [p.ptype for p in params] 784 except: 785 print(cls, p, p.ptype_str) 786 print(params) 787 raise 788 --- 886 unchanged lines hidden --- |