module Origen::Location::Map::ClassMethods
Public Instance Methods
Source
# File lib/origen/location/map.rb, line 46 def constructed @constructed ||= {} end
A hash of constructed location objects, i.e. an entry will be cached here the first time a location is referenced outside of its initial definition, after that it will be served directly from here.
Source
# File lib/origen/location/map.rb, line 16 def constructor(&block) if defining? constructors[@x] = block else constructors[:default] = block end end
Source
# File lib/origen/location/map.rb, line 32 def constructors @constructors ||= {} end
Source
# File lib/origen/location/map.rb, line 36 def default_attributes @default_attributes ||= {} end
Source
# File lib/origen/location/map.rb, line 24 def default_constructor(attributes, defaults) Origen::Location::Base.new(defaults.merge(attributes)) end
Source
# File lib/origen/location/map.rb, line 8 def define_locations(defaults = {}) @x = @x ? (@x + 1) : 0 # Provides a unique ID for each define_locations block default_attributes[@x] = defaults @defining = true yield @defining = false end
Source
# File lib/origen/location/map.rb, line 28 def definitions @definitions ||= {} end
Source
# File lib/origen/location/map.rb, line 53 def method_missing(method, *args, &block) if defining? if definitions[method] warning "Redefinition of map location: #{method}" end definitions[method] = { attributes: args.first, x: @x } else super end end
Provides accessors for all named locations, for example:
$dut.nvm.fmu.ifr_map.probe1_pass
Calls superclass method