Class: HDLRuby::Low::TimeBlock

Inherits:
Block show all
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_mutable.rb,
lib/HDLRuby/hruby_low_skeleton.rb

Overview

Describes a timed block.

NOTE:

  • this is the only kind of block that can include time statements.
  • this kind of block is not synthesizable!

Direct Known Subclasses

High::TimeBlock

Constant Summary

Constants included from Low2Symbol

Low2Symbol::Low2SymbolPrefix, Low2Symbol::Low2SymbolTable, Low2Symbol::Symbol2LowTable

Instance Attribute Summary

Attributes inherited from Block

#mode, #name

Attributes included from Hparent

#parent

Instance Method Summary collapse

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!, #delete_unless!, #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, #with_var

Methods included from ForceName

#extend_name!, #force_name!

Methods inherited from Statement

#add_blocks_code, #block, #blocks2seq!, #break_types!, #clone, #delete_unless!, #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

#to_sym

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.



3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
# File 'lib/HDLRuby/hruby_low.rb', line 3605

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

#eql?(obj) ⇒ Boolean

Comparison for hash: structural comparison.

Returns:

  • (Boolean)


3617
3618
3619
3620
# File 'lib/HDLRuby/hruby_low.rb', line 3617

def eql?(obj)
    return false unless obj.is_a?(TimeBlock)
    return super(obj)
end

#hashObject

Hash function.



3623
3624
3625
# File 'lib/HDLRuby/hruby_low.rb', line 3623

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