module OrigenTesters module PatternCompilers class UltraFlexPatternCompiler require 'pathname' require_relative 'assembler' require_relative 'job' # Linux compiler executable path LINUX_PATTERN_COMPILER = "#{Origen.root!}/bin/latest/bin/atpcompiler" # LINUX_PATTERN_COMPILER = "#{Origen.root!}/bin/latest/bin/atpcompiler" # Windows compiler executable path WINDOWS_PATTERN_COMPILER = "#{ENV['IGXLROOT']}/bin/apc.exe" # Linux compiler preamble ATPC_SETUP = "#{Origen.root!}/bin/latest/etc/atpcrc.csh" # ID will allow users to set default configurations for the compiler for unique pattern types attr_accessor :id # Compiler commands array attr_accessor :jobs def initialize(id, options = {}) @id = id @id = @id.to_sym @user_options = { path: nil, # required: will be passed in or parsed from a .list file reference_directory: nil, # optional: will be set to @path or Origen.app.config.pattern_output_directory target: nil, # optional: allows user to temporarily set target and run compilation recursive: false # optional: controls whether to look for patterns in a directory recursively } @job_options = { compiler: running_on_windows? ? WINDOWS_PATTERN_COMPILER : LINUX_PATTERN_COMPILER, # required id: @id, # required pinmap_workbook: $dut.pinmap, # required: will default to $dut.pinmap location: :local, # optional: controls whether the commands go to the LSF or run locally clean: false, # optional: controls whether compiler log files are deleted after compilation output_directory: nil, # optional: verbose: false # optional: controls whether the compiler output gets put to STDOUT } @compiler_options = { # Set all of these compiler options that don't have args to true/flase. if true then send compiler '-opt' import_all_undefineds: false, # automatically import all undefined symbols. the key is mis-spelled but correct! cpp: false, # runs C++ preprocessor on pattern file comments: false, # saves comments in binary file for tools visibility. pass '-comments' if set to true # pass nothing if set to false nocompress: false, # do not compress pattern data blocks suppress_log: false, # disables output to main log file multiinst: false, # indicates more than one instrument is connected to a single pin lock: false, # prevents pattern from being reverse compiled or opened in PatternTool stdin: false, # Compile data from standard input. Do not use -cpp or specify any pattern file(s) when using this option. debug: false, # generate intermediate file(s) to simplify debug ( application dependent ) template: false, # generate setup template timestamp: false, # enable log timestamp } @compiler_options_with_args = { output: nil, # Output filename, compiler defaults to .PAT pinmap_sheet: nil, # digital_inst: nil, # 'HSD4G', 'HSDM', or 'HSDMQ' opcode_mode: nil, # HSDM mode: 'single' | 'dual'. HSDMQ mode: 'single' | 'dual' | 'quad' pat_version: nil, # version of pattern file to compile scan_type: nil, # type of scan data max_errors: nil, # , defaults to 200 on compiler side, valu eof 0 will never abort compilation logfile: nil, # , directs any compiler messages to . will default to output directory if nil define: nil, # defines values of macros passed to C++ preprocessor. # can only be defined once per pattern with space delimited list includes: nil, # include paths to be passed to C- preprocessor. post_processor: nil, # customer's post-process executable. # need to pass 'post-processor' to compiler post_processor_args: nil, # customer's post-process executable arguments # need to pass 'post-processor_args' to compiler cdl_cache: nil, # 'yes' | 'no', turns on/off CDL caching, default on compiler side is 'yes' init_pattern: nil, # , uses the specified pattern module/file/set as an init patterns check_set_msb: nil, # 'yes' | 'no', turns on/off check the 'set' or 'set_infinite' opcode # is preceded by a 'set_msb' or 'set_msb_infinite' opcode. compiler default is 'yes' time_domain: nil, #