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
34 35 36 |
# File 'lib/origen/sub_blocks.rb', line 34 def domain(name, = {}) domains[name] = Origen::Registers::Domain.new(name, ) end |
#domain_specified? ⇒ Boolean
38 39 40 |
# File 'lib/origen/sub_blocks.rb', line 38 def domain_specified? @domain_specified end |
#domains ⇒ Object Also known as: register_domains
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/origen/sub_blocks.rb', line 42 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 |