Class: Idl::CsrType

Inherits:
Type
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/idlc/type.rb

Overview

represents a CSR register

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?, #name, #qualify, #runtime?, #signed?, #sub_type, #to_idl, #to_s, #tuple_types, #width

Constructor Details

#initialize(csr, qualifiers: []) ⇒ CsrType

Returns a new instance of CsrType.



765
766
767
# File 'lib/idlc/type.rb', line 765

def initialize(csr, qualifiers: [])
  super(:csr, name: csr.name, csr: csr, width: csr.max_length, qualifiers: qualifiers)
end

Instance Attribute Details

#csrObject (readonly)

Returns the value of attribute csr.



762
763
764
# File 'lib/idlc/type.rb', line 762

def csr
  @csr
end

Instance Method Details

#fieldsObject



770
771
772
773
774
# File 'lib/idlc/type.rb', line 770

def fields
  raise "fields are unknown" if @csr == :unknown

  @csr.fields
end