Commit Graph

22 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 e19407a749 Expose selector enablement to the Assignment backends 2021-05-27 12:51:25 +01:00
therealyingtong 1f6b3c0014 Remove CellValue type 2021-04-28 20:39:08 +08:00
therealyingtong 21aaab20f6 Remove empty() methods from Config and Loaded traits
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-04-28 10:47:26 +08:00
therealyingtong 7524c95547 Clippy fixes 2021-04-26 08:53:43 +08: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
therealyingtong 570f90e4ee SHA-256 chip that uses a 2^16 lookup table
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-02-25 20:01:44 +00: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 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
therealyingtong a19dc68dee Use Column<Any> in Permutation::Argument 2021-02-17 21:32:17 +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 faf5da15c9 Track column usage in RegionShape.
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-01-28 10:55:02 +08:00
Jack Grigg 17da891b25 General traits and structs for implementing circuits 2021-01-08 01:54:18 +00:00