2017-08-31 81 views
0

我計劃在我的測試程序中迭代$ dut模型的許多屬性和各種測試條件。我正在測試一個非常簡單的流程,並得到有關重複測試ID的錯誤。支持測試程序流迭代

Flow.create do |options| 

    [:pmin, :pmax].each do |cond| 
    bist :mbist, ip: :cpu, testmode: :hr, cond: cond, id: :hr 
    end 

end 

以下是錯誤:

[ERROR]  64.198[0.193] || Test ID hr_965EA18 is defined more than once in flow ws1: 
[ERROR]  64.199[0.001] || /users/user/origen/ppekit/program/components/_bist.rb:4 
[ERROR]  64.199[0.000] || /users/user/origen/ppekit/program/components/_bist.rb:4 

我想我會想到這個工作,但是當我檢查了test program generator docs我沒有看到循環,只有條件語句的一個例子。我確實看到了re-useable flow snippets的概念,但似乎最適合於可重複的測試序列,而不是迭代ad-hoc。

問候

回答

0

您的代碼擴展到這一點:

bist :mbist, ip: :cpu, testmode: :hr, cond: :pmin, id: :hr 
bist :mbist, ip: :cpu, testmode: :hr, cond: :pmax, id: :hr 

這意味着你有兩個測試與ID :hr,這是不允許的ID必須是唯一的。

要麼考慮,如果你真的需要的ID,你可能不會,除非你指的是本次測試中a conditional execution relationship with another test,否則更新您的代碼來生成唯一ID:

[:pmin, :pmax].each do |cond| 
    bist :mbist, ip: :cpu, testmode: :hr, cond: cond, id: "hr_#{cond}" 
end 
+0

OK,然後,如果我有100個測試和我想做一個條件分支,如果他們中的任何一個失敗,我必須跟蹤100個ID? –

+1

不,您可以將它們包裝在一個組中,併爲該組分配一個ID。該文件實際上需要更新這個信息,但你可以在這裏看到代碼示例:http://origen-sdk.org/origen/videos/5-create-program-flow/ – Ginty

+0

完美,這將工作。 –