What is it?
GTKWave is a free and open source "wave analyzer tool" generally used
in HDL design. It can display integer and real value data.
There are lots of color and formating option which make it pleasant to
use and also it has many marker and cursor options which makes
waveform analysis simple.
It can read VCD and other dump file formates.
Simulink blockset for GTKWave can be used to display the simulation data
The scope provided by simulink for waveform display is
very uncomfortable for scrolling, zooming and timing analysis. This blockset can be used as alternative of the simulink scope.
Using this blockset, simulink data can be displayed on Gtkawave tool for easy analysis.
How to install?
(1) Blockset is created and tested on Windows system. So download the windows
version of GTKWave (available version 3.3.34) from
Unzip the file in any folder you want(but make sure that, parent directory path
shouldn't contain space. Otherwise tcl script will not run).
The root_folder_of_GTKWave_tool should contain following folders
(2) You have below files & folders for GTKWave blockset
-- gtk_ml_supp (folder contains m-file & a c-file)
Copy these folders and files in the root_folder_of_GTKWave_tool.
(3) Now open Matlab and set the current directory to "root_folder_of_GTKWave_tool"
Run the script "InstallGTKWaveBlockSet.m".
(4) Now set current directory to "root_folder_of_GTKWave_tool\gtk_ml_supp".
>> mex mexGTKWaveWriteVCD.c
to compile the .c file. It should generate .mex file successfully. Mex file is used for
making the process of VCD file writing fast.
(5) Blockset is installed and ready to use. Blockset will now appear on simulink
(6) Blockset is created and tested for Fixed-step Descrete models on Matlab R2012a.
How to use?
Blockset contains two blocks
Connect the GTKLogPort to the signals which you want to log and display in the GTKWave.
Specify the Name, Data type and Data flow properties.
Now drag and connect the GTKSetup block to the "Root level" of the model. Set the
"Launch output on GTKWave" property to "on". Only one GTKSetup block is required for
each model and should be at root level of model.
Now run the simulation. After the simulation, GTKWave will be launced automatically
and it will display the signals which are logged with GTKLogPort.
You can disable the launching of GTKWave after simulation by setting the GTKSetup's
"Launch output on GTKWave" property to "off".
Best of luck.
Feel free to contact on
email@example.com for reporting any issue, any query
TAB (2023). Simulink block set for Gtkwave : An alternative of simulink scope. (https://www.mathworks.com/matlabcentral/fileexchange/36989-simulink-block-set-for-gtkwave-an-alternative-of-simulink-scope), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
V2.0 : Made compatible to R2012a.
Updated the "slblock.m" file to remove minor bug and make tool compatible for R2012a.
Changes in v1.2