origen 0.7.7 → 0.7.8

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: 55a0a4e8ad4368f828c29d55fcbd1e2c533276f7
4
- data.tar.gz: 4a894872729fbb79801e9c98cb5d9e6cf7f2fc26
3
+ metadata.gz: 791d145cfc52402f0d89004ab08060ce874dd30c
4
+ data.tar.gz: 1fe96f4f97b1e2d8011d003c1161ccb025d8ae9e
5
5
  SHA512:
6
- metadata.gz: 0be4fa923fbb1c97519f13c20a82b106cbf7bbeae07646e6a26bca64b6abd9df5fee15ee97452e54461998d48742423f56e44aa6d970b7119928c238f0395680
7
- data.tar.gz: 39a0a321e38e7e1ff2f3acb953816428e57f6c961d0f4eace51678c6a54ab9c8dab6b6659c18a5ecaa02a65baaef4af35061a61b648af1734c6ce5c4dcb4634e
6
+ metadata.gz: a5fece355b661ae5756822e9b994a4430b507ae9a3ceef369c128e893a58453990cbfd2f2b84e1bf9535df1d8ebdce88d33ccb930c6e39059cc4b40131c7a2a0
7
+ data.tar.gz: 2ca85d5ba16eed7a2350a3afd328c367a8218cfaee4c7a4e34e296e6e3903e4d24c51ed173f4b363fc98768c636ad9f614e9b4b70c6b748056b7ed6c76f97bbb
@@ -1,7 +1,7 @@
1
1
  module Origen
2
2
  MAJOR = 0
3
3
  MINOR = 7
4
- BUGFIX = 7
4
+ BUGFIX = 8
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -3,6 +3,7 @@
3
3
  unless defined? RGen::ORIGENTRANSITION
4
4
  require 'English'
5
5
  require 'pathname'
6
+ require 'pry'
6
7
  # Keep a note of the pwd at the time when Origen was first loaded, this is initially used
7
8
  # by the site_config lookup.
8
9
  $_origen_invocation_pwd ||= Pathname.pwd
@@ -53,6 +54,7 @@ unless defined? RGen::ORIGENTRANSITION
53
54
  autoload :Chips, 'origen/chips'
54
55
  autoload :Netlist, 'origen/netlist'
55
56
  autoload :Models, 'origen/models'
57
+ autoload :Errata, 'origen/errata'
56
58
 
57
59
  APP_CONFIG = File.join('config', 'application.rb')
58
60
 
@@ -0,0 +1,117 @@
1
+ module Origen
2
+ module Errata
3
+ autoload :HwErratum, 'origen/errata/hw_erratum'
4
+ autoload :SwErratumWorkaround, 'origen/errata/sw_erratum_workaround'
5
+
6
+ attr_accessor :_errata
7
+
8
+ attr_accessor :_sw_workarounds
9
+
10
+ # Define and instantiate an erratum object
11
+ def erratum(id, ip_block, overview = {}, status = {}, sw_workaround = {})
12
+ _errata
13
+ @_errata[id][ip_block][status[:disposition]] = HwErratum.new(id, ip_block, overview, status, sw_workaround)
14
+ end
15
+
16
+ # Returns an erratum or list of erratum that meet a specific criteria
17
+ def errata(options = {})
18
+ options = {
19
+ id: nil,
20
+ ip_block: nil,
21
+ disposition: nil
22
+ }.update(options)
23
+ return nil if @_errata.nil?
24
+ return nil if @_errata.empty?
25
+
26
+ errata_found = Hash.new do |h, k|
27
+ h[k] = Hash.new do |hh, kk|
28
+ hh[kk] = {}
29
+ end
30
+ end
31
+
32
+ # First filter on id, then ip_block, then disposition
33
+ filter_hash(@_errata, options[:id]).each do |id, hash|
34
+ filter_hash(hash, options[:ip_block]).each do |ip_block, hash1|
35
+ filter_hash(hash1, options[:disposition]).each do |disposition, errata|
36
+ errata_found[id][ip_block][disposition] = errata
37
+ end
38
+ end
39
+ end
40
+
41
+ # Return nil if there are no errata that meet criteria
42
+ if errata_found.empty?
43
+ return nil
44
+ # If only one errata meets criteria, return that HwErratum object
45
+ elsif errata_found.size == 1
46
+ errata_found.values.first.values.first.values.first
47
+ else
48
+ return errata_found
49
+ end
50
+ end
51
+
52
+ # Define and instantiate a sw_workaround object
53
+ def sw_workaround(id, overview = {}, resolution = {})
54
+ _sw_workarounds
55
+ @_sw_workarounds[id] = SwErratumWorkaround.new(id, overview, resolution)
56
+ end
57
+
58
+ # Returns a sw_workaround object with a specific id
59
+ def sw_workarounds(options = {})
60
+ options = {
61
+ id: nil
62
+ }.update(options)
63
+ return nil if @_sw_workarounds.nil?
64
+ return nil if @_sw_workarounds.empty?
65
+
66
+ sw_workarounds_found = Hash.new do |h, k|
67
+ h[k] = {}
68
+ end
69
+
70
+ # filter on id
71
+ filter_hash(@_sw_workarounds, options[:id]).each do |id, workarounds|
72
+ sw_workarounds_found[id] = workarounds
73
+ end
74
+ if sw_workarounds_found.empty?
75
+ return nil
76
+ elsif sw_workarounds_found.size == 1
77
+ sw_workarounds_found.values.first # .values.first
78
+ else
79
+ return sw_workarounds_found
80
+ end
81
+ end
82
+
83
+ private
84
+
85
+ def _errata
86
+ @_errata ||= Hash.new do |h, k|
87
+ h[k] = Hash.new do |hh, kk|
88
+ hh[kk] = {}
89
+ end
90
+ end
91
+ end
92
+
93
+ def _sw_workarounds
94
+ @_sw_workarounds ||= {}
95
+ end
96
+
97
+ # Return a hash based on the filter provided
98
+ # def filter_hash(hash, filter)
99
+ # fail 'Hash argument is not a Hash!' unless hash.is_a? Hash
100
+ # filtered_hash = {}
101
+ # select_logic = case filter
102
+ # when String then 'k[Regexp.new(filter)] && k.length == filter.length'
103
+ # when (Fixnum || Integer || Float || Numeric) then "k[Regexp.new('#{filter}')]"
104
+ # when Regexp then 'k[filter]'
105
+ # when Symbol then
106
+ # 'k == filter'
107
+ # when NilClass then true # Return all specs if a filter is set to nil (i.e. user doesn't care about this filter)
108
+ # else true
109
+ # end
110
+ # rubocop:disable UnusedBlockArgument
111
+ # filtered_hash = hash.select do |k, v|
112
+ # [TrueClass, FalseClass].include?(select_logic.class) ? select_logic : eval(select_logic)
113
+ # end
114
+ # filtered_hash
115
+ # end
116
+ end
117
+ end
@@ -0,0 +1,47 @@
1
+ module Origen
2
+ module Errata
3
+ class HwErratum
4
+ # ID number used to identify erratum
5
+ attr_reader :id
6
+
7
+ # Erratum Title
8
+ attr_accessor :title
9
+
10
+ # Description of erratum
11
+ attr_accessor :description
12
+
13
+ # Description of the hardware workaround for the erratum
14
+ attr_accessor :hw_workaround_description
15
+
16
+ # How the errata is to be distributed ex:
17
+ # --Internal Only
18
+ # --Customer visible
19
+ # --Other: 3rd party, etc.
20
+ attr_accessor :disposition
21
+
22
+ # Impact of erratum to customer
23
+ attr_accessor :impact
24
+
25
+ # When/if the erratum will be fixed
26
+ attr_accessor :fix_plan
27
+
28
+ # IP block that is associate with this errata
29
+ attr_accessor :ip_block
30
+
31
+ # Software workaround object associated with erratum
32
+ attr_accessor :sw_workaround
33
+
34
+ def initialize(id, ip_block, overview = {}, status = {}, sw_workaround = {})
35
+ @id = id
36
+ @ip_block = ip_block
37
+ @title = overview[:title]
38
+ @description = overview[:description]
39
+ @hw_workaround_description = overview[:hw_workaround_description]
40
+ @disposition = status[:disposition]
41
+ @impact = status[:impact]
42
+ @fix_plan = status[:fix_plan]
43
+ @sw_workaround = sw_workaround
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,39 @@
1
+ module Origen
2
+ module Errata
3
+ class SwErratumWorkaround
4
+ # ID number used to identify software workaround
5
+ attr_reader :id
6
+
7
+ # Title of software workaround
8
+ attr_accessor :title
9
+
10
+ # Description of software workaround and implementation
11
+ attr_accessor :description
12
+
13
+ # Availability of workaround, ex:
14
+ # -- Not Applicable: Errata does not affect software
15
+ # -- Not Available: Workaround not available
16
+ # -- Available: Workaround is available to be distributed
17
+ attr_accessor :sw_disposition
18
+
19
+ # Software distribution version which incorporates the workaround
20
+ attr_accessor :distribution
21
+
22
+ # Release note
23
+ attr_accessor :note
24
+
25
+ # Link to patch(s) for workaround
26
+ attr_accessor :patches
27
+
28
+ def initialize(id, overview = {}, resolution = {})
29
+ @id = id
30
+ @title = overview[:title]
31
+ @description = overview[:description]
32
+ @sw_disposition = overview[:sw_disposition]
33
+ @distribution = overview[:distribution]
34
+ @note = resolution[:note]
35
+ @patches = resolution[:patches]
36
+ end
37
+ end
38
+ end
39
+ end
@@ -23,6 +23,7 @@ module Origen
23
23
  include Origen::Ports
24
24
  include Origen::Netlist
25
25
  include Origen::Memory
26
+ include Origen::Errata
26
27
  end
27
28
 
28
29
  module ClassMethods
@@ -137,7 +137,7 @@ module Origen
137
137
  def documentation(header_info, selection, link)
138
138
  _documentation
139
139
  # Create a new documenation and place it in the 5-D hash
140
- @_documentation[header_info[:section]][header_info[:subsection]][selection[:interface]][selection[:type]][selection[:subtype]][selection[:mode]][selection[:audience]] = Documentation.new(header_info, selection, link)
140
+ @_documentation[header_info[:section]][header_info[:subsection]][selection[:interface]][selection[:type]][selection[:sub_type]][selection[:mode]][selection[:audience]] = Documentation.new(header_info, selection, link)
141
141
  end
142
142
 
143
143
  # Adds a new feature to the block
@@ -2,6 +2,9 @@ module Origen
2
2
  module Specs
3
3
  # This class is used to store documentation map that the user can change
4
4
  class Documentation
5
+ # Level that Section is at. Allows for a key to be found.
6
+ attr_accessor :level
7
+
5
8
  # This is the Section Header for the Documentation Map. Usually these are main headers
6
9
  # Examples:
7
10
  # I. Overall DC Electricals
@@ -43,6 +46,7 @@ module Origen
43
46
 
44
47
  # Initialize the Class
45
48
  def initialize(header_info = {}, selection = {}, link = nil)
49
+ @level = header_info[:level]
46
50
  @section = header_info[:section]
47
51
  @subsection = header_info[:subsection]
48
52
  @interface = selection[:interface]
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.7
4
+ version: 0.7.8
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-04-07 00:00:00.000000000 Z
11
+ date: 2016-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -508,6 +508,9 @@ files:
508
508
  - lib/origen/database/key_value_store.rb
509
509
  - lib/origen/database/key_value_stores.rb
510
510
  - lib/origen/encodings.rb
511
+ - lib/origen/errata.rb
512
+ - lib/origen/errata/hw_erratum.rb
513
+ - lib/origen/errata/sw_erratum_workaround.rb
511
514
  - lib/origen/features.rb
512
515
  - lib/origen/features/feature.rb
513
516
  - lib/origen/file_handler.rb
@@ -649,7 +652,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
649
652
  version: 1.8.11
650
653
  requirements: []
651
654
  rubyforge_project:
652
- rubygems_version: 2.6.2
655
+ rubygems_version: 2.2.2
653
656
  signing_key:
654
657
  specification_version: 4
655
658
  summary: The Semiconductor Developer's Kit