mirror of
https://github.com/openhwgroup/cvw
synced 2025-01-24 05:24:49 +00:00
fix bugs in PLIC checkpoint state parsing
This commit is contained in:
parent
777de6e05b
commit
6c56f52e7c
@ -26,11 +26,8 @@ def strip0x(num):
|
|||||||
return num[2:]
|
return num[2:]
|
||||||
|
|
||||||
def stripZeroes(num):
|
def stripZeroes(num):
|
||||||
num = num.strip('0')
|
num = int(num,16)
|
||||||
if num=='':
|
return hex(num)[2:]
|
||||||
return '0'
|
|
||||||
else:
|
|
||||||
return num
|
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# Main Code #
|
# Main Code #
|
||||||
@ -84,11 +81,11 @@ with open(rawPlicStateFile, 'r') as rawPlicStateFile:
|
|||||||
# 0x0C020000 thru 0x0C020004
|
# 0x0C020000 thru 0x0C020004
|
||||||
plicIntEnable = tokenize(rawPlicStateFile.readline())[1:]
|
plicIntEnable = tokenize(rawPlicStateFile.readline())[1:]
|
||||||
plicIntEnable = map(strip0x,plicIntEnable)
|
plicIntEnable = map(strip0x,plicIntEnable)
|
||||||
plicIntEnableArray.append(reduce(lambda x,y: x+y,plicIntEnable))
|
plicIntEnableArray.append(reduce(lambda x,y: y+x,plicIntEnable))
|
||||||
# 0x0C020080 thru 0x0C020084
|
# 0x0C020080 thru 0x0C020084
|
||||||
plicIntEnable = tokenize(rawPlicStateFile.readline())[1:]
|
plicIntEnable = tokenize(rawPlicStateFile.readline())[1:]
|
||||||
plicIntEnable = map(strip0x,plicIntEnable)
|
plicIntEnable = map(strip0x,plicIntEnable)
|
||||||
plicIntEnableArray.append(reduce(lambda x,y: x+y,plicIntEnable))
|
plicIntEnableArray.append(reduce(lambda x,y: y+x,plicIntEnable))
|
||||||
|
|
||||||
plicIntPriorityThresholdArray = [] # iterates over number of different contexts
|
plicIntPriorityThresholdArray = [] # iterates over number of different contexts
|
||||||
# 0x0C200000
|
# 0x0C200000
|
||||||
|
Loading…
Reference in New Issue
Block a user