Class: HDLRuby::High::TypeDef
- Inherits:
-
Low::TypeDef
- Object
- Low::Type
- Low::TypeDef
- HDLRuby::High::TypeDef
- Includes:
- Htype
- Defined in:
- lib/HDLRuby/hruby_high.rb,
lib/HDLRuby/hruby_rcsim.rb
Overview
Describes a high-level type definition.
NOTE: type definition are actually type with a name refering to another type (and equivalent to it).
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::TypeDef
Attributes inherited from Low::Type
Attributes included from Low::Hparent
Instance Method Summary collapse
-
#initialize(name, type) ⇒ TypeDef
constructor
Creates a new type definition named +name+ refering +type+.
-
#to_low(name = self.name) ⇒ Object
Converts the type to HDLRuby::Low and set its +name+.
-
#to_rcsim ⇒ Object
Generate the C description of the type.
Methods included from Htype
#[], #binary, #comp_operator, #constant, #define_operator, #define_operator_with_context, #each_overload, #htype?, included, #inner, #inout, #input, #left, #name=, #output, #register, #right, #shared, #to_type, #typedef, #unary
Methods included from Tprocess
#&, #*, #+, #+@, #-@, #/, #<<, #==, #abs, #lr, #make, #resolve, #slice, #~
Methods inherited from Low::TypeDef
#base, #base?, #direction, #each_type_deep, #eql?, #equivalent?, #fixed?, #float?, #hash, #hierarchical?, #leaf?, #max, #min, #range, #range?, #regular?, #set_def!, #signed?, #struct?, #to_c, #to_hdr, #to_high, #to_vector, #to_verilog, #to_vhdl, #types?, #unsigned?, #vector?, #width
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, #to_viz_name, #types?, #unsigned?, #vector?, #width
Methods included from Low::Low2Symbol
Methods included from Low::Hparent
#absolute_ref, #hierarchy, #no_parent!, #scope
Constructor Details
#initialize(name, type) ⇒ TypeDef
Creates a new type definition named +name+ refering +type+.
2123 2124 2125 2126 |
# File 'lib/HDLRuby/hruby_high.rb', line 2123 def initialize(name,type) # Initialize the type structure. super(name,type) 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.
2131 2132 2133 2134 2135 2136 2137 2138 |
# File 'lib/HDLRuby/hruby_high.rb', line 2131 def to_low(name = self.name) # return HDLRuby::Low::TypeDef.new(name,self.def.to_low) typeDefL = HDLRuby::Low::TypeDef.new(name,self.def.to_low) # # For debugging: set the source high object # typeDefL.properties[:low2high] = self.hdr_id # self.properties[:high2low] = typeDefL return typeDefL end |
#to_rcsim ⇒ Object
Generate the C description of the type.
250 251 252 253 254 |
# File 'lib/HDLRuby/hruby_rcsim.rb', line 250 def to_rcsim # Create the type C object. @rctype = self.def.to_rcsim return @rctype end |