Disjoint Write Analysis #103
rachitnigam
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(Moved from #12)
The disjoint write analysis provides the second guarantee of the Filament type checker: that resource usage never conflicts. A naive way to enforce this is to require that writes to ports of the same instance are all disjoint. For example:
We can try to generate the following disjointness conditions where
L
give the liveness of a port:In general, for a component with
n
input ports andk
uses, we'd generaten
constraints of sizek
. However, I want to demonstrate that we can get away by checking that the assignments to the abstract event variables do not conflict with each other.The
@interface
PortsThe
@exact
modality allows us to reason about when signals will have zero and non-zero values. For example:This states that we can reason about the value of
go
b/w[G, G+5]
and rely on the fact that it will only be non-zero during[G, G+1]
.An
@interface
definition like the following:Is just sugar for:
Using this "required zero" semantics,
@interface
ports allow us to enforce requirements on repeated usage: a signal may not pulse more often than allowed by its interface requirement.Correct Interface Ports
When compiling a high-level Filament program, the compiler infers interface ports that correspond to each event in the component.
Well-formedness of
@interface
: If a signal is used b/w[G+i, G+i+n]
, the interface signal should have a delay of at leastn
.In other words, if a design is using the signal for
n
cycles, it is certainly not safe to trigger the design more than once everyn
cycles.Correct Interface Usage Implies Disjoint Use
Going back to our original example, if the design uses an input signal between
[G+i, G+i+n]
, then we know that the interface signal will require a delay of at leastn
.If we can ensure that
G
andG+1
aren
apart, then we know that all signals associated with them will also be disjoint.In other words, the disjointness of
@interface
ports is a sufficient constraint for disjointness of all other ports that make use of the related event.Beta Was this translation helpful? Give feedback.
All reactions