Design verification method for programmable logic design

Abstract: A technique for checking a logic design for compliance with a set of design rules in a computer-aided logic design system. An initial logic design is provided in computer-readable form in a logic design file. A set of design rules expressing permitted and prohibited structural and functional logic device relationships is provided as a portion of a logic design simulation system capable of synthesizing the initial design into a simulated network list. The initial design is checked against the various design rules incorporated into the set, and any violation of the design rules by the initial logic design is visibly displayed to the user. In one mode of operation, a list of user selectable optional rules is visibly displayed. A hierarchy of levels of design compliance is also displayed for user selection. For some design rules, a comparison can be made with the synthesized version of the initial logic design in order to spot design rule violations introduced by the synthesis process.

Description: BACKGROUND OF THE INVENTION The present invention relates generally to tools for computer-aided software engineering. More specifically, the present invention relates to a software-implemented tool for assisting in the design of logic circuits having interconnected circuit elements, the invention providing a technique for checking a user's design against a set of design rules. Computer design tools are known for assisting circuit designers in the laying out and simulation testing of logic circuitry. One such software base system is that system sold under the trademark MAX-PLUS available from Altera Corporation of San Jose, California. Typically, the designer uses such a system to initially design and subsequently test the operation of the design using computer simulation techniques. With reference to Fig. 1, a typical computer logic simulation technique proceeds by initially providing a logic design in the form of a schematic or netlist stored in a file 10 and converting the netlist by means of a logic compiler 12 into a simulator logic netlist 14 that is used by a logic simulator 15. In use, a set of simulation input vectors 16 is also provided to the logic simulator, which reads the simulator logic netlist, along with the simulator input vectors and "simulates" the operation of the logic design by propagating logic levels through the logic primitives in order to generate a set of output vectors 18, which are the simulated outputs of the logic design. This process has been found to be exceedingly useful in the field of logic design, particularly for complex circuits intended for physical implementation in erasable programmable logic devices (EPLDs) and mask programmable logic devices (MPLDs). Recently, with volume applications of circuits, the trend has been to either initially design the logic circuitry with MPLD implementation in mind, or to convert an original design intended for implementation in EPLD form to a functionally identical design intended for implementation in an MPLD form. Typically, a given user's design must conform to a set of design rules governing permitted and prohibited structural and functional configurations, in order for the design to be useful and reliable. Failure to comply with one or a few of the design rules, while not necessarily fatal to the operation of a circuit, can introduce operational uncertainties under special conditions, sometimes with a cumulative effect leading to a partially inoperative or, in extreme cases, a totally inoperative circuit design. While the logic simulation process is intended to reveal erroneous or inconsistent responses to stimulation by the test input vectors, such a result is only obtained after an often lengthy and time consuming simulation of the original design. 1988 IEEE International Conference on Computer Design: VLSI in Computers and Processors (1988), pages 324-327, Spickelmier et al discloses a method for critiquing circuit designs using a knowledge-based program that looks for errors or bad design style in circuit designs. The knowledge-base consists of process and design-style constants, a set of prohibited descriptions, a set of structural descriptions and error checking rules. Information in the knowledge-base is used to find structures and errors in the circuit. To find circuit structure, the program employs a rule-based pattern or procedural matching system. Those structures which have been found in the database are then checked for errors. SUMMARY OF THE INVENTION According to the present invention, there is provided a method of verifying compliance of an initial logic design with a user-selected set of design rules from a pre-existing set of design rules that express permitted and prohibited structural and functional logic device relationships, in a computer-aided logic design system for designing and testing logic circuitry prior to physical implementation, the method comprising the steps of: (a) presenting a user with choices including the entire pre-existing set of design rules, a predetermined subset of the pre-existing set of design rules, and a customisable subset of the pre-existing set of design rules to be customised by the user, wherein said predetermined subset of design rules is applicable to programmable logic devices ; (b) accepting from the user a choice from among the presented choices that thereby establishes the user-selected set of design rules; (c) providing a logic design file incorporating the initial logic design in computer-readable form; (d) executing the user-selected set of design rules to check at least portions of the initial logic design; and (e) providing a user-discernable indication of any violation of the user-selected set of design rules by the initial logic design. Thus, the invention provides a technique for checking a user's initial design against a user-selected set of design rules in order to uncover potential problems with an original design, which could result in an unreliable circuit, whether implemented in EPLD or MPLD form. The preferred method includes the step of enabling a user to select the level of design rule compliance from among a hierarchy of such levels. In addition, the method includes the step of providing a user-selectable list of optional rule selections. Thus, all rules in the set or only selected ones of the rules in the set are used to check the initial logic design for design rule compliance, with the level of compliance also being selectable by the user. Both the hierarchy of levels of design rule compliance and the user-selectable list of optional rule selections are preferably visibly displayed to the user to aid in the selection of choices. The preferred method also provides for an additional comparison of at least some of the design rules with a synthesized version of the initial logic design in those cases in which the initial design undergoes logic synthesis. This capability is provided in order to check for design rule violations potentially introduced by the process of logic synthesis. The invention provides a convenient and effective technique for verifying the compliance of an initial logic design against the set of design rules applicable to the type of programmable device in which the design will be implemented. Thus, embodiment of the invention can be used in conjunction with ELPD and MLPD implementations. In addition, embodiments of the invention can be readily expanded to include changes to an existing set of design rules or to implement new design rules found necessary or desirable in the computer-aided logic design process. Examples of embodiments of the present invention will now he described with reference to the drawings, in which:- Fig. 1 is a schematic diagram illustrating a prior art computer logic simulation system; Fig. 2 is an illustration of computer hardware suitable for implementing the present invention; Fig. 3 is a block diagram of a system for implementing the present invention using the computer hardware shown in Fig. 2; Fig. 4 illustrates a first-user interface in the preferred embodiment of the invention; and Fig. 5 illustrates a second-user interface in the preferred embodiment of the invention; Fig. 6 is a shematic diagram illustrating the method of the present invention. DESCRIPTION OF THE PREFERRED EMBODIMENT Fig. 2 is an illustration of computer hardware suitable for implementing the present invention. As seen in this Fig., a computer system 31 includes a monitor 33, a display screen 35, a housing 37, a keyboard 39 and a mouse 41. Mouse 41 may have one or more mouse buttons, such as buttons 43. Housing 37 encloses typical computer components, such as a processor, memory, disk drives, and peripheral interface adapter (not shown). Fig. 2 is a representation of only one of many types of computer systems which are suitable for embodying the present invention. Other types of computer systems suitable for use in the present invention include so-called "notebook," "palmtop" or "hand-held," "pentop," etc., computers. Further, the use of the term "mouse" or "user input device" is understood to include other means for inputting information into a computer, such as touch screen, trackball, MIDI keyboard, light pen, data glove, etc. As will be readily apparent to one of ordinary skill in the art, many types of computer hardware, and configurations of the hardware, are suitable for use in conjunction with the present invention. Fig. 3 illustrates a system 50 for implementing the invention using the computer hardware shown in Fig. 2. As seen in this Fig., system 50 includes a computer system 51 coupled to a relative pointing device (RPD) 53, for example a trackball or a mouse. The computer system 50 includes a central processor 55, a system memory 56, an input device, such as keyboard 39, a fixed disk 58, monitor 33, an external interface 61, a printer 62, an input/output (I/O) controller 63, a communications port 64, and a display adapter 65. A system bus 67 connects the components of computer system 50, providing a link among them. The keyboard 57 and RPD 53, taken individually or jointly, are data entry devices with which a user of the computer system 51 can interact with the design checking system. A preferred embodiment uses an appropriately programmed IBM-compatible personal computer (PC) operating under the MS-DOS operating system using Windows 3.x as a shell. It is understood that other platforms are available and may embody the invention in other forms. The invention is not limited to embodiments that include PC-type computers, but may include other platforms, such as Apple Macintosh® computers (Apple Computer, Cupertino, California) or Sun SparcStations, for example. The design checking invention is implemented by the central processor 55 under appropriate process control and instruction from procedures stored in the system memory 56 and provided as part of the system 50. In operation, after a user has created the original design and reduced it to a suitable form for the logic design file (such as a network list), this design is checked against a preselected set of design rules. Thus, the invention checks user designs for flaws that can cause reliability problems when the circuitry is implemented in silicon. This tool applies a set of rules, as specified below, to scan for various structures in the user's design that have been determined to cause problems. When a particular structure is located, the user is alerted and may then locate the structure in the design files. An embodiment of the invention can execute as part of the MAX+plus II compiler, and is controlled through an options dialog box. Different predefined sets of design rules are selectable, along with a user-specified rule set. The primary motivation for the following rules is a functional MPLD implementation of a user's design. However, when a design satisfies the rules motivated by the MPLD conversion, it can be assumed that an EPLD implementation will be reliable as well. Thus, the invention is useful for checking both EPLD implementable designs and MPLD implementable designs. User Interface The preferred embodiment appears as a user-selectable compiler option. Particularly, when selected from the menu, an icon resembling a doctor is displayed below the logic synthesis module. During compilation, this embodiment runs in three places: after netlist extraction, after logic synthesis, and after simulated netlist (SNF) extraction. At each point, a different subset of rules is executed. For example, illegal clock structures are detected after netlist extraction, while static hazards are detected in both the pre- and post- synthesis netlists after logic synthesis has executed. An embodiment of the invention is controlled through an options menu item. This item opens a dialog box shown in Fig. 4 that controls the types of design rules to be applied and allows customization of the rule set. When this embodiment is set by the user to the "MPLD Rules" level (see Fig. 4), all rules will be executed, as described below. This level is the most time-consuming, and may generate a number of spurious warnings. A check at this level is required of any design submitted for MPLD conversion. To reduce the number of warnings, and speed the processing of a design, three other options are provided. The "FLEX" and "EPLD" levels prevent various rules from executing, or restrict the structures that a rule will warn about. Finally, there is a fully customizable warning set, which is controlled by a dialog box available by selecting the Advanced Options button. (See Figure 5). With the Advanced Options dialog box, the user can selectively enable or disable every rule that this embodiment of the invention executes. The setting of each of the rules in the custom configuration, and the current rules level, is saved in the project initialization file. The default for a new project is the "FLEX" warning level, with the rules that make up this level selected in the Advanced Options dialog box. Design Rules A preferred embodiment checks the following set of design rules. Each of these rules is controlled with a check box in the customize dialog box (see Figure 5). Every rule is applied when aggressive ("MPLD") checking is selected, and various rules are applied when lower or custom levels are used, as noted below. When a design rule violation is detected, a warning is issued to the user via the display. In the preferred embodiment, each warning is of the form: "Design Doctor Warning:" followed by a description of the violation. If desired, the user can call up for display those portions of the original design logic circuitry pertinent to the warning. Clocking Schemes The most important system in a synchronous design is the clocking of registers. The preferred clock design for a MPLD implementation is global clocking, in which a single pin serves as a clock source for all registers in a design. This approach, as well as clocks driven by a single pin, will be approved by the preferred embodiment. All other approaches will generate a warning. These rules are executed at all warning levels, before logic synthesis. Ripple Clocks A ripple clock exists when the output of one register feeds the clock of another register. This is not really dangerous in itself, but will produce a warning at all levels. However, if the output of one or more flipflops in a chain feeds into combinatorial logic (for example, a decoder), a warning will be issued that there may be glitchiness. Gated Clocks If a flipflop's clock is fed by combinatorial logic, then there must be at most two gates between the clock and any input pins feeding the clock. In any path, there must be only AND, OR, NAND, NOR, and NOT gates. Also, there should only be two AND/OR (NAND/NOR) gates in total. Any variation from this pattern will produce a warning. Also, if two or more registers feed a clock through logic, then a warning will be issued, since it cannot be guaranteed that the registers will change at the same time, and that the delay paths to the clock will be the same length. Multi-level Clocks Any other clocking schemes will fall under the general heading of multi-level clocks. When such a clocking scheme is detected, an advisory warning is issued to the user, in the nature of a directive to consult detailed reference sources, for more information. Multi-Clock Networks This rule checks to determine whether a synchronous device that is synchronized to one clock receives data that is synchronized to another clock. Unless the device is a synchronizing register having a single input from the other clock group, a warning is issued that this is a design violation. Preset and Clear Configurations The rules listed in the previous section are also applied to the preset and clear signals of a flipflop. These signals ideally should be driven by input pins, but barring that, should be driven by no more than two levels of logic. Any combination of multiple flipflops, or flipflops with input pins, will generate a warning. Static and Dynamic Hazards A static hazard occurs when an input changes logic levels and causes an output to momentarily change levels, or glitch. This occurs because the new set of input vectors maps to a different cover on the function's Karnaugh map than the original set. If both sets of input vectors map into the same cover on the Karnaugh map, then a static hazard does not exist. A dynamic hazard occurs when an output should change state, but actually changes three times, instead of just once. This implies at least three paths through the function of interest. There are two possible sources of hazards in a design compiled for an EPLD. In the first case, the user's design may contain various hazards. In the other, logic synthesis may introduce hazards into the design. To check both possible sources of hazards, the invention runs this rule both before and after the Logic Synthesis module. If the user is only looking for faults in their original design, this rule will run before logic synthesis. If the user is looking for faults in both cases, this rule will run after logic synthesis, where it can look at both the pre-synthesis design and the post-synthesis design. If the user is only looking for faults from synthesis, both designs will be analyzed after Logic Synthesis has executed, and faults from the original design will not be reported. Since hazards do not really matter if they only affect the data input of a flipflop, the preferred embodiment does not check such logic. It does check logic that feeds all control pins of a flipflop, as well as any purely combinatorial networks. This rule will execute at the "FLEX" and "MLPD" level for the post-synthesis network, and at all levels for the pro-synthesis network. Latching Asynchronous Inputs To avoid setup and hold problems with asynchronous inputs, the rule checks all input pins and to see whether or not they are latched with the clock of any synchronous devices that they feed. The theory here is that an asynchronous input should fan out to at most one synchronous device, which would be considered the synchronizing latch. An input that feeds a purely combinatorial network will not be subject to this rule, unless the network feeds into the data line of a flipflop. Race Conditions The invention searches for certain types of critical races when this rule is selected. It will not have the capability to search for the conventional two-or-more-inputs-switching-at-once type of race, since the number of two-or-more input networdks in a large design is vast. The preferred embodiment does detect the use of a flipflop depending on its output for some other control logic. A good example of this is a pulse generator in which a signal clocks VCC into a DFF, and Q feeds the CLRN through a NOT gate. This configuration would create a pulse of uncertain width. Therefore, this rule looks for flipflops that depend on their output for one of their control signals, namely CLK, CLRN, PRN, or ENA. Delay Chains and Asynchronous Pulse Generators This rule checks the original design for chains of primitives available to the user, such as expanders, MCELLs, or SOFTs in the Altera System. It looks for cases in which one of the given primitives has a single fan out to another of the primitives, with some added look-ahead. For example, b = mcell(mcell(a)) will be found, while b = soft(exp(a)) will not. The look-ahead is used to check for structures of the form b = mcell(exp(mcell(exp(a)))). These structures generate a warning at all levels, since they indicate a reliance on a fixed delay, and this cannot be guaranteed across device speed gates, fabrication differences, temperature, etc. Cross-coupled Expanders Basically structures to be avoided, cross-coupled expanders will always cause a warning to be generated when found. The type of warning will be determined by reading the user's design, and looking for an EXPDFF, EXPLATCH, NORLATCH, or NANDLATCH primitive. If one of these macrofunctions is found, then a mild warning will be issued at the "FLEX" and "MPLD" levels. If user-created cross-coupled expanders are found, a harsh warning will be issued at all levels. Use of a Master Reset When converting a design from an EPLD to an MPLD, state machines and other registered logic lose the assumption of power-on reset. Therefore, a design to be converted must have a master reset pin that clears all flipflops, which would be driven by some board-level signal. The rule attempts to isolate a common reset pin from all registers, even if there is combinatorial logic on some of the lines (for example, active low LLCLR = /reset & ...). This rule will only be active at the "MPLD" level, since it is only useful for checking a conversion to an MPLD. It will execute either from the user's original design, or from the SNF. Stuck States A design may include a set of flipflops that effectively function as a state machine, which can include stuck states. The preferred embodiment will try to isolate groups of flipflops that act as state machines, even though they are not explicitly declared as a state machine. If it finds such groups, it analyzes the state transitions of the machine, and looks for mutually exclusive groups of states. In other words, a state machine should not have states that cannot return to the base state. (For example, A→B→C→A, and D→E→F→D indicates that one of the two groups is stuck.) Since this could be very time consuming, it is only executed at the "MPLD" level. Different output Delays Within a Group When the preferred embodiment finds an output group, this rule checks the clock to output delays of each member of the group. If the delays are not identical, this indicates possible glitches off chip. This rule, working from the SNF, is activated at both the "FLEX" and "MPLD" levels. Detailed Discussion The following is a detailed discussion of the algorithms used to check a user's design. Each of the various algorithms is first discussed and then listed. If an algorithm depends on the output or data structures of another algorithm, it will be noted in the discussion. Following the description of the algorithms is a discussion of the data structures that are used in the invention. A brief description of each data structure follows each definition. Finally, the entry point from the Compiler is described. This serves as the final authority on when a particular design rule will be executed. Clock Analysis These routines attempt to isolate clock structures, and report to the user when a structure that violates the currently selected design rules is found. The analysis of clock structures consists of two parts. First, the routine drc_mark_clock_groups() isolates groups of synchronous devices which share the same clock logic, whether it be an input pin, an equation, or another synchronous device. Then, with the clock groups isolated, the routine drc_reduce_ripple_clocks() combines clock groups that are part of a ripple clocking chain. These are of the form C.CLK = B.Q, B.CLK = A.Q., etc. Finally, the equations or pins that drive a clocking group are analyzed, and warnings will be issued based on the rules that are currently selected. The clocking groups are saved for use by drc_check_asynch_signals() (see below under the heading Asynchronous input pins). The first stage of the clock analysis consists of collecting all synchronous devices into clock groups, which are identified by the compiler database ID of the pin, flipflop, or gate that feeds the devices. When the group ID for a device has been determined, the group will be found from the list of known groups. If the group does not exist, a new group is created and inserted into the list of groups. Then, the device ID is added to a linked list of all synchronous devices in the group, which will be used for checking asynchronous signals and for error reporting. The second and third stages of clock analysis involve reducing ripple-clocked groups, and analyzing the clocking groups determined by drc_mark_clock_groups(). Since a ripple clocking group has each member driven by a different signal, namely the output of the previous member, each member will create its own clocking group. Also, because the records for the group could occur in any order in the database, the groups cannot be combined during the first pass. Therefore, the routine drc_reduce_ripple_clocks() scans the list of clock groups, and looks for ripple chains. It condenses these chains into a single clocking group, with the group ID from the first device in the chain. Once all of the clock groups have been identified and reduced, the main analysis is started. This looks at the logic that drives each clock group, and compares it to known legal and illegal structures. The reporting of warnings will vary depending on the design rules selected by the user. For example, if the user selected the ripple clocking design rule, any ripple groups found in the design will be reported. However, regardless of whether this rule is selected, the ripple group will be checked to see if it feeds any logic, as would a ripple counter. This will always generate a warning. After ripple clocking, the clock group is checked to see if it is driven by an input pin. If not, the logic that drives the group will fall into one of three categories. The first is a logical combination of register outputs and possibly input pins. For this case, there must be at least one register and one pin, since a single register would fall into a ripple group, or two or more registers with zero or more pins. In both cases, a warning will be issued about registered clock lines if the user has enabled gate clock checking. The second case occurs when the clock is a logical function of input pins. Any single pin clock groups are used here, to determine if the equation involves another known clock line. A warning will be generated if the logic is more complicated than two gates in an AND-AND, OR-OR, or similar configuration. Also, if a known single pin clock is used in the equation, the other logic should look like an enable signal. If it does, the inventor will suggest that the user use an enabled DFF. Otherwise, a warning will be issued. The final case involves multiple level logic and other structures that this embodiment cannot analyze. In such a case, a warning is be given that the clock logic is too complicated, and can not be analyzed. Preset and Clear Configurations The analysis that is performed for clocking schemes is repeated for preset and clear logic. The major difference is that a design should have a master reset pin if it is intended to be converted to an MPLD. Therefore, the Design Doctor will attempt to isolate a master reset pin when it builds the list of reset groups. If a master reset is actually located, then the tests of logic on the reset lines will be modified, to look for simple functions involving this master reset. Static and Dynamic Hazards "If, in response to an input change and for some combination of propagation delays, a network output may momentarily go to 0 when it should remain a constant 1, we say that the network has a static 1-hazard. Similarly, if the output may momentarily go to 1 when it should remain 0, we say that the network has a static-0 hazard. If, when the output is supposed to change form 0 to 1 (or 1 to 0), the output may change three or more times, we say that the network has a dynamic hazard." Charles H. Roth, Jr. Fundamentals of Logic Design, Second Edition, c. 1979 West Publishing Company. The following routines isolate instances of static hazards. As noted above, the user interface allows a designer to search for hazards in the original design, to search for hazards introduced by logic synthesis, or to look for both. In order to handle this, the routine below is written to handle the compiler database both before and after logic synthesis. In fact, all of the necessary records exist after logic synthesis, allowing this routine to be called after that module has run. The routine drc_check_ hazards() is called once, regardless of what the user has requested for hazard detection. It then determines what parts of the compiler database to check, and how to deal with warnings. This routine prevents two warnings about the same bit of logic, since that can only happen if the user's original design contains hazards. In that case, the warning about the original design will be issued, with a note that the hazard exists after synthesis as well. To handle this processing, drc_check_hazards() calls a second routine, drc_check_function_for_hazards(), that performs the actual hazard testing. This function has the ability to work from both sets of compiler database records, and determines which set to analyze based on the validity of passed parameters. Once it has constructed the appropriate logic trees, the function calls drc_create_sum_of_products() to reduce each of the trees to sum of products form, and then passes the reduced trees to drc_check_trees(), where they are checked for hazards and compared against each other. After the sum of products equation has been dealt with, the original equation is inverted and reduced to produce an equation that lists the 0-terms of the function. This new equation is processed in the same manner as the original equation, resulting in a list of any static-0 hazards. The function drc_check_trees() accepts one or two logic trees generated by drc_check_function_for_hazards(), and analyzes them for static hazards. When the drc_check_trees() finds hazards, it compares the list of hazards from the pre-synthesis tree to the list of hazards from the post synthesis tree, as appropriate. It then determines what error messages to display, based on whether the user has selected pre or post synthesis hazard detection, or both. The procedure for checking a function for hazards, as shown below, works from a sum of products equation generated from the database. The equation, of he form F= a b+ a c+b c d+abc, will be analyzed in pairs of terms, in order to isolate adjacent covers. These will be found when two terms contain the same variable, but in complementary sense, for example a b and abc from F. Then, the routine collects all of the other variables contained in those two terms, and attempts to find a term that covers this collection. In the function F, there is no cover for the term bc, so static-l hazard exists in the function. On the other hand, a c and b c d produce the set of variables a bd, which is covered by the term a b. Finally, the procedure to generate sum-of-products trees is as follows. First, a tree is built from the compiler database by directly reading in the description of logical gates, and converting these to DRCS_TREE_NODE structures. All registers and input pins are treated as sources, as are any cases of combinatorial feedback. Then, the function drc_create_sum_of_products() is called, which recursively reduces the tree into a sum-of-products form. The actual reduction is handled by the function drc_compress_tree() . This function performs the Boolean algebra functions AND and OR (or "multiply" and "add") from the deepest nesting level upwards. As it works its way up the tree (or, conceptually, from the most nested parenthesis), it produces trees that are at most a single level deep. In other words, the tree produced by this function will always be of the sum-of-products form term + term +..., where term is a single literal, or a product of literals (e.g. A, AB, ABC, etc.). When the function returns a tree to drc_create_sum_of_ products, the result is by definition a sum-of-products expression. The function also removes trees that reduce to VCC or GND during multiplication, as well as duplicated terms and trees that are absorbed by other trees (e.g. AB absorbing ABC). Asynchronous Input Pins To reduce the possibility of setup and hold violations, a design should latch any input signal to the clock of the synchronous network that the signal feeds. This routine determines if an input signal drives more than one flipflop by tracing the data lines of every synchronous device back through logic to either other synchronous devices or input pins. Each device that depends directly on an input pin will therefore increase that pin's usage count by one. At the end of tracing, the routine merely reads these usage counts, which determines the fanout of the pin. Also, a signal which is generated by a register synchronized to one clock should be latched to the clock of any other register that the signal feeds. Therefore, when a trace terminates at a synchronous device, the clocking group ID of the terminal device is checked against the clocking group ID of the original data port. If the IDs do not agree, then a device that is synchronized to one clock is receiving data synchronized to another clock. That configuration is a design violation unless the register is a synchronizing register, which has a single input from the other clock group (e.g. reg_b is a synchronizing register if reg_b.d = reg_a.q, reg_a.clk = clk_a, reg_b.clk = clk_b) This function is always executed, since it determines whether any multi-clock systems exist, and where there are any problems with those systems. Race Conditions The preferred embodiment will find critical races that involve control signals that depend on the register that they control. It will not search for other critical races, which involve two (or more) inputs to a function switching at the same time. This routine performs a simple trace of the logic driving each of a register's control lines, stopping at pins and other registers. A warning is issued if the register's output is found in any of the equations. Delay Chains and Asynchronous Pulse Generators The use of chains of expanders or MCELL primitives to modify the timing of a device will be detected by this function. Since the database records of members of a chain can come in any order, this function makes a total of three passes through the compiler database. On the first pass, it locates all primitives which appear to be part of a delay chain. Then, if it found delay chains, a second pass reduces the number of marked primitives to one per chain, in order to facilitate error reporting. Finally, a third pass reports all the errors, after verifying that a chain has been found, and not a configuration of the type represented by MCELL(NOT (...)), with the polarity of the output versus the input reported as well. Cross-Coupled Expanders This function detects expander latches and other cross-coupled expander structures. It uses some graph-theory algorithms to isolate all loops in a graph which represents the network. This is done by building a directed graph with all the connectivity of the network. Then, starting at registers and pins, forward and backwards dependencies are removed. When a node no longer has any forward dependencies, all nodes on which it has backwards dependencies on can remove this node from their forward dependency lists, and the mode can be deleted. This deletion is performed recursively through the graph. Backward dependencies are handled in the same manner. At the end of this algorithm, the only nodes with dependencies are those that are part of a combinatorial loop, or are dependent on a combinatorial loop. With this information, the graph is then searched for small loops that look like latch structures. These typically involve four gates in the database, consisting of two AND or NAND gates and two place holder EXPANDER or MCELL gates. When one of these is found, the nearby area is checked for two more latches. This indicates the presence of a known class of DFF built from logic, where two latches perform the preset and clear operations, and feed a third output latch. When a LATCH or DFF structure is isolated, the invention looks at the full name of the gates for the keywords EXPLATCH, EXPDFF, NANDLTCH, and NORLTCH. These indicate that they may be ALTERA-supplied macrofunctions, and cause a different type of warning to be issued. The user is then warned about the structure, whether it meets the LATCH or DFF criteria or whether it is an unknown structure. Use of a Master Reset This function attempts to isolate an input pin that serves as a master reset signal to the user's design. It will also determine the reset groups in a design, which are groups of synchronous devices that are reset or preset by the same signal. These groups, as well as the master reset (if found), are used by drc_check_preset_clear() to check all reset configurations in a design. Finding a master reset contains this heuristic: the master reset should be in the reset equation of most registers. When searching for the master reset, single pins are weighted more heavily than groups of pins. If a reset group consisting of a single pin is found, then the number of registers in this group is added to the pin's usage count. If there are several pins involved in some logical equation, then the usage count for each pin in the group will be increased by one, instead of by the number of registers in the group. After all the reset groups have been analyzed, a master reset is identified from the counts generated during the scanning. The following functions may also be included in the preferred embodiment of the invention. The first will check the efficiency of each macrofunction in the user's design against a precompiled list of macrofunctions and equivalents. The second will verify that the time to outputs for each member of a known group are identical. The last will attempt to isolate any unknown state machines, and check to see if they contain possible stuck states. Data Structures This structure contains a flag for every design rule within the preferred embodiment of the invention. This structure is used to control design rule checking, and to set up the Advanced Options dialog box. As new design rules are developed, flags will be added to this structure. Each element of this structure is also written out to the project initialization file in the form RULE_NAME = 0/1. This type encodes the current selected rule set. The EPLD, Flex and MPLD rule sets map to a particular pattern of TRUE flags in the design rules structure above, while the custom rule set allows an arbitrary pattern. This is used to set up the Advanced options... dialog box, and as a shorthand for the three known sets of rules. This is saved in the project initialization file as DRC_RULES=number. This type is used to indicate the current state of the compiler and is exported to the compiler control module. This structure holds data about a group of synchronous devices that share a common clock, referred to as a "clocking group." For each clocking group in a design, this structure holds a pointer to the list of devices clocked by this pin or equation; the database ID of the clock pin or equation; whether or not this clocking group is part of a ripple clocking chain, the number of registers in a group, and a pointer to the next clocking group. This structure defines a node in a clocking group, which is an occurrence of a synchronous device. The invention does not require a designation of the type of synchronous device represented in a clocking group, whether it be a latch, a DFF, a JKFF, or a state machine. This structure holds the database ID of the synchronous device, the clock group ID, and the sense of the clock when it reaches this node. This structure holds a single pin in a list of input pins in a design. The use count variable is the number of synchronous devices that are driven by this pin through any combinatorial logic. The structure also records the database id of the pin it represents, and a pointer to the next element in the list. This structure is use when determining the master reset pin for a design. This type defines the logical operators that can exist within the logic tree extracted from the compiler database by the preferred embodiment. Unlike the Compiler, there is a single type for each operator, instead of a type with an embedded pin count. That information is stored in the tree node, as discussed below. This structure defines a node in the logic tree used in static hazard detection. Conceptually, each node in this tree represents a gate in the design before the tree is converted to sum-of-products form. The structure lists the logical operation that it represents, the number of other nodes that are inputs to this node, and the number of fixed database records that are also inputs to this node. The fixed database records represent input pins and synchronous devices. The node then holds a pointer to an array of database record IDs and a pointer to an array of pointers to other nodes. This structure holds a warning generated about a logic function. The type indicates whether this is a warning about a static 1 or a static 0 hazards. Name is the name of the primitive, which will be reported to the user, and conditions is a list of a names of sources in the design and the levels that they must be at for the hazard to exist. These sources are input nodes and synchronous devices. Finally, there is a list of database ids of the sources, which are used to generate location information when the error is reported. This structure defines a node in the graph extracted from the database by the preferred embodiment when checking for combinatorial latches, flipflops, and other feedback structures. Each record in the database holds a pointer to one of these structures. The structure then contains a list of inputs to this database record, a list of all records which depend on this one for input, and the total number of elements in each list. It then records the number of inputs and outputs that have not yet been processed, as described above. Compiler Interface This function is the main entry point from the compiler control module and comprises the dispatch point for the functions which check the various design rules. As new design rules are created, they may be added to the appropriate stage of the compiler through this function. As will now be apparent, the invention provides a simple and expedient technique for validating an original design, and a logic synthesized version of the original design, for conformance with or violation of predetermined design rules. In the preferred embodiment, the invention is implemented as an additional module of the above-noted MAX PLUS system and can be used in conjunction with that system for initial design checking. The MAX PLUS System is generally described in the MAX PLUS II Programmable Logic Development System and Software data sheet dated September, 1992, available from Altera Corporation. The user selectability of various levels of conformability testing (i.e., "EPLD Rules," "FLEX Rules") and the Custom Rule feature provide great flexibility in the use of the invention to check original user designs. While the above provides a full and complete disclosure of the preferred embodiment of the invention, various modifications, alternate constructions and equivalents may be employed. as desired. For example, different design rule sets or additional rules provided to the design rule set described above, may be implemented in other embodiments of the invention. Therefore, the above description and illustrations should not be construed as limiting the scope of the invention, which is defined by the appended claims.

Claims: A method of verifying compliance of an initial logic design with a user-selected set of design rules from a pre-existing set of design rules that express permitted and prohibited structural and functional logic device relationships, in a computer-aided logic design system for designing and testing logic circuitry prior to physical implementation, the method comprising the steps of: (a) presenting a user with choices including the entire pre-existing set of design rules, a predetermined subset of the pre-existing set of design rules for programmable logic devices, and a customisable subset of the pre-existing set of design rules to be customised by the user; (b) accepting from the user a choice from among the presented choices that thereby establishes the user-selected set of design rules; (c) providing a logic design file incorporating the initial logic design in computer-readable form; (d) executing the user-selected set of design rules to check at least portions of the initial logic design; and (e) providing a user-discernable indication of any violation of the user-selected set of design rules by the initial logic design. A method as claimed in Claim 1, wherein the choices presented to the user include a set of design rules, from the pre-existing set of design rules, applicable to erasable programmable logic devices (EPLDS). A method as claimed in Claim 1 or 2, wherein the choices presented to the user include a set of design rules, from the pre-existing set of design rules, applicable to mask programmable logic devices (MPLDS). A method as claimed in Claim 3, wherein the set of design rules for MPLDs consists of the entire pre-existing set of design rules. A method as claimed in Claim 4, wherein the set of design rules for EPLDs is a subset of the set of design rules for MPLDs. A method as claimed in any preceding claim, wherein the step of presenting the user with the choices includes visibly displaying the choices. A method as claimed in any preceding claim further including the steps of performing a logic synthesis of the initial logic design and repeating the steps (d) of executing the user-selected set of design rules and (e) of providing a user-discernable indication with the logic synthesis version of the initial logic design, to check for design rule violations potentially introduced by the logic synthesis.

Inventors: FAIRBANKS BRENT ALAN, FAIRBANKS, BRENT ALAN
Applicants: ALTERA CORP, ALTERA CORPORATION
Application year: 1993
Main classification: G06F17
IPC codes: G06F17