Class: Origen::Limits::Limit

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expr, type, owner, options = {}) ⇒ Limit

Returns a new instance of Limit.



7
8
9
10
11
12
# File 'lib/origen/limits/limit.rb', line 7

def initialize(expr, type, owner, options = {})
  @expr = expr
  @owner = owner
  @type = type
  @value = evaluate_expr
end

Instance Attribute Details

#exprObject

Returns the value of attribute expr.



4
5
6
# File 'lib/origen/limits/limit.rb', line 4

def expr
  @expr
end

#ownerObject

Returns the value of attribute owner.



4
5
6
# File 'lib/origen/limits/limit.rb', line 4

def owner
  @owner
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/origen/limits/limit.rb', line 4

def type
  @type
end

#valueObject

If the value is still a String then it could be due to referencing another LimitSet that is yet to be defined



17
18
19
20
21
22
23
# File 'lib/origen/limits/limit.rb', line 17

def value
  if @value.is_a?(String)
    evaluate_expr
  else
    @value
  end
end

Instance Method Details

#expObject

Backwards compatibility



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

def exp
  @expr
end