Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- 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
-
#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 +dec+ digits 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
#ms ⇒ Object
Converts to a new delay in milliseconds.
4246 4247 4248 |
# File 'lib/HDLRuby/hruby_high.rb', line 4246 def ms return Delay.new(self,:ms) end |
#ns ⇒ Object
Converts to a new delay in nanoseconds.
4236 4237 4238 |
# File 'lib/HDLRuby/hruby_high.rb', line 4236 def ns return Delay.new(self,:ns) end |
#ps ⇒ Object
Converts to a new delay in picoseconds.
4231 4232 4233 |
# File 'lib/HDLRuby/hruby_high.rb', line 4231 def ps return Delay.new(self,:ps) end |
#s ⇒ Object
Converts to a new delay in seconds.
4251 4252 4253 |
# File 'lib/HDLRuby/hruby_high.rb', line 4251 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_value ⇒ Object
Converts to a new high-level value.
4226 4227 4228 |
# File 'lib/HDLRuby/hruby_high.rb', line 4226 def to_value to_expr end |
#to_value? ⇒ Boolean
Tell if the expression can be converted to a value.
4221 4222 4223 |
# File 'lib/HDLRuby/hruby_high.rb', line 4221 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.
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.
1532 1533 1534 |
# File 'lib/HDLRuby/hruby_low2vhd.rb', line 1532 def to_vhdl(level = 0) return self.to_s end |