Class: HDLRuby::High::Type

Inherits:
Low::Type
  • Object
show all
Includes:
Htype
Defined in:
lib/HDLRuby/hruby_high.rb

Overview

Describes a high-level data type.

NOTE: by default a type is not specified.

Direct Known Subclasses

TypeGen

Constant Summary collapse

High =
HDLRuby::High

Constants included from Low::Low2Symbol

Low::Low2Symbol::Low2SymbolPrefix, Low::Low2Symbol::Low2SymbolTable, Low::Low2Symbol::Symbol2LowTable

Instance Attribute Summary

Attributes inherited from Low::Type

#name

Attributes included from Low::Hparent

#parent

Instance Method Summary collapse

Methods included from Htype

#[], #binary, #comp_operator, #constant, #define_operator, #each_overload, #htype?, included, #inner, #inout, #input, #left, #name=, #output, #register, #right, #to_type, #typedef, #unary

Methods included from Tprocess

#&, #*, #+, #+@, #-@, #/, #<<, #==, #abs, #lr, #make, #resolve, #slice, #~

Methods inherited from Low::Type

#base, #base?, #boolean?, #break_types!, #direction, #each_type_deep, #eql?, #equivalent?, #fixed?, #float?, #hash, #hierarchical?, #leaf?, #max, #min, #range, #range?, #regular?, #set_name!, #signed?, #struct?, #to_c, #to_hdr, #to_high, #to_vector, #to_verilog, #to_vhdl, #types?, #unsigned?, #vector?, #width

Methods included from Low::Low2Symbol

#to_sym

Methods included from Low::Hparent

#hierarchy, #scope

Methods included from Low::Ltype

included, #ltype?

Constructor Details

#initialize(name) ⇒ Type

Creates a new type named +name+.



1561
1562
1563
1564
# File 'lib/HDLRuby/hruby_high.rb', line 1561

def initialize(name)
    # Initialize the type structure.
    super(name)
end

Instance Method Details

#to_low(name = self.name) ⇒ Object

Converts the type to HDLRuby::Low and set its +name+.

NOTE: should be overridden by other type classes.



1569
1570
1571
1572
1573
1574
1575
1576
# File 'lib/HDLRuby/hruby_high.rb', line 1569

def to_low(name = self.name)
    # return HDLRuby::Low::Type.new(name)
    typeL = HDLRuby::Low::Type.new(name)
    # # For debugging: set the source high object 
    # typeL.properties[:low2high] = self.hdr_id
    # self.properties[:high2low] = typeL
    return typeL
end