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_ruby ⇒ Object
Convert to Ruby code.
Methods inherited from Statement
#each_statement, #each_statement_deep
Constructor Details
#initialize(sequencer, val) ⇒ Sreturn
Create a new break statement in sequencer +sequencer+ returning value +val+.
2524 2525 2526 2527 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 2524 def initialize(sequencer,val) @sequencer = sequencer @value = val end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
2520 2521 2522 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 2520 def value @value end |
Instance Method Details
#to_c ⇒ Object
Convert to Ruby code.
2535 2536 2537 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 2535 def to_c return @sequencer.clk_up_c + "\nreturn #{@value.to_c};" end |
#to_ruby ⇒ Object
Convert to Ruby code.
2530 2531 2532 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 2530 def to_ruby return @sequencer.clk_up + "\nreturn #{@value.to_ruby}" end |