Class: HDLRuby::Low::TimeBlock
- Defined in:
- lib/HDLRuby/hruby_db.rb,
lib/HDLRuby/hruby_low.rb,
lib/HDLRuby/hruby_low2c.rb,
lib/HDLRuby/hruby_low2vhd.rb,
lib/HDLRuby/hruby_low2high.rb,
lib/HDLRuby/hruby_low_cleanup.rb,
lib/HDLRuby/hruby_low_mutable.rb,
lib/HDLRuby/hruby_low_skeleton.rb,
lib/HDLRuby/hruby_low_with_var.rb
Overview
Extends the TimeBlock class with separation between signals and variables.
Direct Known Subclasses
Constant Summary
Constants included from Low2Symbol
Low2Symbol::Low2SymbolPrefix, Low2Symbol::Low2SymbolTable, Low2Symbol::Symbol2LowTable
Instance Attribute Summary
Attributes inherited from Block
Attributes included from Hparent
Instance Method Summary collapse
-
#add_statement(statement) ⇒ Object
Adds a
statement. -
#delete_unless!(keep) ⇒ Object
Removes the signals and corresponding assignments whose name is not in
keep. -
#eql?(obj) ⇒ Boolean
Comparison for hash: structural comparison.
-
#hash ⇒ Object
Hash function.
-
#to_high(level = 0, header = true) ⇒ Object
Generates the text of the equivalent HDLRuby::High code.
-
#unshift_statement(statement) ⇒ Object
Adds a
statementand the begining of the block. -
#with_var(upper = nil) ⇒ Object
Converts to a variable-compatible block where
upperis the upper block if any.
Methods inherited from Block
#add_blocks_code, #add_inner, #add_variable, #att_sharp, #att_signal, #blocks2seq!, #boolean_in_assign2select!, #break_concat_assigns!, #change_branch, #clone, #delete_inner!, #delete_statement!, #do_flat, #each_block, #each_block_deep, #each_inner, #each_node_deep, #each_signal_deep, #each_statement, #each_statement_deep, #explicit_types!, #extract_declares!, #extract_from_externals!, #flatten, #get_by_name, #get_inner, #get_variable, #initialize, #insert_statement!, #last_statement, #map_inners!, #map_statements!, #mix?, #num_statements, #reassign_expressions!, #refs_by_variables!, #replace_expressions!, #replace_names!, #replace_names_subs!, #res_name, #reverse_each_statement, #search_refname, #select2case!, #set_mode!, #set_name!, #set_statement!, #sym2var_name, #to_c, #to_c_code, #to_ch, #to_conversion, #to_upper_space!, #to_verilog, #to_vhdl, #var2ref, #var_name2sym, #variable_name?, #variables
Methods included from ForceName
Methods inherited from Statement
#add_blocks_code, #block, #blocks2seq!, #break_types!, #clone, #explicit_types!, #extract_declares!, #mix?, #replace_expressions!, #replace_names!, #to_c, #to_upper_space!, #to_vhdl, #top_block, #top_scope, #with_boolean!
Methods included from Low2Symbol
Methods included from Hparent
Constructor Details
This class inherits a constructor from HDLRuby::Low::Block
Instance Method Details
#add_statement(statement) ⇒ Object
Adds a statement.
NOTE: TimeBlock is supported.
3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 |
# File 'lib/HDLRuby/hruby_low.rb', line 3643 def add_statement(statement) unless statement.is_a?(Statement) then raise AnyError, "Invalid class for a statement: #{statement.class}" end @statements << statement # And set its parent. statement.parent = self statement end |
#delete_unless!(keep) ⇒ Object
Removes the signals and corresponding assignments whose name is not
in keep.
198 199 200 |
# File 'lib/HDLRuby/hruby_low_cleanup.rb', line 198 def delete_unless!(keep) # Nothing to cleanup. end |
#eql?(obj) ⇒ Boolean
Comparison for hash: structural comparison.
3669 3670 3671 3672 |
# File 'lib/HDLRuby/hruby_low.rb', line 3669 def eql?(obj) return false unless obj.is_a?(TimeBlock) return super(obj) end |
#hash ⇒ Object
Hash function.
3675 3676 3677 |
# File 'lib/HDLRuby/hruby_low.rb', line 3675 def hash return super end |
#to_high(level = 0, header = true) ⇒ Object
Generates the text of the equivalent HDLRuby::High code.
level is the hierachical level of the object.
515 516 517 |
# File 'lib/HDLRuby/hruby_low2high.rb', line 515 def to_high(level = 0, header = true) super(level,header,true) end |
#unshift_statement(statement) ⇒ Object
Adds a statement and the begining of the block
NOTE: TimeWait is not supported unless for TimeBlock objects.
3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 |
# File 'lib/HDLRuby/hruby_low.rb', line 3657 def unshift_statement(statement) unless statement.is_a?(Statement) then raise AnyError, "Invalid class for a statement: #{statement.class}" end @statements.unshift(statement) # And set its parent. statement.parent = self statement end |
#with_var(upper = nil) ⇒ Object
Converts to a variable-compatible block where upper is
the upper block if any.
NOTE: the result is a new block.
257 258 259 260 261 |
# File 'lib/HDLRuby/hruby_low_with_var.rb', line 257 def with_var(upper = nil) # For the specific case of block, the conversion is not # done. return self end |