Module: OrigenLink::CaptureSupport

Included in:
VectorBased
Defined in:
lib/origen_link/capture_support.rb

Instance Method Summary collapse

Instance Method Details

#capture(*args) ⇒ Object

Capture any store data within the given block, return it and then internally clear the tester’s capture memory.

Examples:


v = tester.capture do
  my_reg.store!
end
v      # => Data value read from my_reg on the DUT


49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/origen_link/capture_support.rb', line 49

def capture(*args)
  if block_given?
    yield
    synchronize
    d = @captured_data
    @captured_data = []
    d
  else
    # On other testers capture is an alias of store
    store(*args)
  end
end

#store(*pins) ⇒ Object

Capture a vector

This method applies a store vector request to the previous vector, note that is does not actually generate a new vector.

The captured data is added to the captured_data array.

This method is indended to be used by pin drivers, see the #capture method for the application level API.

Examples:

$tester.cycle                # This is the vector you want to capture
$tester.store                # This applies the store request


16
17
18
19
# File 'lib/origen_link/capture_support.rb', line 16

def store(*pins)
  options = pins.last.is_a?(Hash) ? pins.pop : {}
  fail 'The store is not implemented yet on Link'
end

#store_next_cycle(*pins) ⇒ Object

Capture the next vector generated

This method applies a store request to the next vector to be generated, note that is does not actually generate a new vector.

The captured data is added to the captured_data array.

This method is indended to be used by pin drivers, see the #capture method for the application level API.

Examples:

tester.store_next_cycle
tester.cycle                # This is the vector that will be captured


34
35
36
37
38
# File 'lib/origen_link/capture_support.rb', line 34

def store_next_cycle(*pins)
  options = pins.last.is_a?(Hash) ? pins.pop : {}
  flush_vector
  @store_pins = pins
end