Class: OrigenTesters::SmartestBasedTester::Base::VariablesFile
- Inherits:
-
Object
- Object
- OrigenTesters::SmartestBasedTester::Base::VariablesFile
- Includes:
- Generator
- Defined in:
- lib/origen_testers/smartest_based_tester/base/variables_file.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#id ⇒ Object
Returns the value of attribute id.
-
#subdirectory ⇒ Object
Returns the value of attribute subdirectory.
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
Attributes included from Generator
Instance Method Summary collapse
- #add_variables(vars) ⇒ Object
-
#declarations ⇒ Object
What SMT7 calls a declaration.
-
#flags ⇒ Object
What SMT7 calls a flag.
-
#initialize(options = {}) ⇒ VariablesFile
constructor
A new instance of VariablesFile.
- #to_be_written? ⇒ Boolean
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( = {}) end |
Instance Attribute Details
#filename ⇒ Object
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 |
#id ⇒ Object
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 |
#subdirectory ⇒ Object
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 |
#variables ⇒ Object (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 |
#declarations ⇒ Object
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] + variables[:all][:unset_flags] + variables[:all][:add_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 |
#flags ⇒ Object
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
60 61 62 |
# File 'lib/origen_testers/smartest_based_tester/base/variables_file.rb', line 60 def to_be_written? tester.smt7? end |