Class: OrigenVerilog::TopLevel
- Inherits:
-
Object
- Object
- OrigenVerilog::TopLevel
- Includes:
- Origen::TopLevel
- Defined in:
- lib/origen_verilog/top_level.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ TopLevel
constructor
A new instance of TopLevel.
Constructor Details
#initialize(options = {}) ⇒ TopLevel
Returns a new instance of TopLevel.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/origen_verilog/top_level.rb', line 7 def initialize( = {}) @name = [:ast].to_a[0] [:ast].pins.each do |node| name = node.to_a.last if node.type == :input_declaration direction = :input elsif node.type == :ouput_declaration direction = :output else direction = :io end if r = node.find(:range) size = r.to_a[0] - r.to_a[1] + 1 else size = 1 end add_pin name, direction: direction, size: size end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/origen_verilog/top_level.rb', line 5 def name @name end |