Method: VerilogTools.name_to_HDLRuby

Defined in:
lib/HDLRuby/verilog_hruby.rb

.name_to_HDLRuby(name) ⇒ Object

Converts a Verilog HDL name to a HDLRuby one.



109
110
111
112
113
114
115
116
117
118
# File 'lib/HDLRuby/verilog_hruby.rb', line 109

def self.name_to_HDLRuby(name)
  if name[0] =~ /[_$A-Z]/ then
    # HDLRuby names cannot start with a $ or a capital letter.
    # To fix that add an "_", but then to avoid confusion, also
    # convert starting "_" to "__" if any.
    return "_" + name
  else
    return name
  end
end