Class: Rhdl::TopDsl

Inherits:
Object
  • Object
show all
Defined in:
lib/rhdl/top_dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTopDsl



4
5
6
7
8
9
# File 'lib/rhdl/top_dsl.rb', line 4

def initialize
  @components = {}
  @contents = {
    components: @components
  }
end

Instance Attribute Details

#contentsObject (readonly)

Returns the value of attribute contents.



3
4
5
# File 'lib/rhdl/top_dsl.rb', line 3

def contents
  @contents
end

Instance Method Details

#component(name, &block) ⇒ Object



11
12
13
14
15
# File 'lib/rhdl/top_dsl.rb', line 11

def component(name, &block)
  raise "component '#{name}' already defined" if @components[name]
  @components[name] = Component.new(name, self, Proc.new(&block))

end