class Transient(pc_ast.Node):
- def __init__(self, value="UINT64_C(0)", bits="(uint8_t)ctx->XLEN"):
+ def __init__(self, value="UINT64_C(0)", bits="(uint8_t)OPPC_XLEN"):
self.__value = value
self.__bits = bits
def __getitem__(self, node):
return self.__code[node]
- def transient(self, node, value="UINT64_C(0)", bits="(uint8_t)ctx->XLEN"):
+ def transient(self, node, value="UINT64_C(0)", bits="(uint8_t)OPPC_XLEN"):
transient = Transient(value=value, bits=bits)
with self.pseudocode(node=node):
self.traverse(root=transient)
bits = f"UINT8_C({str(len(value[2:]) * 4)})"
value = int(value, 16)
else:
- bits = "ctx->XLEN"
+ bits = "(uint8_t)OPPC_XLEN"
value = int(value)
fmt = str
if (value > ((2**64) - 1)):
def GPR(self, node):
yield node
with self.pseudocode(node=node):
- self[node].emit(stmt=f"&ctx->gpr[OPPC_GPR_{str(node)}]")
+ self[node].emit(stmt=f"&OPPC_GPR[OPPC_GPR_{str(node)}]")
@pc_util.Hook(pc_ast.FPR)
def FPR(self, node):
yield node
with self.pseudocode(node=node):
- self[node].emit(stmt=f"&ctx->fpr[OPPC_FPR_{str(node)}]")
+ self[node].emit(stmt=f"&OPPC_FPR[OPPC_FPR_{str(node)}]")
@pc_util.Hook(pc_ast.RepeatExpr)
def RepeatExpr(self, node):
@pc_util.Hook(pc_ast.XLEN)
def XLEN(self, node):
yield node
- (value, bits) = ("ctx->XLEN", "(uint8_t)ctx->XLEN")
+ (value, bits) = ("OPPC_XLEN", "(uint8_t)OPPC_XLEN")
transient = self.transient(node=node, value=value, bits=bits)
for (level, stmt) in self[transient]:
self[node].emit(stmt=stmt, level=level)