Using a Mac for Engineering

For many years, my primary workstation computer for all my work (and play!) has been an Apple Macintosh computer of some description. Changing to a Mac has truly been positive experience not only in terms of productivity, but also for the joy of computing. I have always been a computer hobbyist/enthusiast since receiving my first computer (an Atari 800) back in 1982, up until present day building servers and computers from scratch. I learned to code since receiving my first computer and software development has always been a big component of my engineering life. Therefore, I do consider myself to be fairly experienced and adept computer user. I am always eager to learn new tools, optimize workflows, and generally have fun!

As an engineer, I was concerned that my access to specialized design tools was going to be limited on a Mac. I always had the option to run Windows in a virtualization environment such as Parallels, VMWare, or VirtualBox--but I wanted to remain within OS X as much as possible. General purpose productivity tools such as email, MS Office, etc. were never my concern since there is an abundance of Mac alternatives for these applications. It was the analytical simulation and design tools that I was concerned with. As an electrical engineer, I require tools to perform schematic capture, PCB layout, circuit simulation, FPGA HDL synthesis/simulation, firmware development, I/O control, etc.

The main purpose of this article is to describe my Mac environment, my workflows, my favorite applications and utilities, and the engineering specific tools that I use on my Mac(s). I'll try to throw in some handy tips and advice along the way, since it may prove useful to someone other Mac-based engineers!

I. Desktop Productivity Tools



1) email - Apple Mail mailapp


Apple Mail is simple to use, has enough features such as filters, and "smart" mailboxes, and it comes on every Mac. Its native integration with the Address/Contacts app, Apple's spotlight (system-wide search), and support for multiple email accounts makes it just that much better.

2) Calendars - Apple iCal ICal_Icon

Again, Apple's built in calendar app iCal is simple, ubiquitous and syncs seamlessly across all my devices and computers. It isn't burdened with a lot of features or customization, but achieves its role as a calendar and scheduling app more than adequately.

3) To-do lists/"GTD" - OmniFocus from Omni Group OmniFocus-Mac-Icon

I've tried many to-do list systems and software but adopted OmniFocus just after it was released. There was a steep learning curve getting used to concepts like "contexts" and "atomic tasks" but I am now a comfortable user. In addition to having several categories of recurring tasks, OmniFocus is really useful at capturing all of those single-action to-do tasks that either never get written down or get lost on a post-it note somewhere on my desk!

4) Office (word processing / spreadsheets / presentations) - Apple iWork Pages_icon numbers-icon1 icon_keynote-1

As much as the world revolves around MS Office, I found myself more productive within Apple's iWork suite of office apps. They are "light weight" in comparison to MS Office equivalent apps and this is where their strength resides. Simple factors such as application launch time really do matter. I can launch iWork Pages and start using it in a fraction of the time it takes to launch MS Office Word. Simplicity matters sometimes. Lastly, iWork can read/write MS Office documents so I can still exchange documents with MS Office.

II. Software Development



1) Text Editor - TextWrangler & TextMate textWranglerIcon tm2-icon

The ultimate tool in any developer's arsenal is the text editor. I confess to not being a big fan of the shell based editors such as Vi or emacs. I have used them in a pinch but I don't use them enough to be a power user and to remember all of the keyboard commands/shortcuts. Thus, I have preferred to use GUI based editors. TextWrangler from Bare Bones Software has been my general purpose text editor for things such as shell scripts and configuration files. For more intensive source code editing I have really enjoyed using MacroMates TextMate. It has all of the useful features developers want such as colour-coded syntax highlighting and auto-completion. Its tabbed interface with a dockable file browser gives it the power of an IDE based environment for larger multi-file projects.

textmatescreen
TextMate screenshot illustrating features such as tabbed windows, dockable file browser, and syntax highlighting for Verilog HDL and Octave scripts


2) IDE - XCode xcode

Just when I learned XCode 3.x, Apple released XCode 4.x and changed almost everything! Fortunately its change to 5.x from 4.x was much less dramatic. Having said that, I am still a big fan of XCode and enjoy its industrial-strength combination of features. Its source code editors have excellent syntax highlighting, auto-completion and customizable rules for indentation, etc. The debugger is very useful with step in/over controls and deep inspection into variables and structures. If you develop apps that use CoreData (Apple's data structure API over sqlite3), the visual editor for creating data structures and their relationships is fabulous. Overall, XCode has all of the features you would expect from a good IDE and given that its free from Apple is also very compelling!

xcodescreen
Xcode 5 IDE screenshot showing the clean arrangement of tools such as the file/object browser, source editor, inspectors, and git version control integration.


3) Shell - iTerm 2 with zsh ITerm2-icon Zsh_icon

Apple's built in terminal app is relatively basic, but gets the job done. However, as power users, we all want more customization and features! Therefore, I have been using iTerm 2 as a replacement for Apple's terminal.app. It has an impressive array of features such as split panes, autocomplete, search, tabbed windows, and more. In addition to replacing the terminal, I also have replaced Apple's default shell (bash) with zsh. Furthermore, I have installed "oh-my-zsh" into my zsh installation to extend its functionality with a rich array of specialized plug-ins.

With this combination, my shell environment is vastly improved. Customizable visual themes change the typeface and colour syntax highlighting for better readability and smarter syntax feedback. The autocompletion of filenames, paths, and commands is incredibly powerful--sometimes an entire path can be specified with simply the first one or two characters of each path hierarchy. Plug-ins support git syntax highlighting for the command prompt so that revision status is shown directly. These features amount to a big improvement in both productivity and visual appearance to everyday shell interaction.

itermscreen
iTerm 2 window with zsh + “Oh-my-zsh” customization plug-ins showing split pane terminal with syntax highlights and path completion.

4) Package Management - MacPorts macports-logo

If you spend enough time working with open source software and libraries, the process of obtaining source packages/tarballs/etc. will seem familiar. Linux users (depending on distribution) will have their familiar package manager (apt-get, rpm, etc.) to automatically fetch sources, resolve dependencies, and compile binaries. Mac users don't have the same level of native ease of access. Fortunately, this gap has been filled by projects like MacPorts and Brew. I have used MacPorts successfully for obtaining a myriad of tools and software libraries to support my work. Tools such as Octave and Icarus Verilog were obtained from MacPorts and compiled from source.

5) Source Code Revision Control - git / GitHub GitHub-Logo-1

Revision control of source code of any kind is a vital function. Having used classic revision control systems such as CVS and Subversion, the process of tracking revisions and collaborating with other team members has been a bittersweet experience. Overall, cvs and svn have kept the development process under control; however, merging branches has not always been a smooth process (which I’m sure many other developers can empathize!) The functionality of both cvs and svn are highly dependent on access to a central server on which they are hosted. In contrast, git uses a completely different model in that every git working directory is a complete repository with complete history and full version tracking and is not dependent on a central server. The adoption of git as a primary source control system has been rapid; and as of May 2013, represents the dominant choice of version control among professional software developers.

Despite having a complete local copy of the entire repository, it is still necessary to “push” and “pull” changes of your repository to a hosted repository when collaborating with others. GitHub has emerged as the dominant hosting service for git repositories. Its service is free for open source projects and individual use. Corporate clients such as Vectis Research can keep privately hosted repositories on GitHub at very modest cost. This service offers the integrity of a redundant repository source and allows for seamless collaboration with others for joint development projects.


III. Engineering Design



1) Schematic Capture & PCB Layout - Eagle icon_cadsoft_eagle

EDA (Electronic Design Automation) tools are vital for the design and development of electronic printed circuit boards (PCBs). EDA tool suites vary a great deal in both level of sophistication and corresponding cost. CadSoft’s Eagle EDA suite represents a harmonious balance of both sophistication and cost. I was a committed Eagle user even before switching to Mac OS. I have always been impressed that CadSoft simultaneously release Eagle for Windows, Mac OS, and Linux platforms. I have used other schematic capture tools such as P-Cad and others; however, I have always appreciated the ease and simplicity of Eagle compared to bigger EDA tool suites. The primary feature that I love about Eagle is the seamless and automatic integrity of the netlist between schematic and PCB layout. Any changes made in one context are automatically reflected in the other. This allows for the incremental design flows that I depend on the most. I can progressively build a design section by section and immediately see issues such as congestion and regionally group functions on the PCB in an approximate way and get a sense of the ideal configuration of board sections, connector placement, etc. Eagle's functionality is augmented with a rich availability of scripts and "ULPs" (user language programs) which add features such as bill of materials generation, drill plans, board statistics, and much more.

eaglescreens
Screenshot illustrating the Mac OS X version of CadSoft’s Eagle EDA tools; in particular the seamless net list consistency between schematic and PCB layout views.


2) Math Simulation/Modelling - Octave octaveicon

Since university, I have depended on MatLab for all kinds of simulation and modelling tasks. Its famous scripting language and rich application libraries have made it the default tool for modelling and simulation. However, as with many software application spaces, it has been invaded by a free/open source alternative; namely gnu Octave. Octave is a cross-platform simulation tool based on C++ and has a rich support of libraries and tools. It is essentially source compatible with MatLab's ".m" scripting language; thus, it is possible to run the same code in both MatLab and Octave. There are some detail differences, but these are easily resolved. Octave performs the bulk of my simulation and modelling tasks and is a hugely valuable tool for prototyping algorithms before committing them to C code, firmware or FPGA HDL. Octave supports rapid prototyping of algorithms and signal processing tasks. A testament to Octave's immense utility is the fact that I always have a dedicated shell window open on my desktop workspace with Octave running. I essentially use Octave as a general purpose calculator as well!

octavescreens
Octave screenshot illustrating the generation of sophisticated test waveforms and visualization of simulation output streams. All simulation activity can be scripted for automated testing and tight integration with other simulation tools.

3) FPGA HDL Simulation - Icarus Verilog Icarus_Verilog_logo2

Despite using vendor specific tools such as Xilinx ISE and Altera Quartus, much of my HDL development starts in the vendor-independent realm of pure Verilog implementation and simulation. Icarus Verilog is a free/open source Verilog compiler and synthesizer designed to parse Verilog syntax compliant with IEEE Std 1364-2005. I use TextMate as a primary editor for Verilog HDL (with its native support for Verilog syntax highlighting) and use the command line shell to run Icarus Verilog. Icarus Verilog does not have native support for viewing output waveforms or interpreting simulation output. Therefore, I use custom Octave scripts to read output files generated by Icarus Verilog to either plot waveforms or perform additional post processing. Also, since much of my work has centred on digital signal processing, generation of sophisticated test waveforms is crucial. This workflow represents the efficient and powerful integration of both Icarus Verilog and Octave. Octave is used for generating test waveforms and interpreting output. Icarus Verilog is used for compiling the HDL and executing the behavioural simulation. When the design has reached a level of maturity, it is then ported into a vendor specific IDE for synthesis into a target FPGA family. Often, this means less time is spent inside vendor tools because the design has been optimized and refined before it reaches synthesis.

4) Circuit Simulation - QUCS qucs

Circuit level simulation, in particular for analog design using transistors, op amps, etc., often require fine-tuning and optimization with a circuit level simulator. I have used spice tools of various flavours and it is common place to find vendor supplied spice models for virtually any semiconductor device. QUCS (Quite Universal Circuit Simulator) is a tool I discovered from a Circuit Cellar article by Robert Lacoste (Alciom). It is feature rich circuit simulation environment combining analog, digital, and some degree of RF simulation into a single GUI tool. It is still very much a "beta" level tool in active development and does have some bugs. Despite this, I have found it to be immensely useful and versatile for circuit level simulation.

qucsscreen
Screenshot illustrating the Mac OS X version of QUCS simulating a simple DC circuit.

5) Microcontroller - Microchip PIC with MPLABX mplabx

Inevitably, a circuit of even modest complexity will require some sort of controller to either interface with a host computer or perform I/O with multiple devices using ubiquitous serial interfaces such as I2C or SPI. My microcontroller of choice is usually some type of Microchip PIC device. They are extremely well understood and documented, readily available, low cost, and well supported. This support extends to Microchip’s release of their IDE tool MPLAB-X for the Mac OS X platform. As with all decent IDE platforms, MPLAB-X has all the key tools nicely organized including a file/object browser, source editor with syntax highlighting, debugger, etc. Furthermore, PIC’s hardware programmers are all more or less supported on Mac OS X; including the USB connected PICKit-3 programmer which I have connected to a dedicated 24” iMac laboratory workstation.

mplabxscreen
MPLAB-X for Mac OS X; Microchip’s full-featured IDE tool for PIC microcontroller firmware development