Class: Origen::Tester::Doc::Generator::Flow

Inherits:
Object
  • Object
show all
Includes:
Generator, Generator::FlowControlAPI
Defined in:
lib/origen/tester/doc/generator/flow.rb

Constant Summary

OUTPUT_POSTFIX =
'flow'
OUTPUT_EXTENSION =
'yaml'

Constants included from Generator::FlowControlAPI

Generator::FlowControlAPI::FLOW_METHODS, Generator::FlowControlAPI::RELATION_METHODS

Instance Method Summary (collapse)

Methods included from Generator::FlowControlAPI

#apply_current_context!, #apply_relationships, #at_run_start, #conditionally_deactivated?, #confirm_valid_context, #context_changed?, #current_context, #extract_flow_control_options!, #extract_relation_options!, #finalize, #find_by_id, #generate_unique_label, #identity_map, #if_all_failed, #if_all_passed, #if_any_failed, #if_any_passed, #if_enable, #if_failed, #if_job, #if_passed, #if_ran, #record_id, #replace_context_with_current, #save_context, #summarize_context, #track_relationships, #unless_enable, #unless_job, #unless_ran

Methods included from Generator

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

Instance Method Details

- (Object) add(type, options = {})



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/origen/tester/doc/generator/flow.rb', line 12

def add(type, options = {})
  preserve_comments = options.delete(:preserve_comments)
  line = track_relationships(options) do |options|
    FlowLine.new(type, options)
  end
  collection << line unless Origen.interface.resources_mode?
  if preserve_comments
    line.description = Origen.interface.doc_comments
  else
    line.description = Origen.interface.doc_comments_consume
  end
  line
end

- (Object) render(file, options = {})



54
55
56
57
# File 'lib/origen/tester/doc/generator/flow.rb', line 54

def render(file, options = {})
  options[:file] = file
  add(:render, options)
end

- (Object) set_device(options = {})



46
47
48
# File 'lib/origen/tester/doc/generator/flow.rb', line 46

def set_device(options = {})
  add(:set_device, options)
end

- (Object) skip(identifier = nil, options = {})



59
60
61
62
63
64
65
66
# File 'lib/origen/tester/doc/generator/flow.rb', line 59

def skip(identifier = nil, options = {})
  identifier, options = nil, identifier if identifier.is_a?(Hash)
  identifier = generate_unique_label(identifier)
  options[:test] = identifier
  add(:branch, options)
  yield
  add(:label, test: identifier)
end

- (Object) start_section(options = {})



26
27
28
29
30
31
32
33
34
35
# File 'lib/origen/tester/doc/generator/flow.rb', line 26

def start_section(options = {})
  l = FlowLine.new(:section_start, options)
  if options[:name]
    desc = [options[:name]]
  else
    desc = []
  end
  l.description = desc + Origen.interface.doc_comments_consume
  collection << l
end

- (Object) stop_section(options = {})



37
38
39
# File 'lib/origen/tester/doc/generator/flow.rb', line 37

def stop_section(options = {})
  collection << FlowLine.new(:section_stop, options)
end

- (Object) test(instance, options = {})



41
42
43
44
# File 'lib/origen/tester/doc/generator/flow.rb', line 41

def test(instance, options = {})
  options = save_context(options)
  add(:test, { test: instance }.merge(options))
end

- (Object) to_yaml(options = {})



50
51
52
# File 'lib/origen/tester/doc/generator/flow.rb', line 50

def to_yaml(options = {})
  collection.map { |l| l.to_yaml(options) }
end