origen 0.5.11 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/version.rb +2 -2
- data/lib/origen/application/runner.rb +23 -23
- data/lib/origen/client.rb +1 -1
- data/lib/origen/specs.rb +75 -4
- data/lib/origen/specs/spec_features.rb +46 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e99939b78d9b7a1a5b792938910f001791e9721
|
4
|
+
data.tar.gz: 39ffafc59ef48c446ebefb60e792102a0b92e48f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48cd1e06b4a31837292e84392a07488e8592a6fe8560280ecb40bffcbf25c2e696a98a89712f173aee4f01594f3b4550185926be845236f777ed538af139957f
|
7
|
+
data.tar.gz: 46507aebdf7041b89312fd07d6f18156c965842cbf736d091014ca4bb02abef6b92f9b52216426bd5ead3df8f0e4c73a088bf4e5894776e5ec93106a3fa50e61
|
data/config/version.rb
CHANGED
@@ -110,30 +110,30 @@ module Origen
|
|
110
110
|
#
|
111
111
|
# @api private
|
112
112
|
def record_invocation(options)
|
113
|
-
record_invocation = false
|
114
|
-
begin
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
rescue
|
123
|
-
|
124
|
-
end
|
113
|
+
# record_invocation = false
|
114
|
+
# begin
|
115
|
+
# # Only record user invocations at this time, also bypass windows since it seems
|
116
|
+
# # that threads can't be trusted not to block
|
117
|
+
# unless Origen.running_remotely? # || Origen.running_on_windows?
|
118
|
+
# record_invocation = Thread.new do
|
119
|
+
# Origen.client.record_invocation(options[:action]) if options[:action]
|
120
|
+
# end
|
121
|
+
# end
|
122
|
+
# rescue
|
123
|
+
# # Don't allow this to kill an origen command
|
124
|
+
# end
|
125
125
|
yield
|
126
|
-
begin
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
rescue
|
135
|
-
|
136
|
-
end
|
126
|
+
# begin
|
127
|
+
# unless Origen.running_remotely?
|
128
|
+
# # Wait for a server response, ideally would like to not wait here, but it seems if not
|
129
|
+
# # then invocation postings can be dropped, especially on windows
|
130
|
+
# Origen.profile 'waiting for recording invocation' do
|
131
|
+
# record_invocation.value
|
132
|
+
# end
|
133
|
+
# end
|
134
|
+
# rescue
|
135
|
+
# # Don't allow this to kill an origen command
|
136
|
+
# end
|
137
137
|
end
|
138
138
|
|
139
139
|
# The action to take should be set by the action option, but legacy code will pass
|
data/lib/origen/client.rb
CHANGED
data/lib/origen/specs.rb
CHANGED
@@ -9,10 +9,11 @@ module Origen
|
|
9
9
|
autoload :Mode_Select, 'origen/specs/mode_select.rb'
|
10
10
|
autoload :Version_History, 'origen/specs/version_history.rb'
|
11
11
|
autoload :Creation_Info, 'origen/specs/creation_info.rb'
|
12
|
+
autoload :Spec_Features, 'origen/specs/spec_features.rb'
|
12
13
|
require 'origen/specs/checkers'
|
13
14
|
include Checkers
|
14
15
|
|
15
|
-
attr_accessor :_specs, :_notes, :_exhibits, :_doc_resources, :_overrides, :_power_supplies, :_mode_selects, :_version_history, :_creation_info
|
16
|
+
attr_accessor :_specs, :_notes, :_exhibits, :_doc_resources, :_overrides, :_power_supplies, :_mode_selects, :_version_history, :_creation_info, :_spec_features
|
16
17
|
|
17
18
|
# Detailed description for the ip block
|
18
19
|
attr_accessor :description
|
@@ -22,6 +23,8 @@ module Origen
|
|
22
23
|
|
23
24
|
NOTE_TYPES = [:spec, :doc, :mode, :feature, :sighting]
|
24
25
|
|
26
|
+
FEATURE_TYPES = [:intro, :feature, :subfeature]
|
27
|
+
|
25
28
|
SpecTableAttr = Struct.new(:table_text, :show, :padding)
|
26
29
|
|
27
30
|
# A regular Array but print specs to the console via their ID for brevity and
|
@@ -49,10 +52,12 @@ module Origen
|
|
49
52
|
_specs
|
50
53
|
if s.nil?
|
51
54
|
return show_specs(options)
|
52
|
-
elsif s.is_a? Hash
|
55
|
+
elsif s.is_a? Hash
|
56
|
+
# no spec was passed but some option was passed
|
53
57
|
options.update(s)
|
54
58
|
return show_specs(options)
|
55
|
-
else
|
59
|
+
else
|
60
|
+
# a spec was passed
|
56
61
|
options[:spec] = s
|
57
62
|
return show_specs(options)
|
58
63
|
end
|
@@ -80,6 +85,8 @@ module Origen
|
|
80
85
|
.new(name, type, mode, owner_name, &block)
|
81
86
|
# Check if the spec already exists
|
82
87
|
if has_spec?(name, type: type, mode: mode, sub_type: spec_placeholder.sub_type, creating_spec: true)
|
88
|
+
# Spec already exists. Go ahead flag error and drop processing.
|
89
|
+
# This is a fatal error.
|
83
90
|
fail "Spec already exists for name: #{name}, type: #{type}, mode: #{mode} for object #{self}"
|
84
91
|
end
|
85
92
|
@_specs[name][mode][type][spec_placeholder.sub_type] = spec_placeholder
|
@@ -103,6 +110,7 @@ module Origen
|
|
103
110
|
end
|
104
111
|
end
|
105
112
|
|
113
|
+
# Returns the modes for this block
|
106
114
|
def get_modes
|
107
115
|
@_modes
|
108
116
|
end
|
@@ -121,69 +129,99 @@ module Origen
|
|
121
129
|
!!show_specs(options)
|
122
130
|
end
|
123
131
|
|
132
|
+
# Adds a new feature to the block
|
133
|
+
def spec_feature(id, attrs, device, text, internal_comment)
|
134
|
+
# Welguisz: No idea why this is here, but keeping it here because it follows other blocks
|
135
|
+
_spec_features
|
136
|
+
# Create a new feature and place it in the features 2-D Hash
|
137
|
+
@_spec_features[id][device] = Spec_Features.new(id, attrs, device, text, internal_comment)
|
138
|
+
end
|
139
|
+
|
124
140
|
# Define and instantiate a Note object
|
125
141
|
def note(id, type, options = {})
|
142
|
+
# Welguisz: No idea why this is here, but keeping it here because it follows other blocks
|
126
143
|
_notes
|
144
|
+
# Create a new note and place it in the notes 2-D Hash
|
127
145
|
@_notes[id][type] = Note.new(id, type, options)
|
128
146
|
end
|
129
147
|
|
130
148
|
def exhibit(id, type, options = {})
|
149
|
+
# Welguisz: No idea why this is here, but keeping it here because it follows other blocks
|
131
150
|
_exhibits
|
151
|
+
# Create a new Exhibit and place it in the exhibits 3-D Hash
|
132
152
|
@_exhibits[options[:block_id]][id][type] = Exhibit.new(id, type, options)
|
133
153
|
end
|
134
154
|
|
135
155
|
def doc_resource(selector = {}, table_title = {}, text = {}, options = {})
|
156
|
+
# Welguisz: No idea why this is here, but keeping it here because it follows other blocks
|
136
157
|
_doc_resources
|
137
158
|
mode = selector[:mode]
|
138
159
|
type = selector[:type]
|
139
160
|
sub_type = selector[:sub_type]
|
140
161
|
audience = selector[:audience]
|
162
|
+
# Create a new Document Resource and place it in the Doc Resources 4-D Hash
|
141
163
|
@_doc_resources[mode][type][sub_type][audience] = Doc_Resource.new(selector, table_title, text, options)
|
142
164
|
end
|
143
165
|
|
144
166
|
def version_history(date, author, changes)
|
167
|
+
# Welguisz: No idea why this is here, but keeping it here because it follows other blocks
|
145
168
|
_version_history
|
169
|
+
# Create a new Version History and place it in the version history 2-D Hash
|
146
170
|
tmp_ver_history = Version_History.new(date, author, changes)
|
147
171
|
@_version_history[date][author] = tmp_ver_history
|
148
172
|
end
|
149
173
|
|
150
174
|
def override(block_options = {}, find_spec = {}, values = {}, options = {})
|
175
|
+
# Welguisz: No idea why this is here, but keeping it here because it follows other blocks
|
151
176
|
_overrides
|
152
177
|
block = block_options[:block]
|
153
178
|
spec_ref = find_spec[:spec_id]
|
154
179
|
mode_ref = find_spec[:mode_ref]
|
155
180
|
sub_type = find_spec[:sub_type]
|
156
181
|
audience = find_spec[:audience]
|
182
|
+
# Create a new Override and place it in the overrides 5-D Hash
|
157
183
|
@_overrides[block][spec_ref][mode_ref][sub_type][audience] = Override.new(block_options, find_spec, values, options)
|
158
184
|
end
|
159
185
|
|
160
186
|
def power_supply(gen, act)
|
187
|
+
# Welguisz: No idea why this is here, but keeping it here because it follows other blocks
|
161
188
|
_power_supplies
|
189
|
+
# Create a new Power Supply and place it in the power supplies 2-D Hash
|
162
190
|
@_power_supplies[gen][act] = Power_Supply.new(gen, act)
|
163
191
|
end
|
164
192
|
|
165
193
|
def mode_select(block_information, mode_usage, power_information)
|
194
|
+
# Welguisz: No idea why this is here, but keeping it here because it follows other blocks
|
166
195
|
_mode_selects
|
196
|
+
# See if the mode will be used. If so, create a new Mode Select and place it in mode_selects 2-D Hash
|
167
197
|
if block_information[:usage]
|
168
198
|
@_mode_selects[block_information[:name]][mode_usage[:mode]] = Mode_Select.new(block_information, mode_usage, power_information)
|
169
199
|
end
|
170
200
|
end
|
171
201
|
|
172
202
|
def creation_info(author, date, version, src_info = {}, tool_info = {})
|
203
|
+
# Create a new Information Information. Should only be one.
|
173
204
|
@_creation_info = Creation_Info.new(author, date, version, src_info, tool_info)
|
174
205
|
end
|
175
206
|
|
176
207
|
# Returns a Note object from the notes hash
|
177
208
|
def notes(options = {})
|
209
|
+
# Create a default 2 item hash and update if options is supplied
|
178
210
|
options = {
|
179
211
|
id: nil,
|
180
212
|
type: nil
|
181
213
|
}.update(options)
|
214
|
+
# Empty 2-D Hash to be used for notes found based on id and type
|
182
215
|
notes_found = Hash.new do |h, k|
|
216
|
+
# h is the id portion of the hash
|
217
|
+
# k is the type portion of the hash
|
183
218
|
h[k] = {}
|
184
219
|
end
|
185
|
-
|
220
|
+
# Filter @notes based off of the id
|
221
|
+
@_notes.filter(options[:id]).each do |id, hash|
|
222
|
+
# Filter hash based off of the type
|
186
223
|
hash.filter(options[:type]).each do |type, note|
|
224
|
+
# Store the note into note_found
|
187
225
|
notes_found[id][type] = note
|
188
226
|
end
|
189
227
|
end
|
@@ -196,6 +234,29 @@ module Origen
|
|
196
234
|
end
|
197
235
|
end
|
198
236
|
|
237
|
+
def spec_features(options = {})
|
238
|
+
options = {
|
239
|
+
id: nil,
|
240
|
+
device: nil
|
241
|
+
}.update(options)
|
242
|
+
return @_spec_features if options[:id].nil? && options[:device].nil?
|
243
|
+
features_found = Hash.new do |h, k|
|
244
|
+
h[k] = {}
|
245
|
+
end
|
246
|
+
@_spec_features.filter(options[:id]).each do |id, hash|
|
247
|
+
hash.filter(options[:device]).each do |device, feat|
|
248
|
+
features_found[id][device] = feat
|
249
|
+
end
|
250
|
+
end
|
251
|
+
if features_found.empty?
|
252
|
+
return nil
|
253
|
+
elsif features_found.size == 1
|
254
|
+
features_found.values.first.values.first
|
255
|
+
else
|
256
|
+
return features_found
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
199
260
|
def exhibits(options = {})
|
200
261
|
options = {
|
201
262
|
block: nil,
|
@@ -348,6 +409,10 @@ module Origen
|
|
348
409
|
@_creation_info = nil
|
349
410
|
end
|
350
411
|
|
412
|
+
def delete_spec_features
|
413
|
+
@_spec_features = nil
|
414
|
+
end
|
415
|
+
|
351
416
|
private
|
352
417
|
|
353
418
|
def _specs
|
@@ -368,6 +433,12 @@ module Origen
|
|
368
433
|
end
|
369
434
|
end
|
370
435
|
|
436
|
+
def _spec_features
|
437
|
+
@_spec_features ||= Hash.new do |h, k|
|
438
|
+
h[k] = {}
|
439
|
+
end
|
440
|
+
end
|
441
|
+
|
371
442
|
def _exhibits
|
372
443
|
@_exhibits ||= Hash.new do |h, k|
|
373
444
|
h[k] = Hash.new do |hh, kk|
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Origen
|
2
|
+
module Specs
|
3
|
+
# Ruby Data Class that contains Creation Information for the IP Block
|
4
|
+
class Spec_Features
|
5
|
+
# This is the Id of the Feature that will be referenced
|
6
|
+
# Future goal is to be able to tie this ID to a specification in a Product Requirements Document
|
7
|
+
attr_accessor :id
|
8
|
+
|
9
|
+
# Feature Type
|
10
|
+
# Current supported types are
|
11
|
+
# intro :: Intro Paragraph for the Features Page
|
12
|
+
# feature :: Main Feature (e.g. Additional peripherals include)
|
13
|
+
# subfeature :: Sub Feature that will be a sub-bullet to feature. (e.g. Four I2C controllers)
|
14
|
+
attr_accessor :type
|
15
|
+
|
16
|
+
# Feature Reference
|
17
|
+
# To be used for sub-feature so that they can be linked easily
|
18
|
+
attr_accessor :feature_ref
|
19
|
+
|
20
|
+
# Applicable Devices for this feature. This allows for multiple devices from one piece of silicon
|
21
|
+
# If this feature is on Part B and Part D, then applicable devices will include Part B and Part D, but no other parts
|
22
|
+
attr_accessor :applicable_devices
|
23
|
+
|
24
|
+
# The actual text of the feature
|
25
|
+
attr_accessor :text
|
26
|
+
|
27
|
+
# Internal comments about this feature. Why was this feature included here? Any changes from the
|
28
|
+
# Product Requirements Document
|
29
|
+
attr_accessor :internal_comments
|
30
|
+
|
31
|
+
# Intended Audience for this feature. Internal or External?
|
32
|
+
attr_accessor :audience
|
33
|
+
|
34
|
+
# Initialize the Feature to be used
|
35
|
+
def initialize(id, attrs, applicable_devices, text, internal_comments)
|
36
|
+
@id = id
|
37
|
+
@type = attrs[:type]
|
38
|
+
@feature_ref = attrs[:feature_ref]
|
39
|
+
@audience = attrs[:audience]
|
40
|
+
@applicable_devices = applicable_devices
|
41
|
+
@text = text
|
42
|
+
@internal_comments = internal_comments
|
43
|
+
end
|
44
|
+
end # module Features
|
45
|
+
end # module Specs
|
46
|
+
end # module Origen
|
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.
|
4
|
+
version: 0.6.0
|
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-
|
11
|
+
date: 2016-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -582,6 +582,7 @@ files:
|
|
582
582
|
- lib/origen/specs/override.rb
|
583
583
|
- lib/origen/specs/power_supply.rb
|
584
584
|
- lib/origen/specs/spec.rb
|
585
|
+
- lib/origen/specs/spec_features.rb
|
585
586
|
- lib/origen/specs/version_history.rb
|
586
587
|
- lib/origen/sub_blocks.rb
|
587
588
|
- lib/origen/top_level.rb
|