Class: Origen::Pins::PowerPin
Constant Summary
Constants inherited from Pin
Origen::Pins::Pin::FUNCTION_SCOPED_ATTRIBUTES, Origen::Pins::Pin::ORG_FILE_INTERCEPTED_METHODS, Origen::Pins::Pin::PACKAGE_SCOPED_ATTRIBUTES, Origen::Pins::Pin::TYPES
Instance Attribute Summary collapse
-
#current_limit ⇒ Object
Returns the value of attribute current_limit.
Attributes inherited from Pin
#aliases, #description, #ext_pulldown, #ext_pullup, #force, #functions, #invert, #notes, #open_drain, #order, #owner, #repeat_previous, #rtl_name, #size, #state_meta, #supply, #supply_str, #type
Instance Method Summary collapse
-
#initialize(id, owner, options = {}) ⇒ PowerPin
constructor
:nodoc:.
-
#voltage ⇒ Object
Like voltages but if there is only one voltage known then it will be returned directly instead of being wrapped in an array.
-
#voltage=(val) ⇒ Object
Set the operating voltage for the pin, can be a single value or an array.
-
#voltages ⇒ Object
Returns an array of known operating voltages for the given pin.
Methods inherited from Pin
#<=>, #add_alias, #add_dib_assignment, #add_dib_meta, #add_function, #add_function_attributes, #add_location, #assert, #assert!, #assert_hi, #assert_hi!, #assert_lo, #assert_lo!, #assert_midband, #assert_midband!, #belongs_to_a_pin_group?, #capture, #capture!, #clear_mask, #compare_wave, #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!, #drive_wave, #driving?, #driving_mem?, #duty_cycles, #enable_clock, #expect_mem, #expect_mem!, #function_scoped_name, #global_path_to, #goodbye, #group, #group_index, #groups, #half_period, #has_alias?, #hello, #high_voltage?, #index, #index?, #inspect, #invalidate_group_cache, #invalidate_vector_cache, #inverted?, #is_a_clock?, #is_a_running_clock?, #is_alias_of?, #is_not_a_clock?, #mask, #method_missing, #name, #name=, #named?, #next_edge, #org_file_intercepted_methods, #repeat_previous?, #respond_to_missing?, #restore, #restore_state, #resume, #sanitize_direction, #save, #set_state, #set_state_with_options, #set_value, #sites, #start_clock, #state, #state=, #stop_clock, #suspend, #suspended?, #to_be_captured?, #to_vector, #toggle, #toggle!, #toggle_clock, #update_clock, #update_packages, #value, #vector_formatted_value=
Methods included from OrgFile::Interceptable
#__interceptor__=, included, #myself
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
#initialize(id, owner, options = {}) ⇒ PowerPin
:nodoc:
6 7 8 9 10 11 |
# File 'lib/origen/pins/power_pin.rb', line 6 def initialize(id, owner, = {}) # :nodoc: v = [:voltage] || [:voltages] self.voltage = v if v self.current_limit = [:current_limit] if [:current_limit] super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Origen::Pins::Pin
Instance Attribute Details
#current_limit ⇒ Object
Returns the value of attribute current_limit.
4 5 6 |
# File 'lib/origen/pins/power_pin.rb', line 4 def current_limit @current_limit end |
Instance Method Details
#voltage ⇒ Object
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.
23 24 25 26 27 28 29 30 31 |
# File 'lib/origen/pins/power_pin.rb', line 23 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
14 15 16 |
# File 'lib/origen/pins/power_pin.rb', line 14 def voltage=(val) @voltages = [val].flatten.uniq end |
#voltages ⇒ Object
Returns an array of known operating voltages for the given pin
34 35 36 |
# File 'lib/origen/pins/power_pin.rb', line 34 def voltages @voltages ||= [] end |