You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ug/tutorial.md
+35-18Lines changed: 35 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -427,37 +427,54 @@ Running a physical simulation is then no different from running a functional sim
427
427
428
428
During physical implementation, the tools are able to independently generate area and timing numbers. For a complete PPA analysis, you will want to include power estimates as well.
429
429
430
-
Power numbers are extremely dependent on the switching activity in your circuit, which in turn depends on the stimuli you feed in to your DUT, so you are in charge of providing this information to the tools. The switching activity is typically recorded in the form of a [VCD](https://en.wikipedia.org/wiki/Value_change_dump) file, and can be generated by most RTL simulators.
430
+
Power numbers are extremely dependent on the switching activity in your circuit, which in turn depends on the stimuli you feed in to your DUT, so you are in charge of providing this information to the tools. The switching activity can be recorded either as a [VCD](https://en.wikipedia.org/wiki/Value_change_dump) file or as a more compact [SAIF](https://en.wikipedia.org/wiki/Switching_Activity_Interchange_Format) (Switching Activity Interchange Format) — both carry the switching data PrimeTime needs. SAIF files are typically ~300× smaller than VCDs; pick VCD if you also want waveforms for debugging.
431
431
432
-
To do so, set the `VCD_DUMP` flag when building the physical simulation model:
433
-
```shell
434
-
make TECH=gf12 VCD_DUMP=1 DEBUG=ON vsim
435
-
```
432
+
To record switching activity during the simulation, set the corresponding flag when building the physical simulation model:
433
+
434
+
=== "VCD"
435
+
```shell
436
+
make TECH=gf12 VCD_DUMP=1 DEBUG=ON vsim
437
+
```
438
+
=== "SAIF"
439
+
```shell
440
+
make TECH=gf12 SAIF_DUMP=1 DEBUG=ON vsim
441
+
```
436
442
437
443
!!! danger
438
-
When using QuestaSim for VCD generation, you must build the model with the `DEBUG=ON` flag, to ensure that all nets are preserved during compilation, preventing them from being optimized away. This guarantees that the VCD file contains switching activity for all nets in your circuit.
444
+
When using QuestaSim for VCD or SAIF generation, you must build the model with the `DEBUG=ON` flag, to ensure that all nets are preserved during compilation, preventing them from being optimized away.
439
445
440
-
When you run a simulation, the simulator will now automatically create a `vcd` subdirectory within the _simulation directory_, where a VCD file is generated.
446
+
When you run a simulation, the simulator will automatically create a `vcd`or `saif`subdirectory within the _simulation directory_, where the recording is written.
441
447
442
-
Most often you are not interested in estimating the power of an entire simulation, but only of a specific section, e.g. while executing a part of a kernel computation.
443
-
You can pass start and end times (in ns) for VCD recording to the simulation as environment variables:
448
+
Most often you are not interested in estimating the power of an entire simulation, but only of a specific section, e.g. while executing a part of a kernel computation. You can pass start and end times (in ns) for the recording to the simulation as environment variables:
Variable assignments must preceed the executable in a shell command to be interpreted as environment variable assignments. Note that environment variables set this way only persist for the current command.
451
461
452
462
A benefit of RTL simulations is that they are cycle-accurate. You can thus use them as a reference to find the start and end times of interest with the help of the simulation traces (unavailable during physical simulation), and directly apply these to the physical simulation.
453
463
454
-
With a VCD file at your disposal, you can now estimate the power consumption of your circuit. Run the following command:
455
-
```shell
456
-
make SIM_DIR=<path_to_simulation_directory> power
457
-
```
458
-
You need to point the command to the _simulation directory_ in which the VCD dump was generated, for it to find the VCD file.
464
+
With a recording at your disposal, you can now estimate the power consumption of your circuit:
465
+
466
+
=== "VCD"
467
+
```shell
468
+
make SIM_DIR=<path_to_simulation_directory> power
469
+
```
470
+
=== "SAIF"
471
+
```shell
472
+
make SIM_DIR=<path_to_simulation_directory> power-saif
473
+
```
474
+
475
+
You need to point the command to the _simulation directory_ in which the recording was generated, for it to find the file.
459
476
460
477
!!! note
461
478
Since the actual simulation command is run in a different directory, you need to point to the _simulation directory_ using an absolute path.
462
479
463
-
Once the command terminates, you will find power reports in the `nonfree/gf12/synopsys/reports` folder, from which you can extract relevant power numbers.
480
+
Once the command terminates, you will find power reports in the `nonfree/gf12/synopsys/reports` folder, from which you can extract relevant power numbers. The nonfree repository's README covers additional options, including how to derive a SAIF from an existing VCD via Synopsys's `vcd2saif` utility.
0 commit comments