Class: ClassHDL::HDLInitialBlock
- Inherits:
-
Object
- Object
- ClassHDL::HDLInitialBlock
- Defined in:
- lib/tdl/class_hdl/hdl_initial.rb
Instance Attribute Summary collapse
-
#opertor_chains ⇒ Object
Returns the value of attribute opertor_chains.
Instance Method Summary collapse
-
#initialize ⇒ HDLInitialBlock
constructor
A new instance of HDLInitialBlock.
- #instance(block_name = nil) ⇒ Object
Constructor Details
#initialize ⇒ HDLInitialBlock
Returns a new instance of HDLInitialBlock.
7 8 9 |
# File 'lib/tdl/class_hdl/hdl_initial.rb', line 7 def initialize @opertor_chains = [] end |
Instance Attribute Details
#opertor_chains ⇒ Object
Returns the value of attribute opertor_chains.
5 6 7 |
# File 'lib/tdl/class_hdl/hdl_initial.rb', line 5 def opertor_chains @opertor_chains end |
Instance Method Details
#instance(block_name = nil) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/tdl/class_hdl/hdl_initial.rb', line 11 def instance(block_name=nil) str = [] str.push "initial begin#{block_name ? ':'.concat(block_name.to_s) : ''}" opertor_chains.each do |op| unless op.is_a? OpertorChain str.push op.instance(:assign).gsub(/^./){ |m| " #{m}"} else unless op.slaver rel_str = ClassHDL.compact_op_ch(op.instance(:assign)) str.push " #{rel_str};" end end end str.push "end\n" str.join("\n") end |