Commit cd3093e2 authored by Jan Pospisil's avatar Jan Pospisil

fixed multi read/write SV reporting issues when accessing slice of the memory

parent 8e25fb8d
......@@ -75,8 +75,8 @@ def WbReadMulti(register, start = 0, 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 begin\n')
WB_DEBUG_2_SV_FP.write(' $error("WB_READ_MULTI different, result should be '+hex(int(result[i]))+'!");\n')
WB_DEBUG_2_SV_FP.write('assert (dataOut == '+str(result[i-start])+') else begin\n')
WB_DEBUG_2_SV_FP.write(' $error("WB_READ_MULTI different, result should be '+hex(int(result[i-start]))+'!");\n')
WB_DEBUG_2_SV_FP.write(' errors = errors + 1;\n')
WB_DEBUG_2_SV_FP.write('end\n')
return result
......@@ -89,7 +89,7 @@ def WbWriteMulti(register, data, start = 0, to = -1):
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')
WB_DEBUG_2_SV_FP.write('WbWrite('+str(address+i*4)+', '+str(data[i-start])+', "WB_WRITE_MULTI: '+register+'['+str(i)+']:");\n')
m.write(register, data, start=start, to=to)
def WbSetBitsMulti(register, mask, bits, start = 0, to = -1):
......@@ -176,7 +176,7 @@ def Ad9512Init():
# 0 - front panel clock
# 1 - FPGA loop clock
# 2 - oscilator
# 2 - oscillator
def SelectClock(clock):
if clock == 0:
# select CLK1 input, power down CLK2 input (AD9512)
......@@ -293,14 +293,16 @@ def PrintBit(value, bit, label, ifSet, ifNotSet):
def PrintBits(value, bitFrom, bitTo, label, descriptions):
print(' '+'['+str(bitTo)+':'+str(bitFrom)+'] '+label+':')
value &= (1<<bitTo+1)-1
value >>= bitFrom
color = ConColors.YELLOW
description = descriptions[value]
if value > len(descriptions)-1:
color = ConColors.RED
description = '<unknown>'
else:
color = ConColors.YELLOW
description = descriptions[value]
print(color+' '+str(value)+': '+description+ConColors.NONE)
def Status():
......
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