lib/origen/specs/spec.rb in origen-0.60.7 vs lib/origen/specs/spec.rb in origen-0.60.8
- old
+ new
@@ -81,10 +81,11 @@
# name: :tddkhas, type: :ac, mode: ddr4dr2400, sub_type: nil
def initialize(name, type, mode, owner_name, &block)
@name = name_audit(name)
fail 'Specification names must be of types Symbol or String and cannot start with a number' if @name.nil?
+
@type = type
@sub_type = nil # not necessary to be able to find a unique spec, but required for some specs
@mode = mode
@ip_name = owner_name
@symbol = nil # Meant to be populated with HTML representing the way the spec name should look in a document
@@ -96,10 +97,11 @@
@exhibits = {}
@testable = nil
@guardband = nil
(block.arity < 1 ? (instance_eval(&block)) : block.call(self)) if block_given?
fail "Spec type must be one of #{TYPES.join(', ')}" unless TYPES.include? type
+
@min = Limit.new(@min)
@max = Limit.new(@max)
@typ = Limit.new(@typ)
@min_ovr = Limit.new(@min_ovr)
@max_ovr = Limit.new(@max_ovr)
@@ -204,10 +206,11 @@
end
# Loop through self's isntance variables first
instance_variables.each do |ivar|
ivar_sym = ivar.to_s.gsub('@', '').to_sym
next if ivar_sym == :notes # temporarily disable until notes diff method written
+
ivar_str = ivar.to_s.gsub('@', '')
if compare_spec.respond_to? ivar_sym
# Check if the instance variable is a Limit and if so then find
# all instance_variables and diff them as well
if instance_variable_get(ivar).class == Origen::Specs::Spec::Limit
@@ -259,10 +262,11 @@
end
# Returns a Note object from the notes hash
def notes(id = nil)
return nil if @notes.nil?
+
@notes.filter(id)
end
# Returns the number of notes as an Integer
def note_count
@@ -308,10 +312,10 @@
name_set = 0
name_set = 8 unless @name.nil?
name_set += 4 unless @type.nil?
name_set += 2 unless @sub_type.nil?
unless @mode.nil?
- unless (@mode.to_s.include? 'local') || (@mode.to_s.include? 'global')
+ unless (@mode.to_s.include? 'local') || (@mode.to_s.include? 'global')
name_set += 1
end
end
name_set
end