作者ric2k1 (Ric)
看板EE_DSnP
標題Re: [問題] 有關輸出的順序
時間Tue Jun 3 15:40:17 2008
AIGER format 裡有規定:
In the binary format we assume that the AND gates are ordered and respect
the child parent relation. AND gates with smaller literals on the LHS
come first. Therefore we can assume that the literals on the right-hand
side of a definition of an AND gate are smaller than the LHS literal.
Furthermore we can sort the literals on the RHS, such that the larger
literal comes first. A definition thus consists of three literals
lhs rhs0 rhs1
with 'lhs' even and 'lhs > rhs0 >= rhs1'....
所以 .aig file 裏面會印成這樣:
AND(3) = PI(2) && PI(1)
但是 .aag file 就沒有這樣的限制了, 所以 AND gate 的 fanin 應該會按照
他在 file 裏面定義的順序:
6 2 4
==> AND(3) = PI(1) && PI(2)
所以 reference program 應該是沒有錯的, 你可能要檢查一下為什麼你會印反?
※ 引述《spock ()》之銘言:
: ※ 引述《spock ()》之銘言:
: : 請問老師,我剛才測試過 aiger-20071012/examples/ 與 tip-k-ind-aigs-o1234g/
: : 小於 100k 的檔案(因為我的 code 執行時間是老師的 60 倍,還不敢測太大的檔),
: : 發現所有 .aig 檔案的 cirp -n 輸出結果與 ref 完全一樣。
: : 但是 example 裡面的 and 與 or 比較奇怪。
: : ref 輸出同一種電路的 .aig 與 .aag 時,PI 的順序與 AND 右手邊輸出順序剛好相反。
: : 我的程式則是 .aig 與 .aag 一樣。
: : 不知道這樣會不會造成助教批改的困擾?
: 以下是 ref/cirTest 的輸出:
: cir> cirr /home/spock/dsnp/aiger-20071012/examples/and.aig
: cir> cirp -n
: PI(2)
: PI(1)
: AND(3) = PI(2) && PI(1)
: PO(3) = AND(3)
: cir> cirr /home/spock/dsnp/aiger-20071012/examples/and.aag
: Deleting circuit...
: cir> cirp -n
: PI(1)
: PI(2)
: AND(3) = PI(1) && PI(2)
: PO(3) = AND(3)
: cir> cirr /home/spock/dsnp/aiger-20071012/examples/or.aig
: cir> cirp -n
: PI(2)
: PI(1)
: AND(3) = !PI(2) && !PI(1)
: PO(3) = !AND(3)
: cir> cirr /home/spock/dsnp/aiger-20071012/examples/or.aag
: cir> cirp -n
: PI(1)
: PI(2)
: AND(3) = !PI(1) && !PI(2)
: PO(3) = !AND(3)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.21.241
1F:推 spock:謝謝老師!看來我還有很多 code 要改 orz 06/03 18:14
2F:推 spock:ok,找到問題了。因為我搜尋 fan-in gate 時沒有順序。 06/03 21:07