#!/usr/bin/env python3

import sys

failed = False

tbman_lines = []

for line in open(sys.argv[1]).readlines():
	if line.startswith("TBMAN:"):
		tbman_lines.append(line.strip()[7:])

failed = failed or tbman_lines.pop(0) != "Raising all IRQs"
failed = failed or tbman_lines.pop(0) != "IRQs received. Checking order"
for i in range(16):
	failed = failed or tbman_lines.pop(0) != "{:08x}".format(i)
failed = failed or not tbman_lines[0].startswith("CPU requested termination")
failed = failed or tbman_lines[0].split(" ")[-1] != "0"

if not failed:
	print("Test PASSED.")
68b325168ed817c41904ab0c1f49370d6b897229
<mask token>

<mask token>
for line in open(sys.argv[1]).readlines():
    if line.startswith('TBMAN:'):
        tbman_lines.append(line.strip()[7:])
<mask token>
for i in range(16):
    failed = failed or tbman_lines.pop(0) != '{:08x}'.format(i)
<mask token>
if not failed:
    print('Test PASSED.')

<mask token>
failed = False
tbman_lines = []
for line in open(sys.argv[1]).readlines():
    if line.startswith('TBMAN:'):
        tbman_lines.append(line.strip()[7:])
failed = failed or tbman_lines.pop(0) != 'Raising all IRQs'
failed = failed or tbman_lines.pop(0) != 'IRQs received. Checking order'
for i in range(16):
    failed = failed or tbman_lines.pop(0) != '{:08x}'.format(i)
failed = failed or not tbman_lines[0].startswith('CPU requested termination')
failed = failed or tbman_lines[0].split(' ')[-1] != '0'
if not failed:
    print('Test PASSED.')

import sys
failed = False
tbman_lines = []
for line in open(sys.argv[1]).readlines():
    if line.startswith('TBMAN:'):
        tbman_lines.append(line.strip()[7:])
failed = failed or tbman_lines.pop(0) != 'Raising all IRQs'
failed = failed or tbman_lines.pop(0) != 'IRQs received. Checking order'
for i in range(16):
    failed = failed or tbman_lines.pop(0) != '{:08x}'.format(i)
failed = failed or not tbman_lines[0].startswith('CPU requested termination')
failed = failed or tbman_lines[0].split(' ')[-1] != '0'
if not failed:
    print('Test PASSED.')

#!/usr/bin/env python3

import sys

failed = False

tbman_lines = []

for line in open(sys.argv[1]).readlines():
	if line.startswith("TBMAN:"):
		tbman_lines.append(line.strip()[7:])

failed = failed or tbman_lines.pop(0) != "Raising all IRQs"
failed = failed or tbman_lines.pop(0) != "IRQs received. Checking order"
for i in range(16):
	failed = failed or tbman_lines.pop(0) != "{:08x}".format(i)
failed = failed or not tbman_lines[0].startswith("CPU requested termination")
failed = failed or tbman_lines[0].split(" ")[-1] != "0"

if not failed:
	print("Test PASSED.")