Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/HDLRuby/hruby_high.rb,
lib/HDLRuby/std/fixpoint.rb,
lib/HDLRuby/hruby_low2hdr.rb,
lib/HDLRuby/hruby_low2vhd.rb,
lib/HDLRuby/hruby_verilog.rb

Overview

Extends the Numeric class with generation of verilog text.

Instance Method Summary collapse

Instance Method Details

#msObject

Converts to a new delay in milliseconds.



4519
4520
4521
# File 'lib/HDLRuby/hruby_high.rb', line 4519

def ms
    return Delay.new(self,:ms)
end

#nsObject

Converts to a new delay in nanoseconds.



4509
4510
4511
# File 'lib/HDLRuby/hruby_high.rb', line 4509

def ns
    return Delay.new(self,:ns)
end

#psObject

Converts to a new delay in picoseconds.



4504
4505
4506
# File 'lib/HDLRuby/hruby_high.rb', line 4504

def ps
    return Delay.new(self,:ps)
end

#sObject

Converts to a new delay in seconds.



4524
4525
4526
# File 'lib/HDLRuby/hruby_high.rb', line 4524

def s
    return Delay.new(self,:s)
end

#to_fix(dec) ⇒ Object

Convert to fixed point value with +dec+ digits after the decimal point.



89
90
91
# File 'lib/HDLRuby/std/fixpoint.rb', line 89

def to_fix(dec)
    return (self * (2**dec.to_i)).to_i
end

#to_hdr(level = 0) ⇒ Object

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



733
734
735
# File 'lib/HDLRuby/hruby_low2hdr.rb', line 733

def to_hdr(level = 0)
    return self.to_s
end

#to_valueObject

Converts to a new high-level value.



4499
4500
4501
# File 'lib/HDLRuby/hruby_high.rb', line 4499

def to_value
    to_expr
end

#to_value?Boolean

Tell if the expression can be converted to a value.

Returns:

  • (Boolean)


4494
4495
4496
# File 'lib/HDLRuby/hruby_high.rb', line 4494

def to_value?
    return true
end

#to_verilog(level = 0) ⇒ Object

Generates the text of the equivalent verilog code. +level+ is the hierachical level of the object.



2197
2198
2199
# File 'lib/HDLRuby/hruby_verilog.rb', line 2197

def to_verilog(level = 0)
    return self.to_s
end

#to_vhdl(level = 0) ⇒ Object

Generates the text of the equivalent HDLRuby::High code. +level+ is the hierachical level of the object.



1544
1545
1546
# File 'lib/HDLRuby/hruby_low2vhd.rb', line 1544

def to_vhdl(level = 0)
    return self.to_s
end

#usObject

Converts to a new delay in microseconds.



4514
4515
4516
# File 'lib/HDLRuby/hruby_high.rb', line 4514

def us
    return Delay.new(self,:us)
end