From: Jacob Lifshay Date: Fri, 9 Oct 2020 03:23:17 +0000 (-0700) Subject: add carry handling to pia_res_to_output X-Git-Tag: 24jan2021_ls180~176 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=66f9f9d041d3b8dcd74d80627a6c68b50ea4d507;p=soc.git add carry handling to pia_res_to_output --- 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