Class: HDLRuby::Low::TimeTerminate
- Defined in:
- lib/HDLRuby/hruby_low.rb,
lib/HDLRuby/hruby_low2c.rb,
lib/HDLRuby/hruby_low2vhd.rb,
lib/HDLRuby/hruby_verilog.rb,
lib/HDLRuby/hruby_low_fix_types.rb,
lib/HDLRuby/hruby_low_bool2select.rb,
lib/HDLRuby/hruby_low_without_select.rb,
lib/HDLRuby/hruby_low_without_subsignals.rb
Overview
Describes a timed terminate statement: not synthesizable!
Direct Known Subclasses
Constant Summary
Constants included from Low2Symbol
Low2Symbol::Low2SymbolPrefix, Low2Symbol::Low2SymbolTable, Low2Symbol::Symbol2LowTable
Instance Attribute Summary
Attributes included from Hparent
Instance Method Summary collapse
-
#boolean_in_assign2select! ⇒ Object
Converts booleans in assignments to select operators.
-
#clone ⇒ Object
Clones the TimeRepeat (deeply).
-
#each_block_deep(&ruby_block) ⇒ Object
Iterates over all the blocks contained in the current block.
-
#each_deep(&ruby_block) ⇒ Object
Iterates over each object deeply.
-
#each_node(&ruby_block) ⇒ Object
Iterates over all the nodes.
-
#each_node_deep(&ruby_block) ⇒ Object
Iterates over all the nodes deeply.
-
#each_statement_deep(&ruby_block) ⇒ Object
Iterates over all the statements deeply.
-
#eql?(obj) ⇒ Boolean
Comparison for hash: structural comparison.
-
#explicit_types! ⇒ Object
Explicit the types conversions in the statement.
-
#extract_selects! ⇒ Object
Extract the Select expressions.
-
#hash ⇒ Object
Hash function.
-
#initialize ⇒ TimeTerminate
constructor
Creates a new timed terminate statement that terminate execution.
-
#signal2subs! ⇒ Object
Decompose the hierarchical signals in the statements.
-
#to_c(res, level = 0) ⇒ Object
Generates the C text of the equivalent HDLRuby code.
-
#to_verilog(spc = 3) ⇒ Object
Converts the terminate to Verilog code.
-
#to_vhdl(vars, level = 0) ⇒ Object
Generates the text of the equivalent HDLRuby::High code.
Methods inherited from Statement
#add_blocks_code, #add_make_block, #behavior, #block, #blocks2seq!, #break_types!, #delete_related!, #delete_unless!, #each_statement, #extract_declares!, #mix?, #par_in_seq2seq!, #parent_system, #replace_expressions!, #replace_names!, #scope, #to_ch, #to_hdr, #to_high, #to_seq!, #to_upper_space!, #top_block, #top_scope, #use_name?, #with_boolean!
Methods included from Low2Symbol
Methods included from Hparent
#hierarchy, #no_parent!, #scope
Constructor Details
#initialize ⇒ TimeTerminate
Creates a new timed terminate statement that terminate execution.
4334 4335 4336 |
# File 'lib/HDLRuby/hruby_low.rb', line 4334 def initialize super() end |
Instance Method Details
#boolean_in_assign2select! ⇒ Object
Converts booleans in assignments to select operators.
84 85 86 87 |
# File 'lib/HDLRuby/hruby_low_bool2select.rb', line 84 def boolean_in_assign2select! # Nothing to do. return self end |
#clone ⇒ Object
Clones the TimeRepeat (deeply)
4397 4398 4399 |
# File 'lib/HDLRuby/hruby_low.rb', line 4397 def clone return TimeTerminate.new end |
#each_block_deep(&ruby_block) ⇒ Object
Iterates over all the blocks contained in the current block.
4378 4379 4380 4381 4382 4383 |
# File 'lib/HDLRuby/hruby_low.rb', line 4378 def each_block_deep(&ruby_block) # No ruby block? Return an enumerator. return to_enum(:each_block_deep) unless ruby_block # A ruby block? # Nothing to do anyway. end |
#each_deep(&ruby_block) ⇒ Object
Iterates over each object deeply.
Returns an enumerator if no ruby block is given.
4341 4342 4343 4344 4345 4346 4347 |
# File 'lib/HDLRuby/hruby_low.rb', line 4341 def each_deep(&ruby_block) # No ruby block? Return an enumerator. return to_enum(:each_deep) unless ruby_block # A ruby block? First apply it to current. ruby_block.call(self) # And that's all. end |
#each_node(&ruby_block) ⇒ Object
Iterates over all the nodes.
4350 4351 4352 4353 4354 4355 |
# File 'lib/HDLRuby/hruby_low.rb', line 4350 def each_node(&ruby_block) # No ruby block? Return an enumerator. return to_enum(:each_node) unless ruby_block # A ruby block? # Nothing to do anyway. end |
#each_node_deep(&ruby_block) ⇒ Object
Iterates over all the nodes deeply.
4358 4359 4360 4361 4362 4363 4364 4365 |
# File 'lib/HDLRuby/hruby_low.rb', line 4358 def each_node_deep(&ruby_block) # No ruby block? Return an enumerator. return to_enum(:each_node_deep) unless ruby_block # A ruby block? # Apply of current node. ruby_block.call(self) # And that's all. end |
#each_statement_deep(&ruby_block) ⇒ Object
Iterates over all the statements deeply.
4368 4369 4370 4371 4372 4373 4374 4375 |
# File 'lib/HDLRuby/hruby_low.rb', line 4368 def each_statement_deep(&ruby_block) # No ruby block? Return an enumerator. return to_enum(:each_statement_deep) unless ruby_block # A ruby block? # Apply of current node. ruby_block.call(self) # And that's all. end |
#eql?(obj) ⇒ Boolean
Comparison for hash: structural comparison.
4386 4387 4388 4389 |
# File 'lib/HDLRuby/hruby_low.rb', line 4386 def eql?(obj) return false unless obj.is_a?(TimeTerminate) return true end |
#explicit_types! ⇒ Object
Explicit the types conversions in the statement.
126 127 128 129 |
# File 'lib/HDLRuby/hruby_low_fix_types.rb', line 126 def explicit_types! # Nothing to do. return self end |
#extract_selects! ⇒ Object
Extract the Select expressions.
192 193 194 195 |
# File 'lib/HDLRuby/hruby_low_without_select.rb', line 192 def extract_selects! # Nothing to extract. return [] end |
#hash ⇒ Object
Hash function.
4392 4393 4394 |
# File 'lib/HDLRuby/hruby_low.rb', line 4392 def hash return TimeTerminate.hash end |
#signal2subs! ⇒ Object
Decompose the hierarchical signals in the statements.
150 151 152 153 |
# File 'lib/HDLRuby/hruby_low_without_subsignals.rb', line 150 def signal2subs! # Nothing to do. return self end |
#to_c(res, level = 0) ⇒ Object
Generates the C text of the equivalent HDLRuby code. +level+ is the hierachical level of the object.
1547 1548 1549 1550 |
# File 'lib/HDLRuby/hruby_low2c.rb', line 1547 def to_c(res,level = 0) # Save the value pool state. res << (" " * (level*3)) << "terminate();\n" end |
#to_verilog(spc = 3) ⇒ Object
Converts the terminate to Verilog code.
194 195 196 |
# File 'lib/HDLRuby/hruby_verilog.rb', line 194 def to_verilog(spc = 3) return "#{" " * spc}$finish;" end |
#to_vhdl(vars, level = 0) ⇒ Object
Generates the text of the equivalent HDLRuby::High code. +vars+ is the list of the variables and +level+ is the hierachical level of the object.
948 949 950 951 |
# File 'lib/HDLRuby/hruby_low2vhd.rb', line 948 def to_vhdl(vars,level = 0) # Generate a report statement. return " " * (level*3) + "finish;\n" end |