-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data dependent method calling #478
Conversation
I find this explanation very unintuitive. "Before" and "after" doesn't matter for combinatorial logic; only thing that exists are data dependencies. What you are doing, in actuality, is generating separate circuits for the readiness condition for each calling transaction. This relaxes the previous restriction on ready signals, but at the cost of a (potentially small) increase in circuit size. The idea seems sound; I'll review the PR later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is pretty cool actually, but some cleanups are required.
This is not just backward compatibility. Both things have a different performance characteristic: there is only one combinatorial circuit generating the old |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some minor comments.
Merged without a second review. |
We have currently concept of single caller methods (#416, #425). Such methods allow us to add condition in
ready
signal which depends from input argument. Such conditions are only supported in single caller methods, because when there are two or more callers there is a risk that we end up with combinational cycle. Goal of this PR is to extend data dependent readiness of methods to multi caller methods.Current implementation of transactron assume that readiness signal is constant for the whole cycle. So we use it to calculate
runnable
signal for each transaction. When ready signal depend from data we can decided after scheduling a transaction to execution that method isn't ready. This cause change inrunnable
and an another transaction can be chosen to execution, which data will be potentially accepted by method, so theready
will be high one more time and the whole story will repeat.Solution which I propose in this PR is to calculate data dependent readiness before scheduling the transaction, so that we already know that method will accept data from this transaction. The old
ready
signal is used as global readiness for the whole method for backward compatibility.Additionally I modified types in
method_uses
to be more strict. Instead ofValueLike
onlyRecord
is accepted. This allow to properly type input argument for theuser_ready_function
.