Module: Origen::SubBlocks::Domains
- Included in:
- Registers::Reg, Origen::SubBlocks
- Defined in:
- lib/origen/sub_blocks.rb
Instance Method Summary collapse
- #domain(name, options = {}) ⇒ Object
- #domain_specified? ⇒ Boolean
- #domains ⇒ Object (also: #register_domains)
Instance Method Details
#domain(name, options = {}) ⇒ Object
27 28 29 |
# File 'lib/origen/sub_blocks.rb', line 27 def domain(name, = {}) domains[name] = Origen::Registers::Domain.new(name, ) end |
#domain_specified? ⇒ Boolean
31 32 33 |
# File 'lib/origen/sub_blocks.rb', line 31 def domain_specified? @domain_specified end |
#domains ⇒ Object Also known as: register_domains
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/origen/sub_blocks.rb', line 35 def domains @domains ||= {}.with_indifferent_access if @domain_names @domain_names.each do |domain| if domain.is_a?(Origen::Registers::Domain) @domains[domain.id] = domain elsif parent.domains[domain] @domains[domain] = parent.domains[domain] else fail "Uknown domain: #{domain}" end end @domain_names = nil end if parent && @domains.empty? parent.domains else @domains end end |