Module: OrigenTesters::SmartestBasedTester::Base::Generator
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/origen_testers/smartest_based_tester/base/generator.rb
Instance Method Summary collapse
- #add_tml(name, methods) ⇒ Object (also: #add_test_method_library)
- #at_flow_start ⇒ Object private
- #at_run_start ⇒ Object (also: #reset_globals) private
- #flow(filename = Origen.file_handler.current_file.basename('.rb').to_s) ⇒ Object
-
#flow_generators ⇒ Object
Returns an array containing all flow sheet generators.
- #flow_sheets ⇒ Object
-
#initialize(options = {}) ⇒ Object
This is just to give all interfaces an initialize that takes one argument.
-
#pattern_compiler ⇒ Object
Generates a pattern compiler configuration file (.aiv) to compile all patterns referenced in all flows.
-
#pattern_master ⇒ Object
Returns a top-level pattern master file which will contain all patterns from all flows.
- #resources_filename=(name) ⇒ Object
-
#sheet_generators ⇒ Object
Returns an array containing all sheet generators.
- #test_methods ⇒ Object
- #test_suites ⇒ Object
Instance Method Details
#add_tml(name, methods) ⇒ Object Also known as: add_test_method_library
21 22 23 24 |
# File 'lib/origen_testers/smartest_based_tester/base/generator.rb', line 21 def add_tml(name, methods) methods[:class_name] ||= name.to_s.camelize custom_tmls[name] = methods end |
#at_flow_start ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
28 29 30 |
# File 'lib/origen_testers/smartest_based_tester/base/generator.rb', line 28 def at_flow_start flow.at_flow_start end |
#at_run_start ⇒ Object Also known as: reset_globals
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 36 |
# File 'lib/origen_testers/smartest_based_tester/base/generator.rb', line 33 def at_run_start flow.at_run_start @@flow_sheets = nil end |
#flow(filename = Origen.file_handler.current_file.basename('.rb').to_s) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/origen_testers/smartest_based_tester/base/generator.rb', line 42 def flow(filename = Origen.file_handler.current_file.basename('.rb').to_s) f = filename.to_sym f = f.to_s.sub(/_resources?/, '').to_sym return flow_sheets[f] if flow_sheets[f] # will return flow if already existing p = platform::Flow.new p.inhibit_output if Origen.interface.resources_mode? p.filename = f p.test_suites ||= platform::TestSuites.new(p) p.test_methods ||= platform::TestMethods.new(p) p.pattern_master ||= platform::PatternMaster.new(p) flow_sheets[f] = p end |
#flow_generators ⇒ Object
Returns an array containing all flow sheet generators. All Origen program generators must implement this method
107 108 109 110 111 112 113 |
# File 'lib/origen_testers/smartest_based_tester/base/generator.rb', line 107 def flow_generators g = [] flow_sheets.each do |_name, sheet| g << sheet end g end |
#flow_sheets ⇒ Object
88 89 90 |
# File 'lib/origen_testers/smartest_based_tester/base/generator.rb', line 88 def flow_sheets @@flow_sheets ||= {} end |
#initialize(options = {}) ⇒ Object
This is just to give all interfaces an initialize that takes one argument. The super is important for cases where this module is included late via Testers::ProgramGenerators
16 17 18 19 |
# File 'lib/origen_testers/smartest_based_tester/base/generator.rb', line 16 def initialize( = {}) super @initialized = true end |
#pattern_compiler ⇒ Object
Generates a pattern compiler configuration file (.aiv) to compile all patterns referenced in all flows.
70 71 72 73 74 75 76 77 78 |
# File 'lib/origen_testers/smartest_based_tester/base/generator.rb', line 70 def pattern_compiler @pattern_compiler ||= begin m = platform::PatternCompiler.new(manually_register: true) name = 'complete.aiv' name = "#{Origen.config.program_prefix}_#{name}" if Origen.config.program_prefix m.filename = name m end end |
#pattern_master ⇒ Object
Returns a top-level pattern master file which will contain all patterns from all flows. Additionally each flow has its own pattern master file containing only the patterns for the specific flow.
58 59 60 61 62 63 64 65 66 |
# File 'lib/origen_testers/smartest_based_tester/base/generator.rb', line 58 def pattern_master @pattern_master ||= begin m = platform::PatternMaster.new(manually_register: true) name = 'complete.pmfl' name = "#{Origen.config.program_prefix}_#{name}" if Origen.config.program_prefix m.filename = name m end end |
#resources_filename=(name) ⇒ Object
39 40 |
# File 'lib/origen_testers/smartest_based_tester/base/generator.rb', line 39 def resources_filename=(name) end |
#sheet_generators ⇒ Object
Returns an array containing all sheet generators. All Origen program generators must implement this method
94 95 96 97 98 99 100 101 102 103 |
# File 'lib/origen_testers/smartest_based_tester/base/generator.rb', line 94 def sheet_generators # :nodoc: g = [] flow_sheets.each do |_name, sheet| g << sheet g << sheet.pattern_master end g << pattern_master if pattern_master g << pattern_compiler unless referenced_subroutine_patterns.empty? && referenced_patterns.empty? g end |
#test_methods ⇒ Object
84 85 86 |
# File 'lib/origen_testers/smartest_based_tester/base/generator.rb', line 84 def test_methods flow.test_methods end |
#test_suites ⇒ Object
80 81 82 |
# File 'lib/origen_testers/smartest_based_tester/base/generator.rb', line 80 def test_suites flow.test_suites end |