code: def run_and_check(xshape, yshape, dtype, mod, opts):
      """Run and check values.
  
      Paramters
      ---------
      xshape : Tuple
          The x shape tuple.
  
      yshape : Tuple
          The y shape tuple.
  
      dtype : Str
          The data type.
  
      mod: Module
          The relay module.
  
      opts: Dict
          The compiler options.
  
      Returns
      -------
      cycles: Int
          The number of cycles.
      """
      x_data = np.random.randint(5, size=xshape, dtype=dtype)
      y_data = np.random.randint(5, size=yshape, dtype=dtype)
      ref = x_data + y_data
      inp = {"x": x_data, "y": y_data}
      clear_stats()
      out = run_module(inp, mod, params=None, opts=opts)
      values = stats()
      tvm.testing.assert_allclose(
          out.numpy(), ref, rtol=1e-5, atol=1e-5
      )
      return values["cycle_counter"]
  
file_path: tvm/tests/python/contrib/test_verilator/test_verilator_ops.py
imports: import numpy
  import tvm
  import tvm.testing
  from tvm import relay
  import pytest
  from test_verilator.infrastructure import skip_test, compile_hardware, compiler_opts, run_module, offload, clear_stats, stats
label_desc: Use image node_id 3 for calling a global function with example usage: run_and_check(xshape, yshape, dtype, mod, opts) and returns: values