Class: Idl::RegFileElementType

Inherits:
Type
  • Object
show all
Defined in:
lib/idlc/type.rb

Overview

General-purpose register file element type. Represents the type of one element in a named register file (e.g. F, V, X).

Direct Known Subclasses

XregType

Constant Summary

Constants inherited from Type

Type::KINDS, Type::QUALIFIERS, Type::TYPE_FROM_KIND

Instance Attribute Summary collapse

Attributes inherited from Type

#kind, #max_width, #qualifiers, #width_ast

Instance Method Summary collapse

Methods inherited from Type

#==, #ary?, #ary_type, #clone, #comparable_to?, #const?, #convertable_to?, #default, #enum_class, #equal_to?, from_json_schema, from_typename, #global?, #integral?, #known?, #make_const, #make_const!, #make_global, #make_known, #make_signed, #mutable?, #qualify, #runtime?, #signed?, #sub_type, #to_idl, #tuple_types, #width

Constructor Details

#initialize(name, width, max_width: nil) ⇒ RegFileElementType

Returns a new instance of RegFileElementType.



971
972
973
974
# File 'lib/idlc/type.rb', line 971

def initialize(name, width, max_width: nil)
  super(:bits, width:, max_width: max_width || width)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



969
970
971
# File 'lib/idlc/type.rb', line 969

def name
  @name
end

Instance Method Details

#to_cxxObject



977
# File 'lib/idlc/type.rb', line 977

def to_cxx = "#{name}Reg"

#to_sObject



976
# File 'lib/idlc/type.rb', line 976

def to_s = "#{name}Reg"