Class: Origen::Chips::Chip

Inherits:
Object show all
Defined in:
lib/origen/chips/chip.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = {})
  @part_name = part_name
  @description = description
  @previous_parts = previous_parts
  @power = power
  @l2_ram = options[:l2_ram]
  @l3_ram = options[:l3_ram]
  @package_type = options[:package_type]
  @core_speed = options[:core_speed]
end

Instance Attribute Details

#_designs=(value) ⇒ Object

Sets the attribute _designs

Parameters:

  • value

    the value to set the attribute _designs to.



29
30
31
# File 'lib/origen/chips/chip.rb', line 29

def _designs=(value)
  @_designs = value
end

#_docs=(value) ⇒ Object

Sets the attribute _docs

Parameters:

  • value

    the value to set the attribute _docs to.



29
30
31
# File 'lib/origen/chips/chip.rb', line 29

def _docs=(value)
  @_docs = value
end

#_notes=(value) ⇒ Object

Sets the attribute _notes

Parameters:

  • value

    the value to set the attribute _notes to.



29
30
31
# File 'lib/origen/chips/chip.rb', line 29

def _notes=(value)
  @_notes = value
end

#core_speedObject

Speed for the Cores



27
28
29
# File 'lib/origen/chips/chip.rb', line 27

def core_speed
  @core_speed
end

#descriptionObject

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_ramObject

L2 Ram Size



18
19
20
# File 'lib/origen/chips/chip.rb', line 18

def l2_ram
  @l2_ram
end

#l3_ramObject

L3 Ram Size



21
22
23
# File 'lib/origen/chips/chip.rb', line 21

def l3_ram
  @l3_ram
end

#package_typeObject

Package for the Part



24
25
26
# File 'lib/origen/chips/chip.rb', line 24

def package_type
  @package_type
end

#part_nameObject

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

#powerObject

Power Number



15
16
17
# File 'lib/origen/chips/chip.rb', line 15

def power
  @power
end

#previous_partsObject

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_designsObject



119
120
121
# File 'lib/origen/chips/chip.rb', line 119

def delete_all_designs
  @_designs = nil
end

#delete_all_docsObject

Delete all doc



115
116
117
# File 'lib/origen/chips/chip.rb', line 115

def delete_all_docs
  @_docs = nil
end

#delete_all_notesObject

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, options = {})
  _designs
  @_designs[type][revision] = Design_Entry.new(date, type, revision, description, options)
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(options = {})
  options = {
    type: nil,
    rev:  nil
  }.update(options)
  designs_to_be_shown = []
  filter_hash(_designs, options[:type]).each do |type, hash|
    filter_hash(hash, options[: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, options = {})
  _docs
  @_docs[type][revision] = Doc_Entry.new(date, type, revision, description, options)
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(options = {})
  options = {
    type: nil,
    rev:  nil
  }.update(options)
  docs_to_be_shown = []
  filter_hash(_docs, options[:type]).each do |type, hash|
    filter_hash(hash, options[: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(options = {})
  options = {
    id:   nil,
    type: nil
  }.update(options)
  notes_found = Hash.new do |h, k|
    h[k] = {}
  end
  _notes.filter(options[:id]).each do |id, hash|
    hash.filter(options[: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