class Origen::Chips::Chip
Attributes
Speed for the Cores
Description for the Part, will be used as part of the RSS feed
L2 Ram Size
L3 Ram Size
Package for the Part
Part Name for the SoC, usually this will be the ID
Power Number
Previous Roadmap Parts. This will allow for a backwards viewable list so that previous parts can have an upgrade path
Public Class Methods
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
Source
# File lib/origen/chips/chip.rb, line 119 def delete_all_designs @_designs = nil end
Source
# File lib/origen/chips/chip.rb, line 115 def delete_all_docs @_docs = nil end
Delete all doc
Source
# File lib/origen/chips/chip.rb, line 110 def delete_all_notes @_notes = nil end
Delete all notes
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
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
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
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
Source
# File lib/origen/chips/chip.rb, line 43 def note(id, type, feature) _notes @_notes[id][type] = RSS_Note.new(id, type, feature) end
Define and instantiate a Note object
Source
# 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
Returns a Note object from the notes hash
Private Instance Methods
Source
# 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
Return a hash based on the filter provided