Class: HDLRuby::High::Delay

Inherits:
Low::Delay
  • Object
show all
Includes:
HStatement
Defined in:
lib/HDLRuby/hruby_high.rb,
lib/HDLRuby/hruby_rsim.rb,
lib/HDLRuby/hruby_rcsim.rb

Overview

Extends the Delay class for hybrid Ruby-C simulation.

Constant Summary collapse

High =
HDLRuby::High

Constants included from Low::Low2Symbol

Low::Low2Symbol::Low2SymbolPrefix, Low::Low2Symbol::Low2SymbolTable, Low::Low2Symbol::Symbol2LowTable

Instance Attribute Summary

Attributes inherited from Low::Delay

#unit, #value

Attributes included from Low::Hparent

#parent

Instance Method Summary collapse

Methods included from HStatement

#hif

Methods inherited from Low::Delay

#clone, #each_deep, #eql?, #hash, #initialize, #replace_expressions!, #set_unit!, #set_value!, #to_c, #to_hdr, #to_high, #to_verilog, #to_vhdl

Methods included from Low::Low2Symbol

#to_sym

Methods included from Low::Hparent

#hierarchy, #no_parent!, #scope

Constructor Details

This class inherits a constructor from HDLRuby::Low::Delay

Instance Method Details

#!Object



2646
2647
2648
# File 'lib/HDLRuby/hruby_high.rb', line 2646

def !
    High.top_user.wait(self)    
end

#time_psObject

Get the time of the delay in pico seconds.



631
632
633
634
635
636
637
638
639
640
641
642
643
644
# File 'lib/HDLRuby/hruby_rsim.rb', line 631

def time_ps
    case self.unit
    when :ps
        return self.value.to_i 
    when :ns
        return self.value.to_i * 1000
    when :us
        return self.value.to_i * 1000000
    when :ms
        return self.value.to_i * 1000000000
    when :s
        return self.value.to_i * 1000000000000
    end
end

#to_lowObject

Converts the delay to HDLRuby::Low.



2651
2652
2653
2654
2655
2656
2657
2658
# File 'lib/HDLRuby/hruby_high.rb', line 2651

def to_low
    # return HDLRuby::Low::Delay.new(self.value, self.unit)
    delayL = HDLRuby::Low::Delay.new(self.value, self.unit)
    # # For debugging: set the source high object 
    # delayL.properties[:low2high] = self.hdr_id
    # self.properties[:high2low] = delayL
    return delayL
end