Class: HDLRuby::High::Behavior
- Inherits:
-
Low::Behavior
- Object
- Base::Behavior
- Low::Behavior
- HDLRuby::High::Behavior
- Defined in:
- lib/HDLRuby/hruby_high.rb
Overview
Describes a high-level 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, *events, &ruby_block) ⇒ Behavior
constructor
Creates a new behavior executing +block+ activated on a list of +events+, and built by executing +ruby_block+.
-
#to_low ⇒ Object
Converts the time behavior to HDLRuby::Low.
Methods inherited from Low::Behavior
#add_event, #blocks2seq!, #delete_event!, #each_block, #each_block_deep, #each_event, #each_node_deep, #each_statement, #eql?, #explicit_types!, #extract_declares!, #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_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, *events, &ruby_block) ⇒ Behavior
Creates a new behavior executing +block+ activated on a list of +events+, and built by executing +ruby_block+. +mode+ can be either :seq or :par for respectively sequential or parallel.
3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 |
# File 'lib/HDLRuby/hruby_high.rb', line 3570 def initialize(mode,*events,&ruby_block) # Initialize the behavior with it. super(nil) # # Save the Location for debugging information # @location = caller_locations # Sets the current behavior @@cur_behavior = self # Add the events. events.each { |event| self.add_event(event) } # Create and add the block. self.block = High.make_block(mode,&ruby_block) # Unset the current behavior @@cur_behavior = nil end |
Instance Method Details
#to_low ⇒ Object
Converts the time behavior to HDLRuby::Low.
3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 |
# File 'lib/HDLRuby/hruby_high.rb', line 3590 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. behaviorL = HDLRuby::Low::Behavior.new(blockL) eventLs.each(&behaviorL.method(:add_event)) return behaviorL end |