Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/HDLRuby/hruby_high.rb,
lib/HDLRuby/std/fixpoint.rb,
lib/HDLRuby/hruby_verilog.rb,
lib/HDLRuby/hruby_low2vhd.rb,
lib/HDLRuby/hruby_low2hdr.rb
Overview
Extends the Numeric class for conversion to fixed point litteral.
Instance Method Summary collapse
-
#fs ⇒ Object
Converts to a new dealy in fentoseconds.
-
#ms ⇒ Object
Converts to a new delay in milliseconds.
-
#ns ⇒ Object
Converts to a new delay in nanoseconds.
-
#ps ⇒ Object
Converts to a new delay in picoseconds.
-
#s ⇒ Object
Converts to a new delay in seconds.
-
#to_fix(dec) ⇒ Object
Convert to fixed point value with
decdigits after the decimal point. -
#to_hdr(level = 0) ⇒ Object
Generates the text of the equivalent hdr text.
-
#to_value ⇒ Object
Converts to a new high-level value.
-
#to_value? ⇒ Boolean
Tell if the expression can be converted to a value.
-
#to_verilog(level = 0) ⇒ Object
Generates the text of the equivalent verilog code.
-
#to_vhdl(level = 0) ⇒ Object
Generates the text of the equivalent HDLRuby::High code.
-
#us ⇒ Object
Converts to a new delay in microseconds.
Instance Method Details
#fs ⇒ Object
Converts to a new dealy in fentoseconds.
5212 5213 5214 |
# File 'lib/HDLRuby/hruby_high.rb', line 5212 def fs return Delay.new(self,:fs) end |
#ms ⇒ Object
Converts to a new delay in milliseconds.
5232 5233 5234 |
# File 'lib/HDLRuby/hruby_high.rb', line 5232 def ms return Delay.new(self,:ms) end |
#ns ⇒ Object
Converts to a new delay in nanoseconds.
5222 5223 5224 |
# File 'lib/HDLRuby/hruby_high.rb', line 5222 def ns return Delay.new(self,:ns) end |
#ps ⇒ Object
Converts to a new delay in picoseconds.
5217 5218 5219 |
# File 'lib/HDLRuby/hruby_high.rb', line 5217 def ps return Delay.new(self,:ps) end |
#s ⇒ Object
Converts to a new delay in seconds.
5237 5238 5239 |
# File 'lib/HDLRuby/hruby_high.rb', line 5237 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.
760 761 762 |
# File 'lib/HDLRuby/hruby_low2hdr.rb', line 760 def to_hdr(level = 0) return self.to_s end |
#to_value ⇒ Object
Converts to a new high-level value.
5207 5208 5209 |
# File 'lib/HDLRuby/hruby_high.rb', line 5207 def to_value to_expr end |
#to_value? ⇒ Boolean
Tell if the expression can be converted to a value.
5202 5203 5204 |
# File 'lib/HDLRuby/hruby_high.rb', line 5202 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.
2489 2490 2491 |
# File 'lib/HDLRuby/hruby_verilog.rb', line 2489 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.
1580 1581 1582 |
# File 'lib/HDLRuby/hruby_low2vhd.rb', line 1580 def to_vhdl(level = 0) return self.to_s end |