EDN logo


Design Feature: May 9, 1996

LPMs: High-level design uses low-level techniques

by Clive "Max" Maxfield,
Intergraph Computer Systems

Adding LPMs to your design allows you to adopt a high-level methodology using low-level techniques.

So many design tools are available that you might question the need for yet another one. However, a relative newcomer, the Library of Parameterized Modules (LPMs) is proving its worth by providing a path for users to adopt a high-level design methodology using (conceptually) low-level techniques.


The first taste

Consider where LPMs fit in the big picture before examining them in detail. In electronics, devices and methodologies tend to appear, disappear, and reappear in different guises. Many industry observers would say that ASICs emerged in the early 1980s, but the concept actually originated 15 years earlier, thereby predating the introduction of conceptually much simpler PLDs.

In 1967, Fairchild Corp (Hasbrouck Heights, NJ) introduced the Micromosaic, which contained a few hundred transistors. The key feature of the Micromosaic was that the transistors were unconnected. A designer used a computer program to specify the function the device was required to perform, and the program then determined the necessary interconnections and generated the masks required to complete the device. The Micromosaic, therefore, was the forerunner of modern ASICs and was one of the first real applications of computer-aided design. This device also exhibited one of the first examples, albeit rudimentary, of high-level design coupled with logic synthesis.


Schematic-only techniques

Had designers pursued the concepts behind Micromosaic, high-level design techniques would almost certainly have enjoyed widespread acceptance much sooner than they did. Unfortunately, however, this technology faded into the background for a while. When the use of ASICs became more commonplace in the early 1980s, designers based the devices' design on traditional methodologies and techniques that had been established for circuit boards. Thus, the designers of early ASICs used schematic capture to describe the function of their circuits as primitive logic functions and the connections between those functions.

The schematic approach does convey certain advantages, not the least of which is that it reflects the way in which designers think at the lowest level of abstraction. The approach also allows expert designers to handcraft extremely efficient functions. However, entering gate-level schematics is time-consuming, and this approach doesn't lend itself to what-if analysis at the architectural level. Also, verification using simulation is extremely CPU-intensive at the gate level, and it is difficult to retarget gate-level schematics to new device technologies because of the different symbols and design rules.

Because early ASICs typically supported only 2000 to 5000 primitive gates, the schematic-capture approach was at least tenable, and it remained in force throughout most of the 1980s. However, as gate counts continued to rise through 10,000, 15,000, and 20,000, it became increasingly difficult to design these devices using traditional techniques. Thus, the tail end of the 1980s and the beginning of the 1990s saw the emergence of language-driven design (LDD), which combines hardware-description languages (HDLs) and logic-synthesis technology.


Examining LDD

The early examples of LDD involved proprietary languages, but the industry eventually standardized on VHDL and Verilog. HDLs are appropriate for describing both control and datapath logic at a reasonably high level of abstraction. Using this technique allows designers to concentrate—in the early stages of a project—on the architecture of the design rather than implementation details. Simulating designs is more efficient at a high level of abstraction than at the gate level, and it is easier to perform what-if analysis at the architectural level. Synthesis technology then allows designers to migrate these high-level representations to the implementation level, and this approach facilitates design reuse by letting you retarget the design to alternative implementation technologies.

General studies show that LDD techniques increase designer productivity in terms of gates per day by a factor of at least 10 compared to designing at the gate level. Based on these promises of delectation and delight, several early adopters became overenthusiastic, in that they decided that LDD was the only way to go and discarded schematics as being "yesterday's technology." In reality, nothing comes for free, and LDD methodologies have their own problems, such as the fact that describing a design using an HDL doesn't usually reflect the way in which the designer thinks. In addition to learning the HDL along with software-design techniques and disciplines, the designer also has to learn how certain constructs and statements affect the synthesis tool. Today's synthesis tools are reasonably powerful and may help you to obtain good results. Using these tools, however, can allow designs to get out of control. Writing the code in two ways that simulate exactly the same in register-transfer level can synthesize to radically different gate-level implementations.

Even worse, portions of designs may be unamenable to logic-synthesis techniques; you must capture these portions inherently at the gate level. Thus, the industry came to realize that schematics still had a role to play: First, you can use schematics to graphically describe the design in terms of high-level functional blocks and the connections among them, and, second, you may be obliged to use schematics to describe certain portions of the design at the gate level. The resulting "mixed-level" design style offered the best of both worlds by allowing designers to mix schematic and HDL representations.


Flow charts and state diagrams

The early mixed-level design tools allowed designers to create a schematic of functional blocks and the connections among them; in these schematics, each block represented a functional unit. The designer could then "push" into a block and describe its contents as a gate-level schematic or as a textual HDL using an appropriate editor. However, problems still remained: The designer had to learn the HDL in question, and numerous subtle tricks of the trade existed for creating the HDL in such a way that it synthesized efficiently.

Thus, the current generation of mixed-level design tools augment the schematic and textual capabilities of the first generation by supporting more sophisticated graphical-entry mechanisms, such as VeriBest Inc's (Boulder, CO) flow charts and state diagrams (Figure 1). Again, designers can commence by creating a block-level schematic at a high level of abstraction, but, on "pushing" into the block, they can represent its contents as a flow chart or state diagram. Designers can then process these graphical representations to automatically generate VHDL or Verilog in a form that is guaranteed to simulate and synthesize efficiently.

Other advantages of the graphical-flow-chart and -state-diagram techniques are that they closely reflect the way in which designers visualize the control portions of their designs, and designers lacking expertise or even familiarity with the HDL in question can use these techniques. These graphical tools can also serve as training aids, because designers can gain familiarity with a language by analyzing the generated code.

Unfortunately, although flow charts and state diagrams are ideal for describing control functions, neither is well-suited to representing datapath logic. Another problem with LDD is that most of today's synthesis tools target and work best with fine-grained architectures, such as those on ASICs. "Fine-grained" devices are those that the synthesis tool "sees" as primitive logic gates and simple register elements.

Toward the end of the 1980s, a new breed of devices—FPGAs—emerged. Although some FPGAs are fine-grained, others are constructed around different flavors of coarse-grained architectures (Figure 2). The problem with FPGAs is that each vendor can sport radically different architectures. Each of the programmable logic blocks contains several primitive gates and registers; in some architectures, the primitive gates essentially implement small truth tables. The inputs and outputs from the programmable logic blocks connect to programmable connection matrices, which, in turn, connect to programmable switching matrices. This type of FPGA is strongly layout-dependent in terms of functionality and propagation delays, and these devices require special "fitting" software to map the design into the device.

A designer could create an HDL representation either manually or using a graphical technique and subsequently could migrate this representation to a gate-level netlist via logic synthesis. Then, unfortunately, after the fitting tool performs task, the final result is typically nonoptimal in terms of resource usage and timing. In other words, if the designer could work at a slightly higher level of abstraction, such as multibit multiplexers, registers, counters, and adders, then the fitter could recognize and treat as special cases these higher level functions. The benefit of this approach is that the fitter could contain handcrafted algorithms for each of these higher level functions and could, therefore, return better results.


LPMs to the rescue

In a rare example of cooperation, a group of EDA vendors and chip manufacturers met in October 1990 to hammer out the details of an alternative design methodology. Their main goals were to offer a vendor-independent methodology that didn't target a specific FPGA architecture, oblige the user to learn an HDL, or require any investment in synthesis technology. LPMs were the result. The idea behind LPMs was to use graphical techniques based on a library of high-level, parameterizable building blocks, similar in concept to connecting SSI and MSI devices at the board level. The basic idea behind LPMs is not radically new, and a number of proprietary implementations of template-driven approaches are available, such as DMAG and AutoLogic Blocks from Mentor Graphics (Wilsonville, OR), Synthetic Libraries from Synopsys (Mountain View, CA), and XBLOX from Xilinx (San Jose, CA). However, one of the key differentiators of the LPM approach is that it is part of a nonproprietary industry standard. The group that originally described LPMs presented a preliminary version of this standard to the Electronic Design Interoperability Format (EDIF) Committee in March 1991. The EDIF Committee subsequently adopted it as an extension to the EDIF 2.0.0 standard (EIA-548-A). The result was a generic set of 25 parameterizable templates for some of the most common datapath functions in digital design. These templates allow designers to represent complex behavior without worrying about implementation-specific details and comprise the following functions:

  • Basic gates: invert, AND, OR, XOR, multiplexer, constant, decode, tristate, and shift;
  • Arithmetic components: add/subtract, compare, multiply, counter, absolute value;
  • Storage components: latch, D flip-flop, T flip-flop, RAM, ROM;
  • Table primitives: truth table, finite-state machine;
  • Pad primitives: input, output, bidirectional.

    As an initial example, consider one of the simpler functions, the LPM_AND. This function supports two properties—"width" and "size," where the width reflects the number of gates the function represents, and the size reflects the number of inputs to each gate (Figure 3).

    Thus, an LPM_AND with width=3 and size=2 represents three two-input AND gates, and a similar function with width=2 and size=3 represents two three-input AND gates. Even at this simple level, it is easy to see how the use of LPM symbols can reduce the complexity and increase the clarity of a schematic. Although the primitive LPM functions are useful for creating compact schematic representations, the more complex functions demonstrate the true power of LPMs. For example, consider the LPM_COUNTER function (Figure 4). First, consider the ports (the inputs and outputs). Some of these ports, such as the data outputs, are mandatory, but others are optional. If you use LPMs at the schematic level, then you need only connect signals to those ports that you wish to use. For example, if you connect a signal to the asynchronous-clear (ACLR) input, then you have automatically instructed the system that you wish this function to have an asynchronous clear. Or, if you connect a signal to the synchronous-clear (SCLR) input, then you've instructed the system that you wish to have a synchronous clear.

    Similarly, connecting or not connecting signals to the testin, testout, and testen pins determines whether the counter supports scan technology. Thus, when you generate the EDIF/LPM netlist from the schematic, the subcircuit call references only those pins to which signals connect. Additionally, when this netlist is passed to the technology-specific fitter tool for a FPGA device, the fitter creates only the minimum logic required to generate the optimal implementation of this function (assuming that the fitter actually supports LPMs). In addition to customizing LPMs by either connecting or not connecting signals to ports, each function also supports a set of properties. For example, in the case of the LPM_COUNTER, you can request an unsigned binary counter (the default) or a gray-code counter. Also, in addition to specifying the modulus of the counter, you can specify constant values that can be loaded either synchronously or asynchronously and an initialization value to load to power-on.

    There are many reasons to use LPMs. One of the main reasons is that they provide efficient access to unique silicon architectures, such as those in coarse-grained FPGAs, without the designer's detailed knowledge of the silicon technology. Also, although their designers did not originally position LPMs as a capture methodology, they are useful in this role, because designing with LPMs at the schematic level facilitates the rapid evaluation of alternative design architectures. In addition, some LPM tools facilitate design reuse and the ability to retarget designs among alternative FPGA and ASIC implementations. For example, some tools help you retarget an LPM-based design from a coarse-grained FPGA architecture to a fine-grained ASIC architecture by generating a high-level HDL representation of the LPM, which can subsequently be passed to your logic-synthesis suite.

    This type of tool can save you considerable time. For example, in the LPM_COUNTER example, handcrafting this function as textual HDL is a nontrivial task, requiring a substantial amount of verification by simulation before you can use this code with confidence. By comparison, the HDL that an automatic tool generates inspires much greater confidence.


    LPMs can't do everything

    In the same way that state diagrams and flow charts are useful for representing control functions but less effective for datapath logic, LPMs are effective for datapath logic but less so for control functions. Thus, an optimal design methodology lets you capture and verify your designs using a mixture of whatever styles are appropriate for the various design portions. These styles include hierarchical schematics, including mixing block, gate, and LPM levels; graphical techniques, including state diagrams and flow charts; and textual HDLs. Various LPM-driven EDA tools are available, each with their own capabilities and restrictions. The problem is that the EDA market is fast-moving, and such tools are always evolving. Thus, it's ultimately your responsibility to determine the feature set that best matches your requirements and then to check with the various EDA vendors to see what's available to meet your needs.


    Author's biography

    Clive "Max" Maxfield is a member of the technical staff at Intergraph Computer Systems (Huntsville, AL) (800) 763-0242), where he gets to play with the company's high-performance graphics workstations. In addition to numerous technical articles and papers, Maxfield is also the author of Bebop to the Boolean Boogie: An Unconventional Guide to Electronics (ISBN 1-878707-22-1). To order, phone (800) 247-6553. You can reach Maxfield via e-mail at crmaxfie@ingr.com.

    
    


    | EDN Access | feedback | subscribe to EDN! |
    | design features | out in front | design ideas | columnist | departments | products |


    Copyright © 1995 EDN Magazine. EDN is a registered trademark of Reed Properties Inc, used under license.