Class: Origen::Chips::Chip
Instance Attribute Summary collapse
-
#_designs ⇒ Object
writeonly
Sets the attribute _designs.
-
#_docs ⇒ Object
writeonly
Sets the attribute _docs.
-
#_notes ⇒ Object
writeonly
Sets the attribute _notes.
-
#core_speed ⇒ Object
Speed for the Cores.
-
#description ⇒ Object
Description for the Part, will be used as part of the RSS feed.
-
#l2_ram ⇒ Object
L2 Ram Size.
-
#l3_ram ⇒ Object
L3 Ram Size.
-
#package_type ⇒ Object
Package for the Part.
-
#part_name ⇒ Object
Part Name for the SoC, usually this will be the ID.
-
#power ⇒ Object
Power Number.
-
#previous_parts ⇒ Object
Previous Roadmap Parts.
Instance Method Summary collapse
- #delete_all_designs ⇒ Object
-
#delete_all_docs ⇒ Object
Delete all doc.
-
#delete_all_notes ⇒ Object
Delete all notes.
- #design(date, type, revision, description, options = {}) ⇒ Object
- #designs(options = {}) ⇒ Object
- #doc(date, type, revision, description, options = {}) ⇒ Object
- #docs(options = {}) ⇒ Object
-
#initialize(part_name, description, previous_parts, power, options = {}) ⇒ Chip
constructor
A new instance of Chip.
-
#note(id, type, feature) ⇒ Object
Define and instantiate a Note object.
-
#notes(options = {}) ⇒ Object
Returns a Note object from the notes hash.
Constructor Details
#initialize(part_name, description, previous_parts, power, options = {}) ⇒ Chip
Returns a new instance of Chip.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/origen/chips/chip.rb', line 31 def initialize(part_name, description, previous_parts, power, = {}) @part_name = part_name @description = description @previous_parts = previous_parts @power = power @l2_ram = [:l2_ram] @l3_ram = [:l3_ram] @package_type = [:package_type] @core_speed = [:core_speed] end |
Instance Attribute Details
#_designs=(value) ⇒ Object
Sets the attribute _designs
29 30 31 |
# File 'lib/origen/chips/chip.rb', line 29 def _designs=(value) @_designs = value end |
#_docs=(value) ⇒ Object
Sets the attribute _docs
29 30 31 |
# File 'lib/origen/chips/chip.rb', line 29 def _docs=(value) @_docs = value end |
#_notes=(value) ⇒ Object
Sets the attribute _notes
29 30 31 |
# File 'lib/origen/chips/chip.rb', line 29 def _notes=(value) @_notes = value end |
#core_speed ⇒ Object
Speed for the Cores
27 28 29 |
# File 'lib/origen/chips/chip.rb', line 27 def core_speed @core_speed end |
#description ⇒ Object
Description for the Part, will be used as part of the RSS feed
8 9 10 |
# File 'lib/origen/chips/chip.rb', line 8 def description @description end |
#l2_ram ⇒ Object
L2 Ram Size
18 19 20 |
# File 'lib/origen/chips/chip.rb', line 18 def l2_ram @l2_ram end |
#l3_ram ⇒ Object
L3 Ram Size
21 22 23 |
# File 'lib/origen/chips/chip.rb', line 21 def l3_ram @l3_ram end |
#package_type ⇒ Object
Package for the Part
24 25 26 |
# File 'lib/origen/chips/chip.rb', line 24 def package_type @package_type end |
#part_name ⇒ Object
Part Name for the SoC, usually this will be the ID
5 6 7 |
# File 'lib/origen/chips/chip.rb', line 5 def part_name @part_name end |
#power ⇒ Object
Power Number
15 16 17 |
# File 'lib/origen/chips/chip.rb', line 15 def power @power end |
#previous_parts ⇒ Object
Previous Roadmap Parts. This will allow for a backwards viewable list so that previous parts can have an upgrade path
12 13 14 |
# File 'lib/origen/chips/chip.rb', line 12 def previous_parts @previous_parts end |
Instance Method Details
#delete_all_designs ⇒ Object
119 120 121 |
# File 'lib/origen/chips/chip.rb', line 119 def delete_all_designs @_designs = nil end |
#delete_all_docs ⇒ Object
Delete all doc
115 116 117 |
# File 'lib/origen/chips/chip.rb', line 115 def delete_all_docs @_docs = nil end |
#delete_all_notes ⇒ Object
Delete all notes
110 111 112 |
# File 'lib/origen/chips/chip.rb', line 110 def delete_all_notes @_notes = nil end |
#design(date, type, revision, description, options = {}) ⇒ Object
53 54 55 56 |
# File 'lib/origen/chips/chip.rb', line 53 def design(date, type, revision, description, = {}) _designs @_designs[type][revision] = Design_Entry.new(date, type, revision, description, ) end |
#designs(options = {}) ⇒ Object
95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/origen/chips/chip.rb', line 95 def designs( = {}) = { type: nil, rev: nil }.update() designs_to_be_shown = [] filter_hash(_designs, [:type]).each do |type, hash| filter_hash(hash, [:rev]).each do |revision, hash_| designs_to_be_shown << hash_ end end designs_to_be_shown end |
#doc(date, type, revision, description, options = {}) ⇒ Object
48 49 50 51 |
# File 'lib/origen/chips/chip.rb', line 48 def doc(date, type, revision, description, = {}) _docs @_docs[type][revision] = Doc_Entry.new(date, type, revision, description, ) end |
#docs(options = {}) ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/origen/chips/chip.rb', line 81 def docs( = {}) = { type: nil, rev: nil }.update() docs_to_be_shown = [] filter_hash(_docs, [:type]).each do |type, hash| filter_hash(hash, [:rev]).each do |revision, hash_| docs_to_be_shown << hash_ end end docs_to_be_shown end |
#note(id, type, feature) ⇒ Object
Define and instantiate a Note object
43 44 45 46 |
# File 'lib/origen/chips/chip.rb', line 43 def note(id, type, feature) _notes @_notes[id][type] = RSS_Note.new(id, type, feature) end |
#notes(options = {}) ⇒ Object
Returns a Note object from the notes hash
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/origen/chips/chip.rb', line 59 def notes( = {}) = { id: nil, type: nil }.update() notes_found = Hash.new do |h, k| h[k] = {} end _notes.filter([:id]).each do |id, hash| hash.filter([:type]).each do |type, note| notes_found[id][type] = note end end if notes_found.empty? nil elsif notes_found.size == 1 notes_found.values.first.values.first else notes_found end end |