class Origen::Chips::Chip
Attributes
_designs[RW]
_docs[RW]
_notes[RW]
core_speed[RW]
Speed for the Cores
description[RW]
Description for the Part, will be used as part of the RSS feed
l2_ram[RW]
L2 Ram Size
l3_ram[RW]
L3 Ram Size
package_type[RW]
Package for the Part
part_name[RW]
Part Name for the SoC, usually this will be the ID
power[RW]
Power Number
previous_parts[RW]
Previous Roadmap Parts. This will allow for a backwards viewable list so that previous parts can have an upgrade path
Public Class Methods
new(part_name, description, previous_parts, power, options = {})
click to toggle source
# 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
Public Instance Methods
delete_all_designs()
click to toggle source
# File lib/origen/chips/chip.rb, line 119 def delete_all_designs @_designs = nil end
delete_all_docs()
click to toggle source
Delete all doc
# File lib/origen/chips/chip.rb, line 115 def delete_all_docs @_docs = nil end
delete_all_notes()
click to toggle source
Delete all notes
# File lib/origen/chips/chip.rb, line 110 def delete_all_notes @_notes = nil end
design(date, type, revision, description, options = {})
click to toggle source
# 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 = {})
click to toggle source
# 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 = {})
click to toggle source
# 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 = {})
click to toggle source
# 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)
click to toggle source
Define and instantiate a Note object
# 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 = {})
click to toggle source
Returns a Note object from the notes hash
# 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
Private Instance Methods
filter_hash(hash, filter)
click to toggle source
Return a hash based on the filter provided
# File lib/origen/chips/chip.rb, line 151 def filter_hash(hash, filter) fail 'Hash argument is not a Hash!' unless hash.is_a? Hash filtered_hash = {} select_logic = case filter when String then 'k[Regexp.new(filter)]' when (Fixnum || Integer || Float || Numeric) then "k[Regexp.new('#{filter}')]" when Regexp then 'k[filter]' when Symbol then 'k == filter' when NilClass then true # Return all specs if a filter is set to nil (i.e. user doesn't care about this filter) else true end filtered_hash = hash.select do |k, v| [TrueClass, FalseClass].include?(select_logic.class) ? select_logic : eval(select_logic) end filtered_hash end