From 6c56f52e7c1f5fd2b7450ffc92d58297cf8da506 Mon Sep 17 00:00:00 2001 From: bbracker Date: Wed, 13 Apr 2022 01:59:21 -0700 Subject: [PATCH] fix bugs in PLIC checkpoint state parsing --- linux/testvector-generation/parsePlicState.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/linux/testvector-generation/parsePlicState.py b/linux/testvector-generation/parsePlicState.py index b917bfdc3..c05dd65e3 100755 --- a/linux/testvector-generation/parsePlicState.py +++ b/linux/testvector-generation/parsePlicState.py @@ -26,11 +26,8 @@ def strip0x(num): return num[2:] def stripZeroes(num): - num = num.strip('0') - if num=='': - return '0' - else: - return num + num = int(num,16) + return hex(num)[2:] ############# # Main Code # @@ -84,11 +81,11 @@ with open(rawPlicStateFile, 'r') as rawPlicStateFile: # 0x0C020000 thru 0x0C020004 plicIntEnable = tokenize(rawPlicStateFile.readline())[1:] 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 plicIntEnable = tokenize(rawPlicStateFile.readline())[1:] 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 # 0x0C200000