From 66f9f9d041d3b8dcd74d80627a6c68b50ea4d507 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Thu, 8 Oct 2020 20:23:17 -0700 Subject: [PATCH] add carry handling to pia_res_to_output --- src/soc/fu/test/pia.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/soc/fu/test/pia.py b/src/soc/fu/test/pia.py index b51ab7db..0cb51661 100644 --- a/src/soc/fu/test/pia.py +++ b/src/soc/fu/test/pia.py @@ -30,4 +30,14 @@ def pia_res_to_output(pia_res): else: retval["xer_ov"] = 0 retval["xer_so"] = 0 + if pia_res.carry is not None: + carry = pia_res.carry + v = 0 + if carry.ca: + v |= 1 + if carry.ca32: + v |= 2 + retval["xer_ca"] = v + else: + retval["xer_ca"] = 0 return retval -- 2.30.2