Repository navigation
Conversation
…w and exact area under a delay target. Exact area decision is timed incrementally and undone if an output miises the target. When liberty data available, cells timed with NLDM tables with loads. Original implementation runs with emap -O
alanminko
left a comment
There was a problem hiding this comment.
Review of 6cf7e5d based on code inspection only; no builds or tests were run. I found four issues, detailed in the inline comments.
The PR does not identify the benchmarks used to evaluate the new mapper. Please share the benchmarks (or public download links and the exact case list), the Liberty/GENLIB libraries, and the command lines or scripts, including preprocessing, used to compare the new emap with emap -O. Per-benchmark area, delay, and runtime results, together with the ABC revision and machine details, would let us reproduce the runs.
| SRC += src/map/emap/emap.c \ | ||
| src/map/emap/emapCore.c | ||
| src/map/emap/emapCore.c \ | ||
| src/map/emap/emapMap.c |
There was a problem hiding this comment.
[P1] Add the new source to the Windows project as well.
emap.c now references Emap_ManMapNew, but abclib.dsp still lists only emap.c and emapCore.c for this module. Applications linking that library will have an unresolved symbol. Please add emapMap.c to the Windows source list.
| if ( pB->Type == EMP_INV ) | ||
| Emp_LoadInc( p, 2 * i + !f, Emp_InvCin(p, pB->iMem), Emp_InvCinD(p, pB->iMem) ); | ||
| else if ( pB->Type == EMP_WIRE ) | ||
| Emp_LoadInc( p, 2 * pB->Leaves[0] + pB->Phases[0], p->pLoad[2 * i + f], p->pLoadD[2 * i + f] ); |
There was a problem hiding this comment.
[P2] Account for inverter loads before propagating wire loads.
When phase 0 is EMP_WIRE and phase 1 is EMP_INV, this loop forwards the wire load first, then adds the inverter input capacitance to the already-processed wire phase. That capacitance never reaches the actual driver. Consequently, even full retiming can underestimate delay and incorrectly report that the -D target is met. Please accumulate the inverter loads before forwarding loads through wires.
| Flow = pFam->Area[m] + LeafFlow; | ||
| if ( fArea && pB->Type != EMP_NONE && Flow > pB->Flow + 0.0001 ) | ||
| break; | ||
| Emp_CellArrival( p, pCell, pCutLeaves, Load, fLeafLoad, nMem == 1 ? -1 : m, &Cand ); |
There was a problem hiding this comment.
[P2] Do not use family size to disable NLDM timing.
A cell family with one member makes nMem == 1 even when NLDM is enabled and gain mode is off. Passing iMem = -1 here selects load-independent timing, and the nMem > 1 condition below also skips the leaf-load check. Area-flow matching therefore uses inconsistent timing for single-size families. Select the approximation using fGainMode/fNldm independently of family size. The MOG area-flow path repeats this issue.
| SC_Cell * pCell; | ||
| int i; | ||
| p->pScl = p->pPars->fNldm ? (SC_Lib *)Abc_FrameReadLibScl() : NULL; | ||
| if ( p->pScl == NULL || Abc_SclCellFind(p->pScl, Mio_GateReadName(Mio_LibraryReadInv(p->pMio))) < 0 ) |
There was a problem hiding this comment.
[P2] Validate the inverter before initializing NLDM.
With Liberty data loaded and no inverter in the current GENLIB, Mio_LibraryReadInv returns NULL and Mio_GateReadName dereferences it here. The missing-inverter check in Emp_LibPrepare runs only after Emp_ManStartNldm, so the command can crash before reporting the error. Please check the inverter before this lookup or perform the library validation first.
…, Emp_ManStartNldm
…in the cover has one node
|
New modifications were tested using EPFL benchmarks using sky130_fd_sc_hd__tt_025C_1v80 library. Resyn2 used as the preprocessing step. Delay and area recorded with 'stime' command. Runtime was recorded using 'time' command. emap -O vs emap (sky130)
|
|
emap -O vs emap -D <delay from emap -O> (sky130)
Resyn2 used as the preprocessing step. Delay and area recorded with 'stime' command. Runtime was recorded using 'time' command. |
|
Thank you very much for addressing the four points from the earlier review. I found three more correctness issues and three minor issues with timing, export, and area recovery.
For the benchmark results, I’d ask to confirm equivalence against the exported netlist. |
…in ioWriteEdgelist.c, reject sequential networks:Emap_Command in emap.c, adding Emp_ManReplaceLoneMogs to replace one output used two-output cells with single output cells if possible, and modifications in emapMap.c based on review comments
|
Thanks for the review comments. emap -O vs emap
emap -O vs emap -D <delay from emap -O as the target>
|
Priority cuts with cached matches. Area flow and exact area under a delay target. Exact area decision is timed incrementally and undone if an output misses the target. When liberty data available, cells timed with NLDM tables with loads. Original implementation runs with emap -O