Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sim/SPI_v3/components/SPITestHarness.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from pymtl3.stdlib.test_utils import config_model_with_cmdline_opts

from math import ceil
import copy
import copy, sys
from spidriver import SPIDriver

#=========================================================================
Expand All @@ -34,7 +34,7 @@ class SPITestHarness( object ):
def __init__( s, DESIGN, num_components, spi_bits, cmdline_opts, trace=True ):

s.dut = DESIGN
s.is_phy_test = False # Change this switch to True if you want to use the Physical Test Harness and the SPIDriver
s.is_phy_test = sys._is_physical # Use the --physical flag in pytest if you want to use the Physical Test Harness and the SPIDriver
s.dut = config_model_with_cmdline_opts( s.dut, cmdline_opts, [] )
s.dut.apply(DefaultPassGroup(linetrace=True)) #commented out for chip-sim
# from pymtl3.passes.mamba import Mamba2020
Expand Down
5 changes: 5 additions & 0 deletions sim/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ def pytest_addoption(parser):

parser.addoption( "--vrtl", action="store_true",
help="use VRTL implementations" )

parser.addoption( "--physical", action="store_true",
help="Use tests on a physical chip" )

#-------------------------------------------------------------------------
# Handle other command line options
Expand All @@ -25,6 +28,7 @@ def pytest_configure(config):
import sys
sys._called_from_test = True
sys._pymtl_rtl_override = False
sys._is_physical = config.option.physical
if config.option.prtl:
sys._pymtl_rtl_override = 'pymtl'
elif config.option.vrtl:
Expand All @@ -34,6 +38,7 @@ def pytest_unconfigure(config):
import sys
del sys._called_from_test
del sys._pymtl_rtl_override
del sys._is_physical

#-------------------------------------------------------------------------
# fix_randseed
Expand Down