aboutsummaryrefslogtreecommitdiff
path: root/verif/tosa_serializer.py
diff options
context:
space:
mode:
authorKevin Cheng <kevin.cheng@arm.com>2020-11-11 13:54:06 -0800
committerKevin Cheng <kevin.cheng@arm.com>2020-11-12 11:47:16 -0800
commitaee1facbde25caf27cc34e5ec08eb8bba6af8e18 (patch)
tree0ff32b95e6f32444445ca01c1b47835b52fb955f /verif/tosa_serializer.py
parent99bea145a050e12f1b5f8301979713d9a9b04e12 (diff)
downloadreference_model-aee1facbde25caf27cc34e5ec08eb8bba6af8e18.tar.gz
Implement and add unit tests for MUL and ARITHMETIC_RIGHT_SHIFT
add .clang-format Add expected failure for RESIZE and RESCALE unit tests Signed-off-by: Kevin Cheng <kevin.cheng@arm.com> Change-Id: I33c8afdc8998e8518f2b0e5fabddd36ce3aa2ee9
Diffstat (limited to 'verif/tosa_serializer.py')
-rw-r--r--verif/tosa_serializer.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/verif/tosa_serializer.py b/verif/tosa_serializer.py
index 7ba68c3..07e0e1a 100644
--- a/verif/tosa_serializer.py
+++ b/verif/tosa_serializer.py
@@ -247,6 +247,24 @@ class TosaSerializerAttribute(TosaSerializerUnion):
self.bools.append((a.RescaleAttributeAddPerChannel,
per_channel))
+ def MulAttribute(self, shift):
+ from tosa import MulAttribute as a, Attribute
+
+ self.utype = Attribute.Attribute().MulAttribute
+ self.optFcns = (a.MulAttributeStart, a.MulAttributeEnd)
+
+ self.ints.append((a.MulAttributeAddShift,
+ shift))
+
+ def ArithmeticRightShiftAttribute(self, round):
+ from tosa import ArithmeticRightShiftAttribute as a, Attribute
+
+ self.utype = Attribute.Attribute().ArithmeticRightShiftAttribute
+ self.optFcns = (a.ArithmeticRightShiftAttributeStart, a.ArithmeticRightShiftAttributeEnd)
+
+ self.bools.append((a.ArithmeticRightShiftAttributeAddRound,
+ round))
+
def CustomAttribute(self, identifier):
from tosa import CustomAttribute as a, Attribute