Class: VHDL_Parser::Port
- Inherits:
-
Object
- Object
- VHDL_Parser::Port
- Defined in:
- lib/vhdl_parser/port.rb
Overview
Defines an input or output on the Entity
Instance Attribute Summary collapse
-
#comment ⇒ String
Any inline comment on the Port.
-
#direction ⇒ String
The direction of the port.
-
#left ⇒ String
Left part of the size, e.g.
-
#name ⇒ String
The name of the Port.
-
#right ⇒ String
Right part of the size, e.g.
-
#size ⇒ String
Returns a string based on the left, right, and size_dir attributes.
-
#size_dir ⇒ String
Left part of the size, e.g.
-
#type ⇒ String
The type of the Port.
Instance Method Summary collapse
-
#initialize ⇒ Port
constructor
A new instance of Port.
- #to_s ⇒ String
Constructor Details
#initialize ⇒ Port
Returns a new instance of Port.
38 39 40 41 42 |
# File 'lib/vhdl_parser/port.rb', line 38 def initialize @left = 0 @right = 0 @size_dir = "downto" end |
Instance Attribute Details
#comment ⇒ String
Any inline comment on the Port
15 16 17 |
# File 'lib/vhdl_parser/port.rb', line 15 def comment @comment end |
#direction ⇒ String
The direction of the port. I.e. “in”, “out”, “inout”
11 12 13 |
# File 'lib/vhdl_parser/port.rb', line 11 def direction @direction end |
#left ⇒ String
Left part of the size, e.g. “7”
28 29 30 |
# File 'lib/vhdl_parser/port.rb', line 28 def left @left end |
#name ⇒ String
The name of the Port
6 7 8 |
# File 'lib/vhdl_parser/port.rb', line 6 def name @name end |
#right ⇒ String
Right part of the size, e.g. “0”
32 33 34 |
# File 'lib/vhdl_parser/port.rb', line 32 def right @right end |
#size ⇒ String
Returns a string based on the left, right, and size_dir attributes.
24 25 26 |
# File 'lib/vhdl_parser/port.rb', line 24 def size @size end |
#size_dir ⇒ String
Left part of the size, e.g. “downto”
36 37 38 |
# File 'lib/vhdl_parser/port.rb', line 36 def size_dir @size_dir end |
#type ⇒ String
The type of the Port
19 20 21 |
# File 'lib/vhdl_parser/port.rb', line 19 def type @type end |
Instance Method Details
#to_s ⇒ String
45 46 47 48 49 50 51 |
# File 'lib/vhdl_parser/port.rb', line 45 def to_s name.ljust(15) + "\t" + direction + "\t" + type + " " + size + "\t" + comment + "\n" end |