无法从on_flow_end回调创建Web文档

时间:2018-02-12 23:21:22

标签: origen-sdk

我正在尝试设置origen以在使用delete命令生成流后自动生成Web文档,因此我添加了以下回调:

origen p

这会在构建流页面时导致错误:

def on_flow_end(options)
  OrigenDocHelpers.generate_flow_docs layout: "#{Origen.root}/templates/web/layouts/_basic.html.erb", tab: :flows do |d|
    d.page  flow: "#{options[:test_module]}_flow".to_sym,
            name: "#{options[:test_module].to_s.upcase} Flow",
            target: "#{Origen.target.name}.rb"  
  end
end

如果我单独调用[INFO] 14.641[0.005] || Building flow page: /users/chorton/osdk/ppekit/web/content/flows/pcie_flow.md COMPLETE CALL STACK ------------------- Can't find: partials/_navbar.html /home/chorton/.origen/gems/ruby/2.3.0/bundler/gems/origen-7bf48a874995/lib/origen/file_handler.rb:137:in `clean_path_to' /home/chorton/.origen/gems/ruby/2.3.0/bundler/gems/origen-7bf48a874995/lib/origen/file_handler.rb:226:in `rescue in clean_path_to_sub_template' /home/chorton/.origen/gems/ruby/2.3.0/bundler/gems/origen-7bf48a874995/lib/origen/file_handler.rb:213:in `clean_path_to_sub_template' /home/chorton/.origen/gems/ruby/2.3.0/bundler/gems/origen-7bf48a874995/lib/origen/generator/renderer.rb:8:in `render' (erb):4:in `_get_binding' (没有添加回调)然后运行,则没有错误:

origen p

是否可以将这两个命令与我正在尝试的回调合并为一个回调,或者origen web compile --remote --api之后是否需要调用origen web compile

感谢。

1 个答案:

答案 0 :(得分:2)

这看起来像是一个错误,如果你无法解决它,请在这里打开一张票 - https://github.com/Origen-SDK/origen/issues

我想说通常用来执行此操作的惯例是挂钩after_web_site_compile中的config/application.rb回调。

以下是一个例子:

# config/application.rb

def after_web_site_compile(options)
  # Build the test flow docs
  Origen.environment.temporary = 'v93k.rb'
  # Generate the program for the target(s) you want to document
  %w(device_a device_b).each do |target|
    Origen.target.temporary = "#{target}.rb"
    Origen.app.runner.launch action: :program,
                             files:  'program/full.list' # Or whatever file arg you pass to 'origen p'

    OrigenDocHelpers.generate_flow_docs layout: "#{Origen.root}/templates/web/layouts/_basic.html.erb", tab: :flows do |d|
      d.page flow: "#{options[:test_module]}_flow".to_sym,
             name: "#{options[:test_module].to_s.upcase} Flow",
           target: "#{target}.rb"  
    end
  end
end