Class: RubyHDL::High::Sreturn
- Defined in:
- lib/HDLRuby/std/sequencer_sw.rb
Overview
Describes a SW implementation of a return statement.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(sequencer, val) ⇒ Sreturn
constructor
Create a new break statement in sequencer +sequencer+ returning value +val+.
-
#to_c ⇒ Object
Convert to Ruby code.
-
#to_python(l = "") ⇒ Object
Convert to Python code.
-
#to_ruby ⇒ Object
Convert to Ruby code.
Methods inherited from Statement
#each_statement, #each_statement_deep
Constructor Details
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
2703 2704 2705 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 2703 def value @value end |
Instance Method Details
#to_c ⇒ Object
Convert to Ruby code.
2718 2719 2720 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 2718 def to_c return @sequencer.clk_up_c + "\nreturn #{@value.to_c};" end |
#to_python(l = "") ⇒ Object
Convert to Python code.
2723 2724 2725 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 2723 def to_python(l = "") return @sequencer.clk_up_python(l) + "\n#{l}return #{@value.to_c}" end |
#to_ruby ⇒ Object
Convert to Ruby code.
2713 2714 2715 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 2713 def to_ruby return @sequencer.clk_up + "\nreturn #{@value.to_ruby}" end |