diff options
Diffstat (limited to 'src/sw')
-rwxr-xr-x | src/sw/trng_extract.py | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/sw/trng_extract.py b/src/sw/trng_extract.py index a47fb54..9492f53 100755 --- a/src/sw/trng_extract.py +++ b/src/sw/trng_extract.py @@ -318,22 +318,40 @@ def looptest(dev): # main #---------------------------------------------------------------- def main(): - if VERBOSE: - print("Starting trng data extraction.") - - my_commdev = Comm() + # my_commdev = Comm() # looptest(my_commdev) # get_avalanche_entropy() # get_avalanche_delta() - get_rosc_entropy(my_commdev) + # get_rosc_entropy(my_commdev) # get_rosc_raw() # get_rng_data() + parser = argparse.ArgumentParser() + + parser.add_argument('-d', '--debug', dest='debug', action='store_true', + help='Pring debug information.') + + parser.add_argument('-v', '--verbose', dest='verbose', action='store_true', + help='Increase verbosity.') + + parser.add_argument('-i', dest='device', default=I2C_DEVICE, + help='I2C device name (default ' + I2C_DEVICE + ')') + + parser.add_argument('-n', dest='num_words', default=NUM_WORDS, + help='Number of 32-bit words to extract (default ' + + str(NUM_WORDS) + ')') + + + args = parser.parse_args() + DEBUG = args.debug + VERBOSE = args.verbose + + #------------------------------------------------------------------- # __name__ # Python thingy which allows the file to be run standalone as |