origen 0.6.6 → 0.6.7
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 +4 -4
- data/config/version.rb +1 -1
- data/lib/origen/pins/pin_collection.rb +6 -2
- data/lib/origen/specs.rb +79 -3
- data/lib/origen/specs/documentation.rb +57 -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: d5524389d795a57f92302534b5350ce902a13967
|
4
|
+
data.tar.gz: bb2943010e3ddf48ba8d6b8ba08a9af2d98b7af5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51000c5a32e20f65504744a1bfc668568dbc2de57ffb8d59322e30f94949decec6d55054efd88d0bb7ddc887f4b5ba4a0c362fdd1360c8da3985189d8d4dcca7
|
7
|
+
data.tar.gz: 93649414847c8fbc8a43ea51c0feacc267e05690047959dd31a4a5099401f1c2ae61c90f1a9d569641be94058c9d33070849000c01293c9bd81aa3063dd6fd25
|
data/config/version.rb
CHANGED
@@ -325,9 +325,13 @@ module Origen
|
|
325
325
|
end
|
326
326
|
|
327
327
|
def assert(value, options = {})
|
328
|
-
value = value.data if value.respond_to?('data')
|
329
328
|
each_with_index do |pin, i|
|
330
|
-
|
329
|
+
if !value.respond_to?('is_to_be_read?') || value[size - i - 1].is_to_be_read?
|
330
|
+
value = value.data if value.respond_to?('data')
|
331
|
+
pin.assert(value[size - i - 1], options)
|
332
|
+
else
|
333
|
+
pin.dont_care
|
334
|
+
end
|
331
335
|
end
|
332
336
|
self
|
333
337
|
end
|
data/lib/origen/specs.rb
CHANGED
@@ -10,10 +10,11 @@ module Origen
|
|
10
10
|
autoload :Version_History, 'origen/specs/version_history.rb'
|
11
11
|
autoload :Creation_Info, 'origen/specs/creation_info.rb'
|
12
12
|
autoload :Spec_Features, 'origen/specs/spec_features.rb'
|
13
|
+
autoload :Documentation, 'origen/specs/documentation.rb'
|
13
14
|
require 'origen/specs/checkers'
|
14
15
|
include Checkers
|
15
16
|
|
16
|
-
attr_accessor :_specs, :_notes, :_exhibits, :_doc_resources, :_overrides, :_power_supplies, :_mode_selects, :_version_history, :_creation_info, :_spec_features
|
17
|
+
attr_accessor :_specs, :_notes, :_exhibits, :_doc_resources, :_overrides, :_power_supplies, :_mode_selects, :_version_history, :_creation_info, :_spec_features, :_documentation
|
17
18
|
|
18
19
|
# Detailed description for the ip block
|
19
20
|
attr_accessor :description
|
@@ -129,6 +130,13 @@ module Origen
|
|
129
130
|
!!show_specs(options)
|
130
131
|
end
|
131
132
|
|
133
|
+
# Adds a new documentation notion to the block
|
134
|
+
def documentation(header_info, selection, link)
|
135
|
+
_documentation
|
136
|
+
# Create a new documenation and place it in the 5-D hash
|
137
|
+
@_documentation[header_info[:section]][header_info[:subsection]][selection[:interface]][selection[:type]][selection[:subtype]][selection[:mode]][selection[:audience]] = Documentation.new(header_info, selection, link)
|
138
|
+
end
|
139
|
+
|
132
140
|
# Adds a new feature to the block
|
133
141
|
def spec_feature(id, attrs, device, text, internal_comment)
|
134
142
|
# Welguisz: No idea why this is here, but keeping it here because it follows other blocks
|
@@ -324,6 +332,53 @@ module Origen
|
|
324
332
|
end
|
325
333
|
end
|
326
334
|
|
335
|
+
def documentations(options = {})
|
336
|
+
options = {
|
337
|
+
section: nil,
|
338
|
+
subsection: nil,
|
339
|
+
interface: nil,
|
340
|
+
mode: nil,
|
341
|
+
type: nil,
|
342
|
+
sub_type: nil,
|
343
|
+
audience: nil
|
344
|
+
}.update(options)
|
345
|
+
return nil if @_documentation.nil?
|
346
|
+
return nil if @_documentation.empty?
|
347
|
+
doc_found = Hash.new do |h, k|
|
348
|
+
h[k] = Hash.new do |hh, kk|
|
349
|
+
hh[kk] = Hash.new do |hhh, kkk|
|
350
|
+
hhh[kkk] = Hash.new do |hhhh, kkkk|
|
351
|
+
hhhh[kkkk] = Hash.new do |hhhhh, kkkkk|
|
352
|
+
hhhhh[kkkkk] = Hash.new do |hhhhhh, kkkkkk|
|
353
|
+
hhhhhh[kkkkkk] = {}
|
354
|
+
end
|
355
|
+
end
|
356
|
+
end
|
357
|
+
end
|
358
|
+
end
|
359
|
+
end
|
360
|
+
filter_hash(@_documentation, options[:section]).each do |_section, hash|
|
361
|
+
filter_hash(hash, options[:subsection]).each do |_subsection, hash_|
|
362
|
+
filter_hash(hash_, options[:interface]).each do |_interface, hash__|
|
363
|
+
filter_hash(hash__, options[:mode]).each do |_mode, hash___|
|
364
|
+
filter_hash(hash___, options[:type]).each do |_type, hash____|
|
365
|
+
filter_hash(hash____, options[:sub_type]).each do |_sub_type, hash_____|
|
366
|
+
filter_hash(hash_____, options[:audience]).each do |_audience, doc|
|
367
|
+
doc_found[_section][_subsection][_interface][_mode][_type][_sub_type][_audience] = doc
|
368
|
+
end
|
369
|
+
end
|
370
|
+
end
|
371
|
+
end
|
372
|
+
end
|
373
|
+
end
|
374
|
+
end
|
375
|
+
if doc_found.empty?
|
376
|
+
return nil
|
377
|
+
else
|
378
|
+
return doc_found
|
379
|
+
end
|
380
|
+
end
|
381
|
+
|
327
382
|
def overrides(options = {})
|
328
383
|
options = {
|
329
384
|
block: nil,
|
@@ -456,6 +511,10 @@ module Origen
|
|
456
511
|
@_spec_features = nil
|
457
512
|
end
|
458
513
|
|
514
|
+
def delete_all_documentation
|
515
|
+
@_documentation = nil
|
516
|
+
end
|
517
|
+
|
459
518
|
private
|
460
519
|
|
461
520
|
def _specs
|
@@ -500,6 +559,22 @@ module Origen
|
|
500
559
|
end
|
501
560
|
end
|
502
561
|
|
562
|
+
def _documentation
|
563
|
+
@_documentation ||= Hash.new do |h, k|
|
564
|
+
h[k] = Hash.new do |hh, kk|
|
565
|
+
hh[kk] = Hash.new do |hhh, kkk|
|
566
|
+
hhh[kkk] = Hash.new do |hhhh, kkkk|
|
567
|
+
hhhh[kkkk] = Hash.new do |hhhhh, kkkkk|
|
568
|
+
hhhhh[kkkkk] = Hash.new do |hhhhhh, kkkkkk|
|
569
|
+
hhhhhh[kkkkkk] = {}
|
570
|
+
end
|
571
|
+
end
|
572
|
+
end
|
573
|
+
end
|
574
|
+
end
|
575
|
+
end
|
576
|
+
end
|
577
|
+
|
503
578
|
def _overrides
|
504
579
|
@_overrides ||= Hash.new do |h, k|
|
505
580
|
h[k] = Hash.new do |hh, kk|
|
@@ -535,11 +610,11 @@ module Origen
|
|
535
610
|
end
|
536
611
|
|
537
612
|
# Return a hash based on the filter provided
|
538
|
-
def filter_hash(hash, filter)
|
613
|
+
def filter_hash(hash, filter, debug = false)
|
539
614
|
fail 'Hash argument is not a Hash!' unless hash.is_a? Hash
|
540
615
|
filtered_hash = {}
|
541
616
|
select_logic = case filter
|
542
|
-
when String then 'k[Regexp.new(filter)] && k.length == filter.length'
|
617
|
+
when String then 'k.nil? ? false : k[Regexp.new(filter)] && k.length == filter.length'
|
543
618
|
when (Fixnum || Integer || Float || Numeric) then "k[Regexp.new('#{filter}')]"
|
544
619
|
when Regexp then 'k[filter]'
|
545
620
|
when Symbol then
|
@@ -549,6 +624,7 @@ module Origen
|
|
549
624
|
end
|
550
625
|
# rubocop:disable UnusedBlockArgument
|
551
626
|
filtered_hash = hash.select do |k, v|
|
627
|
+
# binding.pry if filter == 'SubSection A'
|
552
628
|
[TrueClass, FalseClass].include?(select_logic.class) ? select_logic : eval(select_logic)
|
553
629
|
end
|
554
630
|
filtered_hash
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module Origen
|
2
|
+
module Specs
|
3
|
+
# This class is used to store documentation map that the user can change
|
4
|
+
class Documentation
|
5
|
+
# This is the Section Header for the Documentation Map. Usually these are main headers
|
6
|
+
# Examples:
|
7
|
+
# I. Overall DC Electricals
|
8
|
+
# II. General AC Charactertistics
|
9
|
+
# III. Power Sequencing
|
10
|
+
attr_accessor :section
|
11
|
+
|
12
|
+
# This is the subsection header for the Documentation Map. These are found under main headers
|
13
|
+
# Examples
|
14
|
+
# I. Overall DC electrical
|
15
|
+
# A. Absolute Maximum Ratings
|
16
|
+
# B. Recommend Operating Conditions
|
17
|
+
# C. Output Driver
|
18
|
+
attr_accessor :subsection
|
19
|
+
|
20
|
+
# Exhibit References that should be referenced within the table title
|
21
|
+
attr_accessor :interface
|
22
|
+
|
23
|
+
# Mode is part of the 4-D Hash for the Tables. Corresponds to Spec 4-D Hash
|
24
|
+
attr_accessor :mode
|
25
|
+
|
26
|
+
# Type is part of the 4-D Hash for the Tables. Corresponds to Spec 4-D Hash
|
27
|
+
# Usual values
|
28
|
+
#
|
29
|
+
# * DC -> Direct Current
|
30
|
+
# * AC -> Alternate Current
|
31
|
+
# * Temp -> Temperature
|
32
|
+
# * Supply -> Supply
|
33
|
+
attr_accessor :type
|
34
|
+
|
35
|
+
# SubType is part of the 4-D Hash for the Tables. Corresponds to Spec 4-D Hash
|
36
|
+
attr_accessor :sub_type
|
37
|
+
|
38
|
+
# Audience is part of the 4-D Hash for the Tables. Corresponds to Spec 4-D Hash
|
39
|
+
attr_accessor :audience
|
40
|
+
|
41
|
+
# DITA Formatted Text that appears before the table
|
42
|
+
attr_accessor :link
|
43
|
+
|
44
|
+
# Initialize the Class
|
45
|
+
def initialize(header_info = {}, selection = {}, link = nil)
|
46
|
+
@section = header_info[:section]
|
47
|
+
@subsection = header_info[:subsection]
|
48
|
+
@interface = selection[:interface]
|
49
|
+
@mode = selection[:mode]
|
50
|
+
@type = selection[:type]
|
51
|
+
@sub_type = selection[:sub_type]
|
52
|
+
@audience = selection[:audience]
|
53
|
+
@link = link
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
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.6.
|
4
|
+
version: 0.6.7
|
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-03-
|
11
|
+
date: 2016-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -577,6 +577,7 @@ files:
|
|
577
577
|
- lib/origen/specs/checkers.rb
|
578
578
|
- lib/origen/specs/creation_info.rb
|
579
579
|
- lib/origen/specs/doc_resource.rb
|
580
|
+
- lib/origen/specs/documentation.rb
|
580
581
|
- lib/origen/specs/exhibit.rb
|
581
582
|
- lib/origen/specs/mode_select.rb
|
582
583
|
- lib/origen/specs/note.rb
|