Class: Origen::Tester::V93K::Generator::TestFunctions
- Defined in:
- lib/origen/tester/v93k/generator/test_functions.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
Origen::Tester::Generator not included since test functions do not have their own top-level sheet, they will be incorporated within the flow sheet.
-
#flow ⇒ Object
Origen::Tester::Generator not included since test functions do not have their own top-level sheet, they will be incorporated within the flow sheet.
Instance Method Summary collapse
- #[](name) ⇒ Object
- #add(name, type, options = {}) ⇒ Object
-
#duplicate?(name, options = {}) ⇒ Boolean
Returns true if the given test function name has already been added to the current flow.
- #filename ⇒ Object
- #functional(name, options = {}) ⇒ Object
-
#initialize(flow) ⇒ TestFunctions
constructor
A new instance of TestFunctions.
Constructor Details
#initialize(flow) ⇒ TestFunctions
Returns a new instance of TestFunctions.
11 12 13 14 15 |
# File 'lib/origen/tester/v93k/generator/test_functions.rb', line 11 def initialize(flow) @flow = flow @collection = {} @ix = 0 end |
Instance Attribute Details
#collection ⇒ Object
Origen::Tester::Generator not included since test functions do not have their own top-level sheet, they will be incorporated within the flow sheet
9 10 11 |
# File 'lib/origen/tester/v93k/generator/test_functions.rb', line 9 def collection @collection end |
#flow ⇒ Object
Origen::Tester::Generator not included since test functions do not have their own top-level sheet, they will be incorporated within the flow sheet
9 10 11 |
# File 'lib/origen/tester/v93k/generator/test_functions.rb', line 9 def flow @flow end |
Instance Method Details
#[](name) ⇒ Object
35 36 37 |
# File 'lib/origen/tester/v93k/generator/test_functions.rb', line 35 def [](name) @collection[name] end |
#add(name, type, options = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/origen/tester/v93k/generator/test_functions.rb', line 21 def add(name, type, = {}) check_for_duplicates(name) record_test_function(name) func = TestFunction.new(next_name, type, ) @collection[name] = func # c = Origen.interface.consume_comments # Origen.interface.descriptions.add_for_test_definition(name, c) func end |
#duplicate?(name, options = {}) ⇒ Boolean
Returns true if the given test function name has already been added to the current flow.
Pass in :global => true for all test flows to be considered.
42 43 44 45 46 47 48 49 |
# File 'lib/origen/tester/v93k/generator/test_functions.rb', line 42 def duplicate?(name, = {}) files = existing_test_functions[name] if files && !files.empty? [:global] || files.include?(filename) else false end end |
#filename ⇒ Object
17 18 19 |
# File 'lib/origen/tester/v93k/generator/test_functions.rb', line 17 def filename flow.filename end |
#functional(name, options = {}) ⇒ Object
31 32 33 |
# File 'lib/origen/tester/v93k/generator/test_functions.rb', line 31 def functional(name, = {}) add(name, :functional, ) end |