Class: RgGen::SystemVerilog::Common::Utility::DataObject

Inherits:
Object
  • Object
show all
Includes:
Core::Utility::AttributeSetter
Defined in:
lib/rggen/systemverilog/common/utility/data_object.rb

Instance Method Summary collapse

Constructor Details

#initialize(object_type, default_attributes = {}) ⇒ DataObject

Returns a new instance of DataObject.



10
11
12
13
14
# File 'lib/rggen/systemverilog/common/utility/data_object.rb', line 10

def initialize(object_type, default_attributes = {})
  @object_type = object_type
  apply_attributes(**default_attributes)
  block_given? && yield(self)
end

Instance Method Details

#declarationObject



26
27
28
29
30
# File 'lib/rggen/systemverilog/common/utility/data_object.rb', line 26

def declaration
  declaration_snippets
    .select { |snippet| snippet && !snippet.empty? }
    .join(' ')
end

#identifierObject



32
33
34
35
36
37
38
# File 'lib/rggen/systemverilog/common/utility/data_object.rb', line 32

def identifier
  Identifier.new(name) do |identifier|
    identifier.__width__(width)
    identifier.__array_size__(array_size)
    identifier.__array_format__(array_format)
  end
end