class Integer

Public Instance Methods

A() click to toggle source

define_method(“”)

# File lib/tdl/class_hdl/hdl_data.rb, line 17
def A
    if self.zero?
        return "'0".to_nq
    else 
        return "~('0)".to_nq
    end
end
clog2() click to toggle source
# File lib/tdl/basefunc.rb, line 264
def clog2
    b = Math.log2(self)
    c = b.ceil
    return c
end
method_missing(method,arg=nil) click to toggle source
Calls superclass method
# File lib/tdl/class_hdl/hdl_data.rb, line 3
def method_missing(method,arg=nil)
    if method.to_s =~ /^s?[h|d]\d+$/i || method.to_s =~ /^s?[b](0|1|_)+$/i || method.to_s =~ /^s?[h][\d]?[\d|a-f]+$/i
        if self.nonzero?
            return "#{self.to_s}'#{method}".to_nq
        else 
            return "'#{method}".to_nq
        end 
    end

    super

end
real_data() click to toggle source
# File lib/tdl/axi4/axi4_interconnect_verb.rb, line 11
def real_data
    self
end
to_hf(hf="32'd") click to toggle source
# File lib/tdl/basefunc.rb, line 111
def to_hf(hf="32'd")
    case hf 
    when /d/i
        rel = self.to_s 
    when /h/i
        rel = self.to_s 16
    when /b/i
        rel = self.to_s 2
    else 
        raise TdlError.new("Iteger TO HDL FORMAT ERROR [#{hf}]")
    end

    "#{hf}#{rel}".to_nq
end