lib/HDLRuby/hruby_rcsim.rb in HDLRuby-2.11.3 vs lib/HDLRuby/hruby_rcsim.rb in HDLRuby-2.11.4
- old
+ new
@@ -652,11 +652,25 @@
## Extends the TimeRepeat class for hybrid Ruby-C simulation.
class TimeRepeat
attr_reader :rcstatement
- # TODO!!!
+
+ # Generate the C description of the hardware case.
+ # +owner+ is a link to the C description of the owner behavior if any.
+ def to_rcsim(owner = nil)
+ # Create the timeRepeat C object.
+ @rcstatement = RCSim.rcsim_make_timeRepeat(self.number,
+ self.statement.to_rcsim)
+
+ # Sets the owner if any.
+ if owner then
+ RCSim.rcsim_set_owner(@rcstatement,owner)
+ end
+
+ return @rcstatement
+ end
end
## Module for extending the Block classes for hybrid Ruby-C simulation.
module RCSimBlock
@@ -668,10 +682,10 @@
# Create the block C object.
@rcstatement = RCSim.rcsim_make_block(self.mode)
# Sets the owner if any.
if owner then
- RCSim.rcsim_set_block_owner(@rcstatement,owner)
+ RCSim.rcsim_set_owner(@rcstatement,owner)
end
# Add the inner signals.
# self.each_inner do |inner|
# RCSim.rcsim_add_block_inner(@rcstatement,inner.to_rcsim(@rcstatement))