github/workflows/pycopy-test: Upgrade Pycopy to 3.6.1.
[ScratchABlock.git] / arch_dummy.py
blob4440428318ed70840d939206591c887232c65838
1 # Based on arch_xtensa, but simplifies for usage in adhoc tests.
2 from core import ADDR, REG
3 from archutils import *
6 BITNESS = 32
7 ENDIANNESS = "little"
9 ALL_REGS = {REG("a0"), REG("sp")} | reg_range("a", 2, 15)
12 def call_params(addr):
13 return reg_range("a", 2, 7)
16 def param_filter(regs):
17 return regs
20 def call_ret(addr):
21 return reg_range("a", 2, 5)
24 def ret_filter(regs):
25 # Simple filter
26 return regs & reg_range("a", 2, 5)
29 def call_save(addr):
30 return reg_range("a", 12, 15) | {REG("sp")}
33 def call_defs(addr):
34 return call_ret(addr) | (ALL_REGS - call_save(addr))
37 def ret_uses(cfg):
38 # a0 contains return address
39 # sp should be preserved across call, but we'll check that using sp0 pseudo-reg.
40 #return {REG("a0"), REG("sp")}
41 return set()