summaryrefslogtreecommitdiff
path: root/util/cpt_upgraders/remove-arm-cpsr-mode-miscreg.py
blob: be3bf07b536f232d5348023ffdd127ca7f255b7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# Remove the MISCREG_CPSR_MODE register from the ARM register file
def upgrader(cpt):
    if cpt.get('root','isa') == 'arm':
        for sec in cpt.sections():
            import re
            # Search for all ISA sections
            if re.search('.*sys.*\.cpu.*\.isa$', sec):
                mr = cpt.get(sec, 'miscRegs').split()
                # Remove MISCREG_CPSR_MODE
                del mr[137]
                cpt.set(sec, 'miscRegs', ' '.join(str(x) for x in mr))

legacy_version = 5