TDEB Top Bar

Trending
Semiconductor Industry News — The Digital Electronics Blog
Follow Us

TDEB Masthead

The Semiconductor Hub

Semiconductors.  Chips and Systems.  Innovation.

Indexed by leading Search Engines, AI and referenced by Engineers worldwide 500+ Articles 10M+ Pageviews 30+ Reports 50+ Citations

Gate Level Simulation: Introduction and Why GLS Is Still Needed

The Editor's Desk
by
3
Share Facebook X LinkedIn WhatsApp Email

Gate level simulation (GLS) is the simulation of a synthesized or post-layout netlist, built from standard cells and flip-flops, instead of the RTL it came from. Teams still run it, even with mature static timing analysis (STA) and formal equivalence checking (LEC), because GLS catches the things those static tools assume away: reset and boot problems, X behavior that RTL hides, inserted test logic, wrong timing constraints and real switching activity for power.

This introduction explains what GLS is, why it is still needed, the two main ways it is run, and the problems that make it hard to bring up.

Logic gate symbols representing a gate-level netlist

Key takeaways

  • GLS simulates the netlist that will actually be built, so it sees what synthesis, scan insertion and clock tree synthesis added.
  • It does not replace STA or LEC. It checks the assumptions and constraints those tools depend on.
  • Zero-delay GLS is mainly a functional check (reset, boot, X handling, DFT). Timing GLS with back-annotated SDF checks constraints, asynchronous paths and real delays.
  • GLS is slow and only as good as its test vectors, so teams run a small, carefully chosen set of tests.
  • X behavior differs: RTL is often too lenient about unknowns, gate level is often too strict. Both can mislead.

What gate level simulation is

After synthesis, the design is no longer a set of always blocks and assignments. It is a netlist of library cells such as AND, OR, NAND, multiplexers, flip-flops and latches, each described by a Verilog simulation model from the library vendor. GLS runs the same kind of testbench against this netlist.

The gate level is the lowest level of abstraction normally used for digital logic simulation. Below it sit transistor-level (SPICE) simulation and layout, which are used for cells and analog blocks rather than whole digital chips.

A GLS can be run on:

  • the post-synthesis netlist, with estimated or no delays, or
  • the post-layout netlist, after placement, clock tree synthesis and routing, with delays back-annotated from an SDF (Standard Delay Format, IEEE 1497) file produced by the timing tool.

Why we still need GLS

With wide acceptance of STA and formal verification tools by the industry, one question still comes up: why do we need gate level simulation at all? The common reasons quoted by engineers fall into a few groups.

1. Reset, initialization and boot-up

GLS checks that reset release, the initialization sequence and boot-up work on the real netlist. Flip-flops without reset, reset synchronizers, power-on sequencing and memory initialization often behave differently once the RTL shortcuts are gone. Any unintended dependency on initial conditions shows up here as X values that do not clear.

2. Logic added after RTL

Scan chains, test compression, clock gating cells and some power management logic are inserted during or after synthesis. They never appear in RTL simulation, so RTL tests cannot check them. GLS is also required to simulate ATPG patterns and to generate or validate ATE test vectors.

3. Validating timing constraints

Static tools are constraint-based and only as good as the constraints they are given. STA does not analyze asynchronous interfaces, and it trusts every false path and multicycle path it is told about. Timing GLS helps catch:

  • unchecked use of wildcards that sets false paths or multicycle paths where they do not belong;
  • late design changes that never propagated into the constraints;
  • a wrong understanding of the design, or a simple typo, leading to incorrect exceptions;
  • use of create_clock where create_generated_clock was needed, which breaks the relationship between clock domains.

4. X behavior

X values in RTL simulation can be too strict or too lenient. An if statement with an unknown condition takes the else branch, which can hide a real problem. A gate netlist is usually more pessimistic, and can produce X where silicon would settle to a known value. GLS shows how unknowns really propagate through the cells that will be built. The example below makes this concrete.

5. Power

GLS gives switching activity (SAIF or VCD/FSDB) on the real netlist, including clock tree and glitch activity. This is used to estimate power and to correlate RTL power estimates with the implemented design.

6. Other uses

  • Verifying the integration of digital and analog netlists.
  • Validating a tool flow change, for example when moving from one vendor's sign-off tool to another.
  • Checking that RTL simulations were not relying on force statements from the testbench that masked bugs.
  • An honest confidence check, a feel-good factor, that the design has been implemented correctly.

Where GLS complements STA and formal

AreaWhat GLS addsWhat it does not replace
FunctionalitySimulates the gates and flip-flops that will be built, including inserted logicLEC, which proves RTL and netlist equivalent for all inputs
TimingShows real delays and timing check violations for the vectors run, and exercises asynchronous pathsSTA, which covers every path exhaustively; GLS only covers the paths the test happens to activate
DebugExposes glitches, races, reset and X problems in the netlistRTL debug, which is far faster for logic bugs
PowerRealistic switching activity for power analysisPower sign-off tools, which use that activity as input

A point worth being precise about: GLS does not prove that a design meets timing. It can show a violation on the paths a test exercises, and it can reveal a bad constraint, but sign-off timing comes from STA.

How a team typically uses GLS

A common pattern is two passes. Soon after synthesis, a zero-delay GLS runs a handful of tests to prove the netlist resets, boots and passes data, and that scan and clock gating were inserted correctly. Near tape-out, a timing GLS with delays from the layout runs a smaller set of tests at the worst and best corners, to catch constraint mistakes and problems on asynchronous paths. In between, STA and equivalence checking carry the load, because they are exhaustive and much faster.

Deep dive: the numbers and details

This part compares the two GLS modes, walks through SDF back-annotation, shows in code how RTL can hide an X that gates expose, and how gates can invent one, and lists the bring-up problems. Skip it if the overview is all you need.

Zero-delay GLS and timing GLS

Some design teams use GLS only in a zero-delay, ideal clock mode, to check that the design comes out of reset cleanly and that the test structures were inserted properly. Other teams run fully back-annotated simulation as a way to check that the static timing constraints were set up correctly.

Zero-delay (or unit-delay) GLSTiming GLS with SDF
NetlistPost-synthesis, often before layoutPost-layout, with clock tree
DelaysNone or a nominal unit delayCell and wire delays from SDF, per corner
Timing checksUsually switched offOn ($setup, $hold, $width and similar in the cell models)
FindsReset, boot, X, DFT and connectivity problemsConstraint errors, asynchronous path issues, real hold or setup violations on exercised paths
Typical problemsRaces between flip-flops when every delay is zeroSlow runs, X from timing checks on synchronizer flops, SDF annotation warnings
SpeedSeveral times slower than RTLMuch slower again

Speed figures vary widely with design size, simulator and delay mode; treat the relative ordering above as a guide, not a measurement.

SDF back-annotation in practice

The Standard Delay Format was standardized as IEEE 1497-2001, later adopted as the dual-logo IEC/IEEE 61523-3-2004. An SDF file is plain text written by the timing tool for one corner (or with min:typ:max triples) and read by the simulator. Its main parts are:

  • IOPATH entries: cell delays from each input pin to each output pin, with separate rise and fall values.
  • INTERCONNECT entries: wire delays from a driver pin to each load pin.
  • Timing checks: SETUP, HOLD, RECOVERY, REMOVAL, WIDTH and similar limits that replace the defaults in the cell models' specify blocks.

A cell entry looks like this (values in ns, as min:typ:max):

(CELL
  (CELLTYPE "AND2X1")
  (INSTANCE u_core/u_alu/U123)
  (DELAY
    (ABSOLUTE
      (IOPATH A Y (0.080:0.085:0.091) (0.074:0.079:0.086))
    )
  )
)

In a Verilog testbench the file is usually loaded with the $sdf_annotate system task, naming the SDF file, the instance it applies to and, optionally, a log file and which of min, typ or max to use. Three numbers are worth checking in every annotation log: how many IOPATH and INTERCONNECT entries were annotated, how many failed to match a path in the cell model, and how many timing checks were annotated. A large count of unmatched entries usually means the library models and the SDF came from different library versions, and the simulation is then running partly on default delays.

Worked example of why a corner matters. Suppose a hold path in the fast corner has 40 ps of clock-to-Q, 25 ps of logic and a 70 ps hold requirement with 0 ps skew. STA reports 40 + 25 - 70 = -5 ps of hold slack. A timing GLS at that corner shows a hold violation from the flip-flop model only if a test actually toggles that path; a GLS at the slow corner never shows it. That is why GLS supports STA rather than replaces it. These numbers are illustrative.

Example: RTL hides an X, the gate level adds one

The small example below compares an RTL 2:1 multiplexer with a gate-level version of the same function. The select line is driven to X, as it might be if it came from a flip-flop that was never reset.

`timescale 1ns/1ps
// RTL view of a 2:1 mux
module mux_rtl (input a, b, sel, output reg y);
  always @* begin
    if (sel) y = a;
    else     y = b;
  end
endmodule

// Gate-level view of the same mux, as synthesis might produce it
module mux_gl (input a, b, sel, output y);
  wire sel_n, t0, t1;
  not  #0.05 u0 (sel_n, sel);
  and  #0.08 u1 (t0, a, sel);
  and  #0.08 u2 (t1, b, sel_n);
  or   #0.09 u3 (y, t0, t1);
endmodule

module tb;
  reg a, b, sel;
  wire y_rtl, y_gl;
  mux_rtl r (.a(a), .b(b), .sel(sel), .y(y_rtl));
  mux_gl  g (.a(a), .b(b), .sel(sel), .y(y_gl));
  initial begin
    a = 1'b1; b = 1'b0; sel = 1'bx;  #1;
    $display("a=1 b=0 sel=x : rtl y=%b  gate y=%b", y_rtl, y_gl);
    a = 1'b1; b = 1'b1; sel = 1'bx;  #1;
    $display("a=1 b=1 sel=x : rtl y=%b  gate y=%b", y_rtl, y_gl);
    sel = 1'b1; #1;
    $display("a=1 b=1 sel=1 : rtl y=%b  gate y=%b", y_rtl, y_gl);
    $finish;
  end
endmodule

Output:

a=1 b=0 sel=x : rtl y=0  gate y=x
a=1 b=1 sel=x : rtl y=1  gate y=x
a=1 b=1 sel=1 : rtl y=1  gate y=1

In the first case the RTL quietly takes the else branch and outputs 0. Silicon could output 0 or 1, so the RTL has hidden a real uninitialized-select bug: the RTL was too lenient about X. In the second case both data inputs are 1, so real hardware would output 1 whatever the select is, but the gate model outputs X: that is X pessimism. Real libraries often model multiplexers with user-defined primitives that handle this case better, but the same effect appears across chains of simple gates. GLS exposes the first kind of problem, and the second kind is one of the reasons GLS is painful to bring up.

Why GLS is hard to bring up

Getting a GLS up and running is usually accompanied by a series of frustrating problems. They come from a few places:

  • The library vendor: cell models with incomplete X handling, missing or inconsistent timing checks, specify blocks that do not match the SDF, and differences between simulators.
  • The design: flip-flops without reset that start at X and never clear, synchronizer flops that legitimately violate setup and hold and so produce X from timing checks, memories and analog models that need their own behavioral views.
  • Synthesis and implementation: renamed or flattened hierarchy that breaks testbench probes and force paths, constant propagation and register merging that change what the testbench expects, and scan or clock gating logic that needs correct test mode settings.
  • Back-annotated SDF: annotation warnings, interconnect delays on the wrong pins, choosing the right corner, and the long run times of full timing simulation.

Later posts in this series look at examples of each of these problems: from the library, from the design, from synthesis, and the extra challenges of gate level simulation with back-annotated SDF.

Common mistakes

  • Treating a clean timing GLS as timing sign-off. Only STA covers all paths.
  • Running the whole RTL regression at gate level. Pick tests that cover reset, boot, each clock domain crossing, each test mode and the power modes.
  • Switching off all timing checks to get rid of X, which also hides real violations. Disable them only on the specific synchronizer cells that are meant to see asynchronous data.
  • Initializing every flip-flop to 0 or 1 with a simulator option and then believing the reset check passed. Random initialization, run with several seeds, is a more honest test.
  • Leaving testbench force statements that point at RTL signal names, which silently do nothing once hierarchy has changed.

Frequently asked questions

Is gate level simulation still needed if STA and LEC are clean?

Usually yes, but in a reduced form. STA and LEC are exhaustive for what they check, but they trust their constraints and setup. GLS checks reset and boot, inserted test logic, asynchronous paths and the constraints themselves.

What is SDF back-annotation?

The timing tool writes cell and interconnect delays for a chosen corner into an SDF file. The simulator reads it, typically through the $sdf_annotate system task, and replaces the default delays in the cell models with those values.

Why does GLS show X when RTL simulation was clean?

Common causes are flip-flops without reset, gate models that are more pessimistic than RTL, timing check violations on synchronizer flops, and memories or analog blocks without proper models. Each X needs to be traced to its source rather than masked.

How many tests should run at gate level?

There is no fixed number. Teams typically choose a small set that covers reset and boot, every major mode, each test mode, every clock domain and the power states, plus ATPG pattern simulation.

Further reading

The Editor's Desk
About the Author
The Editor's Desk
Share Facebook X LinkedIn WhatsApp Email

Post a Comment

3 Comments

Your comments will be moderated before it appears here.

  1. where can I find the rest of the articles (sources of trouble, challenges etc.) ???

    ReplyDelete
  2. Good introduction. Post was helpful. thanks!

    ReplyDelete
  3. https://gatelevelmodeling.blogspot.com/2021/01/error-during-simulation-vwfwave-form.html

    ReplyDelete
Post a Comment

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn more
Ok, Go it!