Synopsys Nanosim is a fast-Spice simulator. It provides near-Spice accuracy at much faster simulation speed. It can be used for full-chip simulation or for functional verification of custom-digital blocks. It also includes dynamic power analysis, a feature previously provided by Synopsys PowerMill.
To the best of my knowledge, Nanosim replaces both PowerMill and TimeMill
This tutorial will demonstrate simulation, functional verification and dynamic power analysis. The example circuit is a simple 8-bit adder.
The following files are part of this tutorial:
Digital Input Vectors
Nanosim uses the ".vec" file format to provide digital input vectors. This method is far superior to using Spice "pwl" sources. In addition, Nanosim supports both input and output vectos. The input vectors are used to drive the circuit, while the output vectors are used to check the circuit.
The header of "adder.vec" is
radix 1 44 44 44
io i ii ii oo
vname cin a_[7:0] b_[7:0] s_[7:0]
We have 3 input vectors (cin, a and b) and 1 output vector, s. Note that the signals in the Spice netlist are called "a_0", "a_1" etc. Nanosim allows us to group those to a bus using the "[ ]" notation. The "radix" line specifies that "cin" is a 1-bit signal, while all the other ones contain two 4-bit parts, or 8-bit. The "io" line defines which are input and which are output.
A typical excerpt from a ".vec" file looks like this:
4000 1 44 44 21
6000 1 55 55 89
The first column is the simulation time, in this case 4ns and 6ns. Then comes the list of vectors as defined in the header of the ".vec" file. The values for the input vectors will drive the circuit. The last column, which is for "s", is used to check if the circuit outputs the correct value. For example, at time 4ns we add 1+44+44=89, all in hex. So by the time we get to 6ns, the circuit should output "89". As a result, the values in the sum column are always 1 row lower than the input operands.
We run Nanosim on the command line:
nanosim -n adder.sp -c adder.cfg -nvec adder.vec
The window after the run will look like this:
Note that Nanosim reports that no error was found, so the circuit behaves as expected and all outputs have the right value.
Now lets force an in-correct value by changing the expected value in the "adder.vec" file. Change the line
We now changed the value of "s_0" from "1" to "0". Now run Nanosim again. The window should look like this:
We can see that Nanosim detected one bad output. To see more detail about the errors detected in the circuit, we use the command
This should output the following:
Nanosim reports that at time 10ns it noticed that "s_0" was "1", but it expected to see "0". So Nanosim correctly identified the "false" error we constructed.
If this had been an actual error, we could do the following:
- First, simualate the exact same vector in the golden model, for example RTL Verilog. That way we can tell if something went wrong durig implementation or if had this error all along.
- Use "probe" statements in Nanosim to output waveforms. That could help to track back the error to its source
- Finally, we could apply the input vector using pulse sources to a Spice simulator. That would provide the most detail for tracking down the error.
Dynamic Power Analysis
Nanosim also provides dynamic power analysis in a custom digital flow. In a standard-cell based flow we would probably use Synopsys PrimePower or Cadence Encounter for this.
The simulation input vectors come again from the "adder.vec" file. In addition, we use the following command in the "adder.cfg" file:
report_block_power my_pwr XI0.*
(Note that in "adder.cfg" we use a longer line with more options)
This tells Nanosim to compute the dynamic power of instance "XI0". This is the instance name that was used for the instance of our adder in "adder.sp":
XI0 A_7 A_6 ... ADDER8_G1
The results from power analysis are written to the "nanosim.log" file. In a text editor this would look like this:
Nanosim reports that the RMS power of this block is 121uW. Note that this value is only based on 5 vectors, since our "adder.vec" file is so small. Typically we would use 1000 or more vectors, to get a good time average of power consumption.