Class: OrigenTesters::PatternCompilers::V93KPatternCompiler::DigCapAPI::DigCap

Inherits:
Object
  • Object
show all
Defined in:
lib/origen_testers/pattern_compilers/v93k/digcap.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner, options) ⇒ DigCap

Returns a new instance of DigCap.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/origen_testers/pattern_compilers/v93k/digcap.rb', line 8

def initialize(owner, options)
  @owner = owner
  @pins = nil

  if options && options[:skip_setup]
    @skip_setup = options[:skip_setup]   # optional: force skip of AVI digcap setup
    #                                                e.g. handled by RDI
  elsif options && options[:pins] && options[:vps]
    @pins = options[:pins]           # required: pins to be captured
    @vps = options[:vps]             # required: vecotrs per sample
    @nrf = options[:nrf] || 1        # optional: nr_frames (defaults to 1)
    @char = options[:char] || 'C'    # optional: vector character representing capture
  elsif options
    fail 'Must specifiy pins and vps for digcap setup!'
  end
end

Instance Attribute Details

#charObject

Returns the value of attribute char.



6
7
8
# File 'lib/origen_testers/pattern_compilers/v93k/digcap.rb', line 6

def char
  @char
end

#nrfObject

Returns the value of attribute nrf.



6
7
8
# File 'lib/origen_testers/pattern_compilers/v93k/digcap.rb', line 6

def nrf
  @nrf
end

#ownerObject

Returns the value of attribute owner.



6
7
8
# File 'lib/origen_testers/pattern_compilers/v93k/digcap.rb', line 6

def owner
  @owner
end

#pinsObject

Returns the value of attribute pins.



6
7
8
# File 'lib/origen_testers/pattern_compilers/v93k/digcap.rb', line 6

def pins
  @pins
end

#vpsObject

Returns the value of attribute vps.



6
7
8
# File 'lib/origen_testers/pattern_compilers/v93k/digcap.rb', line 6

def vps
  @vps
end

Instance Method Details

#capture_stringObject



41
42
43
# File 'lib/origen_testers/pattern_compilers/v93k/digcap.rb', line 41

def capture_string
  " #{char * num_pins} "
end

#empty?Boolean

Returns:

  • (Boolean)


59
60
61
62
63
64
# File 'lib/origen_testers/pattern_compilers/v93k/digcap.rb', line 59

def empty?
  vec_per_frame.each do |k, v|
    return false if v > 0
  end
  true       # digcap setup but no avc contain capture vectors
end

#enabled?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/origen_testers/pattern_compilers/v93k/digcap.rb', line 55

def enabled?
  pins.nil? ? false : true
end

#num_pinsObject



45
46
47
48
49
50
51
52
53
# File 'lib/origen_testers/pattern_compilers/v93k/digcap.rb', line 45

def num_pins
  if pins.is_a? String
    pins.split(' ').size
  elsif pins.is_a? Symbol
    dut.pins(pins).size
  elsif pins.is_a? Array
    fail 'Digcap Pins does not support array yet'
  end
end

#render_aiv_linesObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/origen_testers/pattern_compilers/v93k/digcap.rb', line 25

def render_aiv_lines
  lines = []
  unless @skip_setup
    lines << ''
    lines << 'AI_DIGCAP_SETTINGS {'
    lines << render_digcap_header
    avc_files.each do |f|
      if vec_per_frame[f.to_sym] > 0
        lines << render_digcap_entry(f)
      end
    end
    lines << '};'
  end
  lines
end