class HDLRuby::Low::TimeBehavior
Describes a timed behavior.
NOTE:
-
this is the only kind of behavior that can include time statements.
-
this kind of behavior is not synthesizable!
Describes a timed behavior.
NOTE:
-
this is the only kind of behavior that can include time statements.
-
this kind of behavior is not synthesizable!
Extends the TimeBehavior
class with generation of C text.
Extends the TimeBehavior
class with generation of hdr text.
Add the conversion to high.
Extends the TimeBehavior
class with generation of HDLRuby::High
text.
Describes a timed behavior.
NOTE:
-
this is the only kind of behavior that can include time statements.
-
this kind of behavior is not synthesizable!
Public Class Methods
Creates a new time behavior executing block
.
# File lib/HDLRuby/hruby_low.rb, line 2293 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
Public Instance Methods
Time behavior do not have other event than time, so deactivate the relevant methods.
# File lib/HDLRuby/hruby_low.rb, line 2320 def add_event(event) raise AnyError, "Time behaviors do not have any sensitivity list." end
Comparison for hash: structural comparison.
# File lib/HDLRuby/hruby_low.rb, line 2306 def eql?(obj) # Specific comparison. return false unless obj.is_a?(TimeBehavior) # General comparison. return super(obj) end
Hash
function.
# File lib/HDLRuby/hruby_low.rb, line 2314 def hash super end
Sets the block.
# 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
Generates the C text of the equivalent HDLRuby
code. level
is the hierachical level of the object.
# File lib/HDLRuby/hruby_low2c.rb, line 721 def to_c(level = 0) super(level,true) end
Generates the text of the equivalent hdr text. level
is the hierachical level of the object.
# File lib/HDLRuby/hruby_low2hdr.rb, line 282 def to_hdr(level = 0) super(level,true) end
Creates a new high time behavior.
# File lib/HDLRuby/hruby_low2high.rb, line 143 def to_high # Create the resulting behavior. res = HDLRuby::High::TimeBehavior.new(self.block.to_high) # Adds the events. self.each_event { |ev| res.add_event(ev.to_high) } return res end