精華區beta EE_DSnP 關於我們 聯絡資訊
(問) >>>>>>>>>>>>>>>>>>>>>>>>>>>>> 發現bddNode裡面有一個_bddManager 我們可以選擇自己建一個global的bddManager嗎? 有點不想改了...XD (答) <<<<<<<<<<<<<<<<<<<<<<<<<<<<< 妳可以隨意建一個global的bddManager 在它的 init() function 裡 BddNode::_bddManager 就會被設好了 不知道這樣是不是你要的? >>>>>>>>>>>>>>>>>>>>>>>>>>>>> : 在 c = a & b 這一行裡, : 呼叫overloading後的&應該是a吧?? : 如果是這樣的話,那在overload & 的function中 : _BddManager->ite((*this), n, BddNode::_zero); : 傳入ite的(*this)就是a了,然後在_BddManager的ite的function中 : 相對應於f、g、h的不就應該分別是a、b、_zero嗎吧 : 然後在ite中的第一個terminal case因為 h == _zero就會結束 : 然後傳回ret(==f==a) 然後再由 overload 後的 = 傳給 c : 不知道這樣的想法中,有什麼樣的錯誤呢?? terminal cases are: bool BddManager::checkIteTerminal (const BddNode& f, const BddNode& g, const BddNode& h, BddNode& n) { if (g == h) { n = g; return true; } if (f == BddNode::_one) { n = g; return true; } if (f == BddNode::_zero) { n = h; return true; } if (g == BddNode::_one && h == BddNode::_zero) { n = f; return true; } return false; } I am not sure which one you mean here? h is zero, but g is NOT zero, so it won't terminate. : 因為這樣的話,BddNode c好像是等於BddNode b不是等於BddNode a : 還有就是c的_left在這個過程中,好像也沒有被重新的assign到該有的BddNode : 我覺得我應該是漏掉了些什麼 : 不知道老師能不能給我點提示 c 不會等於 b or a, 但是它的 level = b 的 level... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> : 另外 做bddCalculator的時候 : 需要用到parser的一些functions來判斷到底有幾個fanins : 老師覺得把Parser從Circuit裡抓出來獨立成一個class比較好 : 還是把isWhite eatWhite getString 重新貼一次比較好? 可以抓出來獨立成一個class 啊... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> : set PI order 這裡,他的 -file的順序是由大到小還是由小到大? : 例如說 .input a b c : 那我們是要把 a 設為 support 1,b 設為 support 2, c 設為 support 3嗎? : 還是相反? ==> a 設為 support 1,b 設為 support 2, c 設為 support 3 (如你所說) 對 DFS order 也一樣, support index 由 1 始排 : 另一個問題 : 假設說一個 circuit 如下 : and f g a : or g b c : 那麼如果我 build f,一定會先build g : 那麼如果下次使用者要 build g,我是不是就丟 warning 說 g 已經built過了? 要不要給 warning 都可以, 反正下次使用者要 build g 的時候可以直接從 _bddMap 找到 BDD(g), 所以應該沒有什麼關係. (問) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 可是_supports不是vector<BddNode>嗎?如何對應到不同的Node (答) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< In BddManager.h: class BddManager { vector<BddNode> _supports; }; _supports[0] --> terminal 1 _supports[1] --> first (lowest) level of support variable (BddNode) ... ======================================================================= Given an arbitrary BddNode, it has a corresponding BddNodeInt*, say "n". class BddNodeInt { unsigned _level : 16; }; The _level here is the index for the _supports. Therefore, if n->_level = 1, n is one of the first (lowest) level of BddNodeIn\ ts. Other BddNodeInts in this level also have _level = 1. (問) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> F_bar會出現嗎?(在standarize parameters的時候) (答) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 簡單的來說, 在 slide p-30 裡, 可以將 "bar" (i.e. upper-line) 看成是 bubble (i.e. negative edge). For example, bdd> set bdd support 2 a bdd> set bdd support 1 b bdd> bdd inv a_bar a bdd> bdd and a_bar b The last command will trigger: ite(a_bar, b, 0) ==> F has bubble, G has no buble, H has bubble ==> the ite(!F, G, !H) case Apply the complementary edge rule: ite(a_bar, b, 0) => ite(a, 0, b) ==> now G has bubble, F & H have no bubble ==> the ite(F, !G, H) case Apply another complementary edge rule: ite(a, 0, b) => !(ite(a, 1, b_bar)) This will satisfy the complementary edge constraint. That is, the first two arguments for ite() functions are "standardized" and have no buble. Please note that the purpose of "standardize ite parameters" is to "increase the hit rate of computed cache". Please also note that the "returned bar" (i.e. !(ite...)) means we need to "inverse" the ite result, not necessary putting a "bubble" to this recursively returned BddNode. For example, if the recursively returned BddNode has negative edge (bubble), before we return this ite(), we need to complement this edge (i.e. make it no-bubble). >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> : 在ite的function中,當我們執行到if(t==e)的判斷之後,老師在後面有提示: : // move bubble if necessary... ==> update isNedEdge : 可以請問老師一下,是什麼樣的情況下,我們會有需要move bubble呢?? : 謝謝老師! : 學生 林坤輝 敬上 Our rule for unique table is that the left child (then child) of the BddNodeInt should has no bubble. Therefore, we need to "complement" the bubble of the right child and the bool isNegEdge if left child has bubble. That's what I mean "move bubble"... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> : : 簡單的來說, 在 slide p-30 裡, 可以將 "bar" (i.e. upper-line) 看成是 bubble : : (i.e. negative edge). : : For example, : : bdd> set bdd support 2 a : : bdd> set bdd support 1 b : : bdd> bdd inv a_bar a : : bdd> bdd and a_bar b : : The last command will trigger: : : ite(a_bar, b, 0) ==> F has bubble, G has no buble, H has bubble : : Apply the complementary edge rule: : : ite(a_bar, b, 0) => ite(a, 0, b) ==> now G has bubble, F & H have no bubble : 我覺得這個定義有問題,因為a_bar所表示的,應該是實線和虛線的互換,也就是把兩 : cofactor交換,所以和把上面的bubble除掉沒有絕對的關係。因為cofactor所表示的, cofactors 交換並不是 "inversion" 的意思啊... >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> : : cofactors 交換並不是 "inversion" 的意思啊... : : (底下恕刪...) : 可是在ite(F_bar,G,H)=ite(F,H,G)不是就把cofactor交換了嗎? : 這個不是inversion嗎? 在 ite(F, G, H) 中, G, H 並不是 F 的 cofactor 呀~~~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.121.130.124