Synthesis Bugs

I've been pretty busy over the last month, and it probably won't get any better over the next two weeks! So this post is a bit of a cop-out to hit my once-per-month goal.

I was interviewing at a certain arrow-having company last week. There was a question about what a really hard technical bug I had to debug was, and how I solved it. I ended up talking about a bug in Synopsys Design Compiler that I found when I was taping out my chip.

Specifically, DC decided to completely elide a reset from a flip-flop during synthesis, and I found this out the hard way when debugging Post-Place-and-Route simulation.

The interviewer was understandably skeptical. Synopsys has a near-monopoly when it comes to RTL synthesis in the silicon industry, as pretty much every team will default to using DC. Logical equivalency is a fairly important part of the synthesis process, so DC completely nuking a reset is fairly hard to believe.

I should write a longer blog post with more evidence about this at some point, but for now here's the FSM change that made our chip go from not-working to working in Post-PNR simulation. Here's the one that didn't work:

// cacheline adapter
  always_comb begin
    if (rst) state_b = REQ;
    else
      unique case (state)
        REQ:     state_b = arb_bus.dfp_read ? RDADDR : WRBUF;
        RDADDR:  state_b = RDBUF;
        RDBUF:   state_b = REQ;
        WRBUF:   state_b = REQ;
      endcase

  end

  assign state_en = rst | arb_bus.dfp_ack | (&burst_ctr) |
                    ((state == RDADDR) & arb_bus.dfp_rdata_valid);
  always_ff @(posedge clk) if (state_en) state <= state_b;

And here's the one that worked.

always_ff @(posedge clk) begin
    if (rst)
      state <= REQ;
    else begin
      case (state)
        REQ: if (arb_bus.dfp_ack) state <= arb_bus.dfp_read ? RDADDR : WRBUF;
        RDADDR: if (arb_bus.dfp_rdata_valid) state <= RDBUF;
        RDBUF: if (&burst_ctr) state <= REQ;
        WRBUF: if (&burst_ctr) state <= REQ;
      endcase
    end
  end

If the two snippets seem the same, that's because they should be under our assumptions for how different signals would reset. Behavioral simulation worked with both versions.

So TL;DR synthesis tools can be wrong!

My interviewer did ask why I didn't do LEC, which is actually a pretty fair criticism. I don't think I was aware LEC existed until my interview, so that probably had something to do with it…


← Back to Ramblings | Written: 11/16/2026