Electronic Design

Versatile Compiler Builds Stacks For Any Communication Protocol

AnyWare handles both standard or custom protocols for hardware or software.

Whether implemented in hardware or software, network protocol stacks are complex structures. As such, most are purchased from third parties. But AnyWare, a compiler-based technology from Novilit, now offers an alternative. Using Novilit's Communication Machine Definition Language (CMDL), AnyWare generates code compatible with operating systems, network processing units (NPUs), or hardware-based solutions such as ASICs and FPGAs.

Although a proprietary language, CMDL is the key to Novilit's simplified design approach. A developer employs this declarative language to describe all details of a protocol. The language definition lends itself to straightforward translations of existing protocol definitions. TCP/IP (transmission control protocol/Internet protocol) is provided as an example of CMDL. Other standard protocols or proprietary protocols can be much more complex, but they're just as easily defined via CMDL.

AnyWare's Communication Machine Development Engine (CMDE) is a multistage compiler. It generates code in C, C++, Assembler, and Java, as well as synthesizable VHDL or Verilog.

Novilit's approach to the protocol problem offers the advantage that code generation is relegated to the compiler with simpler, well defined CMDL inputs from developers. They simply translate the protocol definition to CMDL.

Defining A Protocol: AnyWare assumes that a protocol can be defined in terms of an input bit stream and an output bit stream. By recognizing fields within the input stream, a bit stream can be analyzed and reduced.

The semantics of the bit patterns determine how each protocol in a stack encodes a message and the way to handle the internal state of the receiving communication machine. CMDE im-plements protocols as dispatch trees where incoming bit streams are decoded into messages, or outgoing messages are encoded into bit streams. The process uses four fundamental operators:

  • Barrel shifter
  • Comparator
  • Hash calculator
  • Address controller

The barrel shifter extracts a field from a bit stream. Then data in the field can be stored or analyzed. The comparator determines the next field position for consecutive choices versus the hash calculator, which decides the next field for nonconsecutive choices. The address controller figures out the destination of field information.

These four operators combined to form the inner loop that processes the CMDL-defined dispatch trees (Fig. 1). This inner loop is central to the output of AnyWare. It's supplied in source code to developers, so it can be customized for a particular environment. Different languages are used, depending upon the target environment. For example, a hardware target would employ a Verilog definition, while a software target would have a C definition.

Designers normally modify a software inner loop to take advantage of available hardware. This is especially true for general-purpose processors that have enhanced or extended in-struction sets.

Once the inner loop is defined, the rest of the protocol is defined with CMDL and compiled via CMDE. This generates the dispatch trees used by the inner loop. Protocol-specific actions can be coded in a platform-specific manner.

An input stream is analyzed by the inner loop and the dispatch tree, which consists of many nodes. For incoming streams, a node uses some bits in the stream. The remainder is given to the next node in the tree and the dispatch tree definition controlling node traversal. The inner loop processes each node quickly. It's complete when a leaf node is reached and all bits have been processed.

Using the reverse process creates an output stream. In this case, the process starts at a leaf node, and the message sender supplies the data. The output stream is built incrementally by ascending the tree. The resultant data stream is handed to the next network layer when the data stream is complete. In many instances, this is the data link layer, and the data stream is sent as a packet over the network connection.

The dispatch tree for a simple protocol, such as TCP/IP, consists of a few hundred nodes. More complex protocols like H.323, used for video conferencing, require thousands of nodes.

AnyWare applies a number of optimizations to the dispatch tree in the same fashion as conventional programming language compilers. CMDE compiler technology removes cycles and double-branching. It can also inline subtrees rather than encoding references when that approach is more efficient. This is similar to a C++ compiler implementing a function call as inline code for small functions.

Traversing The Tree: CMDE uses CMDL code like that shown in the Listing to create the tree structure that processes a packet (Fig. 2). The CMDL code includes references to handle application-specific functions. This would be C code for a C target. Usually, these actions are taken at a leaf node. The actual execution uses the inner loop already presented to logically traverse the tree.

While the inner loop logically reduces an input stream, the stream itself is maintained in its entirety in memory. A shared memory table or arena is implemented so data can be handed from one protocol level to another via references.

Developers don't have to crank out CMDL code with a simple text editor. Instead, they can use Novilit's NLEdit, an integrated development environment designed specifically for protocol support creation and diagnostics. It's integrated with CMDE and addresses the test-and-debug phase through NLView.

NLEdit includes a smart copy-and-paste feature. It enables automatic code generation from any standards-based or proprietary specification. NLView is actually a full-function protocol analyzer and debug environment able to work with CMDE code and real-time protocol data from a network. It even allows software implementations to test the validity of CMDL-implemented protocols before hardware is available.

Price & Availability
Pricing for Novilit's AnyWare starts at $100,000 for a four-user team. It's available on Windows 2000 and Windows NT. A Solaris version will be available in the third quarter.

Novilit Inc., 230 Maple St., Marlborough, MA 01752-3250; (508) 485-0050; www.novilit.com.

To download a listing, click Download the Code.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish