##// END OF EJS Templates
sources reorganized...
sources reorganized imports are done in a better way a few renaming also

File last commit:

r9:0cad6347e265 default
r9:0cad6347e265 default
Show More
read_flags.py
90 lines | 2.3 KiB | text/x-python | PythonLexer
import numpy as np
from __main__ import RMAPPlugin0
from test_fft.register_addresses import *
import test_fft.print_custom as prnt
def is_MEM_IN_SM_Emty( address ):
ret = 0
fft_reg = RMAPPlugin0.Read( address, 1)
MEM_IN_SM_Empty = (fft_reg[0] & 0x01f00000) >> 20
if MEM_IN_SM_Empty == 0x1f:
ret = 1
return ret
def out_locked_AND_out_reuse_AND_out_ren( address ):
# reuse => 0111 1111 1111 1111
RMAPPlugin0.Write( address, [0x00007fff] )
#==================================
#==================================
def is_MEM_OUT_SM_Empty( address ):
ret = 0
sm_reg = RMAPPlugin0.Read( address, 1)
MEM_OUT_SM_Empty = (sm_reg[0] & 0x00000030) >> 4
if MEM_OUT_SM_Empty == 0x3:
ret = 1
return ret
def is_MEM_OUT_SM_Full( address ):
ret = 0
sm_reg = RMAPPlugin0.Read( address, 1)
MEM_OUT_SM_Full = (sm_reg[0] & 0x0000000c) >> 2
if MEM_OUT_SM_Full != 0x0:
ret = 1
return ret
def is_MEM_OUT_SM_Full_FIFO_0( address ):
ret = 0
sm_reg = RMAPPlugin0.Read( address, 1)
MEM_OUT_SM_Full = (sm_reg[0] & 0x00000004) >> 2
if MEM_OUT_SM_Full == 0x01:
ret = 1
return ret
def is_MEM_OUT_SM_Full_FIFO_1( address ):
ret = 0
sm_reg = RMAPPlugin0.Read( address, 1)
MEM_OUT_SM_Full = (sm_reg[0] & 0x00000008) >> 3
if MEM_OUT_SM_Full == 0x01:
ret = 1
return ret
def wait_for_FIFO_0_Full( address ):
counter = 0
while ( is_MEM_OUT_SM_Full_FIFO_0( address ) == 0 ):
prnt.print_custom( "FIFO_0 not full " + str(counter) )
counter = counter + 1
if counter == 10:
break
def wait_for_FIFO_1_Full( address ):
counter = 0
while ( is_MEM_OUT_SM_Full_FIFO_1( address ) == 0 ):
prnt.print_custom( "FIFO_1 not full " + str(counter))
counter = counter + 1
if counter == 10:
break
def wait_for_FIFO_Full( fifo, address ):
if fifo == 0:
wait_for_FIFO_0_Full( address )
elif fifo == 1:
wait_for_FIFO_1_Full( address )
else:
prnt.print_custom( "ERR *** wait_for_FIFO_Full *** unexpted value for parameter [fifo]" )
def wait_for_FIFO_0_or_1_Full( address ):
counter = 0
sm_reg = RMAPPlugin0.Read( address, 1)
MEM_OUT_SM_Full = (sm_reg[0] & 0x0000000c) >> 2
while ( MEM_OUT_SM_Full == 0 ):
prnt.print_custom( "FIFO 0 or 1 not full " + str(counter))
counter = counter + 1
if counter == 10:
break
sm_reg = RMAPPlugin0.Read( address, 1)
MEM_OUT_SM_Full = (sm_reg[0] & 0x0000000c) >> 2
RMAPPlugin0.ProcessPendingEvents()