18
Encryption
Encryption allows you to protect your proprietary parameters, subcircuits, models, and netlists, and release your libraries to your customers without revealing sensitive information. Your customers can run simulations in the Spectre® circuit simulator with the encrypted netlists – the Spectre circuit simulator does not print any data inside the encrypted blocks. Messages about the encrypted portions of your circuit are suppressed.
You can encrypt netlists that are in the Spectre and Berkeley SPICE formats.
You cannot use encryption if you are using the Spectre Compiled-Model Interface (CMI).
This chapter covers the following topics:
New key for Encryption
Starting with the SPECTRE19.1 release, Spectre uses a new key (k -4) as default. You can use the k-3 option to invoke the old key. The following table lists the usage of the key in the SPECTRE18.1 ISR8 and SPECTRE19.1 releases.
Encrypting a Netlist
- Open the netlist you want to encrypt in a text editor.
-
Type
PROTectabove the data you want to protect. The capital letters indicate the shortest legal abbreviation, so you achieve the same affect by typing prote or protec for example. -
Type
UNPROTectafter the last line of the data you want to protect. The capital letters indicate the shortest legal abbreviation, so you achieve the same affect by typing unprote or unprotec for example.
You must use theprotectandunprotectkeywords in pairs. - Save the netlist.
-
In a terminal window, type
spectre_encrypt [-i
whereinput_file][-ooutput_file] [-all] [-key 1|2|3|4]
The Spectre circuit simulator uses the SSL CRYPTO library to encrypt your netlist.
spectre_encrypt does not require any license, however, it checks for the existence of any of the 32500, Virtuoso_Multi_mode_Simulation, Virtuoso_Spectre, Virtuoso_Spectre_XL, or Virtuoso_Spectre_GXL licenses. If any of these licenses is not available, it generates an error.
The protect and unprotect keywords are replaced with pragma statements in the output netlist. The pragma statements contain important information about encryption such as the method used, the key name, and the beginning and end of the encrypted block. The Spectre circuit simulator uses this information while decrypting the netlist. Hence it is important that you do not modify any pragma statement or the encrypted text between the pragma statements in the output file.
What You can Encrypt
You can encrypt signals, netlist and subcircuit parameters, files, devices, and model cards. You can use multiple pairs of protect, unprotect to encrypt different portions of your netlist. The content inside the protect, unprotect block is encrypted and the content outside this block remains the same as the original netlist.
Encrypting a File
You can encrypt a file by adding protect at the beginning and unprotect at the end of the file.
Encrypting Subcircuits
As described in the following sections, you can encrypt an entire subcircuit, part of a subcircuit, or multiple subcircuit blocks.
Encrypting an Entire Subcircuit
To encrypt an entire subcircuit, place protect before the subckt and unprotect after the ends statement. This encrypts the subcircuit name as well as the I/O pins. Since the interfaces are not readable after encryption, Cadence recommends that you add some information on how the interface works outside the protected block so that your users can create Composer symbols for simulation.
All flattened primitive devices expanded from a protected subcircuit are also protected.
Encrypting a Subcircuit without Interfaces
To encrypt the contents of a subcircuit leaving its name and I/O pins public, place protect after subckt and unprotect before ends.
Encrypting Portions of a Subcircuit or Multiple Subcircuits
You can use multiple pairs of protect and unprotect in a subcircuit to protect portions of it. See the example below.
If you have multiple subcircuits in your netlist, you can encrypt them by using multiple pairs of protect and unprotect as shown in the example above.
Encrypting a Model Card
You can encrypt one or more model cards with a pair of protect and unprotect keywords. The keywords do not have to be within or outside the model card. Even if you encrypt only a portion of the model card, the entire model card is protected during simulation. In case there are no parameters within a protected block, the Spectre circuit simulator displays a warning message, but still encrypts the model card.
In the following example, the encryption keywords are around the model card definition. The model name and all parameters are encrypted.
In the following example, the protect keyword is within the model card definition, leaving a number of parameters outside the protection block. The model name and parameters outside the protection block remain public, but the whole model is protected for message and parameter output during simulation.
Encrypting an Include File
If there is an include file in the encrypted portion of your netlist, you must encrypt it separately.
Encrypted Information During Simulation
When you simulate an encrypted netlist, all warnings, error messages, and info statements about the encrypted portions of your netlist are suppressed.
E, -D, and -U options in the file, since these options enable CPP. In addition, wildcards are not supported in CPP.The following sections describe how the Spectre circuit simulator handles the encrypted portions of your netlist.
Protected Device
A device is encrypted if any of the following conditions are met:
- It is a primitive and inside a protected block.
-
It is an instance of a subcircuit. The instance is not in a protected block, but the subcircuit is protected. Here is an example:
X1 in out INV
subckt INV (in out)
protect
mp1 vdd in vdd pmos W=1.0e-6 L=1.0e-6
mn1 out in 0 0 nmos W=1.0e-6 L=1.0e-6
unprotect
ends INV
In the flattened netlist, devices X1/mp1 and X1/mn1 are protected. -
It is an instance of a subcircuit, and the instance is in a protected block. Whether the subcircuit is protected or not, all the flattened primitive devices from that hierarchical level are protected. An example is given below.
protect
X1 in out INV
unprotect
subckt INV (in out)
mp1 vdd in vdd pmos W=1.0e-6 L=1.0e-6
mn1 out in 0 0 nmos W=1.0e-6 L=1.0e-6
ends INV
In the flattened netlist, devicesX1/mp1andX1/mn1are protected.
For a device meeting any of the above criteria, its name and instance parameters are protected. The instance parameters of a protected device cannot be modified through an alter statement, but the protected device can be replaced through an altergroup statement. Information about a protected device is filtered out in all analyses outputs.
Encrypted devices are not included in the circuit inventory.
Protected Node
A node contained exclusively within a protected block is protected, and its name and value is not displayed in the output file. If you request an ic file or restart a simulation, protected nodes are displayed in encrypted format in the ic, checking point, and restart output files.
Protected Global and Netlist Parameters
Global and netlist parameters defined inside a protected block are encrypted. However, you can alter or sweep a protected parameter. All device instance and model parameters dependent on the altered parameter are updated even if the device or model is protected.
Protected Subcircuit Parameters
Subcircuit parameters are protected if they appear exclusively within a protected block. All devices or model cards that refer to encrypted parameters must be in a protected block to protect the parameter values. If protected parameters are referred to by an unprotected device or model card, the parameter values are printed in the info statements for this device or model card.
You can alter or sweep a protected subcircuit parameter. All device instance and model parameters dependent on the altered parameter are updated even if the device or model is protected.
Protected Model Parameters
For a model card inside a protected block (where the protect keyword appears before the model statement), the model card and all model parameters are encrypted. If you place protect after the model definition and leave some parameters outside a protection block, only parameters inside the protection block are encrypted. During simulation, all parameters inside the model card are encrypted since encryption is done on the basis of the model card, not individual parameters. Warning messages and info statements for all model parameters and values of a protected model card are suppressed.
Even if the model name is protected, you can instantiate primitives using that model. You cannot alter or sweep protected model parameters, but you can replace a protected model through an altergroup statement.
Multiple Name Spaces
Names of parameters, subcicuits, models, and devices that appear exclusively within protected blocks are encrypted. However, identical names appearing outside the protected blocks are bound to their encrypted counterparts. Hence, Cadence recommends that you give unique names to the parameters, subcircuits, models, and devices you want to protect.
Displaying Messages Generated From an Encrypted Block
By default, messages generated from an encrypted block are not displayed in the Spectre log file. You can use the simulator visible=messages and simulator visible=none keywords to show or hide messages that are generated from an encrypted block.
Consider the following example:
simulator lang=spectre
parameters c1=1p c2=2p c10=c1+c2
parameters res=10k
protect
simulator visible=messages
r1 1 0 resistor r=res
simulator visible=none
c1 1 0 capacitor c=c10
unprotect
run dc
spectre2 options currents=all
In the above example, r1 and c1 are specified in a protected block and both have errors. However, because r1 has been specified using the keyword simulator visible=messsages, the message related to r1 will be displayed in the Spectre log file. On the other hand, the message related to c1 will not be displayed in the log file because it has been specified using the keyword simulator visible=none.
Return to top