GTKWave is an excellent open source wave viewer. It is easy to install on MacOS:
brew tap homebrew/cask
brew cask install gtkwave
In this way, you will get the gtkwave.app in the /Applications directory. The problem is that there is no way to pass command line arguments to the application. After some search on the Internet, I found a workaround.
Installing Perl Switch
The executable is in the directory of /Applications/gtkwave.app/Contents/Resources/bin/. But it won't work by simply typing in /Applications/gtkwave.app/Contents/Resources/bin/gtkwave in terminal.
First we need to install Perl’s Switch module:
cpan install Switch
When installing Perl’s Switch module, there are several options. Just go with default.
And then using this command to check if Switch is installed in the correct location(/Library/Perl/5.*/):
If it's not, please copy Switch.pm to the correct location.
At last, runing this command:
sudo cpan -f Switch
Put this line into ~/.bashrc or other shell configuration files:
Then run source ~/.bashrc to refresh the configuration. Now the gtkwave command works just as it is on Linux.
If you want to using gtkwave in makefile like this tutorial, you have to define a variable containing full path in the makefile. Because make don't care about aliases. For example, you can do this: