Skip to content

Commit

Permalink
[pyxsi] Import optional to ensure non synthesis tests run
Browse files Browse the repository at this point in the history
  • Loading branch information
auphelia committed Nov 19, 2024
1 parent bf1fafa commit 42582f9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/finn/core/rtlsim_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
except ModuleNotFoundError:
PyVerilator = None

import pyxsi_utils
try:
import pyxsi_utils
except ModuleNotFoundError:
pyxsi_utils = None


def prep_rtlsim_io_dict(model, execution_context):
Expand Down
6 changes: 5 additions & 1 deletion src/finn/custom_op/fpgadataflow/hls/addstreams_hls.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@

import numpy as np
import os
import pyxsi_utils

from finn.custom_op.fpgadataflow.addstreams import AddStreams
from finn.custom_op.fpgadataflow.hlsbackend import HLSBackend
from finn.util.data_packing import npy_to_rtlsim_input, rtlsim_output_to_npy

try:
import pyxsi_utils
except ModuleNotFoundError:
pyxsi_utils = None


class AddStreams_hls(AddStreams, HLSBackend):
"""Class that corresponds to finn-hlslib AddStreams_Batch function."""
Expand Down
6 changes: 5 additions & 1 deletion src/finn/custom_op/fpgadataflow/hlsbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

import numpy as np
import os
import pyxsi_utils
import subprocess
from abc import ABC, abstractmethod
from qonnx.core.datatype import DataType
Expand All @@ -43,6 +42,11 @@
except ModuleNotFoundError:
PyVerilator = None

try:
import pyxsi_utils
except ModuleNotFoundError:
pyxsi_utils = None


class HLSBackend(ABC):
"""HLSBackend class all custom ops that correspond to a finn-hlslib
Expand Down
5 changes: 4 additions & 1 deletion src/finn/custom_op/fpgadataflow/hwcustomop.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
except ModuleNotFoundError:
PyVerilator = None

import pyxsi_utils
try:
import pyxsi_utils
except ModuleNotFoundError:
pyxsi_utils = None


class HWCustomOp(CustomOp):
Expand Down

0 comments on commit 42582f9

Please sign in to comment.