Commit 2a626e4d authored by Jan Pospisil's avatar Jan Pospisil

added SV debug trace also for MULTI read/write

parent 2939b35b
......@@ -64,11 +64,24 @@ def WbReadMulti(register, start = 0, to = -1):
result = m.read(register, start=start, to=to)
if WB_DEBUG:
print(ConColors.MAGENTA+'WB_READ_MULTI:'+ConColors.NONE+' ['+register+']('+str(start)+':'+str(to)+') = ' + ', '.join([hex(x) for x in result]))
if WB_DEBUG_2_SV:
address = int(m[register]['offset'], 16)
if to == -1:
to = int(m[register]['depth'], 16)
for i in range(start, to):
WB_DEBUG_2_SV_FP.write('WbRead('+str(address+i*4)+', dataOut, "WB_READ_MULTI: '+register+'['+str(i)+']:");\n')
WB_DEBUG_2_SV_FP.write('assert (dataOut == '+str(result[i])+') else $error("WB_READ_MULTI different, result should be '+hex(int(result[i]))+'!");\n')
return result
def WbWriteMulti(register, data, start = 0, to = -1):
if WB_DEBUG:
print(ConColors.CYAN+'WB_WRITE_MULTI:'+ConColors.NONE+' ['+register+']('+str(start)+':'+str(to)+') <- ' + ', '.join([hex(x) for x in data]))
if WB_DEBUG_2_SV:
address = int(m[register]['offset'], 16)
if to == -1:
to = int(m[register]['depth'])
for i in range(start, to):
WB_DEBUG_2_SV_FP.write('WbWrite('+str(address+i*4)+', '+str(data[i])+', "WB_WRITE_MULTI: '+register+'['+str(i)+']:");\n')
m.write(register, data, start=start, to=to)
def WbSetBitsMulti(register, mask, bits, start = 0, to = -1):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment