Archive for category Verification

A “wire-and” vreg class

Run across a problem recently where I from teal had to drive a bi-directional verilog wire that should model “wire-and” functionality.

Basically the wire was pulled high in the verilog testbench (tri1). So to set the wire you should either drive it ’0′ or release it to get a ’1′.

The Teal vreg class don’t model this by default but it was easy to create a small class that modifies the vreg class to add this functionality

The code looks like this, note it only works for bits and not busses.

class wand : public vreg{
public:
wand(const std::string& n): vreg(n)
{ assert ( (bit_length() == 1)); };
virtual ~wand(){};

wand& operator= (const reg& rhs)
{
vreg::operator= (rhs);
if (rhs.to_int() == 1) {
vreg::release();
}
return *this;
};
};

Note! this assumes pull up of the actual signal in the testbench

Having bit wise wire and is useful in protocols like i2c and CAN.

/Robert

Hardware Verification with C++, a practitioner’s handbook

Hardware Verification with C++ Book Cover New! The two chapters describing teal and truss, our open-source verification libraries can be downloaded here (as pdf)

This book, available through amazon and published by Springer is written by two engineers who do verification for a living. Hardware Verification with C++: A Practioner’s Handbook is a four-part tour of how to perform object-oriented hardware verification through simulation. This handbook goes beyond hype and theoretical discussions to show fully implemented examples, all provided as open-source code on the companion CD.

Both a learning and a reference tool, the Handbook gives you everything you need to do hardware verification with C++ apart from a simulator—all provided as open-source on the companion CD.

“The handbook provides a clear understanding of object-oriented programming, and how it applies to hardware verification. It is clear to me that C++, together with Teal and Truss, could form a strong platform for the next generation of hardware verification.”
Dr. Stanley Hyduke, CEO of Aldec, Inc.

“With this book I feel confident I can constitute a verification team that could make good use of C++ for verification, with all the positive results I would need for success. That is a breakthrough!”
Bob Fredieu, VP of Research and development and Cofounder, Assertive Design
“Hardware verification complexity has grown to be a software effort, requiring advanced techniques such as OOP. With clear techniques and examples, this handbook guides the reader through the complexities of using OOP to create testbenches. Regardless of what language you use, this book will help sharpen your skills.”
Chris Spear, Verification Consultant, Synopsys, Inc.; Author of SystemVerilog for Verification

“A good book with great insight on the real-world problems faced by ASIC verification engineers every day. The authors use a humorous style to make this an easy read, while dealing effectively with complex issues.”
Dale Mosher, Director of ASIC Development