diff options
author | Jeremy Johnson <jeremy.johnson@arm.com> | 2024-04-11 16:21:54 +0100 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2024-04-18 15:34:50 +0000 |
commit | 1eb1455568e2a23971f2c1b7be1077a8c1494685 (patch) | |
tree | 7979b9e1eaf3e407ff493c7f4b51fcf127f6603c /verif/generator/tosa_test_gen.py | |
parent | 8753f3aa944c87e779db2d2c4ba9d9df241b87b1 (diff) | |
download | reference_model-1eb1455568e2a23971f2c1b7be1077a8c1494685.tar.gz |
Update compliance verify checks
Cope with large error bounds with small reference values.
Change how error bounds of NaN are avoided for ABS_ERRORs.
Update SIN/COS compliance to latest spec and use input value as
magnitude.
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Change-Id: I55aca59e0255e1cfd255b08edb845c3e33ca7eff
Diffstat (limited to 'verif/generator/tosa_test_gen.py')
-rw-r--r-- | verif/generator/tosa_test_gen.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/verif/generator/tosa_test_gen.py b/verif/generator/tosa_test_gen.py index 40788a2..b85dd03 100644 --- a/verif/generator/tosa_test_gen.py +++ b/verif/generator/tosa_test_gen.py @@ -290,10 +290,18 @@ class TosaTestGen: } elif op["op"] in (Op.SIN, Op.COS): mode = gtu.ComplianceMode.ABS_ERROR - if "compliance" in op and "abs_error_normal_divisor" in op["compliance"]: - compliance_tens["abs_error_info"] = { - "normal_divisor": op["compliance"]["abs_error_normal_divisor"] - } + if "compliance" in op: + normal_divisor = op["compliance"].get("abs_error_normal_divisor", 1) + bound_addition = op["compliance"].get("abs_error_bound_addition", 0) + else: + normal_divisor = 1 + bound_addition = 0 + + compliance_tens["abs_error_info"] = { + "normal_divisor": normal_divisor, + "bound_as_magnitude": True, + "bound_addition": bound_addition, + } else: mode = gtu.ComplianceMode.EXACT compliance_tens["mode"] = gtu.ComplianceMode(mode).name @@ -4139,7 +4147,10 @@ class TosaTestGen: TosaErrorValidator.evWrongOutputList, ), "data_gen": PSEUDO_RANDOM_DATAGEN, - "compliance": {"abs_error_normal_divisor": 2}, + "compliance": { + "abs_error_normal_divisor": 2, + "abs_error_bound_addition": 1, + }, }, "exp": { "op": Op.EXP, |