Class: OrigenTesters::MemoryStyle
- Inherits:
-
Object
- Object
- OrigenTesters::MemoryStyle
- Defined in:
- lib/origen_testers/memory_style.rb
Instance Attribute Summary collapse
-
#bit_order ⇒ Object
readonly
Returns the value of attribute bit_order.
-
#data_type ⇒ Object
readonly
Returns the value of attribute data_type.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#pin_id ⇒ Object
readonly
Returns the value of attribute pin_id.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#trigger ⇒ Object
readonly
Returns the value of attribute trigger.
Instance Method Summary collapse
-
#accumulate_attributes(pin_id) ⇒ Object
Get the chronologically last setting for the given pin's attributes.
-
#contained_pins ⇒ Object
Get an array of pins contained in this style container.
-
#contains_pin?(pin_id) ⇒ Boolean
Check to see if a given pin exists in this style container.
-
#initialize ⇒ MemoryStyle
constructor
A new instance of MemoryStyle.
-
#pin(*pin_ids) ⇒ Object
Set memory style attributes for the given pin.
Constructor Details
#initialize ⇒ MemoryStyle
Returns a new instance of MemoryStyle.
5 6 7 8 9 10 11 12 13 |
# File 'lib/origen_testers/memory_style.rb', line 5 def initialize @pin_id = [] @size = [] @bit_order = [] @format = [] @trigger = [] @mode = [] @data_type = [] end |
Instance Attribute Details
#bit_order ⇒ Object (readonly)
Returns the value of attribute bit_order.
3 4 5 |
# File 'lib/origen_testers/memory_style.rb', line 3 def bit_order @bit_order end |
#data_type ⇒ Object (readonly)
Returns the value of attribute data_type.
3 4 5 |
# File 'lib/origen_testers/memory_style.rb', line 3 def data_type @data_type end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
3 4 5 |
# File 'lib/origen_testers/memory_style.rb', line 3 def format @format end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
3 4 5 |
# File 'lib/origen_testers/memory_style.rb', line 3 def mode @mode end |
#pin_id ⇒ Object (readonly)
Returns the value of attribute pin_id.
3 4 5 |
# File 'lib/origen_testers/memory_style.rb', line 3 def pin_id @pin_id end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
3 4 5 |
# File 'lib/origen_testers/memory_style.rb', line 3 def size @size end |
#trigger ⇒ Object (readonly)
Returns the value of attribute trigger.
3 4 5 |
# File 'lib/origen_testers/memory_style.rb', line 3 def trigger @trigger end |
Instance Method Details
#accumulate_attributes(pin_id) ⇒ Object
Get the chronologically last setting for the given pin's attributes
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/origen_testers/memory_style.rb', line 46 def accumulate_attributes(pin_id) a = { pin_id: pin_id } @pin_id.each_index do |i| if @pin_id[i].include?(pin_id) a[:size] = @size[i] a[:bit_order] = @bit_order[i] a[:format] = @format[i] a[:trigger] = @trigger[i] a[:mode] = @mode[i] a[:data_type] = @data_type[i] end end a end |
#contained_pins ⇒ Object
Get an array of pins contained in this style container
67 68 69 70 71 72 73 74 75 |
# File 'lib/origen_testers/memory_style.rb', line 67 def contained_pins pins = [] @pin_id.each do |a| a.each do |p| pins << p end end pins.uniq end |
#contains_pin?(pin_id) ⇒ Boolean
Check to see if a given pin exists in this style container
62 63 64 |
# File 'lib/origen_testers/memory_style.rb', line 62 def contains_pin?(pin_id) contained_pins.include?(pin_id) end |
#pin(*pin_ids) ⇒ Object
Set memory style attributes for the given pin
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/origen_testers/memory_style.rb', line 19 def pin(*pin_ids) = pin_ids.last.is_a?(Hash) ? pin_ids.pop : {} pin_ids.each_index do |i| if pin_ids[i].is_a?(Symbol) pin_ids[i] = dut.pin(pin_ids[i]).name else pin_ids[i] = pin_ids[i].name end end @pin_id << pin_ids @size << [:size] @bit_order << [:bit_order] @format << [:format] @trigger << [:trigger] @mode << [:mode] @data_type << [:data_type] end |