Emulation, Honestly

An emulator runs a whole chip's RTL in special hardware, fast enough for software. This site has none, so this page explains how emulators are built and used, from the book, and runs nothing on one.

You Will Be Able To

  • Explain what an emulator does that a simulator cannot, and what it costs.
  • Name the three ways emulators are built, as the book describes them.
  • Tell in-circuit, transaction-based, signal-level and stand-alone use apart.
  • Explain why a long compile can make a fast box slower to debug with, and how a failure goes back to simulation.
Lesson
V13.5
Time
22 min
Runs on
Your browser
Check
5 questions

The final RTL must boot an operating system before tape-out. The VP boots it, but the VP is not the chip. Simulating the boot on the chip's RTL would take longer than the team has.

A Design Mapped into a Box of HardwareThe RTL is compiled into an emulator; a workstation, a real board or a bench inside the box drives it.
  • File
  • Tool
  • External
  • Test
  • Pads
  • Debug
  • Data
  • Transaction / TLM
  • Debug
A Design Mapped Into a Box of HardwareThe RTL is compiled into an emulator; a workstation, a real board or a bench inside the box drives it. file Chip RTL synthesizable tool Compile partition, synthesize,place external Emulator many chips run thedesign test Workstationbench transactions or pins pads Target board through a speedbridge debug Visibility signals captured inthe box hours, not secondsloadedaccelerationin-circuitwaveforms
  1. file Chip RTLsynthesizable
    • hours, not seconds → Compile
  2. tool Compilepartition, synthesize, place
    • loaded → Emulator
  3. external Emulatormany chips run the design
    • waveforms → Visibility
  4. test Workstation benchtransactions or pins
    • acceleration → Emulator
  5. pads Target boardthrough a speed bridge
    • in-circuit → Emulator
  6. debug Visibilitysignals captured in the box
  1. Compile

    The RTL is partitioned across the box's chips and synthesized into them. This takes far longer than a simulator's compile.

  2. Drive it

    A bench on a workstation, a real target board, or a bench inside the box.

  3. See inside

    The box captures signals for debug. The book's three ways of building an emulator pay for that in different ways.

Read the diagram as text
  • Chip RTL: synthesizable
  • Compile: partition, synthesize, place
  • Emulator: many chips run the design
  • Workstation bench: transactions or pins
  • Target board: through a speed bridge
  • Visibility: signals captured in the box
  • Chip RTL → Compile: hours, not seconds
  • Compile → Emulator: loaded
  • Workstation bench → Emulator: acceleration
  • Target board → Emulator: in-circuit
  • Emulator → Visibility: waveforms

Drawn from MEHTA-DV 12.2 and 15.6. ASIC Point has no emulator: nothing on this page was run on one.

What This Page Can and Cannot Show

Before You Start

Read Hybrid: a Model Core With RTL Peripherals first: the transactor there is the same idea an emulator's link uses.

Five questions this page answers
Question
1What does an emulator do, and why is it fast?
2How are emulators built?
3What are the ways of driving a design in an emulator?
4What do compile time and visibility cost?
5How does a failure found on an emulator get debugged?

The Idea: Run the RTL in Hardware Built for It

A simulator is a program that computes every signal, one after another, on a processor. An emulator turns the RTL into hardware: many chips, wired together, each running a piece of the design at once. Every clock of the design takes a fixed, short time.

The price is paid before the run. The RTL is split across the chips and synthesized into them, which takes far longer than compiling for a simulator. And seeing inside the design costs capture hardware or speed.

So an emulator wins on long runs of a stable design: software on the final RTL, billions of cycles. A simulator wins on short runs of a design that changes every hour.

New Words

New words on this page
WordMeaning
EmulatorHardware that runs a design compiled into it, for verification, with means to see inside.
In-circuit emulation (ICE)The real target system, such as a board, drives the design in the box.
AccelerationA bench on a workstation drives the design in the box through a link.
Transaction-basedThe link carries transactions to transactors in the box, not pin values each clock.
Stand-aloneA synthesizable bench goes into the box with the design; it stops only for new stimulus or to unload captured data.
Speed bridgeHardware between a fast real interface and a slower emulated design: it buffers or slows the real side.
VisibilityHow many internal signals can be seen, and at what cost.

The Smallest Example: A Day of Debug

The book makes a point about compile time. On a small design, a one-hour simulation can do more than a ten-second emulation. The reason is the turn: change, compile, run, look.

Turns in an 8-hour day (an exercise; the minutes are invented)
PlatformCompileRun and lookTurns a day
Simulator5 min60 min7
Emulator180 min5 min2

The emulator ran faster and still gave fewer turns. For a design that changes often, the compile decides.

The Rules

  1. Rule 1: Count the turn, not only the run.

    Compile, run and debug together decide how many changes a day you can test.

  2. Rule 2: Match the mode to the job.

    A real board drives in-circuit; a workstation bench drives through a link; a synthesizable bench runs stand-alone.

  3. Rule 3: Cross the link in transactions.

    A bench that exchanges pins every clock holds the box to the workstation's speed.

  4. Rule 4: Bridge real interfaces.

    The box runs slower than the real world, so a speed bridge buffers or slows the real side.

  5. Rule 5: Debug in simulation when you can.

    Run the failing snippet in simulation, where every signal is visible.

Sources for These Rules (MEHTA-DV, chapter 12 and 15.6)

MEHTA-DV 12.1: software needs billions of cycles. A virtual platform joined to RTL in simulation is possible but too slow for software.

MEHTA-DV 12.2.1: emulation maps the design into reconfigurable hardware. There are three architectures: commercial FPGAs, a custom emulator-on-chip, and custom processors.

The book names three commercial systems as examples. They are Veloce-2 of Mentor Graphics, Palladium of Cadence, and ZeBu Server-3 of Synopsys.

MEHTA-DV 12.2.2: compile time, and the one-hour simulation against the ten-second emulation.

MEHTA-DV 12.2.3: emulators aim at debug with full visibility. FPGA prototypes aim at speed, with little debug.

MEHTA-DV 12.2.4: in-circuit use, acceleration through PLI or DPI with limited speed-up, transaction-based acceleration, stand-alone use, embedded software.

MEHTA-DV 12.3: most emulators run at a few MHz. A speed bridge buffers the data or slows the real side.

MEHTA-DV 12.4: transactors join a virtual platform to the emulator, through SCE-MI. They must synthesize into the box.

MEHTA-DV 12.4.1: run the failing snippet in simulation-only mode, with full visibility.

MEHTA-DV 12.5: acceleration runs in kHz and emulation in MHz. Section 16.11 says acceleration reaches a few MHz at best.

The book is not consistent on that figure, so this page gives no number for it.

MEHTA-DV 15.6: emulation in the life cycle, and a scaled-down speed of the real system.

The Lab: Only Arithmetic

This page cannot run an emulator. It can do the sum. Verilator ran ap_soc at 217,258 system clocks a second on this laptop (measured, V13.1). For the emulator the slice uses 1 MHz. That is an exercise value, not a measurement: 12.3 says only that most emulators reach a few MHz.

The slice below: one billion cycles at each rate. The second line is an assumption, not a measurement.
Verilator RTL (measured)         217258 cycles/s: 4602 s (1 h)
emulator (assumed 1 MHz)        1000000 cycles/s: 1000 s (0 h)

Rule 1 again: those hours are the run. The emulator's compile, and the time to bring a failure back to simulation, come on top.

Why It Is Built This Way

Why many chips and not one big processor? A processor computes signals one after another; hardware computes them all at once. Splitting the design across many chips keeps every clock short however big the design is.

Why is visibility hard? In a simulator a signal is a variable you can print. In an emulator it is a wire inside a chip. Capturing it needs extra hardware or costs speed. The book says an emulator built from commercial FPGAs trades speed for full visibility. A custom emulator chip builds the capture into its silicon.

Why transactions across the link? A link that carries pin values every clock makes the box wait for the workstation every clock. Transactions let the box run many clocks per message.

Traps

The first trap is moving a design to an emulator too early. The RTL still changes every day, each change costs a long compile, and the team does fewer turns than in simulation.

The second is keeping the old bench unchanged and linking it pin by pin. The box then runs at the speed of the workstation, and the money buys little.

The third is debugging in the box what could be debugged in simulation. The shortest path is often to replay a small piece of the failure in simulation, with every signal visible.

At Scale

ap_soc~12 blocks
Phone-class SoChundreds of blocks

This section looks ahead, from the book. None of it ran here.

  1. Capacity

    Large designs are split across many chips of the box; the split itself is part of the compile.

  2. Power

    The book notes emulation can record the switching activity of a whole chip for power estimates.

  3. Virtual platforms joined to emulators

    A VP runs the software and transactors join it to the RTL in the box; both run fast.

Try It

Run it: one billion cycles at the measured Verilator rate and at an assumed 1 MHz.

Which line is a measurement, and which is an assumption?

Change the job to a hundred billion cycles. Is either line now a day's work?

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: Verilator RTL (measured) 217258 cycles/s: 4602 s (1 h) emulator (assumed 1 MHz) 1000000 cycles/s: 1000 s (0 h)

Check Yourself

Predict the outputThe job is now a hundred billion cycles. What is the last line printed?
// Time to run one job of 100000000000 cycles at three clock rates (cycles a second).
module tb;
  longint rate [0:1];
  string name [0:1];
  longint s;
  initial begin
    name[0] = "Verilator RTL (measured)"; rate[0] = 217258;
    name[1] = "emulator (assumed 1 MHz)"; rate[1] = 1000000;
    for (int i = 0; i < 2; i++) begin
      s = 100000000000 / rate[i];
      $display("%-28s %10d cycles/s: %0d s (%0d h)", name[i], rate[i], s, s / 3600);
    end
    $finish;
  end
endmodule
ConceptWhat makes an emulator fast?
ConceptA real camera board drives the design in the box. Which mode is that?
ConceptWhy can a one-hour simulation beat a ten-second emulation?
ConceptA failure shows on the emulator. What does the book suggest for debug?

Common Mistakes

Wrong Quote an emulator's speed as a fact without a source.

Rates depend on the product, the design and the visibility asked for; the book itself gives ranges.

Fix Cite the range and its source, or measure.

Wrong Link the old bench to the box pin by pin.

The box waits for the workstation every clock.

Fix Split the bench: transactors in the box, transactions across the link.

Wrong Choose emulation for a design that changes every hour.

Each change costs a long compile.

Fix Simulate until the RTL is stable; emulate the long runs.

Remember

  • An emulator runs compiled RTL as hardware: fast per cycle, slow to compile, costly to see into.
  • Modes: in-circuit, acceleration (pins or transactions), stand-alone with a synthesizable bench.
  • A speed bridge joins a fast real interface to the slower box.
  • Count the whole turn, and hand failures back to simulation. This site runs no emulator; everything here is from the book.

Practice

Report a problem with this page