Class: HDLRuby::High::TypeTuple

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

Overview

Extends the TypeTuple 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::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::TypeTuple

#add_type, #base, #base?, #break_types!, #delete_type!, #direction, #each, #each_type, #each_type_deep, #eql?, #equivalent?, #get_all_types, #get_type, #hash, #initialize, #map_types!, #range, #regular?, #to_c, #to_hdr, #to_high, #to_vhdl, #types?, #width

Methods included from Low::Ltype

included, #ltype?

Methods inherited from Low::Type

#base, #base?, #boolean?, #break_types!, #direction, #each_type_deep, #eql?, #equivalent?, #fixed?, #float?, #hash, #hierarchical?, #initialize, #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

Constructor Details

This class inherits a constructor from HDLRuby::Low::TypeTuple

Instance Method Details

#direction=(dir) ⇒ Object

Add the possibility to change the direction.



256
257
258
# File 'lib/HDLRuby/hruby_rsim.rb', line 256

def direction=(dir)
    @direction = dir == :little ? :little : :big
end

#to_low(name = self.name) ⇒ Object

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



2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
# File 'lib/HDLRuby/hruby_high.rb', line 2053

def to_low(name = self.name)
    # return HDLRuby::Low::TypeTuple.new(name,self.direction,
    #                    *@types.map { |type| type.to_low } )
    typeTupleL = HDLRuby::Low::TypeTuple.new(name,self.direction,
                       *@types.map { |type| type.to_low } )
    # # For debugging: set the source high object 
    # typeTupleL.properties[:low2high] = self.hdr_id
    # self.properties[:high2low] = typeTupleL
    return typeTupleL
end

#to_rcsimObject

Generate the C description of the type.



282
283
284
285
286
# File 'lib/HDLRuby/hruby_rcsim.rb', line 282

def to_rcsim
    # @rctype = self.to_vector.to_rcsim
    @rctype = RCSim.rcsim_get_type_vector(Bit.to_rcsim,self.width)
    return @rctype
end