31 lines
1.4 KiB
Plaintext
31 lines
1.4 KiB
Plaintext
|
|
FUNCTOR DETAILS
|
|
|
|
The README.txt describes the .functor statement and how that creates a
|
|
functor. It also makes passing mention of how the functor is connected
|
|
up to the netlist. This document describes in detail how a functor is
|
|
supposed to act. See also the functor.h header file and the functor.cc
|
|
source file.
|
|
|
|
The current values of the inputs are stored in a single 8-bit byte,
|
|
2-bits per value. This is the ``ival'' member. The input of a functor
|
|
gets set by propagation events, assign events or %set
|
|
instructions.
|
|
|
|
The output value is stored in two bits of the functor. The current
|
|
output is used to detect edges when the input changes. Whenever an
|
|
input is set, a new output is calculated and compared with the current
|
|
output. If the current output is the same as the new output, then the
|
|
operation is complete and propagation stops.
|
|
|
|
If after a set the output changes, the current output is changed to
|
|
the new output, and a propagation event is created. This propagation
|
|
event is given a pointer to the functor that changed, and *not* simply
|
|
the contents of the out port. The event is scheduled for a delay that
|
|
is the propagation delay for the functor.
|
|
|
|
A propagation event is the only way that the output of a functor is
|
|
moved to the input of another functor. The propagation event, which is
|
|
given a pointer to the functor to propagate, looks at the output list
|
|
and sets the listed inputs to the current value of the output.
|