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_ruby ⇒ Object
Convert to Ruby code.
Methods inherited from Statement
#each_statement, #each_statement_deep
Constructor Details
Instance Method Details
#to_c ⇒ Object
Convert to C code.
2529 2530 2531 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 2529 def to_c return "yield();" end |
#to_ruby ⇒ Object
Convert to Ruby code.
2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 2513 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 |