6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/origen/generator/flow.rb', line 6
def create(options = {}, &block)
Origen.app.reload_target!
Origen.tester.generating = :program
if Origen.interface_loaded? && Origen.interface.top_level_flow
sub_flow = true
if Origen.tester.doc?
Origen.interface.flow.start_section
end
else
sub_flow = false
end
job.output_file_body = options.delete(:name).to_s if options[:name]
if sub_flow
interface = Origen.interface
opts = Origen.generator.option_pipeline.pop || {}
Origen.interface.startup(options) if Origen.interface.respond_to?(:startup)
interface.instance_exec(opts, &block)
Origen.interface.shutdown(options) if Origen.interface.respond_to?(:shutdown)
if Origen.tester.doc?
Origen.interface.flow.stop_section
end
interface.close(flow: true, sub_flow: true)
else
unless tester.try(:sim?)
Origen.log.info "Generating... #{Origen.file_handler.current_file.basename}"
end
interface = Origen.reset_interface(options)
Origen.interface.set_top_level_flow
Origen.interface.flow_generator.set_flow_description(Origen.interface.)
options[:top_level] = true
Origen.app.listeners_for(:on_flow_start).each do |listener|
listener.on_flow_start(options)
end
Origen.interface.startup(options) if Origen.interface.respond_to?(:startup)
interface.instance_eval(&block)
Origen.interface.shutdown(options) if Origen.interface.respond_to?(:shutdown)
interface.at_flow_end if interface.respond_to?(:at_flow_end)
Origen.app.listeners_for(:on_flow_end).each do |listener|
listener.on_flow_end(options)
end
interface.close(flow: true)
end
end
|