Module: Origen::PowerDomains

Defined in:
lib/origen/power_domains.rb,
lib/origen/power_domains/power_domain.rb,
lib/origen/power_domains/power_domains_collection.rb

Defined Under Namespace

Classes: PowerDomain, PowerDomainsCollection

Instance Method Summary collapse

Instance Method Details

#add_power_domain(id, options = {}, &block) ⇒ Object Also known as: power_domain



14
15
16
17
18
19
20
# File 'lib/origen/power_domains.rb', line 14

def add_power_domain(id, options = {}, &block)
  if power_domains.include?(id)
    Origen.log.error("Cannot create power domain '#{id}', it already exists!")
    fail
  end
  power_domains[id] = PowerDomain.new(id, options, &block)
end

#power_domains(expr = nil) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/origen/power_domains.rb', line 5

def power_domains(expr = nil)
  @_power_domains ||= PowerDomainsCollection.new
  if expr.nil?
    @_power_domains
  else
    @_power_domains.recursive_find_by_key(expr)
  end
end