Explicit cast to integer before converting to enum or flag type

This commit is contained in:
Alex Forencich
2022-01-07 12:52:41 -08:00
parent 2d70e5cbe5
commit 873bb1a034
4 changed files with 10 additions and 10 deletions

View File

@@ -591,7 +591,7 @@ class AxiMasterWrite(Region, Reset):
for burst_length in cmd.burst_list:
b = await context.get_resp()
burst_resp = AxiResp(getattr(b, 'bresp', AxiResp.OKAY))
burst_resp = AxiResp(int(getattr(b, 'bresp', AxiResp.OKAY)))
burst_user = int(getattr(b, 'buser', 0))
if burst_resp != AxiResp.OKAY:
@@ -973,7 +973,7 @@ class AxiMasterRead(Region, Reset):
for r in burst:
cycle_data = int(r.rdata)
cycle_resp = AxiResp(getattr(r, "rresp", AxiResp.OKAY))
cycle_resp = AxiResp(int(getattr(r, "rresp", AxiResp.OKAY)))
cycle_user = int(getattr(r, "ruser", 0))
if cycle_resp != AxiResp.OKAY: