Closed lekcyjna123 closed 1 year ago
First, your reproduction example doesn't trigger the issue, which is obvious: you included only one branch in the second condition.
Second: yes, this is the consequence of the design. Suppose you have two priority conditions: first with branches A, B, and second with branches C, D. Therefore, A < B and C < D. Because of how simultaneous transactions work, you get four transactions: AC, AD, BC, and BD, and the orderings transfer to them. So, because A < B, AD < BC, but because C < D, BC < AD.
Thanks for explanation. Now I understand.
Also, a word of caution: priority conditions kinda look like if-else, but don't really work like that. In particular, a later branch can be selected if a previous one is blocked. It only guarantees that, if two branches can be executed in a given clock cycle, the first one in code order will be selected. The underlying mechanism is transaction ordering.
First, your reproduction example doesn't trigger the issue, which is obvious: you included only one branch in the second condition.
I have checked and it looks like my reproduction example doesn't work on newest master. But on commits before #415 my reproduction example works and an error is being thrown. On newest branch to the second condition nonblocking=True
has to be added.
Ach, and that is expected because nonblocking=True
add a second transaction so there is a conflict.
Hi @tilk , today I played a little bit with conditions to introduce some syntax sugar and I have found that defining two conditions in the same method both with
priority=True
introduce a cycle in conflict graph. But I can not find an explanation fo that. Is this expected behaviour?To reproduce the issue: In
ConditionTestCircuit
intest_transaction_lib.py
use instead of trunksource
method following definition (simply a second condition is added):After that test fails with error: