class HDLRuby::Low::TimeBehavior

Describes a timed behavior.

NOTE:

Describes a timed behavior.

NOTE:

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:

Public Class Methods

new(block) click to toggle source

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

add_event(event) click to toggle source

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
eql?(obj) click to toggle source

Comparison for hash: structural comparison.

Calls superclass method
# 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() click to toggle source

Hash function.

Calls superclass method
# File lib/HDLRuby/hruby_low.rb, line 2314
def hash
    super
end
set_block!(block) click to toggle source

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
to_c(level = 0) click to toggle source

Generates the C text of the equivalent HDLRuby code. level is the hierachical level of the object.

Calls superclass method
# File lib/HDLRuby/hruby_low2c.rb, line 721
def to_c(level = 0)
    super(level,true)
end
to_hdr(level = 0) click to toggle source

Generates the text of the equivalent hdr text. level is the hierachical level of the object.

Calls superclass method
# File lib/HDLRuby/hruby_low2hdr.rb, line 282
def to_hdr(level = 0)
    super(level,true)
end
to_high() click to toggle source

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