Class: OrigenTesters::SmartestBasedTester::Base::VariablesFile

Inherits:
Object
  • Object
show all
Includes:
Generator
Defined in:
lib/origen_testers/smartest_based_tester/base/variables_file.rb

Direct Known Subclasses

V93K::VariablesFile

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Generator

#close, #collection, #collection=, #compiler, #current_dir, #dont_diff=, execute_source, #file_extension, #file_pipeline, #finalize, #identity_map, #import, #inhibit_output, #name, #on_close, original_reference_file, original_reference_file=, #output_file, #output_inhibited?, #platform, #reference_file, #render, #set_flow_description, #stats, #write_from_template, #write_to_file

Constructor Details

#initialize(options = {}) ⇒ VariablesFile

Returns a new instance of VariablesFile.



11
12
# File 'lib/origen_testers/smartest_based_tester/base/variables_file.rb', line 11

def initialize(options = {})
end

Instance Attribute Details

#filenameObject

Returns the value of attribute filename.



9
10
11
# File 'lib/origen_testers/smartest_based_tester/base/variables_file.rb', line 9

def filename
  @filename
end

#idObject

Returns the value of attribute id.



9
10
11
# File 'lib/origen_testers/smartest_based_tester/base/variables_file.rb', line 9

def id
  @id
end

#subdirectoryObject

Returns the value of attribute subdirectory.



9
10
11
# File 'lib/origen_testers/smartest_based_tester/base/variables_file.rb', line 9

def subdirectory
  @subdirectory
end

#variablesObject (readonly)

Returns the value of attribute variables.



8
9
10
# File 'lib/origen_testers/smartest_based_tester/base/variables_file.rb', line 8

def variables
  @variables
end

Instance Method Details

#add_variables(vars) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/origen_testers/smartest_based_tester/base/variables_file.rb', line 18

def add_variables(vars)
  if @variables
    vars.each do |k, v|
      if k == :empty?
        @variables[:empty?] ||= v
      else
        v.each do |k2, v2|
          unless v2.empty?
            @variables[k][k2] |= v2
          end
        end
      end
    end
  else
    @variables = vars
  end
end

#declarationsObject

What SMT7 calls a declaration



49
50
51
52
53
54
55
56
57
58
# File 'lib/origen_testers/smartest_based_tester/base/variables_file.rb', line 49

def declarations
  if variables
    (variables[:all][:jobs] + variables[:all][:referenced_flags] + variables[:all][:set_flags]).uniq.sort do |x, y|
      x = x[0] if x.is_a?(Array)
      y = y[0] if y.is_a?(Array)
      # Need to use strings for the comparison as some declarations can be a string and some a symbol
      x.to_s <=> y.to_s
    end
  end
end

#flagsObject

What SMT7 calls a flag



37
38
39
40
41
42
43
44
45
46
# File 'lib/origen_testers/smartest_based_tester/base/variables_file.rb', line 37

def flags
  if variables
    (variables[:all][:referenced_enables] + variables[:all][:set_enables]).uniq.sort do |x, y|
      x = x[0] if x.is_a?(Array)
      y = y[0] if y.is_a?(Array)
      # Need to use strings for the comparison as some flags can be a string and some a symbol
      x.to_s <=> y.to_s
    end
  end
end

#to_be_written?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/origen_testers/smartest_based_tester/base/variables_file.rb', line 60

def to_be_written?
  tester.smt7?
end