From: AAAI-87 Proceedings. Copyright ©1987, AAAI (www.aaai.org). All rights reserved. sesentation oath to Understan A i&al Robert J. Hall Artificial Intelligence Lab M.I.T. Cambridge, MA 02139 Circuits Robert S. Kirk Semiconductor Division Gould, Inc. Santa Clara. CA 950.51 Richard EL Lathrop Artificial Intelligence Lab M.I.T. Cambridge, MA 02139 Abstract We put forth a multiple representation approach to deriving the behavioral model of a digital circuit automatically from its structure and the behavioral simulation models of its components. One representation supports tempera) reasoning for composition and simplification, another supports simulation, and a third helps to partition the translation problem. A ’ working prototype, FUNSTRUX, is described. a Figure (l-r) node, (time the functions behavior) of a system of its parts, together connections. Unfortunately, the whole by understanding understood. storage inverter cell. Its three components with delay 1.7 nsec, a storage and an inverter with delay 0.5 nsec. Introduction I. ‘I’hc function A dynamic 1: are a clocked The their by structural understanding the function of the parts is difficult and poorly domain for investigating is determined with of digital this problem circuits because and produces simulator model for the en- The input components’ final output) can also be in either of the equivalent event or temporal is convenient many of its objects an executable tire circuit. equation FUNSTRUX SCORE has [Alexander, descriptions (and the abstract, representations. been tested successfully 19861 standard cell library on the genera- already have well-defined, machine-readable behavior descriptions. These reside in the simulation model libraries tor system, and has successfully generated a behavioral model for one bit-slice of an AMD 2901 [AMD, 19851 (an used by the design community. arithmetic-logic We have developed a multiple deriving to automatically representation of overall devjce models from the interconnection structure gether with their behavior models. havior representations our system scribing code can the components’ describing The nents, naive the behavior solution, has no value. simulation executable behavior behavior of its components, toBecause one of our be- is the executable transform approach program into executable model, code de- program an overall We exploit Instead, ferent reasoning o The simulating we transform B The model Q The about dif- between facilitates rea- values at times. is the executable simulato: for the circuit. absirocl translations A working the to facilitate representation dependencies code representation components’ event representation helps partition the .ietween code and equations. r:ototype, Machine. the functional 7 hours of real time The resulting time to simulate and control and module model for this.large on a Symbolics Lisp uses less than a third as and schedules tude fewer events than the full circuit [Lathrop circuitry, 365 interconnect- an order of magniat component level et al., 19871. the compo- description. representations equation Generating required memory components each compo- tasks: temporal soning behavior different ing buses). circuit much unit with 370 gate-level of the device as a whole. invisibly nent’s behavior to a representation that highlights value dependencies over time. These are propagated by substitution according to the circuit structure and simplified to produce having FUNSTRUX, interconnection and Behavioral simulators dictates how it propagates Consider as input simulator models, applications of well-known the circuit value-changes shown (events). in Figure 1. For the pur- poses of this example, we choose a simple set of three logic levels (values) : 1, 0, and * (“no value,” e.g. the value The inverter unconditionally puts of a tri-stated device). out the negation of its input at a delay of 0.5. (Thropghout, times will be in units of nanoseconds.) If the clocked inverter’s 4 input cal negation accepts are event-driven simulation techniques to digital circuits. Each circuit component has an algorithmic description which is 1, then its output of its a input becomes 1.7 time units the logi- into the future. Otherwise, its output will be * 1.7 into the future. The storage node holds the most recent non-* value. (This ex- Hall, Lathmop, and Kirk 799 (defun storage-node-fen “b input, (let* (self ((b-value (if (#? (read-bus (put-my-state ACT simplify conv circuit circuit 4 events I coding conventions; driven core. back) into stracts ‘(bit) b-value)) ‘(bit))))) Dif- have differing semantics however, they share a common event representation of translating from code (1) a simulator-dependent from the particular abstract > REPRESENTATION. simulators The abstract the problem equation I ’ (bit))) ‘(bit) self EVENTS ferent event-driven conv circuit code I self c self (get-my-state + b * b-value) (drive-bus substitute b c> c output” partitions to equations segment semantics (and which ab- of the simulator and (2) a simulator-independent events, and event- into segment which translates Figure ule. 21 The FUNSTRUX Representation of a circuit into another. form various system conversion change Substitute/simplify one view modules minor et al.. 1987 in FUNSTRUX’ code and since that paper.) FUNSTRUX produces the following code from this example. (Only the code for the y output is shown here.) (defun dynamic-storage-cell-fen (self a y phi) (depends-on ‘(a phi) ‘0 (if (logone (read-bus (put-my-state (read-bus (depends-on ’0 (drive-bus a says that y self “when either schedule astate changes, an event 2.2 later to drive y to the value of astate.” omits the double the storage node changing negation This and the details of event representation from the code above, inputs ((cv (b) This represents The first event node, : (b) ep ( (cv(bstate) (schedule sents the memory of the storage is <#? * b)) bstcLte at 0 equal-to ep T) c at 0 equal-to a cell with one input, of the storage clause indicates b)) b,tste>)) b. bstate repre- node, and c is the output. that when either the value the predicate changes rescentations uled at the same time which sets bstate to the value of b. (Note that in the example b is not * only when the clocked system’s inverter multiple representation scheme ioral simulation [Lathrop and Kirk, 1985], netlist manipulation [Lathrop ant >Tirk. 19861, and parameterized cell generators [Alexander. 19861. STAR’s LISP-based behavSIM?.!ER, is our target. SIMULATOR CODE REPRESENTATHON. code representation is described in [Lathrop model for the storage is driving.) a change 19851) is shown in Figure 2. It runs as one of the STAR design system [Kirk et al., 19871 Expert Systems similar to our enable- (ep) . value. and continues an investigation into function, structure, and their relationships. The STAR system integrates behav- 800 and the if either the and the predicate ConvePsions 19851. The SIMMER (ep) of b changes e ioral simulator, 19791 used a notation jMeinen, if 4 is astate to (see [Rich, component true. ment predicate event: value of a. Whenever predicate The event occurs enablement predicate becomes true or one of the changingvariables changes value while the enablement predicate is 2.2))) an event at the same time to change description list. (schedule 1, schedule The FUNSTRUX the enablement (cv) event: a or 4 changes, consists of the event to be scheduled for delay, and the symbolic expression The event condition predicate con- changing-variable (Event-cell ‘(a-state)) descriptions. sists of two parts, ‘(bit) self the relative new value. produced self ‘(a-state) ‘(bit)) 0.0))) behavior event description the variable predicate, The abstract ‘(bit))) the current * change, for the ’ (a-state) (get-my-state This phi for different An abstract condition from [Lathrop improvements tion the system per- sorts of simplification. ample has been simplified reflects has two sorts of mod- modules from the event representation to the equaThis will make it easier to re-target representation. and node is The Kirk, [#? * b] is true, The second event of c, but since the enablement happens or when from false to true, an event is sched- clause schedules predicate is T it on any change of bstate. BORAL EQUATIONS REPRESENTATHON. One key insight in our approach is that one needs a behavior representation with locality of reference among circuit values at given times. This means that the time points relevant to the computation of a vai?ue must be explicit, and that circuit value dependencie: Zould be explicit and local to uses of the circuit values. For example, applica‘ive programs have locality of referericsY, while programs which set and use global variables at widely separated places do not. [Davis, 19831 has emphasized reasoning about the behavior the importance of circuits. of locality for Tinlelines ues. are mappings We view [Kelly circuits and Steinberg, their time domain A circuit or earlier tors, - and + second t is expressed times. argument was true.” Thus, u, prior of its inputs time opera- must be a non-negative to “the most {$ [Pu] (or equal) at the values at earlier times. recent time inputs and initialization, denotes the unique solution simultaneous The abstract equations. (and the simulator erational The stract events representation disallowed. Proving MPOSITION. opera- formalism for representing but did not automate and did not relate the representation We represent computation prefix to infix notation temporal equations format. for t,he example’s 4 b(u)] REPRESENTATION conversion CONVERSIONS. algorithms b Code t Abstract ecuted to associate each symbol with a formula computes its value under the appropriate Unknown forms according to the semantics perform are treated side-effects variable) Events between so the value event expression By constructing variable’s value a predicate e Abstract -+ Abstract Events + be generated indicates when we are able to reason “State have triggered. objects” Each variable which produce constructs representation mantics for the circuit as a notation structure. for a denotational A circuit, together sewith complexity, hence, the combi- simplification substitution expression size. SIMPLIFIERS. supports transformations, is and simpliOur system’s simple pattern- similar to those used by [Darlington, 19811for program optimization. The rules in FUNSTRUX terminating are tailored to simplification. rule set, so the system applies They form a them until no Experience has shown that we do not need to search different application One simplifier applicable (#? above is * (if p re d’ zca t e value *)) (AND We have implemented proximately orders. to the equation simplifies - using scheme must at some point answer the question of semantic equivalence of different representations. We view the ;else local representation action expression can then SElW4NTIC CONNECTIONS BETWEEN THE REPW ESENTATIONS. A multiple representation equation PATTERN-ACTION syntactically can be re- the effect of each event. *h to reduce intermediate may be port or a state object, Language ;test ;then interleaves more are applicable. a 1 d(v-1.7)) is much worse; delay the values of the inputs. Code. structure. change most recently. Events. solved into either an I/O the circuit fication t is the value last changed, to conditionally FUNSTRUX at time the last time an event would e Equations needed. occurred which fthen ;else 7 a(z.- 1.7) of even moderate which a global A value doesn’t On circuits explosion functions or setting ;test -1.7) *) ; final else clause natorial correctly. --+ Equations. events, of whichever created * (if (=? t -0.5) ex- of pure LISP. Forms which (e.g., reading are not modeled o Abstract about ‘f? 1 A({$ conditions. as “black-box” 1 @(u-1.7)) 1 -O.S} t}) The code is symbolically Events. example: [#? * (if (=? - 1.7)) et al., 19871. Here are the key ideas. in [Lathrop on which b depends {)I The reprein more detail are treated of by replac- 1 a(u-1.7) ;else [#? 1 d({Z sub- locality b was used. y(t) = 1 c(t-0.5) Inverter: sentation The maintains the variables Here is the fully substituted y(t) = 1 (if (=? of the compoto algebraic to b(t) is expanded everywhere ;test ;then 1.7) *> c(t) = b({-s This process when a reference explicitly amounts are b(t) = (if (=? I 4(t-1.7)) Node: ap- (We have components - upStorage appear here for readability.) of equations. reference: the behaviors representation ing it with b’s definition, the reasoning to simulation. LISP-like converted Inverter: and rea- on values as functional in a side-effects-free Clocked loops are and abstract is an open problem. Composing stitution plication of the code t} refers to the most recent t, such that the predicate P to a discrete circuits, op- constant. et al., 19831; however, they also work with lAmblard et al., 19851 proposed time domain. about as long as zero-delay equivalence events representations nents in equation soning with event-based a predicate at u. This is similar to the left-arrow applicative code) are endowed ]Hall, 19871 shows that our equation is equivalent to an essentially similar ab- tor of [Schwartz a similar to the event representation semantics. representation in a tempo- We use two primitive to - reference was satisfied function for expressing -+= allows time, at time as an applicative same into val- was discrete. output ral equation of the real numbers as mappings between timelines. 19821 used a timeline notion, but predicate to (#? a symbolic * value)) simplifier 50-75 rules of this type. the size of tl-a expressions by about which uses ap- It typically 90%. Syntactic reduces lbcal- ity is cruciai LO the efficiency of this technique, as hunting all over a non-local representation would slow down the pattern matchers. less efficient, Furthermore, as relatively the action parts would be major surgery would be required. Hall, Lathrop, and Kirk 801 plied Simplifiers free of hime operators could also be apto the abstract event and/or code representations. the same can not be said for pattern-action which involves time relationships. However, plification REASONING Locality ABOUT of reference is also important. TIME among {Z {g For example, of variables [predicate (u-y)] simplifies - {$ this is applicable t}-7 (t-y)} to understanding y from the most recent time u 5 t such that time u 5 t - y that predicate Another recent is true. all of the system’s pattern-action simplifiers we get a({-Z - . 1 crucial [=? [=? 14(u)] 14(u)] I=? I=? 14(u)] 14(u)] (t-2.2)})) ; test (t-2.2)}) feature of the locality property (2, (i-2.2), of propositional reasoning about points. It is an open question will need to reason about any other a propositional This is needed in order to incorporate ground knowledge, such we have not that it will. reasoner about the truth of predicates to sup- at time points. some types of back- as “if a value is known to be 1 at a time, it is not also 0 at that time;” to handle certain kinds of simplifying assumptions [Feldman and Rich, 19861; and to support simplifications based on logical conditions implied by the context of an expression, for example, icates which are true due to nesting within In the example, (=? can not be simplified 1 c$({-& to TRUE, pred- a conditional. [=? 1 4(u)] because (t-2.2)})) it could be that 4 has never been 1 prior to t - 2.2. Frequently, however, we wish to consider only the normal-case behavior of the circuit, in which 4 will have been 1 1 prior to under consideration. assumption We can communicate to our system iqf ,-- --20).(-z The system cation reduces this axiom to a proposition t - 2.2 for any t this simplifying by the axiom [=? 1 qqu)! quantifi- for each time point in the equation and concludes, through propositional reasoning, that thpredicate is true. With the other simplifiers, this product; y(t) = a({$ 802 Expert Systems [=? 14(u)] (t-2.2)}) the program models their structural approach circuits. to accept To program of the circuit components, connections, and produce code for the circuit model as a whole. 8 The equation-based representation makes easier several forms of reasoning about the time behavior of circuits. of Locality representation code-based is the crucial reference makes simulation effi- cient. The abstract translation Unknown event-based problem forms black-boxes The system’s local partitions the and equations. code are treated to the semantics representations as of pure LISP. support efficient simplification. The finitely-many plicit, code in the program according pattern-action representation between allowing relevant time propositional points reasoning are made exfor time-based simplification. This work step toward in the class restrictions is preliminary and represents only a first FUIVSTRUX is limited our goal. Currently, of circuits to which it can be applied. The are (1) busses can connect only to blocks (not (2) b usses change state only when driven to each other), by a block, ticular, and (3) zero-delay this disallows loops are disallowed zero-delay bidirectional Here are a few issues for further e There realm are several of digital interesting circuits tend our representation sign optimization to research. reasoning which scheme. [Steinberg (in par- elements). we tasks in the hope to ex- Some examples: and Mitchell, de- 19841, trou- bleshooting [Davis and Shrobe, 19831, testing [Shirley, 19861, and learning about design [Hall, 19861. Each of these tasks requires its own representations. t} > -co from a universal with The problem of time We have implemented port reasoning for the functional together of digital this is the first system is that and {g [=? 1 b(u)] (t-2.2)}), plus -00. Note that we have reduced the problem from reasoning about Vt and 3 to times than these for simplification; however, yet come across any examples which indicate code representation propert,y of this representation. mentioned in the equation our knowledge, our multiple the time behavior digital the ones explicitly our system 2. srk ; then the set (relative to 2) of time points t.o the output value. These are just whether astnte)) an ; else it exposes exactly which are relevant the much easier a finite number a>> this to the code in Section Conchsions We have explained [predicate(u)! Iprediellle’ (u)j y(t) 1 q5 4 ((2 y(t) = (if (=? 1 ep T) y at 2.2 equal-to then converts this 4) ep(=? 1 4)) astrrte at 0.0 equal-to : ( (cv(a,tate) (schedule The system v. is true at u - y, is the same as the most Applying inputs:(a event Converting produces to predicate to the example, for the example. event:((cv(a 4) (schedule RELATIONSHIPS. time relationships equation events, the system (Event-cell First, there are several useful time-based pattern-action simplifiers. to the equation above: Subtracting sim- as the simplified to abstract e There are several ways the system it currently could be improved: does not find closed forms for the recursion equations which result from feedback; ir could allocate state objects for simulation better than it currently does; it could recognize low-level implementations higher level functions, such as integer +. of IHall, 19861 Robert o The code ganized which is output by FUNSTRUX is not or- e It may be useful to incorporate of VLSI [Lathrop and Kirk, 19861. o What constraints lator in order must be met by a particular that the abstract be able to capture simu- event representation an equivalent would like to acknowledge with Mark Alexander, Rivest, support Walter uate Fellowship. Personal helpful discussions Chuck Rich, Ron for the second author by an IBM Graduate Fellowship, and durstages of this research by an NSF Gradu- ate Fellowship. jointly at the Gould Semiconductors CAD Research Laboratory the %IJT Artificial Intelligence Laboratory. Support and at for the ~11’1‘ .4rt,ificial is pro- vided This paper Intelligence was prepared Laboratory’s research in part by the Office of Naval Research tract [Kelly and Steinberg, under con- Richard grated [Lathrop Robert 19861 Mark the IEEE 1986 (CICC-86), [Amblard Custom IEEE, Describing havior Circuits fear11 \‘LSl P. Caspi, by means of time functions. ware Description IFIP, 1985. Bipolar terface, AM2900 Devices, 1985. Family and their Microprocessor 19811 J. Darlington. system. pro- Artificial 19831 Randall Davis. Diagnosis via causal reason- ing: paths of interaction and the locality principle. In Proceedings of the Third National Conference on Intelligence and Shrobe, Shrobe. (AAAI-83), 19831 Randall Representing tal hardware. ‘Feldman AAAI, Davis structure Con:puter, and Rich, and behavior 16(10), October 19+6] Yishai 1983. and Feldman Howard of digi- 1983.. and Charles Rich. Reasoning with simplifying assumptions: a methodology and example. In Proceedings of the Fifth National Conferer 86), AAAI, in VLSI :e on Artijicial Intelligence IEEE, 1987. Lathrop H. and object-oriented mixed-, In Proceedings on Artificial II. Lathrop. Functional simulation Design transfer ln1elll- Robert J. Hall, abstraction models. Automation from In Proceedings IEEE, Conference, Formal semantic language construction. ware Description [Rich, for reasoning The about on IEEE, layered Joint 4th 1979. of a In Proceedings Conference on Arti- 1985. Vogt, L. Schwartz, and D.A. Logic for Higher-Level Melliar- An Interval Reasoning. ContracNational Aeronautics And Space Administration, H. Shirley. M. NASl-17067, Temporal Number I’. Plaisted. Contract 19861 Mark of Bard- architecture tors Report: [Shirley, of the Computer programs. International et al., 19831 R. F.H. description and mechanized In Proceedings Languages, Intelligence, [Schwartz elements Symposium 19851 Ch ar 1es Rich. ficial An experimental and synthesis enInte- 1986. Richard International Logic and In- 16, 1981. Intelligence, Artificial IEEE system Micro and Custom (CICC-871, .4AAI, 19791 P. Meinen. Applications, Advanced Databook. of the IEEE manipulation. S. Kirk. 24th Smith, gram transformation iDavis Robert simulator of Hard- structure of the Ninth 19851 AMD. [Darlington, on Computer J. Hall, development 1987. be- In Proceedings Symposium Languages circuits cell simulation system. In Proceedings of Automation Conference, IEEE, 1985. ei al., 1987, [Meinen, and N. Halb- about SCORE An extensible (.4AA4 I-86), of the of Conference 1982. Robert of the Fifth ,1’aiiorlal Corlfererlce register and reasoning the 7th International [Davis, Integrated S. Kirk. on Ar- Robert reasoning In Proceedings May 1986. et al., 19851 P. Amblard, wachs. [AMD, A spatial In Conference AAAJ, (AAAI-82), Conference S. Kirk. structure generation. cir- Lathrop and Kirk. 1986’ Richard and H. A system M hich uses examples to S. Kirk. iJ,athrop and Alexander. to cell layout analyzing 19851 Richard mode functional the 22nd Design ilathrop eferences digital and specifications. National In Proceedings Circuits gence approach system: behaviors H. Lathrop. and Kirk, Simulation 1987. of the Second vironment. In Proceedings on Applied 19821 Van E. Kelly and Louis Stein- CRITTER [Kirk et al., 19871 Robert X00014-80-C-0505. [Alexander, The tificial Intelligence Hamscher, support IASTED, and Modelling, 1986. denotational simulation. Conference Conference AAAI, A fully abstract for event-based Fifteenth Proceedings Brian Williams, and Patrick Winston. Personal for the first author was furnished by an NSF Grad- was furnished ing the early of the by failing to ex- (AA,4I-86), J. Hall. cuits by propagating cknowledgments The authors semantics berg. meaning? Hall. Learning of the Fifth National Intelligence ]Hall, 19871 Robert work on pattern-action structure Joseph In Proceedings on Artificial for readability. simplification plain. 1983. Generating tests by ex- ploiting designed behavior. In Proceedings of the Fifth National Conference on Artificial Intelltigence (AAAI86), AAAI, ISteinberg 1986. and Mitchell, 19841 Louis 1. Steinberg and Tom 11. Mitchell. A knorvledge based approach to VLSI CAD: the REDESJ:~;N system. In Proceedings of the 2lsf Design A v/c. :zation Conference, IEEE, 1984. (AAAI- 1986. Hall, Lathrop, and Kirk 803