With the addition of UVM capabilities, Verilator has become a respected industrial grade simulator. But there remains a problem: IP licensing.

When using commercial simulators, the proprietary IPs and VIPs lean on the simulator’s license manager (e.g. FlexLM); Verilator has nothing like that, so if your design or verification infrastructure uses commercial IPs, you cannot use Verilator.

However there may be a solution. In our demo, a basic license unlocks plain addition, standard adds saturating addition, and advanced adds error injection.

The IP License Checker

In cases where the simulator cannot enforce the license, the IP itself could enforce the license, with the employment of this scheme . Vendors already ship compiled code with the IP. The license check could be integrated into the this library.

In practice, the vendor ships three files:

  • a small SystemVerilog wrapper that the customer instantiates like any other module,
  • a precompiled library holding the IP’s real behavior and the license client,
  • a C header for the DPI functions.

The wrapper uses three DPI-C calls:

initial  licensed = ip_license_checkout("licensed_ip_name");  // once, at start
...      if (!ip_check_feature(FEAT_SAT)) $fatal(...);         // before each gated feature
final    ip_license_checkin();                                 // release the seat

The customer links the library that contains a RO license configuration.

The Licensing Scheme

A license is a signed token (e.g. an RS256 JWT). The vendor signs it with a private key. The client inside the IP checks it with a public key compiled into the library. The token holds the product name, the feature mask, an expiry time and, optionally, a host fingerprint.

The licensing sits inside the vendor’s compiled library. The testbench and the simulator only see ordinary DPI calls.

The client can get that token from three places. All three use the same token format and the same verification code:

BackendWho runs itGood for
JWT serverVendorSimplest online checkout, with a seat limit per license key
Keygen CEVendorOff-the-shelf licensing service with machines, policies and floating seats
Site daemonCustomerAir-gapped or high-volume farms: one vendor-signed activation file, seats counted locally

Each backend also has an offline mode, where the token is just a file the customer references. This works for air-gapped sites and keeps CI hermetic. One environment variable picks the backend and another picks the mode. The SystemVerilog never changes.

The site daemon has a “chained” option. The vendor signs an activation license that includes the daemon’s own public key. The daemon then issues short-lived session tokens, and the client checks the whole chain. The client also keeps only features that appear in both the activation and the session, so a misbehaving daemon can’t grant more than the vendor granted.

Hardening at the archiving stage

The signature stops anyone from forging a license. It doesn’t stop a customer from tampering with the code that checks it. We can add 3 security layers on top:

  1. Hidden symbols: the library is compiled with -fvisibility=hidden, so ip_check_feature isn’t exported.
  2. --protect-lib: Verilator can compile the SystemVerilog body into an opaque binary blob, so the customer gets no readable RTL.
  3. Behavioral entanglement: each license carries a secret, and the IP derives one of its internal constants from it (the saturation limit for saturating add). Patch out the license check and you don’t crash. You get wrong answers, which is worse for a cheater because they may not notice.

The same API also works in a UVM-style verification IP. There, the checkout runs in build_phase and the feature bits decide whether the monitor, driver and coverage components get built at all.

Wrapping up

Verilator doesn’t block the deployment of systems embedding commercial IP, relying on the simulator for licensing does. Put the checkout inside the IP and that simulator limitation no longer matters. Signed tokens, a swappable backend and a little behavioral entanglement then get you to roughly FlexLM-level protection.

Let us know what you think. We’d love to hear from you. We have already drafted a demo which demonstrates the proposed architecture.

Get in touch if you’d like to see it and have a discussion about it.