News & Analysis
DESIGN SOFTWARE: Tools tap C++ for verification
Richard Goering
9/4/2006 9:00 AM EDT
Santa Cruz, Calif. -- Verification engineer Mike Mintz believes so much in the use of object-oriented programming for IC verification that he created two open-source software programs to help engineers do hardware verification with C++. That's in addition to co-authoring a book on the topic in his spare time.
Mintz, who works for a large systems design company that prefers to remain unidentified, and partner Robert Ekendahl, principal verification engineer at Sun Microsystems Inc., have launched the www.trusster.com site to provide two open-source programs. One is Teal, a C++ class library that adapts C++ to Verilog and provides threading support. The other is Truss, an applications framework for C++ verification that sits on top of Teal.
Mintz and Ekendahl have also published Hardware Verification with C++: A Practitioners Handbook, available now from Amazon.com. Teal and Truss are provided with the handbook in a companion CD.
"So far as I know, there are no books on verification with C++, and a lot of people are using C++ for verification," said Mintz. "I thought it would be good to take my 20 years of software experience and push it into the book."
C++, said Mintz, is the best available object-oriented language for verification. "Don't get me started on SystemC," he warned. "It's a good modeling language, but it doesn't do diddly for verification. It puts templates right in your face--that's the C++ term for generics--but in verification, it's extremely rare that you need that."
People looking to use C++ for verification, however, need software to make that possible, and that's where Teal and Truss come in.
Mintz, who spent 15 years as a software engineer, wrote Teal at his first verification job six years ago. "I reimplemented it every time I went to a new company," Mintz said. He finally asked if he could put it in the public domain, and his present employer said yes.
Truss came about last year when Mintz and Ekendahl were both working at Freescale Semiconductor Inc. "Robert said, 'You've got a lot of stuff you're using internally; why not put it out there?' " Mintz recalled.
Mintz compares Truss to the Synopsys-ARM Verification Methodology Manual or Mentor Graphics' Advanced Verification Methodology, "except it's out there, it's free and it's C++."
"It's clear to me," observed Ekendahl, "that object-oriented verification is be- coming an industry best practice." The new book covers basic through advanced uses of object-oriented programming, he said, and its guidance is directly applicable to such languages as SystemVerilog, Vera and Specman.
Teal and Truss are in use now at several companies, Ekendahl noted. And along with C++, the software programs are attracting some notice.
Stanley Hyduke, CEO of simulation provider Aldec Inc., reviews the new book in a posting at www.trusster.com. "The handbook provides a clear understanding of object-oriented programming and how it applies to hardware verification," Hyduke wrote. "It is clear to me that C++, together with Teal and Truss, could form a strong platform for the next generation of hardware verification."
C++-to-Verilog 'gasket'
Mintz describes Teal as a "gasket" that connects C++ code to Verilog simulation environments through the Verilog programming language interface (PLI). "It allows you to write everyday C++, but it's interacting with the hardware," Mintz said. "It wraps the Verilog PLI in something mere mortals can do."
The PLI is efficient as long as you're not trying to implement a high-frequency clock in C++, Mintz said. "Just put that down in Verilog," he said. "We have a watchdog timer, and that's in Verilog, but all the logic is in C++."
Teal also provides a wrapper around portable Posix threads, thereby providing multithreading support. "Because hardware is threaded, verification systems need to be multithreaded," Mintz said. "You can run as many threads as you want. I've run up to 4,000 or 5,000."
Other features of Teal include stable random-number generators, a flexible logging facility and a dictionary name space for passing parameters among parts of the verification system. A memory name space and lookup capability provide a simple way to do "backdoor" memory reading and writing.
All this functionality comes in a small space; Mintz said Teal encompasses only six source files and around 3,000 lines of code. Since it's open-source, users can modify the software as they see fit. The only restriction is that they can't commercially resell it.
Teal works with Verilog simulators from Cadence Design Systems, Synopsys, Mentor Graphics and Aldec, as well as with the open-source Icarus simulator.
While Teal provides "the kernel of what you need for a verification system," as Mintz said, it doesn't provide a methodology. Truss comprises a set of classes, templates and conventions that sit atop Teal for describing how how tests, testbenches and drivers should function. "If you want to see how I'd structure a verification system, look at Truss," Mintz said.
Truss is really all about the "dance" among the top-level controller, testbench and watchdog timer, Mintz said. "It's about how those three guys come up, what calls they make and how they all work together to run tests."
Mintz said he and Ekendahl have no plans to market Teal or Truss. "You can't make money on structure," he said. But someone could potentially offer services around the programs, he said.
Support for Teal and Truss is based on "best effort" and e-mail, Mintz said. But keep in mind that he's a busy guy.
"The book has taken about 2,000 hours to write, and Teal and Truss have probably taken that much effort," he said. "I put in 60 hours of work a week, and then I work more at home."



