0

是否可以访问在 DUT 类的测试接口中找到的相同关闭方法?我在这里看到了测试程序生成回调,但它们都没有到达 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' 回调并不等同于上面显示的测试界面中的 'shutdown' 回调。

谢谢

4

1 回答 1

1

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

# my/interface.rb

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

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

于 2018-02-08T09:19:00.860 回答