summaryrefslogtreecommitdiff
path: root/tools/checker/file_format/c1visualizer/struct.py
diff options
context:
space:
mode:
authorFabio Rinaldi <fabio.rinaldi@linaro.org>2020-02-12 16:18:50 +0000
committerRoland Levillain <rpl@google.com>2020-07-22 10:44:31 +0000
commit40b0614be3296e163654c4e293793d00bcf36a5a (patch)
tree5dcd9dd7d93d14b83c82cb90674df9353280189d /tools/checker/file_format/c1visualizer/struct.py
parent52fe49e87902fb231201874f52c4993e6fe611e9 (diff)
Checker: Add function isaHasFeature
Developers are now able to use hasIsaFeature("feature_name") to check if an instruction set feature was used at compile time. Checker will retrieve the list of features from the .cfg file. It expects them to be dumped at the beginning of the file as a fake compilation block in the following form: begin_compilation name "isa_features:feature1,-feature2" method "isa_features:feature1,-feature2" date 1580721972 end_compilation Dumping that is optional. hasIsaFeature() will always return False if that pass is not found. Author: Fabio Rinaldi Committer: Artem Serov Bug: 147876827 Test: ./art/tools/checker/run_unit_tests.py Test: test.py --target --optimizing Change-Id: I4ce15d853025f9863d7981b33b761cfc799fed50
Diffstat (limited to 'tools/checker/file_format/c1visualizer/struct.py')
-rw-r--r--tools/checker/file_format/c1visualizer/struct.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/checker/file_format/c1visualizer/struct.py b/tools/checker/file_format/c1visualizer/struct.py
index 991564eff4..21036da213 100644
--- a/tools/checker/file_format/c1visualizer/struct.py
+++ b/tools/checker/file_format/c1visualizer/struct.py
@@ -12,14 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from common.logger import Logger
-from common.mixins import PrintableMixin
+from common.immutables import ImmutableDict
+from common.logger import Logger
+from common.mixins import PrintableMixin
class C1visualizerFile(PrintableMixin):
def __init__(self, fileName):
self.fileName = fileName
self.passes = []
+ self.instructionSetFeatures = ImmutableDict()
+
+ def setISAFeatures(self, features):
+ self.instructionSetFeatures = ImmutableDict(features)
def addPass(self, new_pass):
self.passes.append(new_pass)
@@ -32,7 +37,8 @@ class C1visualizerFile(PrintableMixin):
def __eq__(self, other):
return isinstance(other, self.__class__) \
- and self.passes == other.passes
+ and self.passes == other.passes \
+ and self.instructionSetFeatures == other.instructionSetFeatures
class C1visualizerPass(PrintableMixin):