Class: OrigenSim::Artifacts::Artifacts

Inherits:
Object
  • Object
show all
Includes:
Origen::Componentable
Defined in:
lib/origen_sim/simulator/artifacts.rb

Constant Summary collapse

COMPONENTABLE_ADDS_ACCESSORS =

Disable accessors on the simulator. Artifact retrieval must use simulator.artifact

false
COMPONENTABLE_SINGLETON_NAME =

Clean up the names a bit. Componentable assumes the class name is the singleton name, but we’re doing the opposite here.

'artifact'
COMPONENTABLE_PLURAL_NAME =
'artifacts'

Instance Method Summary collapse

Constructor Details

#initializeArtifacts

Returns a new instance of Artifacts.



13
14
15
16
# File 'lib/origen_sim/simulator/artifacts.rb', line 13

def initialize
  # Don't need the full extent of Origen::Mdoel, so we'll just init the includer class directly.
  Origen::Componentable.init_includer_class(self)
end

Instance Method Details

#add(name, options = {}, &block) ⇒ Object

Force the class to be an OrigenSim::Artifacts::Artifact



19
20
21
22
23
24
25
26
27
28
# File 'lib/origen_sim/simulator/artifacts.rb', line 19

def add(name, options = {}, &block)
  instances = _split_by_instances(name, options, &block)
  return_instances = []
  instances.each do |n, opts|
    opts[:class_name] = OrigenSim::Artifacts::Artifact
    return_instances << _add(n, opts)
  end

  return_instances.size == 1 ? return_instances.first : return_instances
end

#cleanObject



39
40
41
42
43
44
45
# File 'lib/origen_sim/simulator/artifacts.rb', line 39

def clean
  artifacts.each do |name, artifact|
    Origen.log.info "Cleaning artifact: #{artifact.run_target}"
    artifact.clean
  end
  true
end

#populateObject



30
31
32
33
34
35
36
37
# File 'lib/origen_sim/simulator/artifacts.rb', line 30

def populate
  artifacts.each do |name, artifact|
    Origen.log.info "Populating artifact: #{artifact.target}"
    Origen.log.info "                 to: #{artifact.run_target}"
    artifact.populate
  end
  true
end