Replace RegisterFile with Memory.
[soc.git] / TestUtil / test_helper.py
1 # Verifies the given values given the particular operand
2 # Arguments:
3 # p (Prefix): Appended to the front of the assert statement
4 # e (Expected): The expected value
5 # o (Output): The output result
6 # op (Operation): (0 => ==), (1 => !=)
7 def assert_op(pre, o, e, op):
8 if op == 0:
9 assert_eq(pre, o, e)
10 else:
11 assert_ne(pre, o, e)
12
13 # Verifies the given values are equal
14 # Arguments:
15 # p (Prefix): Appended to the front of the assert statement
16 # e (Expected): The expected value
17 # o (Output): The output result
18 def assert_eq(p, o, e):
19 assert o == e, p + " Output " + str(o) + " Expected " + str(e)
20
21 # Verifies the given values are not equal
22 # Arguments:
23 # p (Prefix): Appended to the front of the assert statement
24 # e (Expected): The expected value
25 # o (Output): The output result
26 def assert_ne(p, o, e):
27 assert o != e, p + " Output " + str(o) + " Not Expecting " + str(e)