# ~ I n s t l t u t e of E l e c t r o n i c s , S l l e s l a n T e c h n i c a l U n i v e r s i t y 44--100GllWlce, P o l a n d ~ e s e l l s c h a f t f u r R a t h e m a t l k u n d D a t e n v e r a r b e l t u n g (GHD) P r o J e k t E.I.S., 5205 S t , A u g u s t l n , F.R.G.
AB6TRACT The sul~nltted paper presents a k e r n e l of a n e n v i r o n m e n t f o r t h e s t r u c t u r e d d e s i g n of MOS VLSI IC& The d e s c r i b e d CAD s y s t e m I n c l u d e s e l e m e n t s of f o r m a l v e r i f i c a t i o n o f d e s i g n ~-r~-~ I t i s b e i n g p r o t o t y p e d on IBH PC XT a n d lS w r i t t e n In T u r l ~ P a s c a l a n d m i c r o FROIL~ It was a l s o meant t o s e r v e a s a n e n v i r o n m e n t f o r d e v e l o p m e n t of more s o p h i s t i c a t e d CAD tools ( l l k e a u t o m a t i c s y n t h e s i s p r o g r a m s ) . 1. I N T R O D U C T I O N
The m m n g o a l of t h e p r e s e n t e d work w a s to c r e a t e a u~er~frleadly e n v i r o n m e n t f o r a s t r u c t u r e d d e s i g n of VLSI system& Tl~e e n v i r o n m e n t s h o u l d a l s o p r o v i d e u s e r s w l t h the p o s s i b i l i t y of I n v e s t i g a t i o n of f o r mal verlflcaUon methods for dlgltal systems, and l e t t h e m d e v e l o p a v a r i e t y o f CAD t o o l s f o r VL$I design. Ac~x~-dlng t o Read a n d Conway LH ' eCoSO]t h e d e s i g n of a n I n t e g r a t e d c i r c u i t l s d i v i d e d l n t o two p h a s e s : - top-down logic d e s i g n process, - bottom-up pl~yalcal I m p l e m e n t a t i o n . presented s o f t w a r e a l l o w s t h e d e s i g n e r t o f o l l o w that scheme. As s h o w n i n Flg.1 the system c o n s i s t s of four maln routines a n d a user interface. Tl~e floorplan editor creates hierarchical design environment, In which a designer keeps refining the s t r u c t u r e a n d f l o o r p l a n of t h e c h i p s t e p b y s t e p .
The l a y o u t e d i t o r i s u s e d t o s p e c i f y t h e s t r u c t u r e a n d geometry of t h e l o w e s t l e v e l m o d u l e s a n d t o ¢ o m ] ~ e them I n t o a s y s t e m . In order to enhance a correct-by-constructlon design methodology we bullt a formal verification prod'am Into our framework, It allows a designer to verli~ each refinement step. It is done automatlcally by the verification program, but the deslgner must specify t h e b e h a v l o u r of t h e m o d u l e being d e aig~ed and of l t s s u b m o d u l e e . A bullt-ln t e x t e d i t o r serves thls Purpose.
A designer has to speclfy the behavlour of a ~_e~_!gned circuit In m l c r o - P R O L 0 ~ Tl~ere w a s a serlous reason for choosing P R O L O G as a l a n g u a g e of speclflcatlon. The kernel of o u r system, l.e. the verification program, is Implemented In mlcro-PROLOG. Several planned extensions to our system are to be implemented In Prolog. T h u s it is quite natural to spenfy a designed circuit In the same language. Altlwu.~ the expressive power of Prolog makes it a good l a n g u a g e for a digital circuit specification. stlll It w o u l d be more convenient for a deslgner to specify the integrated clrcult In a n y of the exist-
l u g h a r d w a r e d e s c r i p t i o n l a n g u a g e s (e,g. VHDL). I t r e q u i r e s a - q u l t a b l e p a r s e r t h a t we p l a n t o b U l l t . N e v e r t b e l e ~ P r o l o g w111 r e m a i n t h e l a n g u a g e o f l n t e r n a l r e p r e s e n t a t i o n o f d l g l t a l c i r c u i t In o u r system. The v e r l f l c a t l o n p r o g r a m ls b a s e d on B a r r o w ' s I d e a s d e s c r i b e d In [BarB4] a n d i s u s e r e x t e n d a b l e . Due t o m o d u l a r s t r u c t u r e of o u r s y s t e m I t i s a l s o p o s s l b l e to r e p l a c e I t w l t h a n o t h e r p r o g r a m of t h a t kind. T h l s f e a t u r e w l l l l e t u s I n v e s t i g a t e d i f f e r e n t approaches t o w a r d s f o r m a l v e r i f i c a t i o n . presente~ software w a s a l s o aimed a s a n e n v i r o n m e n t for d e v e l o p m e n t o f a u t o m a t i c s y n t h e s i s tOOlS. The f l o o r p l a n e d i t o r d a t a s t r u c t u r e s , w h l c h reflect the deslgn hierarchy and lts graphlc Interface are convenient to extend the edltor w l t h s u c h programs a~: a u t o m a t i c r o u t e r , a u t o m a t i c f l o o r p l a n n e r or t o o l s f o r h l g h l e v e l s y n t h e s i s (1.e, s y n t h e s i s of RTL a r c h i t e c t u r e b a s e d on t h e b e h a v l o u r a l d e s c r i p t i o n of t h e l n t e n d e d c i r c u i t ) . On t h e o t h e r hand, c e l l compilers and module g e n e r a t o r s may be b u i l d a n d v e r l f l e d In t h e l a y o u t edltOr e n v i r o n m e n t .
U
ITEXT I, ~
BEHAVO I UR
i C E
Fig.1.
PROGRAM
j i :; Y I O0~
The general
GEOMETRYI
structure framework
I
FUNCTO I NSLB I RARY]
LELALCRELL
of t h e p r e s e n t e d
I
7:. Grabowiecki et al / A University Framework for Correct
38
2. 7 1 ~ - D O ~
DESI6N PROCEI~
The basic notion u s e d in the description of a hlerarchlcal deslgn process ls a module, which is a part of a dlgltal system wlth the clearly determlned bebavlour (i.e. the w a y h o w its outputs d e p e n d on Its inputs a n d internal states) a n d loglcal a n d physlcal interfaces to other parts of the system. Each m o d u l e m a y consist of a n u m b e r of s u b modules. These submodules, connected according to the designer's intentions, define a m o d u l e structure on the lower level. The m o d u l e slmple e n o u g h to design Its l a y o u t Is called a leaf cell. S u c h a m o d u l e does not consist of submodules, but only of layout editor primitives. These are discussed in d e t a l l s I n 5.1. While deslgnln9 a system, a designer defines a structure a n d a floorplan of each module on subsequent levels of hierarchy. The structure of a m o d u l e is determlned by Interconnectlons of Its submodules. In o r d e r t o d e f l n e a f l o o r p l a n o f a m o d u l e a d e -
+ BEHAVIOURSPECIFICATIONTE[
1
,
I SUBHOOULES BEHAVIOUR SPECIFICATIONTE REFN I EMENT LOOP
CORRECTO IN
I
VERIFICATIONV I
LOOP
I
Yes~
No
,
1
I LEAFCELLSLAYOUT I DESIGN LE 1
I STRUCTURE EXTRATIO]N I
VERIFICATIONV I
L
BOTTOM UPCHIP [ LAYOUTASSEMBLY LE
I
Flg 2. Design process In the presented f r a m e w o r k (TE - text editor, FE - floorplan editor, LE - layout edltOr, v - verlflcatlon program)
slgner must estlmate shapes, relatlve sizes and posltlons of Its submodules. Declslons how to do It are based on the designer's experience. T h e s a m e applies to the placement of termlnals. Modules are represented as boxes wlth terminal symbols. Effects of all the designer's actlvltles, performed by means of a menu-drlven set of procedure~ are displayed Immedlately on a screen. ^ user m a y vlew a modelled system at multlple levels of structural hierarchy. The designer m a y check the correctness of the deslgn he w o r m s on b y m e a n s of the verification progrant In order to take advantage of this program the designer m u s t speclfy the behavlour a n d structure of a m o d u l e Delng designed. A m o d u l e Is conaldered correct If lts specified behavlour meets the behav~ur ~ b y i t s s t r u c t u r e a n d ]b~l~avlour I t s s u l m o d u l e s . The t o o l f o r b e h a v l o u r s p e c i f i cation is a b u i l t - I n t e x t edltor a n d t h e l a n g u a g e used for thls p u r p o s e Is described in part 3. of tbls paper. The structure of a m o d u l e Is derived automatically from floorplan or layout edltor data structures. The correctness of a m o d u l e m a y be proved if each of Its su/)modules falls Into one of the three categories: a - It is a prlmltlve of the verification p r o g r a m (the d i f f e r e n c e s b e t w e e n l a y o u t editor prlmltlves a n d verification program prlmltlves are dlscussed In 5.1); b - I t s detailed structure a n d behavlour Is already k n o w n a n d 1is correctness h a s l)een a l r e a d y proved; c - its b e h a v l o u r is specified b y the deslgner assuming that it w111 be des19ned correctly (thus It Is correct by assumption). The verlflcaUon pro@ram m a y be used In several ways. Firstly, It offers the posslblllty of a hierarchical verlflcatlon of a system that has been already deslgned. In such a case the structure of the system Is deflned u p to the level of prlmttlves. verification program checks consistency between t h e Inltlal speclflcatlon of t h e system's b e h a v l o u r and the behavlour derived from its flnal structure. However, if a mlstake has been m a d e early In the design process, It m a y be necessary to redeslgn a large part of a system. To avoid such a sltuatlon the designer m a y use the verification program after one or several refinement step(s) to m a r e sure that tl~ transformatlon(s) has(have) been done correctly. I f It is done repeatedly on sul)sequent l e v e l s of hlerarcby, the designer wlll flnlsh 121s w o r k wlth tl~e system that Is correct b y construction. Tl~ere Is no place for a n y b u g into the deslgn, b e c a u s e the correctness of every designer's s t e p h a s b e e n proved. To speed u p a designer's work a n d let h l m reuse results of hls earller work, our system supports the library of "ready-made" layout pieces that are frequently used in digital IC design. Layouts a n d behavtoural m o d e l s of leaf cells or more c o m p l e x modules are stored there a n d m a y be used w h e n they fit designer's needs. The meth_~_o!ogy presented ~ has unfortunately a t least one w~ak point. A mlstake can De m a d e while
7". Grabowiecki et al / A University Framework for Correct
s p e c i f y i n g t h e b e h a v l o u r . To m l n l m l Z e t h l s p e s s i b t l l t y o u r system p r o v i d e s t w o o t h e r l i b r a r i e s . The first aw contains parameterlzed behavloural models of functional unlts, which are commonly used in d i g i t a l s y s t e m s . Tl~ese a r e ALUs, a d d e r s , r e g i s t e r s , RAMs, c o u n t e r s , etc. A t t h e moment t h e l r s p e c l f l c a u o n s m a y be used for verification purposes only. However, we plan to develop a variety of m o d u l e generator& that wlll be able to generate a correct structure and layout of these modules automatically according to parameters passed to them. Some parameterlzed behavloural models from this library are listed In an appendix. The second library supports Its users wlth a set o f functions that m a y be lwl~ul whlle specifying the behavlour of less common modules. ~1~e-~ATIM 3~ Integrated
OF ~ circuit
B~iAV~q~ as a finite
A E ) STRUCTURE state
machine
In our s y s t e m e v e r y m o d u l e l s c o n s i d e r e d as a finite s t a t e machine. The finite state machine has some lnputs x, o u t p u t s y a n d (possibly) some state varlables s. Its b e h a v l o u r ls fully d e scribed by a set o f dependencies between all these varlahte~ a ommon way of specyfylng such dependencles is a state transition table of a flnite state m a ~ t l n ~ An a l t e r n a t i v e w a y . e m p l o y e d I n o u r s y s t e m , ls to glve a set of output and state equations Yn = f Cxr~ Sn) sn+l = g(Xr~ Sn) Although this convention is perhaps not v e r y natural to a circuit designer, It ls fairly general and allows one to speclfy modules on different levels o f abstraction. All prlmltlve m o d u l e s o f our s y s t e m ( e n h a n c e m e n t FET, d e p l e t i o n F E T . p u l l - u p , ground and Join) as well as gates, registers, a d ders, buses, ROMS, RAMs, P L A s etc. h a v e a f i n i t e s t a t e machine r e p r e s e n t a t i o n .
3.2.
Signals
Inputs~ o u t p u t s a n d s t a t e v a r i a b l e s a r e a l l e x a m ples of different types of signals. A domain of a slgnal depends on a level of abstraction. On t h e lowest level signals are usually trl-state (high, l o w or h i g h i m p e d a n c e ) , w h l l e on h i g h e r l e v e l s t h e y can be Boolean variables, single blts, Integers of l e n g ~ etc. B e f o r e f o r m u l a U n g a n o u t p u t o r a state equation of a m o d u l e one m u s t specify two parameters of every signal: Its type and its domain. Thls can be accomplished with a Prolog relation slgnal: (signal (module type> and represent user-defined names of a type of a module a n d o f a s l g n a l r e s p e c t i v e l y . The f l r s t o n e c a n b e a single constant or a list (see 3.5), whlle the l a t t e r - always s i n g l e Prolog c o n s t a n t . T e r m ls a l w a y s one of the constants: Input, output or state whose interpretation Is obvious. The last a r g u m e n t of the signal relation depends on a level of abstraction. Here are some
39
examples: ] ) I t - v a l u e 1 o r O. I t I s u s e d t o d e n o t e s i n g l e blts as well as Boolean variables wlth number 1 denoung truth or 0 - falsity, (integer x) - x-blt lnteger (non-negative integ e r s I n a r a n g e [0, 2 X - l ] o r s i g n e d I n t e g e r s In an appropriate range), (hit x) - vector consisting of x slgnals of type /)It (llst of x bits), ((Integer x) y) - vector consisting of y slgnals of type (Jnteg"er .r) (llst of y x-blt Integers). Example: Slgnala of a one-bit multiplexer four clauses: ((signal ((signal ((signal ((signal
multiplexer multiplexer multiplexer multiplexer
In1 Ir2 ctrl out
3.E O u t p u t a n d s t a t e
are described with
Inlmt b i t ) ) Inlmt b i t ) ) Inlmt b i t ) ) outlet b i t ) ) equations
Both o u t p u t a n d s t a t e e q u a t i o n s a single relation equation
are described by
(equation ¢module type> :: (expression>) Term Is u s u a l l y JUSt < s J g n a l name.>. It must be o f i n p u t or state type (this u n a m b l g o u s l y states w h e a t h e r equation Is an output or state equation). The In t h e s i m p l e s t case is a s l n g l e term < s J g n a l name.>, In more complex cases this term takes the form ((function
name> (list
of
arguments>).
Functions encountered most frequently are defined within our system. Currently several functions a r e d e f l n e d : l o g l c a l f u n c t i o n s not, or, and, n o r etc., a r i t h m e t i c operators for addition, subtraction, multiplication, Integer dlvlslon and modulus, three-argument funcUon lf, shifting, conc a t e n a t l o n e t c . I t Is POSSible f o r a d e s i g n e r t o u s e h l s own f u n c t i o n names p r o v i d e d h e d e s c r i b e s them In a way sufficient for a verification program. Every argument of a function m a y be Itself an expreSSion, which means that the functions m a y be embedded to any depth. Examples:
((equation f l i p - f l o p out :: cont)) ((equation multiplexer out :: ( I f ( c t r l In1 Ir2)) )) ((equation ar out :: (*(a (~(b c)))) )) 3~4. N o d u l e
structure
There are two relations for describing Internal structure of a module. RelaUon ~ u l e names e l e m e n t s of a d e s i g n e d module a n d t a k e s t h e form: (salmo~le (sal~mdule name> ). T h e m a l n purpose of the form
of the
relation
connected
(connected (module t~e) a n d < d e a t J n a t l o n
T. Grabowiecki et a l / A University Framework for Correct
40
inl
InI in2 ~
o
ctr[o---
_•
~
out
in2o
f o u n d In a n a p p o n d l x . out
in1 in2
----o o~
in 1 in2
The e x p r e s s i v e p o w e r o f P r o l o g e n a b l e s u s t o c r e a t e common s p e c i f i c a t i o n s f o r a w h o l e c l a s s o f m o d u l e s of the same klnd. I t l s p o s s l b l e to w r i t e one c o m p l e x s p e c i f i c a t i o n e.g. f o r a f a m l l y o f s h i f t registers wlth or wlthout parallel I n p u t / o u t p u t , wlth or without reversion of shlftlng direction etc. Another e x a m p l e is a u n i v e r s a l m o d e l of a f ~ m n y of binary counters (see appendix). Thls feature ls extremely useful In creatlng a llhrary o f D a m c functional unlts. A ~ I ~ M
Flg.3. One-blt multiplexer
sig'nal> are b o t h t w o - e l e m e n t
llsts, the flrst element being lnput or output slgnal n a m e a n d the second - s u b m o d u l e n a m e (ln a case the signal is that of a s u b m o d u l e ) or m o d u l e type (if it ls a slgnal of a designed module). Example: The structure of a one-blt multiplexer speclfled in 3.3 Is s h o w n In Flg.3. The floorplan e d i t o r w l l l generate the f o l l o w i n g clauses: