Class: RubyHDL::High::Sreturn

Inherits:
Statement show all
Defined in:
lib/HDLRuby/std/sequencer_sw.rb

Overview

Describes a SW implementation of a return statement.

Instance Attribute Summary collapse

Instance Method Summary collapse

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+.



3263
3264
3265
3266
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3263

def initialize(sequencer,val)
  @sequencer = sequencer
  @value = val
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



3259
3260
3261
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3259

def value
  @value
end

Instance Method Details

#to_cObject

Convert to Ruby code.



3274
3275
3276
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3274

def to_c
  return @sequencer.clk_up_c + "\nreturn #{@value.to_c};"
end

#to_python(l = "") ⇒ Object

Convert to Python code.



3279
3280
3281
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3279

def to_python(l = "")
  return @sequencer.clk_up_python(l) + "\n#{l}return #{@value.to_python}"
end

#to_rubyObject

Convert to Ruby code.



3269
3270
3271
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3269

def to_ruby
  return @sequencer.clk_up + "\nreturn #{@value.to_ruby}"
end

#to_tf(l = "") ⇒ Object

Convert to TensorFlow code.



3284
3285
3286
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3284

def to_tf(l = "")
  return "\n#{l}return #{@value.to_tf}"
end