Commit Graph

23 Commits

Author SHA1 Message Date
Jack Grigg 6d0017f47c Introduce a FloorPlanner trait and integrate it into the Circuit trait
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`).
2021-06-22 23:47:17 +01:00
Jack Grigg f5bd3109eb Reduce various trait requirements from `FieldExt` to `Field` 2021-06-22 00:35:57 +01:00
Jack Grigg 1d7060af8a Enable region assignments to defer inversions 2021-06-12 19:36:37 +01:00
Jack Grigg 7cca91331b Implement improved strategy for the V1 layouter
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.
2021-06-08 11:35:41 +01:00
Jack Grigg a94d4a9c01 Implement V1 layouter
The V1 layouter is a dual-pass layouter, that has visibility into the
entire `Circuit::synthesize` step.

This first commit implements the same strategy as `SingleChipLayouter`,
behaving as if it were a single-pass layouter.
2021-06-07 15:13:41 +01:00
Jack Grigg b00a0df392 Move SingleChipLayouter into a submodule
It is a single-pass layouter, but we won't rename it for now.
2021-06-07 14:52:25 +01:00
Jack Grigg e19407a749 Expose selector enablement to the Assignment backends 2021-05-27 12:51:25 +01:00
therealyingtong 3ad1c43fb8 Only keep config() and loaded() generic on Chip trait
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-04-23 17:40:43 +08:00
therealyingtong 40e7bec352 Move config responsiblities from Layouter to Chip trait 2021-04-23 17:40:43 +08:00
str4d 9467a03ae2
Merge pull request #209 from zcash/ecc-gadget-fixedpoints
Store `Loaded` chip state in chip
2021-02-26 04:24:28 +13:00
therealyingtong 4f17322c2d Allow Chip::load to return state that the Layouter will hold
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>
2021-02-24 23:28:18 +08:00
therealyingtong 5a341b0f8f Modify Assignment::copy() to take Column<Any> instead of usize 2021-02-24 00:18:22 +08:00
therealyingtong d82a0c85b1 Modify Assignment::copy() to take Permutation instead of usize 2021-02-24 00:17:29 +08:00
therealyingtong 340fb2b6df Move Permutation struct from crate::circuit -> plonk::circuit 2021-02-24 00:17:29 +08:00
therealyingtong 84f732acb4 Add circuit::RegionIndex and circuit::RegionStart newtypes 2021-02-20 21:26:42 +08:00
Jack Grigg 3fc245343e Return results from assigned regions
This makes it easier to pass variables out of a region.
2021-02-01 21:42:57 +00:00
Jack Grigg bf771a7446 Add namespacing and gadget name collection to Layouter 2021-02-01 18:38:04 +00:00
Jack Grigg 60061f64fd Add name field to Layouter::assign_region 2021-02-01 18:34:24 +00:00
Jack Grigg 4c3adf59d5 Add annotations to Region::{assign_advice, assign_fixed}
This enables circuits to annotate individual cells with variable names
or similar protocol-specific metadata.
2021-02-01 18:33:25 +00:00
therealyingtong 2255fbec8b Make RegionShape struct public 2021-01-28 10:55:17 +08:00
therealyingtong faf5da15c9 Track column usage in RegionShape.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-01-28 10:55:02 +08:00
Jack Grigg 7e2406cc77 Implement a simple single-chip layouter 2021-01-08 01:54:44 +00:00
Jack Grigg 17da891b25 General traits and structs for implementing circuits 2021-01-08 01:54:18 +00:00