Sha256: b486c3b3563f63f9f6131661c7fdc88af39c329da3287998b6cc8fd653d82a67

Contents?: true

Size: 1.53 KB

Versions: 6

Compression:

Stored size: 1.53 KB

Contents

# This file is the Ruby side of the bench.

require 'rubygems'
require 'ruby-vpi'

RubyVpi.init_bench :Counter, :xUnit 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):
  #
  #    !
  #    !
  #    ! ____      ____      ____      ____
  # ___!/    \____/    \____/    \____/    \
  #    !
  #    !
  #
  ##

  Counter.clock.intVal = 1

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

  advance_time

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

  Counter.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 samp/counter/counter_xunit_bench.rb
ruby-vpi-15.0.1 samp/counter/counter_xunit_bench.rb
ruby-vpi-15.0.2 samp/counter/counter_xunit_bench.rb
ruby-vpi-15.0.0 samp/counter/counter_xunit_bench.rb
ruby-vpi-16.0.1 samp/counter/counter_xunit_bench.rb
ruby-vpi-16.0.0 samp/counter/counter_xunit_bench.rb