origen 0.7.31 → 0.7.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4fac3698db2dd4c2f9e76c4d69e4c3978a3afba2
4
- data.tar.gz: c012add50e18d3e3514349108d2a728068c6404a
3
+ metadata.gz: 7799e384862e6d6c36e40876e3fb519bf557260a
4
+ data.tar.gz: 2fcb7098f5ee2c4fc4c5afd5809a01950196193a
5
5
  SHA512:
6
- metadata.gz: b68dd0a476af5fe6ac816bf54f2135ee23abdf68bbac1e13002db30ce25518522a4d97a9b3398cbe4a7ad860b91baa8a7c8d390d70ad0f4baa57e0c2c2874372
7
- data.tar.gz: fd66ca810a030294c6bccfbd86af22053ceb418738e75856475ed52b0285e9a6b8fa0ab8aac6c838d47637bac4f5feb27e83ed865f69edd15277162fd6570dae
6
+ metadata.gz: 2a0a31dd7643e2fc3f053aadd60ae1f972a9f95a0ab2b9b6a1e33aecd2f2951a1ed7d2dcc0d4045556cb79fc7f229e2109a0284ab4c0d29814a575c6a960c72a
7
+ data.tar.gz: 39a9cf84746217211cbae45bfe8b49bc8d77aa6fd2865e8bb737be18c6524a9ee5927dd0dd09d371b2dc56e12a52ee9033fabd4c84f0ebb1c2174aa92059d7de
@@ -1,7 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
3
  MINOR = 7
4
- BUGFIX = 31
4
+ BUGFIX = 32
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -176,6 +176,7 @@ module Origen
176
176
  autoload :PinClock, 'origen/pins/pin_clock'
177
177
  autoload :PowerPin, 'origen/pins/power_pin'
178
178
  autoload :GroundPin, 'origen/pins/ground_pin'
179
+ autoload :OtherPin, 'origen/pins/other_pin'
179
180
  autoload :VirtualPin, 'origen/pins/virtual_pin'
180
181
  autoload :FunctionProxy, 'origen/pins/function_proxy'
181
182
 
@@ -215,6 +216,7 @@ module Origen
215
216
  power_pin = options.delete(:power_pin)
216
217
  ground_pin = options.delete(:ground_pin)
217
218
  virtual_pin = options.delete(:virtual_pin)
219
+ other_pin = options.delete(:other_pin)
218
220
  if options[:size] && options[:size] > 1
219
221
  group = PinCollection.new(self, options.merge(placeholder: true))
220
222
  group.id = id if id
@@ -231,6 +233,8 @@ module Origen
231
233
  group[i] = GroundPin.new(i, self, options)
232
234
  elsif virtual_pin
233
235
  group[i] = VirtualPin.new(i, self, options)
236
+ elsif other_pin
237
+ group[i] = OtherPin.new(i, self, options)
234
238
  else
235
239
  group[i] = Pin.new(i, self, options)
236
240
  end
@@ -253,6 +257,8 @@ module Origen
253
257
  pin = GroundPin.new(id || :temp, self, options)
254
258
  elsif virtual_pin
255
259
  pin = VirtualPin.new(id || :temp, self, options)
260
+ elsif other_pin
261
+ pin = OtherPin.new(id || :temp, self, options)
256
262
  else
257
263
  pin = Pin.new(id || :temp, self, options)
258
264
  end
@@ -281,6 +287,15 @@ module Origen
281
287
  end
282
288
  alias_method :add_ground_pins, :add_ground_pin
283
289
 
290
+ def add_other_pin(id = nil, options = {}, &block)
291
+ id, options = nil, id if id.is_a?(Hash)
292
+ options = {
293
+ other_pin: true
294
+ }.merge(options)
295
+ add_pin(id, options, &block)
296
+ end
297
+ alias_method :add_other_pins, :add_other_pin
298
+
284
299
  def add_virtual_pin(id = nil, options = {}, &block)
285
300
  id, options = nil, id if id.is_a?(Hash)
286
301
  options = {
@@ -399,6 +414,11 @@ module Origen
399
414
  end
400
415
  alias_method :has_ground_pins?, :has_ground_pin?
401
416
 
417
+ def has_other_pin?(id)
418
+ !!Origen.pin_bank.find(id, other_pin: true)
419
+ end
420
+ alias_method :has_other_pins?, :has_other_pin?
421
+
402
422
  # Equivalent to the has_pin? method but considers virtual pins rather than regular pins
403
423
  def has_virtual_pin?(id)
404
424
  !!Origen.pin_bank.find(id, virtual_pin: true)
@@ -412,7 +432,6 @@ module Origen
412
432
  options = {}
413
433
  end
414
434
  # check if this is a pin group alias
415
-
416
435
  found = false
417
436
  group = nil
418
437
  unless options[:pins_only] == true
@@ -478,6 +497,18 @@ module Origen
478
497
  add_pin_group(id, *pins, options, &block)
479
498
  end
480
499
 
500
+ def add_other_pin_group(id, *pins, &block)
501
+ if pins.last.is_a?(Hash)
502
+ options = pins.pop
503
+ else
504
+ options = {}
505
+ end
506
+ options = {
507
+ other_pin: true
508
+ }.merge(options)
509
+ add_pin_group(id, *pins, options, &block)
510
+ end
511
+
481
512
  def add_virtual_pin_group(id, *pins, &block)
482
513
  if pins.last.is_a?(Hash)
483
514
  options = pins.pop
@@ -521,6 +552,15 @@ module Origen
521
552
  end
522
553
  end
523
554
 
555
+ # Equivalent to the all_pins method but considers other pins rather than regular pins
556
+ def all_other_pins(id = nil, _options = {}, &_block)
557
+ if id
558
+ pin = Origen.pin_bank.find(id, ignore_context: true, other_pin: true)
559
+ else
560
+ Origen.pin_bank.all_other_pins
561
+ end
562
+ end
563
+
524
564
  # Equivalent to the all_pins method but considers ground pins rather than regular pins
525
565
  def all_virtual_pins(id = nil, _options = {}, &_block)
526
566
  if id
@@ -595,6 +635,28 @@ If you meant to define the ground_pin_group then use the add_ground_pin_group me
595
635
  end
596
636
  alias_method :ground_pin_group, :ground_pin_groups
597
637
 
638
+ # Equivalent to the pin_groups method but considers other pins rather than regular pins
639
+ def other_pin_groups(id = nil, options = {}, &_block)
640
+ id, options = nil, id if id.is_a?(Hash)
641
+ if id
642
+ pin = Origen.pin_bank.find(id, options.merge(other_pin: true))
643
+ unless pin
644
+ puts <<-END
645
+ You have tried to reference other_pin_group :#{id} within #{self.class} but it does not exist, this could be
646
+ because the pin group has not been defined yet or it is an alias that is not available in the current context.
647
+
648
+ If you meant to define the other_pin_group then use the add_other_pin_group method instead.
649
+
650
+ END
651
+ fail 'Other pin group not found'
652
+ end
653
+ pin
654
+ else
655
+ Origen.pin_bank.other_pin_groups(options)
656
+ end
657
+ end
658
+ alias_method :other_pin_group, :other_pin_groups
659
+
598
660
  # Equivalent to the pin_groups method but considers virtual pins rather than regular pins
599
661
  def virtual_pin_groups(id = nil, options = {}, &_block)
600
662
  id, options = nil, id if id.is_a?(Hash)
@@ -645,6 +707,8 @@ If you meant to define the pin then use the add_pin method instead.
645
707
  Origen.pin_bank.ground_pins
646
708
  elsif options[:virtual_pin]
647
709
  Origen.pin_bank.virtual_pins
710
+ elsif options[:other_pin]
711
+ Origen.pin_bank.other_pins
648
712
  else
649
713
  Origen.pin_bank.pins
650
714
  end
@@ -670,6 +734,15 @@ If you meant to define the pin then use the add_pin method instead.
670
734
  pins(id, options, &block)
671
735
  end
672
736
 
737
+ # Equivalent to the pins method but considers other pins rather than regular pins
738
+ def other_pins(id = nil, options = {}, &block)
739
+ id, options = nil, id if id.is_a?(Hash)
740
+ options = {
741
+ other_pin: true
742
+ }.merge(options)
743
+ pins(id, options, &block)
744
+ end
745
+
673
746
  # Equivalent to the pins method but considers virtual pins rather than regular pins
674
747
  def virtual_pins(id = nil, options = {}, &block)
675
748
  id, options = nil, id if id.is_a?(Hash)
@@ -0,0 +1,6 @@
1
+ module Origen
2
+ module Pins
3
+ class OtherPin < Pin
4
+ end
5
+ end
6
+ end
@@ -39,6 +39,9 @@ module Origen
39
39
  # Pin RTL name, short term solution for products that do not get full HDL path for pins
40
40
  attr_accessor :rtl_name
41
41
 
42
+ attr_accessor :description
43
+ attr_accessor :notes
44
+
42
45
  # Should be instantiated through the HasPins macros
43
46
  def initialize(id, owner, options = {}) # :nodoc:
44
47
  options = {
@@ -25,6 +25,8 @@ module Origen
25
25
  bank = all_ground_pins
26
26
  elsif pin.is_a?(VirtualPin)
27
27
  bank = all_virtual_pins
28
+ elsif pin.is_a?(OtherPin)
29
+ bank = all_other_pins
28
30
  else
29
31
  bank = all_pins
30
32
  end
@@ -75,6 +77,12 @@ module Origen
75
77
  end
76
78
  end
77
79
 
80
+ def other_pins(options = {})
81
+ all_other_pins.select do |_id, pin|
82
+ pin.enabled?(options)
83
+ end
84
+ end
85
+
78
86
  def virtual_pins(options = {})
79
87
  all_virtual_pins.select do |_id, pin|
80
88
  pin.enabled?(options)
@@ -102,6 +110,13 @@ module Origen
102
110
  end
103
111
  end
104
112
 
113
+ # Returns a hash containing all ground_pin_groups available in the current context stored by their primary ID
114
+ def other_pin_groups(options = {})
115
+ current_pin_group_store(all_other_pin_groups, options).select do |_id, group|
116
+ group.enabled?(options)
117
+ end
118
+ end
119
+
105
120
  # Returns a hash containing all virtual_pin_groups available in the current context stored by their primary ID
106
121
  def virtual_pin_groups(options = {})
107
122
  current_pin_group_store(all_virtual_pin_groups, options).select do |_id, group|
@@ -129,6 +144,11 @@ module Origen
129
144
  @all_ground_pins ||= {}
130
145
  end
131
146
 
147
+ # Returns a hash containing all other pins stored by their primary ID
148
+ def all_other_pins
149
+ @all_other_pins ||= {}
150
+ end
151
+
132
152
  # Returns a hash containing all virtual pins stored by their primary ID
133
153
  def all_virtual_pins
134
154
  @all_virtual_pins ||= {}
@@ -144,6 +164,11 @@ module Origen
144
164
  @all_ground_pin_groups ||= {}
145
165
  end
146
166
 
167
+ # Returns a hash containing all other pin groups stored by context
168
+ def all_other_pin_groups
169
+ @all_other_pin_groups ||= {}
170
+ end
171
+
147
172
  # Returns a hash containing all virtual pin groups stored by context
148
173
  def all_virtual_pin_groups
149
174
  @all_virtual_pin_groups ||= {}
@@ -157,6 +182,8 @@ module Origen
157
182
  pin = all_ground_pins[id] || find_pin_group(id, options)
158
183
  elsif options[:virtual_pin]
159
184
  pin = all_virtual_pins[id] || find_pin_group(id, options)
185
+ elsif options[:other_pin]
186
+ pin = all_other_pins[id] || find_pin_group(id, options)
160
187
  else
161
188
  pin = all_pins[id] || find_by_alias(id, options) || find_pin_group(id, options)
162
189
  end
@@ -175,6 +202,8 @@ module Origen
175
202
  base = all_power_pin_groups
176
203
  elsif options[:ground_pin]
177
204
  base = all_ground_pin_groups
205
+ elsif options[:other_pin]
206
+ base = all_other_pin_groups
178
207
  elsif options[:virtual_pin]
179
208
  base = all_virtual_pin_groups
180
209
  else
@@ -209,6 +238,8 @@ module Origen
209
238
  bank = all_power_pins
210
239
  elsif pin.is_a?(GroundPin)
211
240
  bank = all_ground_pins
241
+ elsif pin.is_a?(OtherPin)
242
+ bank = all_other_pins
212
243
  elsif pin.is_a?(VirtualPin)
213
244
  bank = all_virtual_pins
214
245
  else
@@ -240,6 +271,8 @@ module Origen
240
271
  base = all_power_pin_groups
241
272
  elsif group.ground_pins?
242
273
  base = all_ground_pin_groups
274
+ elsif group.other_pins?
275
+ base = all_other_pin_groups
243
276
  elsif group.virtual_pins?
244
277
  base = all_virtual_pin_groups
245
278
  else
@@ -285,6 +318,8 @@ module Origen
285
318
  base = all_power_pin_groups
286
319
  elsif group.ground_pins?
287
320
  base = all_ground_pin_groups
321
+ elsif group.other_pins?
322
+ base = all_other_pin_groups
288
323
  elsif group.virtual_pins?
289
324
  base = all_virtual_pin_groups
290
325
  else
@@ -367,10 +402,12 @@ module Origen
367
402
  @all_pins = nil
368
403
  @all_power_pins = nil
369
404
  @all_ground_pins = nil
405
+ @all_other_pins = nil
370
406
  @all_virtual_pins = nil
371
407
  @all_pin_groups = nil
372
408
  @all_power_pin_groups = nil
373
409
  @all_ground_pin_groups = nil
410
+ @all_other_pin_groups = nil
374
411
  @all_virtual_pin_groups = nil
375
412
  end
376
413
 
@@ -8,6 +8,7 @@ module Origen
8
8
 
9
9
  attr_accessor :endian
10
10
  attr_accessor :description
11
+ attr_accessor :group
11
12
 
12
13
  def initialize(owner, *pins)
13
14
  options = pins.last.is_a?(Hash) ? pins.pop : {}
@@ -17,6 +18,7 @@ module Origen
17
18
  @power_pins = options.delete(:power_pin) || options.delete(:power_pins)
18
19
  @ground_pins = options.delete(:ground_pin) || options.delete(:ground_pins)
19
20
  @virtual_pins = options.delete(:virtual_pin) || options.delete(:virtual_pins)
21
+ @other_pins = options.delete(:other_pin) || options.delete(:other_pins)
20
22
  @endian = options[:endian]
21
23
  @description = options[:description] || options[:desc]
22
24
  @options = options
@@ -87,6 +89,11 @@ module Origen
87
89
  @virtual_pins
88
90
  end
89
91
 
92
+ # Returns true if the pin collection contains other pins rather than regular pins
93
+ def other_pins?
94
+ @other_pins
95
+ end
96
+
90
97
  def id
91
98
  @id
92
99
  end
@@ -182,14 +189,14 @@ module Origen
182
189
  pin = owner.power_pins(pin)
183
190
  elsif ground_pins?
184
191
  pin = owner.ground_pins(pin)
192
+ elsif other_pins?
193
+ pin = owner.other_pins(pin)
185
194
  elsif virtual_pins?
186
195
  pin = owner.virtual_pins(pin)
187
196
  else
188
197
  pin = owner.pins(pin)
189
198
  end
190
- if @store.include?(pin)
191
- fail "Pin collection #{id} already contains pin #{pin.id}!"
192
- else
199
+ unless @store.include?(pin)
193
200
  pin.invalidate_group_cache
194
201
  @store.push(pin)
195
202
  end
@@ -22,6 +22,9 @@ module Origen
22
22
  # Plain text of the note. No Mark-up allowed in this field.
23
23
  attr_accessor :text
24
24
 
25
+ # Note Number. Optional. If not set, then DITA will make the number
26
+ attr_accessor :number
27
+
25
28
  # Markup of the text field. Currently markup has been tested with
26
29
  #
27
30
  # * DITA
@@ -46,6 +49,7 @@ module Origen
46
49
  @text = options[:text]
47
50
  @markup = options[:markup]
48
51
  @internal_comment = options[:internal_comment]
52
+ @number = options[:number]
49
53
  end
50
54
  end
51
55
  end
@@ -42,6 +42,21 @@ module Origen
42
42
  @input_display_name = ''
43
43
  @output_display_name = ''
44
44
  end
45
+
46
+ def update_input
47
+ @input_display_name = change_subscript('IN')
48
+ end
49
+
50
+ def update_output
51
+ @output_display_name = change_subscript('OUT')
52
+ end
53
+
54
+ def change_subscript(new_subscript)
55
+ temp_display_name = @display_name.dup
56
+ sub_input = temp_display_name.at_css 'sub'
57
+ sub_input.content = new_subscript unless sub_input.nil?
58
+ temp_display_name
59
+ end
45
60
  end
46
61
  end
47
62
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: origen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.31
4
+ version: 0.7.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-09 00:00:00.000000000 Z
11
+ date: 2016-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -464,6 +464,7 @@ files:
464
464
  - lib/origen/pins.rb
465
465
  - lib/origen/pins/function_proxy.rb
466
466
  - lib/origen/pins/ground_pin.rb
467
+ - lib/origen/pins/other_pin.rb
467
468
  - lib/origen/pins/pin.rb
468
469
  - lib/origen/pins/pin_bank.rb
469
470
  - lib/origen/pins/pin_clock.rb