Skip to content

Commit

Permalink
[BYOC][Verilator] Skip mobilenet test if Verilator is not available (a…
Browse files Browse the repository at this point in the history
…pache#8094)

* skip mobilenet test when verilator is not available

* add skipped to pytest

* add pytest
  • Loading branch information
vegaluisjose authored and trevor-m committed Jun 17, 2021
1 parent ab515bd commit c38315f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/python/contrib/test_verilator/test_mobilenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
from tvm.contrib import graph_executor as runtime

import os
import pytest
from PIL import Image
import numpy as np

from test_verilator.infrastructure import (
skip_test,
compile_hardware,
compiler_opts,
offload,
Expand Down Expand Up @@ -213,13 +215,16 @@ def is_tflite_available():
return False


@pytest.mark.skipif(skip_test(), reason="Skip because Verilator codegen is not available")
def tmobilenet(lanes):
"""Mobilenet test template.
Paramters
---------
lanes : Int
The number of vector lanes.
"""
if skip_test():
return
if not is_tflite_available():
return
model = get_mobilenet_model()
Expand Down
3 changes: 3 additions & 0 deletions tests/python/contrib/test_verilator/test_verilator_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import tvm
from tvm import relay
import pytest

from test_verilator.infrastructure import (
skip_test,
Expand Down Expand Up @@ -138,6 +139,7 @@ def print_test_info(test, lanes, cycles):
print("test:{} vector-lanes:{} number of cycles:{}".format(test, lanes, cycles))


@pytest.mark.skipif(skip_test(), reason="Skip because Verilator codegen is not available")
def tadd(lanes):
"""Print counter
Expand All @@ -158,6 +160,7 @@ def tadd(lanes):
print_test_info("add", lanes, cycles)


@pytest.mark.skipif(skip_test(), reason="Skip because Verilator codegen is not available")
def tbias(lanes):
"""Print counter
Expand Down

0 comments on commit c38315f

Please sign in to comment.