Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/HDLRuby/hruby_high.rb

Overview

Extends the String class for computing conversion to expression.

Instance Method Summary collapse

Instance Method Details

#to_exprObject

Convert to a new high-level string expression



4817
4818
4819
# File 'lib/HDLRuby/hruby_high.rb', line 4817

def to_expr
    return StringE.new(self)
end

#to_valueObject

Converts to a new high-level value.



4808
4809
4810
4811
4812
4813
4814
# File 'lib/HDLRuby/hruby_high.rb', line 4808

def to_value
    # Convert the string to a bit string.
    bstr = BitString.new(self)
    # Use it to create the new value.
    # return Value.new(Bit[bstr.width],bstr)
    return Value.new(Bit[self.length],bstr)
end

#to_value?Boolean

Tell if the expression can be converted to a value.

Returns:

  • (Boolean)


4803
4804
4805
# File 'lib/HDLRuby/hruby_high.rb', line 4803

def to_value?
    return true
end