Implemented LFSR generator with tests and CLI integration

This commit is contained in:
AdrienCos 2019-06-04 15:28:02 -04:00 committed by Adrien Cosson
parent bf094c0361
commit 9f032fffbc
4 changed files with 325 additions and 0 deletions

View file

@ -115,6 +115,12 @@ if arguments.command != 'list-generators':
exit(1)
try:
if (arguments.generator_function[0] == "LFSR"):
# Compute the size of the image for use by the LFSR generator if needed
tmp = tools.open_image(arguments.input_image_file)
size = tmp.width * tmp.height
tmp.close()
arguments.generator_function.append(size)
if (len(arguments.generator_function) > 1):
generator = getattr(generators, arguments.generator_function[0])(
*[int(e) for e in arguments.generator_function[1:]])