module HDLRuby::High::HScope_missing

Public Instance Methods

h_missing(m, *args, &ruby_block)
Alias for: method_missing
method_missing(m, *args, &ruby_block) click to toggle source

Missing methods are looked for in the private namespace.

NOTE: it is ok to use the private namespace because the scope can only be accessed if it is available from its systemT.

# File lib/HDLRuby/hruby_high.rb, line 177
def method_missing(m, *args, &ruby_block)
    # puts "looking for #{m} in #{self}"
    # Is the scope currently opened?
    # if High.space_top.user_deep?(self) then
    if High.space_index(self.namespace) then
        # Yes, use the stack of namespaces.
        h_missing(m,*args,&ruby_block)
    else
        # No, look into the current namespace and return a reference
        # to the result if it is a referable hardware object.
        res = self.namespace.send(m,*args,&ruby_block)
        if res.respond_to?(:to_ref) then
            # This is a referable object, build the reference from
            # the namespace.
            return RefObject.new(self.to_ref,res)
        end
    end
end
Also aliased as: h_missing