Class: HDLRuby::High::TypeDef

Inherits:
Low::TypeDef show all
Includes:
Htype
Defined in:
lib/HDLRuby/hruby_high.rb,
lib/HDLRuby/hruby_rcsim.rb

Overview

Extends the TypeDef class for hybrid Ruby-C simulation.

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

#def

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::TypeDef

#each_type_deep, #eql?, #hash, #set_def!, #to_c, #to_hdr, #to_high, #to_verilog, #to_vhdl

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, #no_parent!, #scope

Methods included from Low::Ltype

included, #ltype?

Constructor Details

#initialize(name, type) ⇒ TypeDef

Creates a new type definition named +name+ refering +type+.



1896
1897
1898
1899
# File 'lib/HDLRuby/hruby_high.rb', line 1896

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.



1904
1905
1906
1907
1908
1909
1910
1911
# File 'lib/HDLRuby/hruby_high.rb', line 1904

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_rcsimObject

Generate the C description of the type.



265
266
267
268
269
# File 'lib/HDLRuby/hruby_rcsim.rb', line 265

def to_rcsim
    # Create the type C object.
    @rctype = self.def.to_rcsim
    return @rctype
end