Class: OrigenTesters::CommandBasedTester

Inherits:
Object
  • Object
show all
Includes:
VectorBasedTester
Defined in:
lib/origen_testers/command_based_tester.rb

Overview

A base class that can be used to model command-based, rather than vector-based testers.

Instance Method Summary collapse

Methods included from VectorBasedTester

#register_tester

Constructor Details

#initializeCommandBasedTester

Returns a new instance of CommandBasedTester.


8
9
10
# File 'lib/origen_testers/command_based_tester.rb', line 8

def initialize
  @vector_based = false
end

Instance Method Details

#call_subroutine(sub) ⇒ Object

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.


29
30
31
# File 'lib/origen_testers/command_based_tester.rb', line 29

def call_subroutine(sub)
  microcode "Call_subroutine called to #{sub}"
end

#cycle(*_args) ⇒ Object

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.


22
23
24
# File 'lib/origen_testers/command_based_tester.rb', line 22

def cycle(*_args)
  microcode '*** Cycle called ***'
end

#direct_write(str) ⇒ Object Also known as: dw

Write a string directly to the output file without being processed or modified in any way


14
15
16
# File 'lib/origen_testers/command_based_tester.rb', line 14

def direct_write(str)
  microcode str
end

#format_vector(vec) ⇒ Object


33
34
35
# File 'lib/origen_testers/command_based_tester.rb', line 33

def format_vector(vec)
  vec.microcode
end

#loop(_name = nil, number_of_loops) ⇒ Object Also known as: loop_vector

Loop the content embedded in the supplied block


38
39
40
41
42
# File 'lib/origen_testers/command_based_tester.rb', line 38

def loop(_name = nil, number_of_loops)
  number_of_loops.times do
    yield
  end
end