Class: HDLRuby::Low::TimeBehavior
- Defined in:
- lib/HDLRuby/hruby_db.rb,
lib/HDLRuby/hruby_low.rb,
lib/HDLRuby/hruby_low2c.rb,
lib/HDLRuby/hruby_low2vhd.rb,
lib/HDLRuby/hruby_low2high.rb,
lib/HDLRuby/hruby_low_mutable.rb,
lib/HDLRuby/hruby_low_skeleton.rb
Overview
Describes a timed behavior.
NOTE:
- this is the only kind of behavior that can include time statements.
- this kind of behavior is not synthesizable!
Direct Known Subclasses
Constant Summary
Constants included from Low2Symbol
Low2Symbol::Low2SymbolPrefix, Low2Symbol::Low2SymbolTable, Low2Symbol::Symbol2LowTable
Instance Attribute Summary
Attributes inherited from Behavior
Attributes included from Hparent
Instance Method Summary collapse
-
#add_event(event) ⇒ Object
Time behavior do not have other event than time, so deactivate the relevant methods.
-
#eql?(obj) ⇒ Boolean
Comparison for hash: structural comparison.
-
#hash ⇒ Object
Hash function.
-
#initialize(block) ⇒ TimeBehavior
constructor
Creates a new time behavior executing +block+.
-
#set_block!(block) ⇒ Object
Sets the block.
-
#to_c(level = 0) ⇒ Object
Generates the C text of the equivalent HDLRuby::High code.
-
#to_high(level = 0) ⇒ Object
Generates the text of the equivalent HDLRuby::High code.
Methods inherited from Behavior
#blocks2seq!, #delete_event!, #each_block, #each_block_deep, #each_event, #each_node_deep, #each_statement, #explicit_types!, #extract_declares!, #has_event?, #last_statement, #map_events!, #mixblocks2seq!, #on_edge?, #on_event?, #parent_system, #replace_names!, #reverse_each_statement, #to_ch, #to_upper_space!, #to_vhdl, #top_scope, #with_boolean!, #with_var!
Methods included from Low2Symbol
Methods included from Hparent
Constructor Details
#initialize(block) ⇒ TimeBehavior
Creates a new time behavior executing +block+.
2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 |
# File 'lib/HDLRuby/hruby_low.rb', line 2152 def initialize(block) # Initialize the sensitivity list. @events = [] # Check and set the block. unless block.is_a?(Block) raise AnyError, "Invalid class for a block: #{block.class}." end # Time blocks are supported here. @block = block block.parent = self end |
Instance Method Details
#add_event(event) ⇒ Object
Time behavior do not have other event than time, so deactivate the relevant methods.
2179 2180 2181 |
# File 'lib/HDLRuby/hruby_low.rb', line 2179 def add_event(event) raise AnyError, "Time behaviors do not have any sensitivity list." end |
#eql?(obj) ⇒ Boolean
Comparison for hash: structural comparison.
2165 2166 2167 2168 2169 2170 |
# File 'lib/HDLRuby/hruby_low.rb', line 2165 def eql?(obj) # Specific comparison. return false unless obj.is_a?(TimeBehavior) # General comparison. return super(obj) end |
#hash ⇒ Object
Hash function.
2173 2174 2175 |
# File 'lib/HDLRuby/hruby_low.rb', line 2173 def hash super end |
#set_block!(block) ⇒ Object
Sets the block.
409 410 411 412 413 414 415 416 417 |
# File 'lib/HDLRuby/hruby_low_mutable.rb', line 409 def set_block!(block) # Check and set the block. unless block.is_a?(Block) raise AnyError, "Invalid class for a block: #{block.class}." end # Time blocks are supported here. @block = block block.parent = self end |
#to_c(level = 0) ⇒ Object
Generates the C text of the equivalent HDLRuby::High code. +level+ is the hierachical level of the object.
713 714 715 |
# File 'lib/HDLRuby/hruby_low2c.rb', line 713 def to_c(level = 0) super(level,true) end |
#to_high(level = 0) ⇒ Object
Generates the text of the equivalent HDLRuby::High code. +level+ is the hierachical level of the object.
282 283 284 |
# File 'lib/HDLRuby/hruby_low2high.rb', line 282 def to_high(level = 0) super(level,true) end |