Commit c2059237 authored by Maciej Lipinski's avatar Maciej Lipinski

[SW] debugged verification test of the PCB/HW version

parent 2adc5839
......@@ -69,21 +69,27 @@ def main(bus,tname,inf,log):
try:
# Get gateware version and convert it to major-minor float number
# Read PCB version: a 6 bits representing HW/PCB version number
# 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(CSR) & 0x3F00) >> CSR_HWVERS_OFS
maj = float(hwvers >> 2)
maj = int(hwvers >> 2)
min = float(hwvers & 0x03)
min /= 10
hwvers = maj + min
# and now check if appropriate
if (hwvers == HWVERS):
msg = "HW/PCB version correct: %2.*f\n" % (p, hwvers)
msg = "HW/PCB version correct: %2.1f\n" % (hwvers)
inf.write(msg)
else:
msg = "ERROR: HW/PCBe version (%2.*f) incorrect - expected %2.*f" % (p, hwvers, pr, HWVERS)
msg = "ERROR: HW/PCBe version (%2.1f) incorrect - expected %2.1f" % (hwvers, HWVERS)
pel.set(msg)
print "-->%s" % msg
return pel.get()
except BusException, e:
......@@ -91,4 +97,3 @@ def main(bus,tname,inf,log):
except BusWarning, e:
raise PtsError("SKT Warning: %s" % (e))
\ No newline at end of file
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