Class: RubyHDL::High::Value
- Inherits:
-
Expression
- Object
- Expression
- RubyHDL::High::Value
- Defined in:
- lib/HDLRuby/std/sequencer_sw.rb
Overview
Describes the software implementation of a value.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Attributes inherited from Expression
Instance Method Summary collapse
-
#initialize(type, content) ⇒ Value
constructor
Create a new value with +type+ data type and content +content+.
-
#to_c ⇒ Object
Convert to C code.
-
#to_python(l = "") ⇒ Object
Convert to Python code.
-
#to_ruby ⇒ Object
Convert to Ruby code.
-
#to_value ⇒ Object
Compute the expression (convert it to a value).
Methods inherited from Expression
#<=, #[], #mux, #sdownto, #seach, #stimes, #supto, #to_expr
Constructor Details
#initialize(type, content) ⇒ Value
Create a new value with +type+ data type and content +content+.
1963 1964 1965 1966 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 1963 def initialize(type,content) super(type) @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
1960 1961 1962 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 1960 def content @content end |
Instance Method Details
#to_c ⇒ Object
Convert to C code.
1979 1980 1981 1982 1983 1984 1985 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 1979 def to_c if @content.is_a?(::Array) then return "{" + @content.to_s[1..-2] + "}" else return @content.to_s end end |
#to_python(l = "") ⇒ Object
Convert to Python code.
1988 1989 1990 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 1988 def to_python(l = "") return @content.to_s end |
#to_ruby ⇒ Object
Convert to Ruby code.
1974 1975 1976 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 1974 def to_ruby return @content.to_s end |
#to_value ⇒ Object
Compute the expression (convert it to a value).
1969 1970 1971 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 1969 def to_value return self end |