Module: HDLRuby::High::HScope_missing

Includes:
Hmissing
Included in:
HBlock, Scope, Std::DecoderT, Std::FsmT, Std::PipelineT
Defined in:
lib/HDLRuby/hruby_high.rb

Constant Summary

Constants included from Hmissing

HDLRuby::High::Hmissing::High, HDLRuby::High::Hmissing::NAMES

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &ruby_block) ⇒ Object

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.



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/HDLRuby/hruby_high.rb', line 193

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

Instance Method Details

#h_missingObject



187
# File 'lib/HDLRuby/hruby_high.rb', line 187

alias_method :h_missing, :method_missing