Class: RubyHDL::High::Sync
- Defined in:
- lib/HDLRuby/std/sequencer_sw.rb
Overview
Describes a SW synchronization of a signal.
Instance Method Summary collapse
-
#initialize(sequencer) ⇒ Sync
constructor
A new instance of Sync.
-
#to_c ⇒ Object
Convert to C code.
-
#to_python(l = "") ⇒ Object
Convert to Python code.
-
#to_ruby ⇒ Object
Convert to Ruby code.
-
#to_tf(l = "") ⇒ Object
Convert to Tensorflow code.
Methods inherited from Statement
#each_statement, #each_statement_deep
Constructor Details
Instance Method Details
#to_c ⇒ Object
Convert to C code.
3342 3343 3344 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3342 def to_c return "yield();" end |
#to_python(l = "") ⇒ Object
Convert to Python code.
3347 3348 3349 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3347 def to_python(l = "") return "#{l}yield()" end |
#to_ruby ⇒ Object
Convert to Ruby code.
3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3326 def to_ruby # Update the inputs and outputs. res = "" RubyHDL::High.global_sblock.each_signal do |signal| case signal.dir when :input res << signal.to_ruby + " = RubyHDL.#{signal.name}\n" when :output res << "RubyHDL.#{signal.name} = " + signal.to_ruby + "\n" end end res << "Fiber.yield" return res end |
#to_tf(l = "") ⇒ Object
Convert to Tensorflow code.
3352 3353 3354 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 3352 def to_tf(l = "") return "#{l}yield()" end |