leonardt / fault

A Python package for testing hardware (part of the magma ecosystem)
BSD 3-Clause "New" or "Revised" License
41 stars 13 forks source link

fault seems to capture output by default? #128

Closed hofstee closed 5 years ago

hofstee commented 5 years ago

When I run tester.compile_and_run it silently completes. This is running a testbench through VCS with display statements. I should expect to see compilation logs from VCS, as well as the actual testbench results from the test that was run.

Even if the intended behavior is to be silent on success, this is unintuitive to me. Can there at least be a verbose/quiet flag?

leonardt commented 5 years ago

All the output from fault has been moved to use the logging module. This was because the simulator output was slowing down/crashing huge test runs. To see the output, you can do

import logging
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)

This will dump everything through the logging output (e.g. verilator command output)

If you want to see some output, but less verbose, you can do

import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)

(Here's an example of the INFO level from https://github.com/leonardt/magma_register_file_tutorial/blob/master/4-Using%20the%20Register%20File.ipynb)

In [10]: test_top_write_then_reads("distribute", 2)
root - INFO - Running tester...
root - INFO - Success!