This is the beginning of the process to enable full floor planning
capabilities in `halo2`. For now, all that a floor planner can do is
synthesize a circuit, which makes it no more powerful than a layouter,
but easier to use (as moving to a multi-pass layouter no longer requires
changes to `Circuit::synthesize`).
This layouter improves on the single-pass strategy in two ways:
- Regions are layed out with a "first fit" strategy (using the algorithm
described in https://github.com/zcash/halo2/issues/93) instead of a
"last fit" strategy. This enables gaps in the circuit to be filled.
- Regions are sorted by their "advice area" (columns * rows), and are
then layed out biggest-first. This takes advantage of the regularity
of circuits, and that the advice columns have the most contention. It
also leads to larger gaps between early layed-out regions that are more
easily filled by subsequent smaller regions.
This enables chips that e.g. want to load multiple lookup tables into
the same columns to store state about where each table was layed out.
Co-authored-by: Jack Grigg <jack@electriccoin.co>