Tcl in space - Embedded.com

Tcl in space

The other day, I was riffling through Internet pages and found an essay called “Tcl and Concurrent Object-Oriented Flight Software: Tcl on Mars” that, needless to say, piqued my interest. The essay, written by NASA JPL flight software team member David E. Smyth, is a description of the development effort prior to the 1996 launch of the Pathfinder. He notes that, “In the spirit of ‘better, cheaper, faster’ Tcl has been proposed as the sequencing and command language for the Mars Pathfinder flight software.”

He goes on to list with more specificity the kinds of processes they could use Tcl for – touching on inter-object messages, the monitor and control environment, and the implementation of flight software responsibilities. He also mentions how Tcl would allow them to refine their requirements via rapid prototyping, and how it would give them “a simple path for evolving the actual flight software directly from the prototype.” Maybe this quote best sums up how he feels about Tcl: “Using Tcl gives us more capability than we hope we need for sequencing, but it also gives us necessary capability for testing, and desirable capability for inter-subsystem communication. And, it covers our ass for free.”

It's hard to find better praise for a dynamic language than that, but I’ll just drop in one last quote from the essay: “Developing languages is an iterative process: they often start out elegantly and devolve into a nightmare, or they start out being ugly and slowly evolve into something reasonably nice. This process is both slow and expensive. Tcl has been tested by fire literally around the world. People like it, even if they have no vested interest in the language. That is quite rare.”

Pathfinder ultimately chose to go with a different technology, but this got me wondering – if NASA was considering Tcl for space flights twenty years ago, what exciting projects is it being used for now? The answer came in two forms: field-programmable gate arrays (FPGAs) and electronic design automation (EDA).

TCL in field-programmable gate arrays
An FPGA is basically a circuit that’s made to be configured by the customer after it’s been manufactured. This is achieved by offering a system of logic blocks that can be reconfigured via the large resources of stratified logic gates and interconnects within the circuit.

These integrated circuits have tons of applications, spanning a huge spectrum that includes aerospace and defense, ASIC prototyping, audio, broadcast, consumer electronics, data center, high performance computing and data storage, industrial, medical, security, military, video and image processing, and wired and wireless communications. When I started to look into who was using Tcl in FPGAs, I found two companies — Microsemi and Altera — doing some really exciting things with it.

Microsemi Corporation offers systems for communications, defense and security, aerospace, and industrial markets. Aside from FPGAs, they make SoCs, ASICs, timing and synchronization devices, and more. They currently use Tcl on their IGLOO2, SmartFusion2, and RTG4 FPGAs. The RTG4 is especially exciting because it’s recommended for designers of high-speed datapaths and for remote sensing payload instruments, both of which keep Tcl’s flag planted firmly in space technology.

They use Tcl in their FPGAs mostly for batch flow scripting, which is used to automate repetitive command sequences that would otherwise be performed, in succession, by a human. The Tcl interpreter is designed to be easily embedded in other application software, so for large design applications written in C, C++, Java, or almost anything else, it's easy to build in a Tcl interpreter that will allow users to write their own scripts. The Tcl language is very simple and, with just a few hours of study, you can start doing useful work with it. This is very important to people who are not software professionals, but engineers who just want to do their job. Tcl is also very compact, and part of its popularity in embedded development comes from its easy integration with special hardware like FPGAs. It also allows for rapid development, as applications dealing with integration can be built several times faster than using C or C++.

Microsemi FPGAs also support a Tcl-based command line interface that allows for the automation of instruments and debugging. Speaking of debugging, Microsemi also uses an on-chip debugging tool for FPGAs that uses Tcl, called “Identify ME,” which is produced by Synopsys.

Next Page >>

Altera Corporation provides logic solutions for automotive, broadcast, computer and storage, consumer, industrial, medical, military, test and measurement, and wired and wireless markets. They invented the first reprogrammable logic device way back in 1984, but aside from FPGAs they make SoCs, CPLDs, and power management products. They’re using Tcl in their Stratix III, which is the world’s lowest-power high-performance 65-nm FPGA. This integrated circuit is used in wireless, broadcast, military, test and measurement, and medical applications. It hasn’t made its way up to space, yet, but it’s still exciting to see the incredible variety of projects that involve Tcl.

Part of the Stratix III is a timing analyzer that offers a Tcl console to quickly and easily create timing constraints, but Tcl interfaces also give the user advanced scripting capabilities. So Tcl is used in the aerospace, security, and communications industries, which is a huge reach already, but that reach extends even further when you consider its uses in EDA.

TCL in electronic design automation
This one might be obvious to some people, because Tcl was specifically designed to do EDA work. The progenitor of Tcl is John Ousterhout, who was a professor at UC Berkeley when he created it. Ousterhout was doing integrated circuit design work and the tools he was using needed a command language, which is why he created Tcl (Tool Command Language) instead of cobbling a language together for each tool he was using. So the genesis of Tcl is inextricably related to EDA, because it started its life as an easily embeddable scripting language for EDA. The popularity of embedding Tcl within other software products has resulted in it becoming the dominant control language in a few industries, and one of those industries is the one it was originally designed for – EDA.

EDA is related to FPGAs in that EDA is basically a group of software tools that aid in designing electronic systems like FPGAs and other integrated circuits. It’s hard to overstate the reach of EDA when it comes to the electronics it helps produce. Computer chips, cell phones, pacemakers, controls for satellites, routers and switches, and even devices now being tied into IoT devices – all of these result from designers who employ EDA tools. One particularly interesting company, Concept Engineering, caught my eye in this field.

Concept Engineering has been a privately-held company since their formation in 1990, and they focus on developing and marketing schematic generation and viewing technology for use with logic synthesis, verification, test automation, and physical design tools. The company mostly caters to EDA tool manufacturers, but they also work with CAD tool developers, semiconductor companies, SoC and IC designers, and even FPGA designers, which I’ll double back to in a moment.

The company mostly uses Tcl in their StarVision debugger, which is a debugger and visualization tool for the transistor, gate, and register-transfer levels of circuit design. This debugger has a Tcl-based API that lets users customize the tool, which allows for interfacing with tool flow and defining electrical rule checks. Tcl allows you to, quite easily, connect to testing hardware or internal APIs, run tests, check results, and report errors. Since Tcl is interpreted rather than compiled, it lets you create and run these tests much more rapidly than other languages.

Tcl is also used in their T-Engine, which is concerned with automatic, transistor level schematic generation. When you integrate the T-Engine with EDA tools, it helps integrated circuit designers visualize information like circuit structure, parasitic components, timing data, and signal values. This is all to say that Tcl helps designers make FPGAs on which Tcl is then used in some applications.

All of this information has reinforced, to me, Tcl’s reach and versatility. It’s used in EDA, which is involved in the production of nearly all electronics, including the FPGAs that use Tcl in aerospace, security, and communications. In an attempt to summarize: Tcl is used in the processes that make the FPGAs that Tcl is then used on, and although the Pathfinder mission ultimately went down another… err… path, Tcl has in fact been used in flight planning software for major space-exploration.

Look out! Tcl’s right behind you! I’m just kidding. But it probably is.

[Editor's note: Updated 28 July 2016 to reflect NASA's eventual decision to not select Tcl for Pathfinder.]

1 thought on “Tcl in space

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.