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.



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

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.



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

def max
  @max
end

#minObject

Returns the value of attribute min.



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

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.



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

def target
  @target
end

#typObject

Returns the value of attribute typ.



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

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)


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

def frozen?
  @static
end

#nameObject

Common alias



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

def name
  @id
end