在DUT类中访问测试接口关闭回调方法?

时间:2018-02-07 22:05:25

标签: origen-sdk

是否可以访问DUT类中测试界面中的相同关闭方法?我看到测试程序生成回调here,但它们都没有到达Origen生成命令的末尾。我们希望能够在不必将Gemfile指向测试接口gem的本地路径并在那里设置断点的情况下执行此操作。

# This will be called at the end of every flow or sub-flow (at the end of every
# Flow.create block).
# Any options passed to Flow.create will be passed in here.
# The options will contain top_level: true, whenever this is called at the end of a
# top-level flow file.
def shutdown(options = {})
  binding.pry
  # Write the tests disabled/removed to the .tf file
  render "\n"
  [:defined, :enabled, :disabled, :removed].each do |category|
    test_list = Origen.top_level.test_modules(options[:test_module]).send("tests_#{category}".to_sym)
    render "-- #{category.to_s.capitalize} test count: #{test_list.size}"
    unless test_list.empty?
      render "-- #{category.to_s.capitalize} Tests: #{test_list.to_csv}" if category.smatch(/remove|disable/)
    end
  end

现有的'on_flow_end' callback并不等同于'关闭'上面显示的测试界面中的回调。

THX

1 个答案:

答案 0 :(得分:1)

没有自动连接,但它很容易在您的应用程序中实现:

# my/interface.rb

def shutdown(options = {})
  dut.some_shutdown_method
end

如果您想要定位Origen generate命令的最后,您也可以考虑使用on_origen_shutdown回调: http://origen-sdk.org/origen/guides/misc/callbacks/#Environment_Teardown