Sha256: 1685d129d359f698f7a78070c5210f124dfa0711bbc01af6de73ba47427c7308

Contents?: true

Size: 1.27 KB

Versions: 20

Compression:

Stored size: 1.27 KB

Contents

module Origen
  module Tester
    # A base class that can be used to model command-based, rather than
    # vector-based testers.
    class CommandBasedTester
      include Tester

      def initialize
        @vector_based = false
      end

      # Write a string directly to the output file without being processed
      # or modified in any way
      def direct_write(str)
        microcode str
      end
      alias_method :dw, :direct_write

      # Concept of a cycle not supported, print out an error to the output
      # file to alert the user that execution has hit code that is not
      # compatible with a command based tester.
      def cycle(*_args)
        microcode '*** Cycle called ***'
      end

      # Concept of a subroutine not supported, print out an error to the output
      # file to alert the user that execution has hit code that is not
      # compatible with a command based tester.
      def call_subroutine(sub)
        microcode "Call_subroutine called to #{sub}"
      end

      def format_vector(vec)
        vec.microcode
      end

      # Loop the content embedded in the supplied block
      def loop(_name = nil, number_of_loops)
        number_of_loops.times do
          yield
        end
      end
      alias_method :loop_vector, :loop
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
origen-0.4.0 lib/origen/tester/command_based_tester.rb
origen-0.3.0 lib/origen/tester/command_based_tester.rb
origen-0.2.6 lib/origen/tester/command_based_tester.rb
origen-0.2.5 lib/origen/tester/command_based_tester.rb
origen-0.2.4 lib/origen/tester/command_based_tester.rb
origen-0.2.3 lib/origen/tester/command_based_tester.rb
origen-0.2.2 lib/origen/tester/command_based_tester.rb
origen-0.2.1 lib/origen/tester/command_based_tester.rb
origen-0.2.0 lib/origen/tester/command_based_tester.rb
origen-0.1.3 lib/origen/tester/command_based_tester.rb
origen-0.1.2 lib/origen/tester/command_based_tester.rb
origen-0.1.1 lib/origen/tester/command_based_tester.rb
origen-0.1.0 lib/origen/tester/command_based_tester.rb
origen-0.0.9 lib/origen/tester/command_based_tester.rb
origen-0.0.8 lib/origen/tester/command_based_tester.rb
origen-0.0.6 lib/origen/tester/command_based_tester.rb
origen-0.0.5 lib/origen/tester/command_based_tester.rb
origen-0.0.4 lib/origen/tester/command_based_tester.rb
origen-0.0.3 lib/origen/tester/command_based_tester.rb
origen-0.0.2 lib/origen/tester/command_based_tester.rb