Class: Origen::Pins::Timing::Wave
- Defined in:
- lib/origen/pins/timing/wave.rb
Constant Summary collapse
- VALID_DRIVE_DATA =
[0, 1, :data]
- VALID_COMPARE_DATA =
[0, 1, :data]
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the pattern code value associated with the wave.
-
#events ⇒ Object
readonly
Returns the value of attribute events.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#timeset ⇒ Object
readonly
Returns the value of attribute timeset.
Instance Method Summary collapse
- #compare(data, options) ⇒ Object (also: #compare_edge)
- #compare? ⇒ Boolean
- #dont_care(options) ⇒ Object (also: #highz)
- #drive(data, options) ⇒ Object
- #drive? ⇒ Boolean
-
#evaluated_events ⇒ Object
Returns the events array but with any formula based times evaluated.
-
#initialize(timeset, options = {}) ⇒ Wave
constructor
A new instance of Wave.
-
#pin_ids ⇒ Object
Returns an array containing all dut pin_ids that are assigned to this wave by the parent timeset.
-
#pins ⇒ Object
Returns an array containing all dut pin objects that are assigned to this wave by the parent timeset.
- #type ⇒ Object
Constructor Details
permalink #initialize(timeset, options = {}) ⇒ Wave
Returns a new instance of Wave.
14 15 16 17 18 19 |
# File 'lib/origen/pins/timing/wave.rb', line 14 def initialize(timeset, = {}) @code = [:code] @code = nil if [0, 1, 'H', 'L', :H, :L].include?(@code) @timeset = timeset @events = [] end |
Instance Attribute Details
permalink #code ⇒ Object (readonly)
Returns the pattern code value associated with the wave. By default this will return nil if no code was given at the time the wave was defined, which means it is the wave that will be applied for the conventional code values of 0, 1, H, L.
9 10 11 |
# File 'lib/origen/pins/timing/wave.rb', line 9 def code @code end |
permalink #events ⇒ Object (readonly)
Returns the value of attribute events.
5 6 7 |
# File 'lib/origen/pins/timing/wave.rb', line 5 def events @events end |
Instance Method Details
permalink #compare(data, options) ⇒ Object Also known as: compare_edge
[View source]
55 56 57 58 59 60 61 62 |
# File 'lib/origen/pins/timing/wave.rb', line 55 def compare(data, ) self.type = :compare validate_data(data) do |d| validate_time() do |t| events << [t, d] end end end |
permalink #compare? ⇒ Boolean
81 82 83 |
# File 'lib/origen/pins/timing/wave.rb', line 81 def compare? @type == :compare end |
permalink #dont_care(options) ⇒ Object Also known as: highz
[View source]
65 66 67 68 69 70 |
# File 'lib/origen/pins/timing/wave.rb', line 65 def dont_care() self.type = :drive validate_time() do |t| events << [t, :x] end end |
permalink #drive(data, options) ⇒ Object
[View source]
46 47 48 49 50 51 52 53 |
# File 'lib/origen/pins/timing/wave.rb', line 46 def drive(data, ) self.type = :drive validate_data(data) do |d| validate_time() do |t| events << [t, d] end end end |
permalink #drive? ⇒ Boolean
77 78 79 |
# File 'lib/origen/pins/timing/wave.rb', line 77 def drive? @type == :drive end |
permalink #evaluated_events ⇒ Object
Returns the events array but with any formula based times evaluated. Note that this does not raise an error if the period is not currently set, in that case any events that reference it will have nil for their time.
26 27 28 29 30 31 32 |
# File 'lib/origen/pins/timing/wave.rb', line 26 def evaluated_events if dut.current_timeset_period events.map { |e| [calc.evaluate(e[0], period: dut.current_timeset_period).ceil, e[1]] } else fail 'The current timeset period has not been set' end end |
permalink #pin_ids ⇒ Object
Returns an array containing all dut pin_ids that are assigned to this wave by the parent timeset
36 37 38 |
# File 'lib/origen/pins/timing/wave.rb', line 36 def pin_ids @pins_ids ||= timeset.send(:pin_ids_for, self) end |
permalink #pins ⇒ Object
Returns an array containing all dut pin objects that are assigned to this wave by the parent timeset
42 43 44 |
# File 'lib/origen/pins/timing/wave.rb', line 42 def pins @pins ||= pin_ids.map { |id| dut.pin(id) } end |
permalink #type ⇒ Object
[View source]
73 74 75 |
# File 'lib/origen/pins/timing/wave.rb', line 73 def type @type ||= :drive end |