Skip to content

Commit

Permalink
[HWCustomOp] Remove unused function for characterization based fifo s…
Browse files Browse the repository at this point in the history
…izing
  • Loading branch information
auphelia committed Jan 9, 2025
1 parent 0e7dfd3 commit 55a3ff3
Showing 1 changed file with 4 additions and 26 deletions.
30 changes: 4 additions & 26 deletions src/finn/custom_op/fpgadataflow/hwcustomop.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import os
import warnings
from abc import abstractmethod
from pyverilator.util.axi_utils import _read_signal, reset_rtlsim, rtlsim_multi_io
from pyverilator.util.axi_utils import rtlsim_multi_io
from qonnx.custom_op.base import CustomOp
from qonnx.util.basic import roundup_to_integer_multiple

Expand Down Expand Up @@ -357,8 +357,6 @@ def derive_characteristic_fxns(self, period, override_rtlsim_dict=None):
exp_cycles,
)
sim = self.get_rtlsim()
# signal name
sname = "_" + self.hls_sname() + "_"
if override_rtlsim_dict is not None:
io_dict = override_rtlsim_dict
else:
Expand All @@ -374,32 +372,12 @@ def derive_characteristic_fxns(self, period, override_rtlsim_dict=None):
txns_in = {key: [] for (key, value) in io_dict["inputs"].items() if "in" in key}
txns_out = {key: [] for (key, value) in io_dict["outputs"].items() if "out" in key}

def monitor_txns(sim_obj):
for inp in txns_in:
in_ready = _read_signal(sim, inp + sname + "TREADY") == 1
in_valid = _read_signal(sim, inp + sname + "TVALID") == 1
if in_ready and in_valid:
txns_in[inp].append(1)
else:
txns_in[inp].append(0)
for outp in txns_out:
if (
_read_signal(sim, outp + sname + "TREADY") == 1
and _read_signal(sim, outp + sname + "TVALID") == 1
):
txns_out[outp].append(1)
else:
txns_out[outp].append(0)

reset_rtlsim(sim)
total_cycle_count = rtlsim_multi_io(
self.reset_rtlsim(sim)
self.rtlsim_multi_io(
sim,
io_dict,
n_outs,
sname=sname,
liveness_threshold=period,
hook_preclk=monitor_txns,
)
total_cycle_count = self.get_nodeattr("cycles_rtlsim")
assert (
total_cycle_count <= period
), """Total cycle count from rtl simulation is higher than
Expand Down

0 comments on commit 55a3ff3

Please sign in to comment.