Class: RubyHDL::High::Sbreak

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

Overview

Describes a SW implementation of a break statement.

Instance Method Summary collapse

Methods inherited from Statement

#each_statement, #each_statement_deep

Constructor Details

#initialize(sequencer) ⇒ Sbreak

Create a new break statement in sequencer +sequencer+.



3204
3205
3206
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3204

def initialize(sequencer)
  @sequencer = sequencer
end

Instance Method Details

#to_cObject

Convert to C code.



3214
3215
3216
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3214

def to_c
  return @sequencer.clk_up_c + "\nbreak;"
end

#to_python(l = "") ⇒ Object

Convert to Python code.



3219
3220
3221
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3219

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

#to_rubyObject

Convert to Ruby code.



3209
3210
3211
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3209

def to_ruby
  return @sequencer.clk_up + "\nbreak"
end

#to_tf(l = "") ⇒ Object

Convert to Tensorflow code.



3224
3225
3226
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3224

def to_tf(l = "")
  return "return tf.constant(0)"
end