Class: HDLRuby::High::TimeBehavior
- Inherits:
-
Low::TimeBehavior
- Object
- Base::Behavior
- Low::Behavior
- Low::TimeBehavior
- HDLRuby::High::TimeBehavior
- Defined in:
- lib/HDLRuby/hruby_high.rb
Overview
Describes a high-level timed behavior.
Constant Summary collapse
Constants included from Low::Low2Symbol
Low::Low2Symbol::Low2SymbolPrefix, Low::Low2Symbol::Low2SymbolTable, Low::Low2Symbol::Symbol2LowTable
Instance Attribute Summary
Attributes inherited from Low::Behavior
Attributes included from Low::Hparent
Instance Method Summary collapse
-
#initialize(mode, &ruby_block) ⇒ TimeBehavior
constructor
Creates a new timed behavior built by executing +ruby_block+.
-
#to_low ⇒ Object
Converts the time behavior to HDLRuby::Low.
Methods inherited from Low::TimeBehavior
#add_event, #eql?, #hash, #set_block!, #to_c, #to_hdr, #to_high
Methods inherited from Low::Behavior
#add_event, #blocks2seq!, #delete_event!, #each_block, #each_block_deep, #each_deep, #each_event, #each_node_deep, #each_statement, #eql?, #explicit_types!, #extract_declares!, #get_by_name, #has_event?, #hash, #last_statement, #map_events!, #mixblocks2seq!, #on_edge?, #on_event?, #parent_system, #replace_names!, #reverse_each_statement, #set_block!, #to_c, #to_ch, #to_hdr, #to_high, #to_upper_space!, #to_vhdl, #top_scope, #with_boolean!, #with_var!
Methods included from Low::Low2Symbol
Methods included from Low::Hparent
Constructor Details
#initialize(mode, &ruby_block) ⇒ TimeBehavior
Creates a new timed behavior built by executing +ruby_block+. +mode+ can be either :seq or :par for respectively sequential or
4253 4254 4255 4256 4257 4258 |
# File 'lib/HDLRuby/hruby_high.rb', line 4253 def initialize(mode, &ruby_block) # Create a default par block for the behavior. block = High.make_time_block(mode,&ruby_block) # Initialize the behavior with it. super(block) end |
Instance Method Details
#to_low ⇒ Object
Converts the time behavior to HDLRuby::Low.
4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 |
# File 'lib/HDLRuby/hruby_high.rb', line 4261 def to_low # Create the low level block. blockL = self.block.to_low # Create the low level events. eventLs = self.each_event.map { |event| event.to_low } # Create and return the resulting low level behavior. timeBehaviorL = HDLRuby::Low::TimeBehavior.new(blockL) # # For debugging: set the source high object # timeBehaviorL.properties[:low2high] = self.hdr_id # self.properties[:high2low] = timeBehaviorL eventLs.each(&timeBehaviorL.method(:add_event)) return timeBehaviorL end |