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
more...

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.

[View source]

4284
4285
4286
# File 'lib/HDLRuby/hruby_high.rb', line 4284

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

#nsObject

Converts to a new delay in nanoseconds.

[View source]

4274
4275
4276
# File 'lib/HDLRuby/hruby_high.rb', line 4274

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

#psObject

Converts to a new delay in picoseconds.

[View source]

4269
4270
4271
# File 'lib/HDLRuby/hruby_high.rb', line 4269

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

#sObject

Converts to a new delay in seconds.

[View source]

4289
4290
4291
# File 'lib/HDLRuby/hruby_high.rb', line 4289

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

#to_fix(dec) ⇒ Object

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

[View source]

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.

[View source]

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.

[View source]

4264
4265
4266
# File 'lib/HDLRuby/hruby_high.rb', line 4264

def to_value
    to_expr
end

#to_value?Boolean

Tell if the expression can be converted to a value.

Returns:

  • (Boolean)
[View source]

4259
4260
4261
# File 'lib/HDLRuby/hruby_high.rb', line 4259

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.

[View source]

2189
2190
2191
# File 'lib/HDLRuby/hruby_verilog.rb', line 2189

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.

[View source]

1532
1533
1534
# File 'lib/HDLRuby/hruby_low2vhd.rb', line 1532

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

#usObject

Converts to a new delay in microseconds.

[View source]

4279
4280
4281
# File 'lib/HDLRuby/hruby_high.rb', line 4279

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