Class: OrigenTesters::PatternCompilers::Job
- Inherits:
-
Object
- Object
- OrigenTesters::PatternCompilers::Job
- Defined in:
- lib/origen_testers/pattern_compilers/job.rb
Instance Attribute Summary collapse
-
#aiv2b_opts ⇒ Object
aiv2b options (Smartest-Based).
-
#avc_dir ⇒ Object
Pattern input dir (Smartest-Based).
-
#binl_dir ⇒ Object
Pattern output dir (Smartest-Based).
-
#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'.
-
#count ⇒ Object
Pattern count - should be 1 for IGXL; number of AVC files listed in AIV file for Smartest.
-
#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.
-
#pinconfig ⇒ Object
Pin Config file (Smartest-Based).
-
#pinmap_workbook ⇒ Object
Pinmap file (IGXL-Based).
-
#tmf ⇒ Object
tmf file (Smartest-Based).
-
#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
- #resolve_compiler_location ⇒ Object
Constructor Details
#initialize(pattern, options_with_args, options) ⇒ Job
Returns a new instance of Job.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 52 def initialize(pattern, , ) @pattern = pattern @tester = .delete(:tester) @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) @pinconfig = .delete(:pinconfig) @avc_dir = .delete(:avc_dir) @binl_dir = .delete(:binl_dir) @count = .delete(:count) || 1 @tmf = .delete(:tmf) @aiv2b_opts = .delete(:aiv2b_opts) @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
#aiv2b_opts ⇒ Object
aiv2b options (Smartest-Based)
41 42 43 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 41 def aiv2b_opts @aiv2b_opts end |
#avc_dir ⇒ Object
Pattern input dir (Smartest-Based)
29 30 31 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 29 def avc_dir @avc_dir end |
#binl_dir ⇒ Object
Pattern output dir (Smartest-Based)
32 33 34 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 32 def binl_dir @binl_dir end |
#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
50 51 52 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 50 def compiler @compiler end |
#compiler_options ⇒ Object
Compiler options where only the opt has to be passed as '-opt'
44 45 46 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 44 def @compiler_options end |
#compiler_options_with_args ⇒ Object
Compiler options where an opt and an arg have to be passed '-opt:arg'
47 48 49 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 47 def @compiler_options_with_args end |
#count ⇒ Object
Pattern count - should be 1 for IGXL; number of AVC files listed in AIV file for Smartest
35 36 37 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 35 def count @count 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 |
#pinconfig ⇒ Object
Pin Config file (Smartest-Based)
26 27 28 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 26 def pinconfig @pinconfig end |
#pinmap_workbook ⇒ Object
Pinmap file (IGXL-Based)
23 24 25 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 23 def pinmap_workbook @pinmap_workbook end |
#tmf ⇒ Object
tmf file (Smartest-Based)
38 39 40 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 38 def tmf @tmf 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
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 76 def cmd cmd = '' case @tester when :v93k cmd = "#{resolve_compiler_location} #{@pattern} " when :ultraflex, :j750 cmd = "#{resolve_compiler_location} -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} " } else fail 'Unsupported tester' end 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
72 73 74 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 72 def name @pattern.basename end |
#ready? ⇒ Boolean
105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 105 def ready? ready = true ready &= @output_directory.directory? ready &= @pattern.file? ready &= @pinmap_workbook.file? if @tester == :ultraflex || @tester == :j750 ready &= @pinconfig.file? if @tester == :v93k ready &= @tmf.file? if @tester == :v93k ready &= [true, false].include?(@clean) ready &= [:local, :lsf].include?(@location) ready end |
#resolve_compiler_location ⇒ Object
101 102 103 |
# File 'lib/origen_testers/pattern_compilers/job.rb', line 101 def resolve_compiler_location Pathname.new(@compiler).absolute? ? @compiler : eval('"' + @compiler + '"') end |