Class: HDLRuby::Low::SignalC

Inherits:
SignalI
  • Object
show all
Defined in:
lib/HDLRuby/hruby_low.rb,
lib/HDLRuby/hruby_low2high.rb

Overview

Add the conversion to high.

Direct Known Subclasses

High::SignalC

Constant Summary

Constants included from Low2Symbol

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

Instance Attribute Summary

Attributes inherited from SignalI

#name, #type, #value

Attributes included from Hparent

#parent

Instance Method Summary collapse

Methods inherited from SignalI

#clone, #each_deep, #explicit_types!, #initialize, #replace_names!, #set_name!, #set_type!, #set_value!, #to_c, #to_c_alias, #to_c_signal, #to_ch, #to_hdr, #to_verilog, #to_vhdl, #width

Methods included from Low2Symbol

#to_sym

Methods included from Hparent

#hierarchy, #no_parent!, #scope

Constructor Details

This class inherits a constructor from HDLRuby::Low::SignalI

Instance Method Details

#immutable?Boolean

Tells if the signal is immutable (cannot be written.)

Returns:

  • (Boolean)


2565
2566
2567
2568
# File 'lib/HDLRuby/hruby_low.rb', line 2565

def immutable?
    # Constant signals are immutable.
    true
end

#to_highObject

Creates a new high constant signal.



182
183
184
185
186
187
188
189
190
191
192
# File 'lib/HDLRuby/hruby_low2high.rb', line 182

def to_high
    # Is there an initial value?
    if (self.value) then
        # Yes, create a new high signal with it.
        return HDLRuby::High::SignalC.new(self.name,self.type.to_high,
                                      self.val.to_high)
    else
        # No, create a new high signal with it.
        return HDLRuby::High::SignalC.new(self.name,self.type.to_high)
    end
end