litex/test/test_bist.py

23 lines
508 B
Python
Raw Normal View History

2014-12-22 18:41:39 -05:00
import time
from config import *
from tools import *
2014-12-22 19:39:41 -05:00
sector_size = 512
2014-12-22 18:41:39 -05:00
wb.open()
regs = wb.regs
###
2014-12-22 19:39:41 -05:00
regs.bist_start.write(1)
last_sector = 0
2014-12-22 18:41:39 -05:00
while True:
2014-12-22 19:39:41 -05:00
time.sleep(1)
sector = regs.bist_sector.read()
n_sectors = sector - last_sector
last_sector = sector
n_bytes = n_sectors*sector_size*4*2
ctrl_errors = regs.bist_ctrl_errors.read()
data_errors = regs.bist_data_errors.read()
print("%04d MB/s / data_errors %08d / ctrl_errors %08d " %(n_bytes/(1024*1024), data_errors, ctrl_errors))
2014-12-22 18:41:39 -05:00
###
wb.close()