Sha256: 5e987f61aee089e89f7bc64aa6fab88dd2d2979490873f5cd327243ced475e7b

Contents?: true

Size: 1.66 KB

Versions: 6

Compression:

Stored size: 1.66 KB

Contents

<%
  clock = aOutputInfo.designClassName + '.' + aModuleInfo.ports.first.name
%>
# This file is the Ruby side of the bench.

require 'rubygems'
require 'ruby-vpi'

RubyVpi.init_bench :<%= aOutputInfo.designClassName %>, :<%= aOutputInfo.specFormat %> do
  ##
  # This block is executed whenever Vpi::simulate is invoked.
  #
  # It simulates the design under test. This is typically done
  # by toggling the clock signal, as demonstrated below.
  ##

  ##
  # We are currently here (marked by the ! signs):
  #
  #    !
  #    !
  #    ! ____      ____      ____      ____
  # ___!/    \____/    \____/    \____/    \
  #    !
  #    !
  #
  ##

  <%= clock %>.intVal = 1

  ##
  # After setting the clock signal to high, we are here:
  #
  #      !
  #      !
  #      !____      ____      ____      ____
  # ____/!    \____/    \____/    \____/    \
  #      !
  #      !
  #
  ##

  advance_time

  ##
  # After advancing the time, we are here:
  #
  #          !
  #          !
  #      ____!      ____      ____      ____
  # ____/    !\____/    \____/    \____/    \
  #          !
  #          !
  #
  ##

  <%= clock %>.intVal = 0

  ##
  # After setting the clock signal to low, we are here:
  #
  #           !
  #           !
  #      ____ !     ____      ____      ____
  # ____/    \!____/    \____/    \____/    \
  #           !
  #           !
  #
  ##

  advance_time

  ##
  # After advancing the time, we are here:
  #
  #
  #               !
  #               !
  #      ____     ! ____      ____      ____
  # ____/    \____!/    \____/    \____/    \
  #               !
  #               !
  #
  ##

  ##
  # This process repeats when Vpi::simulate is invoked again.
  ##
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-vpi-14.0.0 bin/generate_test_tpl/bench.rb
ruby-vpi-15.0.0 bin/generate_test_tpl/bench.rb
ruby-vpi-15.0.2 bin/generate_test_tpl/bench.rb
ruby-vpi-15.0.1 bin/generate_test_tpl/bench.rb
ruby-vpi-16.0.0 bin/generate_test_tpl/bench.rb
ruby-vpi-16.0.1 bin/generate_test_tpl/bench.rb