Class: OrigenTesters::Decompiler::Nodes::Vector

Inherits:
Node
  • Object
show all
Defined in:
lib/origen_testers/decompiler/nodes.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#context, #type

Instance Method Summary collapse

Methods inherited from Node

#execute?, inherited, #platform_nodes

Constructor Details

#initialize(repeat:, timeset:, pin_states:, comment:, context:, **nodes) ⇒ Vector

rubocop:disable Metrics/ParameterLists



68
69
70
71
72
73
74
75
76
77
# File 'lib/origen_testers/decompiler/nodes.rb', line 68

def initialize(repeat:, timeset:, pin_states:, comment:, context:, **nodes)
  @execute = true

  @repeat = repeat
  @timeset = timeset
  @pin_states = pin_states
  @comment = comment

  super(context: context, type: :vector)
end

Instance Attribute Details

#commentObject (readonly)

Returns the value of attribute comment.



65
66
67
# File 'lib/origen_testers/decompiler/nodes.rb', line 65

def comment
  @comment
end

#pin_statesObject (readonly)

Returns the value of attribute pin_states.



64
65
66
# File 'lib/origen_testers/decompiler/nodes.rb', line 64

def pin_states
  @pin_states
end

#repeatObject (readonly)

Returns the value of attribute repeat.



62
63
64
# File 'lib/origen_testers/decompiler/nodes.rb', line 62

def repeat
  @repeat
end

#timesetObject (readonly)

Returns the value of attribute timeset.



63
64
65
# File 'lib/origen_testers/decompiler/nodes.rb', line 63

def timeset
  @timeset
end

Instance Method Details

#execute!(context) ⇒ Object

rubocop:enable Metrics/ParameterLists



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/origen_testers/decompiler/nodes.rb', line 80

def execute!(context)
  # Apply a timeset switch, if needed.
  unless Origen.tester.timeset.name == timeset
    Origen.tester.set_timeset(timeset)
  end

  # Apply the comment
  unless comment.empty?
    cc(comment)
  end

  # Apply the pin states
  context.pinlist.each_with_index do |pin, i|
    dut.pins(pin).vector_formatted_value = pin_states[i]
  end

  # Cycle the tester
  repeat.cycles
end