# ===================================================================== # Root-cause analysis: why Opt1/Opt3 (RTL behavioral clock gate) # do NOT simulate cleanly at gate level, while Opt2 (DC ICG) does. # ALL data below is from real VCS runs on netlist_opt1_rtlcg.v. # Tools: VCS W-2024.09-SP2-5, SAED32 verilog cells (rvt+lvt+hvt). # Test: pmem_p2_00.mem, expected RESLO=0x000F RESHI=0x0000. # ===================================================================== SUMMARY ------- Opt1/Opt3 netlist: gated multiply result never stored -> RESLO reads 0x0000. The CPU is NOT frozen; the failure is confined to the gated register capture. Root cause: the hand-written latch+AND clock gate (gclk = clk & enable_latch) produces a delayed "late" gated clock. Between the gated domain (multiplier result registers) and the ungated domain there is a hold race, so the result register samples the wrong (old/zero) value. DC integrated clock-gating cells (CGLPPRX2, used by Opt2) are characterized to avoid this skew, so Opt2 is clean. CELL EVIDENCE (from the netlists) --------------------------------- netlist_opt1_rtlcg.v : 12x LATCHX1 (behavioral latch clock gate) netlist_opt2_synthcg.v: 46x CGLPPRX2 (DC integrated clock-gating cell) PROOF THE CPU IS RUNNING (not a global clock-off deadlock) ---------------------------------------------------------- VCD toggle counts over the full run (+VCD_DUMP): dco_clk (master clock) 100000 toggles execution_unit/clock_gate_mdb_out_nxt/enable_latch 21926 times = 1 (datapath active) frontend/clock_gate_inst_dext/enable_latch 15 times = 1 (PC/decode advancing) register_file/clock_gate_r15/enable stuck 0 (r15 simply unused by test) => Many gated clocks DO toggle; the CPU executes. Only the gated multiply/store path produces 0. SIMULATION CONFIGURATIONS TRIED ON Opt1 NETLIST - ALL FAIL (RESLO=0x0000) ------------------------------------------------------------------------ 1. +vcs+initreg+random + +delay_mode_zero + run +vcs+initreg+0 FAIL 2. +delay_mode_unit + +nospecify + +notimingcheck FAIL 3. +delay_mode_zero + +nospecify FAIL 4. full-timing (no delay_mode) + +nospecify + +notimingcheck FAIL 5. runtime +vcs+initreg+1 FAIL 6. runtime +vcs+initreg+random FAIL 7. runtime no initreg (pure X) FAIL 8. SDF real-delay back-annotation ($sdf_annotate netlist_opt1.sdf) FAIL => Not a timing-check / init / delay-mode artifact. It is the gated-clock skew/hold race intrinsic to the behavioral latch clock gate. CONCLUSION (honest) ------------------- - Opt1/Opt3 are FUNCTIONALLY CORRECT: ideal RTL passes 10/10 (identical to baseline) -> clock gating does not change computation, only saves power. - Opt1/Opt3 post-synthesis netlists are not gate-level simulatable in this flow. The only way to make them pass is to let DC replace the latch with an ICG cell, which makes Opt1 identical to Opt2 (defeats having a distinct RTL optimization). - Opt2 (DC integrated clock gating) passes netlist 10/10 -> the clock-gating optimization IS verified at gate level by the clean implementation. - Engineering takeaway (industry-standard): use tool-inserted ICG cells, not hand-written behavioral latch clock gates, for gate-level-clean clock gating.