Class: Origen::Limits::LimitSet

Inherits:
Object
  • Object
show all
Defined in:
lib/origen/limits/limit_set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, owner, options) ⇒ LimitSet

Returns a new instance of LimitSet



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/origen/limits/limit_set.rb', line 7

def initialize(id, owner, options)
  @id = id
  @description = options[:description]
  @owner = owner
  @min = Limit.new(options[:min], :min, @owner) unless options[:min].nil?
  @typ = Limit.new(options[:typ], :typ, @owner) unless options[:typ].nil?
  @max = Limit.new(options[:max], :max, @owner) unless options[:max].nil?
  @target = Limit.new(options[:target], :target, @owner) unless options[:target].nil?
  unless options[:static].nil?
    unless [true, false].include? options[:static]
      Origen.log.error("Static option must be set to 'true' or 'false'!")
      fail
    end
  end
  @static = options[:static].nil? ? false : options[:static]
  fail unless limits_ok?
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description



5
6
7
# File 'lib/origen/limits/limit_set.rb', line 5

def description
  @description
end

#idObject

Returns the value of attribute id



5
6
7
# File 'lib/origen/limits/limit_set.rb', line 5

def id
  @id
end

#maxObject

Returns the value of attribute max



5
6
7
# File 'lib/origen/limits/limit_set.rb', line 5

def max
  @max
end

#minObject

Returns the value of attribute min



5
6
7
# File 'lib/origen/limits/limit_set.rb', line 5

def min
  @min
end

#ownerObject

Returns the value of attribute owner



5
6
7
# File 'lib/origen/limits/limit_set.rb', line 5

def owner
  @owner
end

#staticObject

Returns the value of attribute static



5
6
7
# File 'lib/origen/limits/limit_set.rb', line 5

def static
  @static
end

#targetObject

Returns the value of attribute target



5
6
7
# File 'lib/origen/limits/limit_set.rb', line 5

def target
  @target
end

#typObject

Returns the value of attribute typ



5
6
7
# File 'lib/origen/limits/limit_set.rb', line 5

def typ
  @typ
end

#typeObject

Returns the value of attribute type



5
6
7
# File 'lib/origen/limits/limit_set.rb', line 5

def type
  @type
end

Instance Method Details

#frozen?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/origen/limits/limit_set.rb', line 30

def frozen?
  @static
end

#nameObject

Common alias



26
27
28
# File 'lib/origen/limits/limit_set.rb', line 26

def name
  @id
end