Commit b45cb368 authored by Denia Bouhired-Ferrag's avatar Denia Bouhired-Ferrag

hardware test with small modification. pts define includes adress for hw information

parent 3d62ae31
......@@ -63,7 +63,7 @@ def main(bus,tname,inf,log):
uses : pts.bit and hwvertest.py
"""
HWVERS = 4.0
HWVERS_target = 4.0
pel = PTS_ERROR_LOGGER(inf,log)
......@@ -73,19 +73,18 @@ def main(bus,tname,inf,log):
# 4 MSB represent HW version number (major)
# 2 LSB represent number of execution (minor)
# Eg: value 010010 represents PCB version 4.2
hwvers = (bus.vv_read(HWVERS)
hwvers = bus.vv_read(HWVERS_reg)
maj = int(hwvers >> HWVERS_VERS_OFS)
min = float(hwvers & 0x03)
min /= 10
hwvers = maj + min
# and now check if appropriate
if (hwvers == HWVERS):
if (hwvers == HWVERS_target):
msg = "HW/PCB version correct: %2.1f\n" % (hwvers)
inf.write(msg)
else:
msg = "ERROR: HW/PCBe version (%2.1f) incorrect - expected %2.1f" % (hwvers, HWVERS)
msg = "ERROR: HW/PCBe version (%2.1f) incorrect - expected %2.1f" % (hwvers, HWVERS_target)
pel.set(msg)
print "-->%s" % msg
......
......@@ -82,7 +82,7 @@ TER_ITERM_OFS = 0
TER_OTERM_OFS = 6
# HW version register
HWVERS = 0x10
HWVERS_reg = 0x10
HWVERS_EXEC_OFS = 0
HWVERS_VERS_OFS = 2
......
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