Class: VerilogParser::Module::Port
- Inherits:
-
Object
- Object
- VerilogParser::Module::Port
- Defined in:
- lib/ruby-vpi/verilog_parser.rb
Instance Attribute Summary collapse
-
#decl ⇒ Object
readonly
Returns the value of attribute decl.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(aDecl, aModule) ⇒ Port
constructor
A new instance of Port.
- #input? ⇒ Boolean
- #output? ⇒ Boolean
Constructor Details
#initialize(aDecl, aModule) ⇒ Port
Returns a new instance of Port.
47 48 49 50 51 52 53 54 |
# File 'lib/ruby-vpi/verilog_parser.rb', line 47 def initialize aDecl, aModule @decl = aDecl @name = aDecl.scan(/\S+/).last parser = /\b(input|output|inout)\b[^;]*\b#{@name}\b/m aDecl =~ parser || aModule.body =~ parser @type = $1 end |
Instance Attribute Details
#decl ⇒ Object (readonly)
Returns the value of attribute decl.
45 46 47 |
# File 'lib/ruby-vpi/verilog_parser.rb', line 45 def decl @decl end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
45 46 47 |
# File 'lib/ruby-vpi/verilog_parser.rb', line 45 def name @name end |
Instance Method Details
#input? ⇒ Boolean
56 57 58 |
# File 'lib/ruby-vpi/verilog_parser.rb', line 56 def input? @type != 'output' end |
#output? ⇒ Boolean
60 61 62 |
# File 'lib/ruby-vpi/verilog_parser.rb', line 60 def output? @type != 'input' end |