This is a well recognized design pattern which works with all synthesis tools. The other way to make sure that a is always driven is to assign a certain value to it before the conditional statement, like here: always begin However, <= is recommended for sequential logic, like latches and = should be used for combinatorial devices. BTW, use of = or <= does not define the type or the coded device. In the above a is driven in all branches of the if statement. The following shows a simple combinatorial two-way mux always (en) To express a combinatorial logic, you need to make sure that a is driven in all cases. This is a latch behavior and synthesis tools recognize the specific pattern in order to generate latches.Īlgorithmically, a latch is derived from a not fully-specified conditional statement, like the above if without else, where a is not driven in some cases. But, if en is low, a will keep its old value even if b changes. In the above scheme, if en is high, then a changes as soon as b changes. The issue is that you coded a latch in your logic.
0 Comments
Leave a Reply. |