A collection of classes providing simple hardware specification, simulation, tracing, and testing suitable for teaching and research. Simplicity, usability, clarity, and extensibility are the overarching goals, rather than performance or optimization.
There was a test helper function, matrix_to_int in test_matrix.py that converts Python lists of lists into an int. Since this is useful outside of testing (i.e. in Simulation), I moved it to matrix.py, renamed it, and added some more functionality (i.e. making sure it handles negative elements (converting to two's complement) and checking for a bad number of bits).
There was a test helper function,
matrix_to_int
intest_matrix.py
that converts Python lists of lists into an int. Since this is useful outside of testing (i.e. in Simulation), I moved it tomatrix.py
, renamed it, and added some more functionality (i.e. making sure it handles negative elements (converting to two's complement) and checking for a bad number of bits).