Class: HDLRuby::High::Unary
- Inherits:
-
Low::Unary
- Object
- Low::Expression
- Low::Operation
- Low::Unary
- HDLRuby::High::Unary
- Includes:
- HExpression
- Defined in:
- lib/HDLRuby/hruby_high.rb,
lib/HDLRuby/hruby_rsim.rb,
lib/HDLRuby/hruby_rcsim.rb
Overview
Describes an unary operation.
Constant Summary
Constants included from Low::Low2Symbol
Low::Low2Symbol::Low2SymbolPrefix, Low::Low2Symbol::Low2SymbolTable, Low::Low2Symbol::Symbol2LowTable
Instance Attribute Summary collapse
-
#rcexpression ⇒ Object
readonly
Extends the Unary class for hybrid Ruby-C simulation.
Attributes included from HExpression
Attributes inherited from Low::Unary
Attributes inherited from Low::Operation
Attributes inherited from Low::Expression
Attributes included from Low::Hparent
Instance Method Summary collapse
-
#execute(mode) ⇒ Object
Execute the expression.
-
#init_sim(systemT) ⇒ Object
Initialize the simulation for system +systemT+.
-
#to_expr ⇒ Object
Converts to a new expression.
-
#to_low ⇒ Object
Converts the unary expression to HDLRuby::Low.
-
#to_rcsim ⇒ Object
Generate the C description of the unary operation.
Methods included from HExpression
#<=>, #[], #as, #coerce, #constant?, #inout, #input, #ljust, #lr, #ls, #match_type, #mux, orig_operator, #orig_operator, #output, #rjust, #rr, #rs, #sdownto, #seach, #sext, #stimes, #supto, #to_bit, #to_signed, #to_unsigned, #to_value, #to_value?, #zext
Methods inherited from Low::Unary
#boolean?, #boolean_in_assign2select, #casts_without_expression!, #clone, #each_deep, #each_node, #each_node_deep, #each_ref_deep, #eql?, #explicit_types, #hash, #immutable?, #initialize, #to_c, #to_hdr, #to_high, #to_verilog, #to_vhdl, #use_name?
Methods included from Low::OneChildMutable
#map_nodes!, #replace_expressions!, #set_child!
Methods inherited from Low::Operation
#eql?, #explicit_types, #hash, #initialize, #set_operator!, #to_c, #to_hdr, #to_vhdl, #to_viz_node
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::Unary
Instance Attribute Details
#rcexpression ⇒ Object (readonly)
Extends the Unary class for hybrid Ruby-C simulation.
967 968 969 |
# File 'lib/HDLRuby/hruby_rcsim.rb', line 967 def rcexpression @rcexpression end |
Instance Method Details
#execute(mode) ⇒ Object
Execute the expression.
1102 1103 1104 1105 1106 1107 1108 1109 |
# File 'lib/HDLRuby/hruby_rsim.rb', line 1102 def execute(mode) # puts "Unary with operator=#{self.operator}" # Recurse on the child. tmp = self.child.execute(mode) # puts "tmp=#{tmp}" # Apply the operator. return tmp.send(self.operator) end |
#init_sim(systemT) ⇒ Object
Initialize the simulation for system +systemT+.
1096 1097 1098 1099 |
# File 'lib/HDLRuby/hruby_rsim.rb', line 1096 def init_sim(systemT) # Recurse on the child. self.child.init_sim(systemT) end |
#to_expr ⇒ Object
Converts to a new expression.
3309 3310 3311 |
# File 'lib/HDLRuby/hruby_high.rb', line 3309 def to_expr return Unary.new(self.type,self.operator,self.child.to_expr) end |
#to_low ⇒ Object
Converts the unary expression to HDLRuby::Low.
3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 |
# File 'lib/HDLRuby/hruby_high.rb', line 3314 def to_low # return HDLRuby::Low::Unary.new(self.type.to_low, self.operator, # self.child.to_low) unaryL = HDLRuby::Low::Unary.new(self.type.to_low, self.operator, self.child.to_low) # # For debugging: set the source high object # unaryL.properties[:low2high] = self.hdr_id # self.properties[:high2low] = unaryL return unaryL end |
#to_rcsim ⇒ Object
Generate the C description of the unary operation.
970 971 972 973 974 |
# File 'lib/HDLRuby/hruby_rcsim.rb', line 970 def to_rcsim # Create the unary C object. return RCSim.rcsim_make_unary(self.type.to_rcsim,self.operator, self.child.to_rcsim) end |