- D Algorithm 底下是 D algorithm 的Sample, 主要分成 Propagate, Consistency. Propagate : 有點像是 Forward 的方式把Data Propagate 下去,直到我們的Flip -Flop端. 在經由我們的JTAG 做Debug的動作. Consistency: 像是Back Track的方式, 回頭去定義我們的Input vector. 底下的Sample中. 假設在Wire d被 Tied住成 0 (SA0), 如何用D algrithm找出解呢?
- Step1. 把 Wire d 的值先設成 "D", D表示 0->1 or 1->0的變化. 目前是 0->1. 因為被Tied 成 0, 所以我們要製造個1的Inf出來 可參考 http://funningboy.blogspot.com/2010/03/stuck-at-fault-4-atpg.html Step2. 在 Wire d的 Fanin 是由And(1)所給的, 所以在And 的Input端必須都要為1,才能確保 OutPut =1, Step3 . Progation 2 EndPoint, 為了要把 "D" 傳出去,在Nor(2)時的Control Point(Wire e) 必須要為0 Step4. Consistency 2 Input, 已知Wire e = 0 && Input B =1, 可以得到 NAND 的 Input C 為 1

演算法流程.
Propagate -> Up Date Look Up Table
+
Consistency -> Up Date Look Up Table
+
Rst
- Pic Ref: UMBC University
2 . Look Up Table Generator
透過C++ 產生Total Solutions. 假設有n個 inputs , 解空間就有 2^n 個.
3. Emulator (Tool)
PS: 本tool 請勿用在商業用途.
Language: C++.
Desgin Flow
使用方式:
解壓 stuck.rar到自己的資料夾.
會有 Inc, Src, Pattern 的資料夾在裡面.
Stuck at Fault 的 Source Code 都放在 Inc/Src裡.
Pattern 資料夾內有我們的Test Pattern 跟 Look Up Table Generator.
Step 1. 準備好我們的test design, 存成 Pattern1.v檔
0 -> And
1 -> Or
2 -> Xor
3 -> Inv
PS: Constrain
目前只有支援 And,OR,Xor,Inv的格式,且為2對1的format. 2 input 1 output.
Pattern1.v
0 And1 w3 w1 w2
2 Xor1 w4 w3 w2
3 Inv1 w5 w4 w4
1 Or1 w6 w7 w5
3 Inv2 w7 w8 w8
2 Xor2 w8 w3 w4
0 And2 w9 w3 w8
2 XOr3 w10 w7 w2
0 AND3 w11 w10 w4
EOF
Step 2. 準備好我們的IO.log存成 IO.log檔 0-> input 1 ->output IO.log 0 w1 0 w2 1 w9 1 w6 1 w11 EOF Step3. Look Up Table generator 在Pattern 資料夾下鍵入 %make, 會產生一個 Pattern.cpp的file ,這個file會把剛剛的Pattern1.v 轉成 C++的file. PS: 注意inpur output的前後關係,不然產生的Look up table會錯誤. Step4. Generator Look up table 在pattern 資料夾下鍵入 %g++ Pattern.cpp %./a.exe 會產生我們的 look up table 叫 GenPat.log
GenPat.log w1 w2 w3 w4 w5 w7 w6 w8 w9 w10 w11 0 0 0 0 1 1 1 0 0 1 0 1 0 0 0 1 1 1 0 0 1 0 0 1 0 1 1 1 1 1 0 0 0 1 1 1 0 1 1 1 1 1 0 0 EOF
Step5. 回到stuck\inc底下 在define.h 中會定義幾個參數.如Stuck at 的點, 跟Stuck at 的值,還有 Stuck at所要走的Path. #define StFLoc "w5" #define StFValue "0" #define StPath "Or1"
全部定義好後.在stuck資料夾下鍵入
%make
%./p1.exe
就ok了
執行結果

沒有留言:
張貼留言