Class: RgGen::VerilogUtility::Variable

Inherits:
Object
  • Object
show all
Defined in:
lib/rggen/core_components/verilog_utility/variable.rb

Instance Method Summary collapse

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

#identifierObject



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_sObject



9
10
11
# File 'lib/rggen/core_components/verilog_utility/variable.rb', line 9

def to_s
  code_snippets.join(' ')
end