lib/origen/pins.rb in origen-0.7.42 vs lib/origen/pins.rb in origen-0.7.43

- old
+ new

@@ -432,19 +432,21 @@ options = {} end # check if this is a pin group alias found = false group = nil + pins_left = pins.dup unless options[:pins_only] == true pins.each do |i| if pin_groups.include?(i) group = add_pin_group_alias(id, i, options) + pins_left.delete(i) found = true end end end - unless found # not a pin group alias + unless pins_left.empty? && !block_given? # not a pin group alias group = Origen.pin_bank.find_or_create_pin_group(id, self, options) if block_given? yield group else # SMcG: @@ -461,12 +463,12 @@ # # However I never work on little endian ports so I don't know for sure! # # In both cases though we always want pins(:pa)[0] to return :pa0. if options[:endian] == :little - pins.each { |pin| group.add_pin(pin, options) } + pins_left.each { |pin| group.add_pin(pin, options) } else - pins.reverse_each { |pin| group.add_pin(pin, options) } + pins_left.reverse_each { |pin| group.add_pin(pin, options) } end end end group # Origen.pin_bank.add_pin_group(group, self, {:pins_exist => true}.merge(options))