File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1326,6 +1326,18 @@ module MakeCircuitInterfaceFromCBackend(Backend: CBackend) : CircuitInterface =
13261326 let cond = circuit_or (circuit_not pre) post in
13271327 circ_taut cond
13281328
1329+ let sublimate_inputs ((c , cinps ): circuit ) : circuit =
1330+ assert (c.type_ = CBool );
1331+ let node_c = Backend. node_of_reg c.reg in
1332+ let node_c, shifts = Backend.Deps. excise_bit node_c in
1333+ let inps = List. filter_map (fun {id; type_} ->
1334+ match Map. find_opt id shifts with
1335+ | Some (low , hi ) -> Some {id; type_ = CBitstring (hi - low + 1 )}
1336+ | None -> None
1337+ ) cinps in
1338+ let c = Backend. reg_of_node node_c in
1339+ { reg = c; type_ = CBool }, inps
1340+
13291341
13301342 (* Review later? *)
13311343 let collapse_lanes (lanes : circuit list ) =
@@ -1399,6 +1411,7 @@ module MakeCircuitInterfaceFromCBackend(Backend: CBackend) : CircuitInterface =
13991411 if debug then Format. eprintf " Checking equivalence for bit %d@." i; (* FIXME *)
14001412
14011413(* let res = fillet_taut pres post in *)
1414+ let post = sublimate_inputs post in
14021415 let res = circ_taut post in
14031416 if not res then Format. eprintf " Failed for bit %d@." i;
14041417
You can’t perform that action at this time.
0 commit comments