Class: RgGen::VerilogUtility::Variable
- Inherits:
-
Object
- Object
- RgGen::VerilogUtility::Variable
- Defined in:
- lib/rggen/core_components/verilog_utility/variable.rb
Instance Method Summary collapse
- #identifier ⇒ Object
-
#initialize(variable_type, attributes) ⇒ Variable
constructor
A new instance of Variable.
- #to_s ⇒ Object
Constructor Details
#initialize(variable_type, attributes) ⇒ Variable
Returns a new instance of Variable.
4 5 6 7 |
# File 'lib/rggen/core_components/verilog_utility/variable.rb', line 4 def initialize(variable_type, attributes) @variable_type = variable_type @attributes = attributes end |
Instance Method Details
#identifier ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/rggen/core_components/verilog_utility/variable.rb', line 13 def identifier name = @attributes[:name] width = @attributes[:width] || 1 dimensions = @attributes[:dimensions] array_fomrat = @attributes[:array_format] || :unpacked Identifier.new(name, width, dimensions, array_fomrat) end |
#to_s ⇒ Object
9 10 11 |
# File 'lib/rggen/core_components/verilog_utility/variable.rb', line 9 def to_s code_snippets.join(' ') end |