I have a system verilog function I am trying to convert into python. the function takes a binary file and reads in and does some ECC function which checks the if the input is valid.
function int local_ecc_function(int word_in) ;
int ecc;
ecc[0] = word_in[0 ]^ word_in[1 ]^ word_in[3 ]^ word_in[4 ]^ word_in[6 ]^ word_in[8 ]^ word_in[10 ]^ word_in[11 ]^ word_in[13 ]^ word_in[15 ]^ word_in[17 ]^ word_in[19 ]^ word_in[21 ]^ word_in[23 ]^ word_in[25 ]^ word_in[26 ]^ word_in[28 ]^ word_in[30];
...
my python reads the file and converts it into a list of ints:
bytes_arr = f.read(4)
list_temp = []
int_temp = int.from_bytes(bytes_arr, byteorder='big')
while bytes_arr:
bytes_arr = f.read(4)
int_temp = int.from_bytes(bytes_arr, byteorder='big')
list_temp.append(int_temp)
how can I convert the int into 32bits list so I can execute the ECC function? I am using python 3.8