Module: HDLRuby::High::HStatement
- Included in:
- Case, Configure, Delay, If, Print, TimeRepeat, TimeTerminate, TimeWait, Transmit
- Defined in:
- lib/HDLRuby/hruby_high.rb
Overview
Module giving high-level statement properties
Instance Method Summary collapse
-
#hif(condition) ⇒ Object
Creates a new if statement with a +condition+ enclosing the statement.
Instance Method Details
#hif(condition) ⇒ Object
Creates a new if statement with a +condition+ enclosing the statement.
NOTE: the else part is defined through the helse method.
2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 |
# File 'lib/HDLRuby/hruby_high.rb', line 2509 def hif(condition) # # Creates the if statement. # return If.new(condition) { self } # Remove self from the current block. obj = self ::HDLRuby::High.cur_block.delete_statement!(obj) # Creates the if statement. stmnt = If.new(condition) { add_statement(obj) } # Add it to the current block. ::HDLRuby::High.cur_block.add_statement(stmnt) # Returns the result. return stmnt end |