Sha256: eb693c5a8c50df744c2ada05ad559df53dc8643409a5e6b17f8be41b3eedde9a

Contents?: true

Size: 1.41 KB

Versions: 21

Compression:

Stored size: 1.41 KB

Contents

require 'optparse'
require 'origen/commands/helpers'

options = {}

# App options are options that the application can supply to extend this command
app_options = @application_options || []
opt_parser = OptionParser.new do |opts|
  opts.banner = <<-EOT
Checkout the simulation object for the current or given environment/target.

Note that this will force a new checkout and will overwrite whatever is in your workspace.

Usage: origen sim:co [options]
  EOT
  opts.on('-e', '--environment NAME', String, 'Override the default environment, NAME can be a full path or a fragment of an environment file name') { |e| options[:environment] = e }
  opts.on('-t', '--target NAME', String, 'Override the default target, NAME can be a full path or a fragment of a target file name') { |t| options[:target] = t }
  opts.on('-d', '--debugger', 'Enable the debugger') {  options[:debugger] = true }
  # Apply any application option extensions to the OptionParser
  opts.separator ''
  opts.on('-h', '--help', 'Show this message') { puts opts; exit }
end

opt_parser.parse! ARGV

Origen.environment.temporary = options[:environment] if options[:environment]
Origen.target.temporary = options[:target] if options[:target]
Origen.load_target

unless tester.sim?
  Origen.log.error 'To run the sim:co command your target/environment must instantiate an OrigenSim::Tester'
  exit 1
end

options[:force] = true
tester.simulator.fetch_simulation_objects(options)

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
origen_sim-0.20.7 lib/origen_sim/commands/co.rb
origen_sim-0.20.6 lib/origen_sim/commands/co.rb
origen_sim-0.20.5 lib/origen_sim/commands/co.rb
origen_sim-0.20.4 lib/origen_sim/commands/co.rb
origen_sim-0.20.3 lib/origen_sim/commands/co.rb
origen_sim-0.20.2 lib/origen_sim/commands/co.rb
origen_sim-0.20.1 lib/origen_sim/commands/co.rb
origen_sim-0.20.0 lib/origen_sim/commands/co.rb
origen_sim-0.16.1 lib/origen_sim/commands/co.rb
origen_sim-0.16.0 lib/origen_sim/commands/co.rb
origen_sim-0.15.0 lib/origen_sim/commands/co.rb
origen_sim-0.14.0 lib/origen_sim/commands/co.rb
origen_sim-0.13.0 lib/origen_sim/commands/co.rb
origen_sim-0.12.0 lib/origen_sim/commands/co.rb
origen_sim-0.11.1 lib/origen_sim/commands/co.rb
origen_sim-0.11.0 lib/origen_sim/commands/co.rb
origen_sim-0.10.0 lib/origen_sim/commands/co.rb
origen_sim-0.9.0 lib/origen_sim/commands/co.rb
origen_sim-0.8.0 lib/origen_sim/commands/co.rb
origen_sim-0.7.0 lib/origen_sim/commands/co.rb