Class: HDLRuby::Low::TimeBlock
- Defined in:
- lib/HDLRuby/hruby_db.rb,
lib/HDLRuby/hruby_low.rb,
lib/HDLRuby/hruby_low2c.rb,
lib/HDLRuby/hruby_low2hdr.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_hdr(level = 0, header = true) ⇒ Object
Generates the text of the equivalent hdr text.
-
#to_high ⇒ Object
Creates a new high time block statement.
-
#unshift_statement(statement) ⇒ Object
Adds a +statement+ and the begining of the block.
-
#with_var(upper = nil) ⇒ Object
Converts to a variable-compatible block where +upper+ is the upper block if any.
Methods inherited from Block
#add_blocks_code, #add_inner, #add_make_block, #add_variable, #att_sharp, #att_signal, #blocks2seq!, #boolean_in_assign2select!, #break_concat_assigns!, #casts_without_expression!, #change_branch, #clone, #delete_inner!, #delete_related!, #delete_statement!, #do_flat, #each_block, #each_block_deep, #each_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, #par_in_seq2seq!, #reassign_expressions!, #refs_by_variables!, #repeat_to_verilog!, #replace_expressions!, #replace_names!, #replace_names_subs!, #replace_statement!, #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_seq!, #to_upper_space!, #to_verilog, #to_vhdl, #var2ref, #var_name2sym, #variable_name?, #variables
Methods included from ForceName
Methods inherited from Statement
#add_blocks_code, #add_make_block, #behavior, #block, #blocks2seq!, #break_types!, #clone, #delete_related!, #each_deep, #each_statement, #explicit_types!, #extract_declares!, #mix?, #par_in_seq2seq!, #parent_system, #replace_expressions!, #replace_names!, #scope, #to_c, #to_ch, #to_seq!, #to_upper_space!, #to_vhdl, #top_block, #top_scope, #use_name?, #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.
4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 |
# File 'lib/HDLRuby/hruby_low.rb', line 4450 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.
4476 4477 4478 4479 |
# File 'lib/HDLRuby/hruby_low.rb', line 4476 def eql?(obj) return false unless obj.is_a?(TimeBlock) return super(obj) end |
#hash ⇒ Object
Hash function.
4482 4483 4484 |
# File 'lib/HDLRuby/hruby_low.rb', line 4482 def hash return super end |
#to_hdr(level = 0, header = true) ⇒ Object
Generates the text of the equivalent hdr text. +level+ is the hierachical level of the object.
515 516 517 |
# File 'lib/HDLRuby/hruby_low2hdr.rb', line 515 def to_hdr(level = 0, header = true) super(level,header,true) end |
#to_high ⇒ Object
Creates a new high time block statement.
351 352 353 354 355 356 357 |
# File 'lib/HDLRuby/hruby_low2high.rb', line 351 def to_high # Create the new block statement. res = HDLRuby::High::TimeBlock.new(self.mode,self.name) # Add the statements. self.each_statement { |stmnt| res.add_statement(stmnt.to_high) } return res end |
#unshift_statement(statement) ⇒ Object
Adds a +statement+ and the begining of the block
NOTE: TimeWait is not supported unless for TimeBlock objects.
4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 |
# File 'lib/HDLRuby/hruby_low.rb', line 4464 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 |