origen 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e99939b78d9b7a1a5b792938910f001791e9721
4
- data.tar.gz: 39ffafc59ef48c446ebefb60e792102a0b92e48f
3
+ metadata.gz: 412394863afdfd32cdb344c17126129b8c499329
4
+ data.tar.gz: 1baa897bcf1e764d3a131d6f827ec0552c9ed662
5
5
  SHA512:
6
- metadata.gz: 48cd1e06b4a31837292e84392a07488e8592a6fe8560280ecb40bffcbf25c2e696a98a89712f173aee4f01594f3b4550185926be845236f777ed538af139957f
7
- data.tar.gz: 46507aebdf7041b89312fd07d6f18156c965842cbf736d091014ca4bb02abef6b92f9b52216426bd5ead3df8f0e4c73a088bf4e5894776e5ec93106a3fa50e61
6
+ metadata.gz: 649434cf50cbe409e0e03ee825262500d97c14bfe6357c8c190bea675c04901acfd5cbc311db7f096cf93409ea3f54bd62daffcf46ec4aa88c27cf6b5558eeb9
7
+ data.tar.gz: 0b964eb7b8cd58ab5ceb99d2b13cea2b6eb3b8f698248fc34c005a24d82d425f864ffc976aabc6e3bf89ad0809832a157e37510f243d808cac24f03d2b638a9a
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
3
  MINOR = 6
4
- BUGFIX = 0
4
+ BUGFIX = 1
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -15,83 +15,85 @@ module Origen
15
15
  # Originally this method was called generate but that is now deprecated in favour
16
16
  # of the more generic 'launch' as the Origen feature set has expanded.
17
17
  def launch(options = {})
18
- # Clean up the input from legacy code
19
- options[:action] = extract_action(options)
20
- options[:files] = extract_files(options)
21
- @options = options
22
- prepare_and_validate_workspace(options)
23
- if options[:lsf]
24
- record_invocation(options) do
25
- prepare_for_lsf
26
- Origen.app.listeners_for(:before_lsf_submission).each(&:before_lsf_submission)
27
- expand_lists_and_directories(options[:files], options).each do |file|
28
- Origen.app.lsf_manager.submit_origen_job(file, options)
29
- end
30
- end
31
- Origen.log.info ''
32
- Origen.log.info 'Monitor status of remote jobs via:'
33
- Origen.log.info ' origen l'
34
- else
35
- Origen.log.info '*' * 70 unless options[:quiet]
36
- Origen.app.listeners_for(:before_generate).each do |listener|
37
- if listener.class.instance_method(:before_generate).arity == 0
38
- listener.before_generate
39
- else
40
- listener.before_generate(options)
41
- end
42
- end
43
- if Origen.running_remotely?
44
- Origen.app.listeners_for(:before_generate_remote).each do |listener|
45
- if listener.class.instance_method(:before_generate_remote).arity == 0
46
- listener.before_generate_remote
47
- else
48
- listener.before_generate_remote(options)
18
+ Origen.file_handler.preserve_state do
19
+ # Clean up the input from legacy code
20
+ options[:action] = extract_action(options)
21
+ options[:files] = extract_files(options)
22
+ @options = options
23
+ prepare_and_validate_workspace(options)
24
+ if options[:lsf]
25
+ record_invocation(options) do
26
+ prepare_for_lsf
27
+ Origen.app.listeners_for(:before_lsf_submission).each(&:before_lsf_submission)
28
+ expand_lists_and_directories(options[:files], options).each do |file|
29
+ Origen.app.lsf_manager.submit_origen_job(file, options)
49
30
  end
50
31
  end
32
+ Origen.log.info ''
33
+ Origen.log.info 'Monitor status of remote jobs via:'
34
+ Origen.log.info ' origen l'
51
35
  else
52
- Origen.app.listeners_for(:before_generate_local).each do |listener|
53
- if listener.class.instance_method(:before_generate_local).arity == 0
54
- listener.before_generate_local
36
+ Origen.log.info '*' * 70 unless options[:quiet]
37
+ Origen.app.listeners_for(:before_generate).each do |listener|
38
+ if listener.class.instance_method(:before_generate).arity == 0
39
+ listener.before_generate
55
40
  else
56
- listener.before_generate_local(options)
41
+ listener.before_generate(options)
57
42
  end
58
43
  end
59
- end
60
-
61
- record_invocation(options) do
62
- case options[:action]
63
- when :forecast_test_time
64
- Origen.time.forecast_test_time(options)
44
+ if Origen.running_remotely?
45
+ Origen.app.listeners_for(:before_generate_remote).each do |listener|
46
+ if listener.class.instance_method(:before_generate_remote).arity == 0
47
+ listener.before_generate_remote
48
+ else
49
+ listener.before_generate_remote(options)
50
+ end
51
+ end
65
52
  else
66
- if options[:action] == :program
67
- Origen.generator.generate_program(expand_lists_and_directories(options[:files], options), options)
53
+ Origen.app.listeners_for(:before_generate_local).each do |listener|
54
+ if listener.class.instance_method(:before_generate_local).arity == 0
55
+ listener.before_generate_local
56
+ else
57
+ listener.before_generate_local(options)
58
+ end
59
+ end
60
+ end
61
+
62
+ record_invocation(options) do
63
+ case options[:action]
64
+ when :forecast_test_time
65
+ Origen.time.forecast_test_time(options)
68
66
  else
69
- temporary_plugin_from_options = options[:current_plugin]
70
- expand_lists_and_directories(options[:files], options).each do |file|
71
- if temporary_plugin_from_options
72
- Origen.app.plugins.temporary = temporary_plugin_from_options
73
- end
74
- case options[:action]
75
- when :compile
76
- Origen.generator.compile_file_or_directory(file, options)
77
- when :merge
78
- Origen.generator.merge_file_or_directory(file, options)
79
- when :import_test_time
80
- Origen.time.import_test_time(file, options)
81
- when :import_test_flow
82
- Origen.time.import_test_flow(file, options)
83
- else
84
- Origen.generator.generate_pattern(file, options)
67
+ if options[:action] == :program
68
+ Origen.generator.generate_program(expand_lists_and_directories(options[:files], options), options)
69
+ else
70
+ temporary_plugin_from_options = options[:current_plugin]
71
+ expand_lists_and_directories(options[:files], options).each do |file|
72
+ if temporary_plugin_from_options
73
+ Origen.app.plugins.temporary = temporary_plugin_from_options
74
+ end
75
+ case options[:action]
76
+ when :compile
77
+ Origen.generator.compile_file_or_directory(file, options)
78
+ when :merge
79
+ Origen.generator.merge_file_or_directory(file, options)
80
+ when :import_test_time
81
+ Origen.time.import_test_time(file, options)
82
+ when :import_test_flow
83
+ Origen.time.import_test_flow(file, options)
84
+ else
85
+ Origen.generator.generate_pattern(file, options)
86
+ end
87
+ Origen.app.plugins.temporary = nil if temporary_plugin_from_options
85
88
  end
86
- Origen.app.plugins.temporary = nil if temporary_plugin_from_options
87
89
  end
88
90
  end
89
91
  end
90
- end
91
92
 
92
- unless options[:quiet]
93
- Origen.log.info '*' * 70
94
- stats.print_summary unless options[:action] == :merge
93
+ unless options[:quiet]
94
+ Origen.log.info '*' * 70
95
+ stats.print_summary unless options[:action] == :merge
96
+ end
95
97
  end
96
98
  end
97
99
  end
@@ -388,11 +388,13 @@ module Origen
388
388
  dir = base_directory
389
389
  output = output_directory
390
390
  ref = reference_directory
391
+ ext = default_extension
391
392
  yield
392
393
  self.base_directory = dir if dir
393
394
  self.current_file = file if file
394
395
  set_output_directory(output: output) if output
395
396
  set_reference_directory(reference: ref) if ref
397
+ self.default_extension = ext
396
398
  end
397
399
 
398
400
  def preserve_and_clear_state
@@ -400,6 +402,7 @@ module Origen
400
402
  dir = base_directory
401
403
  output = output_directory
402
404
  ref = reference_directory
405
+ ext = default_extension
403
406
  current_file = nil
404
407
  base_directory = nil
405
408
  output_directory = nil
@@ -409,6 +412,7 @@ module Origen
409
412
  self.current_file = file if file
410
413
  set_output_directory(output: output) if output
411
414
  set_reference_directory(reference: ref) if ref
415
+ self.default_extension = ext
412
416
  end
413
417
 
414
418
  # Returns the sub directory of the current base directory that the
data/lib/origen/specs.rb CHANGED
@@ -145,11 +145,11 @@ module Origen
145
145
  @_notes[id][type] = Note.new(id, type, options)
146
146
  end
147
147
 
148
- def exhibit(id, type, options = {})
148
+ def exhibit(id, type, overrides = {}, options = {})
149
149
  # Welguisz: No idea why this is here, but keeping it here because it follows other blocks
150
150
  _exhibits
151
151
  # Create a new Exhibit and place it in the exhibits 3-D Hash
152
- @_exhibits[options[:block_id]][id][type] = Exhibit.new(id, type, options)
152
+ @_exhibits[options[:block_id]][id][type] = Exhibit.new(id, type, overrides, options)
153
153
  end
154
154
 
155
155
  def doc_resource(selector = {}, table_title = {}, text = {}, options = {})
@@ -204,6 +204,10 @@ module Origen
204
204
  @_creation_info = Creation_Info.new(author, date, version, src_info, tool_info)
205
205
  end
206
206
 
207
+ def get_creation_info
208
+ @_creation_info
209
+ end
210
+
207
211
  # Returns a Note object from the notes hash
208
212
  def notes(options = {})
209
213
  # Create a default 2 item hash and update if options is supplied
@@ -259,63 +263,92 @@ module Origen
259
263
 
260
264
  def exhibits(options = {})
261
265
  options = {
262
- block: nil,
263
- id: nil,
264
- type: nil,
265
- exhibits_to_be_shown: []
266
+ block: nil,
267
+ id: nil,
268
+ type: nil
266
269
  }.update(options)
267
- exhibits_to_be_shown = options[:exhibits_to_be_shown]
268
- filter_hash(_exhibits, options[:block]).each do |_exhibit, hash|
269
- filter_hash(hash, options[:id]).each do |id, hash_|
270
- filter_hash(hash_, options[:type]).each do |type, hash__|
271
- exhibits_to_be_shown << hash__
270
+ ex_found = Hash.new do |h, k|
271
+ h[k] = Hash.new do |hh, kk|
272
+ hh[kk] = {}
273
+ end
274
+ end
275
+ filter_hash(_exhibits, options[:block]).each do |_block, hash|
276
+ filter_hash(hash, options[:id]).each do |_id, hash_|
277
+ filter_hash(hash_, options[:type]).each do |_type, exh|
278
+ ex_found[_block][_id][_type] = exh
272
279
  end
273
280
  end
274
281
  end
275
- exhibits_to_be_shown
282
+ if ex_found.empty?
283
+ return nil
284
+ else
285
+ return ex_found
286
+ end
276
287
  end
277
288
 
278
289
  def doc_resources(options = {})
279
290
  options = {
280
- mode: nil,
281
- type: nil,
282
- sub_type: nil,
283
- audience: nil,
284
- doc_resources_to_be_shown: []
291
+ mode: nil,
292
+ type: nil,
293
+ sub_type: nil,
294
+ audience: nil
285
295
  }.update(options)
286
- doc_resources_to_be_shown = options[:doc_resources_to_be_shown]
287
- filter_hash(_doc_resources, options[:mode]).each do |_doc_resource, hash|
296
+ dr_found = Hash.new do |h, k|
297
+ h[k] = Hash.new do |hh, kk|
298
+ hh[kk] = Hash.new do |hhh, kkk|
299
+ hhh[kkk] = {}
300
+ end
301
+ end
302
+ end
303
+ filter_hash(_doc_resources, options[:mode]).each do |_mode, hash|
288
304
  filter_hash(hash, options[:type]).each do |_type, hash_|
289
305
  filter_hash(hash_, options[:sub_type]).each do |_sub_type, hash__|
290
306
  filter_hash(hash__, options[:audience]).each do |_audience, spec|
291
- doc_resources_to_be_shown << spec
307
+ dr_found[_mode][_type][_sub_type][_audience] = spec
292
308
  end
293
309
  end
294
310
  end
295
311
  end
312
+ if dr_found.empty?
313
+ return nil
314
+ else
315
+ return dr_found
316
+ end
296
317
  end
297
318
 
298
319
  def overrides(options = {})
299
320
  options = {
300
- block: nil,
301
- spec_ref: nil,
302
- mode_ref: nil,
303
- sub_type: nil,
304
- audience: nil,
305
- overrides: []
321
+ block: nil,
322
+ spec_ref: nil,
323
+ mode_ref: nil,
324
+ sub_type: nil,
325
+ audience: nil
306
326
  }.update(options)
307
- overrides = options[:overrides]
308
- filter_hash(_overrides, options[:block]).each do |_override, hash|
327
+ overrides_found = Hash.new do |h, k|
328
+ h[k] = Hash.new do |hh, kk|
329
+ hh[kk] = Hash.new do |hhh, kkk|
330
+ hhh[kkk] = Hash.new do |hhhh, kkkk|
331
+ hhhh[kkkk] = {}
332
+ end
333
+ end
334
+ end
335
+ end
336
+ filter_hash(_overrides, options[:block]).each do |_block, hash|
309
337
  filter_hash(hash, options[:spec_ref]).each do |_spec_ref, hash_|
310
338
  filter_hash(hash_, options[:mode_ref]).each do |_mode_ref, hash__|
311
339
  filter_hash(hash__, options[:sub_type]).each do |_sub_type, hash___|
312
340
  filter_hash(hash___, options[:audience]).each do |_audience, override|
313
- overrides << override
341
+ overrides_found[_block][_spec_ref][_mode_ref][_sub_type][_audience] = override
314
342
  end
315
343
  end
316
344
  end
317
345
  end
318
346
  end
347
+ if overrides_found.empty?
348
+ return nil
349
+ else
350
+ return overrides_found
351
+ end
319
352
  end
320
353
 
321
354
  def mode_selects(options = {})
@@ -333,8 +366,6 @@ module Origen
333
366
  end
334
367
  if modes_found.empty?
335
368
  return nil
336
- elsif modes_found.size == 1
337
- return modes_found.values.first.values.first
338
369
  else
339
370
  return modes_found
340
371
  end
@@ -355,8 +386,6 @@ module Origen
355
386
  end
356
387
  if ps_found.empty?
357
388
  return nil
358
- elsif ps_found.size == 1
359
- return ps_found.values.first.values.first
360
389
  else
361
390
  return ps_found
362
391
  end
@@ -2,14 +2,48 @@ module Origen
2
2
  module Specs
3
3
  # This class is used to store spec exhibit information used to document IP
4
4
  class Exhibit
5
- attr_accessor :id, :type, :title, :description, :reference, :markup, :include_exhibit, :block_id
5
+ # ID for the exhibit. This allows the exhibit to reference easier
6
+ attr_accessor :id
6
7
 
7
- def initialize(id, type, options = {})
8
+ # Type of exhibit. Currently only :fig is supported. In the future, this could be :topic or :table or anything else
9
+ attr_accessor :type
10
+
11
+ # Title for the Exhibit.
12
+ attr_accessor :title
13
+
14
+ # Description for the Exhibit
15
+ attr_accessor :description
16
+
17
+ # Reference link
18
+ attr_accessor :reference
19
+
20
+ # Markup needed for the exhibit
21
+ attr_accessor :markup
22
+
23
+ # Do we include the exhibit in this block
24
+ attr_accessor :include_exhibit
25
+
26
+ # Block ID that this exhibit is being used in.
27
+ attr_accessor :block_id
28
+
29
+ # Title Override. Allows for the SoC to override the title so that it makes more sense
30
+ attr_accessor :title_override
31
+
32
+ # Reference Override. This allows for the SoC to use a different figure (e.g. Power Supplies are different)
33
+ attr_accessor :reference_override
34
+
35
+ # Description Override. This allows for the SoC to use a different description
36
+ attr_accessor :description_override
37
+
38
+ def initialize(id, type, overrides, options = {})
8
39
  @id = id
9
40
  @type = type
10
41
  @title = options[:title]
11
42
  @description = options[:description]
12
43
  @reference = options[:reference]
44
+ @title_override = overrides[:title]
45
+ @reference_override = overrides[:reference]
46
+ @description_override = overrides[:description]
13
47
  @markup = options[:markup]
14
48
  @include_exhibit = true
15
49
  @include_exhibit = options[:include_exhibit] unless options[:include_exhibit].nil?
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.6.0
4
+ version: 0.6.1
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-02-09 00:00:00.000000000 Z
11
+ date: 2016-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport