Class: HDLRuby::High::RefName
- Inherits:
-
Low::RefName
- Object
- Low::Expression
- Low::Ref
- Low::RefName
- HDLRuby::High::RefName
- Includes:
- HRef
- Defined in:
- lib/HDLRuby/hruby_high.rb,
lib/HDLRuby/hruby_rsim.rb,
lib/HDLRuby/hruby_rcsim.rb
Overview
Describes a name reference.
Constant Summary
Constants included from Low::Low2Symbol
Low::Low2Symbol::Low2SymbolPrefix, Low::Low2Symbol::Low2SymbolTable, Low::Low2Symbol::Symbol2LowTable
Instance Attribute Summary
Attributes inherited from Low::RefName
Attributes inherited from Low::Expression
Attributes included from Low::Hparent
Instance Method Summary collapse
-
#to_low ⇒ Object
Converts the name reference to HDLRuby::Low.
-
#to_rcsim ⇒ Object
Generate the C description of the reference range (not ref name!).
-
#to_ref ⇒ Object
Converts to a new reference.
Methods included from HRef
#each, included, #objects, #to_event
Methods included from Enumerable
Methods inherited from Low::RefName
#ancestor, #boolean_in_assign2select, #casts_without_expression!, #clone, #each_deep, #each_node, #each_node_deep, #eql?, #explicit_types, #fix_scope_refnames!, #flatten, #flatten_to, #from_systemI?, #full_name, #get_systemI, #hash, #initialize, #map_nodes!, #path_each, #replace_expressions!, #resolve, #set_name!, #set_ref!, #signal2subs!, #to_another_verilog, #to_c, #to_c_signal, #to_hdr, #to_high, #to_verilog, #to_vhdl, #to_viz_names, #to_viz_node, #use_name?
Methods included from Low::ForceName
Methods inherited from Low::Ref
#each_node, #each_node_deep, #eql?, #explicit_types, #hash, #map_nodes!, #path_each, #resolve, #to_c, #to_hdr, #to_vhdl
Methods inherited from Low::Expression
#boolean?, #break_types!, #clone, #each_node, #each_node_deep, #each_ref_deep, #eql?, #explicit_types, #extract_selects_to!, #fix_scope_refnames!, #hash, #immutable?, #initialize, #leftvalue?, #map_nodes!, #replace_expressions!, #replace_names!, #rightvalue?, #set_type!, #signal2subs!, #statement, #to_c, #to_c_expr, #to_hdr, #to_high, #to_vhdl, #to_viz_names, #use_name?
Methods included from Low::Low2Symbol
Methods included from Low::Hparent
#absolute_ref, #hierarchy, #no_parent!, #scope
Constructor Details
This class inherits a constructor from HDLRuby::Low::RefName
Instance Method Details
#to_low ⇒ Object
Converts the name reference to HDLRuby::Low.
3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 |
# File 'lib/HDLRuby/hruby_high.rb', line 3732 def to_low # return HDLRuby::Low::RefName.new(self.type.to_low, # self.ref.to_low,self.name) refNameL = HDLRuby::Low::RefName.new(self.type.to_low, self.ref.to_low,self.name) # # For debugging: set the source high object # refNameL.properties[:low2high] = self.hdr_id # self.properties[:high2low] = refNameL return refNameL end |
#to_rcsim ⇒ Object
Generate the C description of the reference range (not ref name!).
1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 |
# File 'lib/HDLRuby/hruby_rcsim.rb', line 1102 def to_rcsim # Convert the base to a bit vector. type_base = Bit[self.ref.type.width] # self.ref.parent = nil # bit_base = Cast.new(type_base,self.ref) bit_base = RCSim.rcsim_make_cast(type_base.to_rcsim,self.ref.to_rcsim) # Compute range in bits of the field. last = 0 self.ref.type.each.detect do |name,typ| last += typ.width name == self.name end first = last-self.type.width last -= 1 # puts "name=#{self.name} first=#{first} last=#{last}" type_int = Bit[type_base.width.width] return RCSim.rcsim_make_refRange(self.type.to_rcsim, Value.new(type_int,last).to_rcsim, Value.new(type_int,first).to_rcsim, bit_base) end |