Class: Origen::Pins::PowerPin

Inherits:
Pin show all
Defined in:
lib/origen/pins/power_pin.rb

Constant Summary

Constants inherited from Pin

Origen::Pins::Pin::FUNCTION_SCOPED_ATTRIBUTES, Origen::Pins::Pin::PACKAGE_SCOPED_ATTRIBUTES, Origen::Pins::Pin::TYPES

Instance Attribute Summary

Attributes inherited from Pin

#aliases, #ext_pulldown, #ext_pullup, #functions, #invert, #open_drain, #order, #owner, #port, #repeat_previous, #rtl_name, #size, #supply, #type

Instance Method Summary collapse

Methods inherited from Pin

#<=>, #add_alias, #add_dib_assignment, #add_function, #add_function_attributes, #add_location, #assert, #assert!, #assert_hi, #assert_hi!, #assert_lo, #assert_lo!, #assert_midband, #assert_midband!, #belongs_to_a_port?, #capture, #capture!, #comparing?, #comparing_mem?, #comparing_midband?, #cycle, #delete!, #describe, #direction=, #disable_clock, #dont_care, #dont_care!, #drive, #drive!, #drive_hi, #drive_hi!, #drive_lo, #drive_lo!, #drive_mem, #drive_mem!, #drive_very_hi, #drive_very_hi!, #driving?, #driving_mem?, #enable_clock, #expect_mem, #expect_mem!, #function_scoped_name, #groups, #half_period, #has_alias?, #high_voltage?, #initialize, #inspect, #invalidate_group_cache, #invalidate_vector_cache, #inverted?, #is_a_clock?, #is_a_running_clock?, #is_alias_of?, #is_not_a_clock?, #name, #name=, #next_edge, #repeat_previous?, #restore, #restore_state, #resume, #sanitize_direction, #save, #set_state, #set_value, #sites, #start_clock, #state, #state=, #stop_clock, #suspend, #suspended?, #to_be_captured?, #to_vector, #toggle, #toggle!, #toggle_clock, #update_clock, #value, #vector_formatted_value=

Methods included from PinCommon

#add_configuration, #add_mode, #add_package, #enabled?, #enabled_in_configuration?, #enabled_in_mode?, #enabled_in_package?, #finalize, #id=, #to_sym

Constructor Details

This class inherits a constructor from Origen::Pins::Pin

Instance Method Details

#voltageObject

Like voltages but if there is only one voltage known then it will be returned directly instead of being wrapped in an array. If no voltages are known this returns nil whereas voltages will return an empty array. For more than one voltages present this behaves like an alias of voltages.



14
15
16
17
18
19
20
21
22
# File 'lib/origen/pins/power_pin.rb', line 14

def voltage
  if voltages.size > 0
    if voltages.size > 1
      voltages
    else
      voltages.first
    end
  end
end

#voltage=(val) ⇒ Object

Set the operating voltage for the pin, can be a single value or an array



5
6
7
# File 'lib/origen/pins/power_pin.rb', line 5

def voltage=(val)
  @voltages = [val].flatten.uniq
end

#voltagesObject

Returns an array of known operating voltages for the given pin



25
26
27
# File 'lib/origen/pins/power_pin.rb', line 25

def voltages
  @voltages ||= []
end