Class: OrigenTesters::PatternCompilers::Job
- Inherits:
-
Object
- Object
- OrigenTesters::PatternCompilers::Job
- Defined in:
- lib/origen_testers/pattern_compilers/job.rb
Instance Attribute Summary collapse
-
#clean ⇒ Object
Controls whether the compiler log files are kept: true/false.
-
#compiler ⇒ Object
readonly
linux compiler full path.
-
#compiler_options ⇒ Object
Compiler options where only the opt has to be passed as ‘-opt’.
-
#compiler_options_with_args ⇒ Object
Compiler options where an opt and an arg have to be passed ‘-opt:arg’.
-
#id ⇒ Object
Type of pattern as designated by the LinuxPatternCompiler.
-
#location ⇒ Object
Where the job is to be executed, either locally (‘local’) or on Linux Server Farm (‘lsf’).
-
#output_directory ⇒ Object
Output directory for the .PAT file.
-
#pattern ⇒ Object
Pattern to be compiled, is Pathname class.
-
#pinmap_workbook ⇒ Object
Pinmap file.
-
#verbose ⇒ Object
Controls whether the compiler STDOUT is displayed.
Instance Method Summary collapse
- #cmd ⇒ Object
-
#initialize(pattern, options_with_args, options) ⇒ Job
constructor
A new instance of Job.
- #name ⇒ Object
- #ready? ⇒ Boolean
Constructor Details
#initialize(pattern, options_with_args, options) ⇒ Job
Returns a new instance of Job.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 34 def initialize(pattern, , ) @pattern = pattern @compiler = .delete(:compiler) @id = .delete(:id) @location = .delete(:location) @clean = .delete(:clean) @verbose = .delete(:verbose) @output_directory = .delete(:output_directory) @pinmap_workbook = .delete(:pinmap_workbook) @compiler_options_with_args = .delete_if { |k, v| v.nil? } # Whatever's left has to be valid compiler options @compiler_options = .delete_if { |k, v| v == false } end |
Instance Attribute Details
#clean ⇒ Object
Controls whether the compiler log files are kept: true/false
14 15 16 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 14 def clean @clean end |
#compiler ⇒ Object (readonly)
linux compiler full path
32 33 34 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 32 def compiler @compiler end |
#compiler_options ⇒ Object
Compiler options where only the opt has to be passed as ‘-opt’
26 27 28 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 26 def @compiler_options end |
#compiler_options_with_args ⇒ Object
Compiler options where an opt and an arg have to be passed ‘-opt:arg’
29 30 31 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 29 def @compiler_options_with_args end |
#id ⇒ Object
Type of pattern as designated by the LinuxPatternCompiler
8 9 10 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 8 def id @id end |
#location ⇒ Object
Where the job is to be executed, either locally (‘local’) or on Linux Server Farm (‘lsf’)
11 12 13 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 11 def location @location end |
#output_directory ⇒ Object
Output directory for the .PAT file
20 21 22 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 20 def output_directory @output_directory end |
#pattern ⇒ Object
Pattern to be compiled, is Pathname class. Will use full path
5 6 7 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 5 def pattern @pattern end |
#pinmap_workbook ⇒ Object
Pinmap file
23 24 25 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 23 def pinmap_workbook @pinmap_workbook end |
#verbose ⇒ Object
Controls whether the compiler STDOUT is displayed
17 18 19 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 17 def verbose @verbose end |
Instance Method Details
#cmd ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 51 def cmd cmd = '' cmd = "#{@compiler} -pinmap_workbook:#{@pinmap_workbook} -output:#{@output_directory}/#{@pattern.basename.to_s.split('.').first}.PAT #{@pattern} " # add in any remaining compiler options .each_key { |k| cmd += "-#{k} " } .each_pair { |k, v| cmd += "-#{k}:#{v} " } if @verbose cmd += ';' else cmd += '2>&1 > /dev/null;' end # If the job is to be run on the LSF add in the clean .log and mv the files if necessary if @location == 'lsf' cmd += clean_lsf if @clean == true end cmd end |
#name ⇒ Object
47 48 49 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 47 def name @pattern.basename end |
#ready? ⇒ Boolean
69 70 71 72 73 74 75 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 69 def ready? ready = true ready && @output_directory.directory? && @pattern.file? && @pinmap_workbook.file? && [true, false].include?(@clean) && [:local, :lsf].include?(@location) end |