lib/origen/application.rb in origen-0.4.0 vs lib/origen/application.rb in origen-0.4.1
- old
+ new
@@ -11,11 +11,10 @@
autoload :Environment, 'origen/application/environment'
autoload :PluginsManager, 'origen/application/plugins_manager'
autoload :Plugins, 'origen/application/plugins'
autoload :LSF, 'origen/application/lsf'
autoload :Runner, 'origen/application/runner'
- autoload :ConfigurationManager, 'origen/application/configuration_manager'
autoload :LSFManager, 'origen/application/lsf_manager'
autoload :Release, 'origen/application/release'
autoload :Deployer, 'origen/application/deployer'
autoload :VersionTracker, 'origen/application/version_tracker'
autoload :CommandDispatcher, 'origen/application/command_dispatcher'
@@ -466,25 +465,15 @@
def db
@db ||= Database::KeyValueStores.new(self)
end
- def session
+ def session(reload = false)
+ @session = nil if reload
@session ||= Database::KeyValueStores.new(self, persist: false)
end
- def pdm_component
- return @pdm_component if @pdm_component
- require "#{Origen.root}/config/pdm_component"
- begin
- @pdm_component = (eval "#{Origen.app.class}::PDMComponent").new
- rescue
- # Try legacy case where the namespace was just Application
- @pdm_component = ::Application::PDMComponent.new
- end
- end
-
def versions
version_tracker.versions
end
def release(options)
@@ -495,15 +484,10 @@
def statistics
runner.statistics
end
alias_method :stats, :statistics
- def configuration_manager
- @cm ||= ConfigurationManager.new
- end
- alias_method :cm, :configuration_manager
-
def pattern_iterators
@pattern_iterators ||= []
end
def callback_listeners
@@ -642,11 +626,11 @@
@target_load_options = options.merge({})
# Since this is a load it will re-instantiate any objects that the application
# declares here, the objects registered with origen should be refreshed accordingly
clear_dynamic_resources
load_event(:transient) do
- Origen.config.mode = :production # Important since a production target may rely on the default
+ Origen.mode = Origen.app.session.origen_core[:mode] || :production # Important since a production target may rely on the default
begin
$_target_options = @target_load_options
Origen.target.set_signature(@target_load_options)
$dut = nil
load environment.file if environment.file
@@ -657,10 +641,10 @@
end
ensure
$_target_options = nil
end
@target_instantiated = true
- Origen.config.mode = :debug if options[:force_debug]
+ Origen.mode = :debug if options[:force_debug]
listeners_for(:on_create).each(&:on_create)
# Keep this within the load_event to ensure any objects that are further instantiated objects
# will be associated with (and cleared out upon reload of) the current target
listeners_for(:on_load_target).each(&:on_load_target)
end