(*------------------------------------------------------------------------*)
DEFINITION MODULE BUS;

FROM KERN IMPORT CELL,PORT,INST,NET,DIRN,TRANSFM ;
FROM LAYS IMPORT Layer ;

EXPORT QUALIFIED BusEl,BusRec,Bus,
                 instside,squareoff,crossover,extract,copybus,combine,
                 wirebus,turnbus,tolayer,sepbus;

TYPE  BusEl  = RECORD
                  name : ARRAY [0..15] OF CHAR ;
		  inst : INST ;
                  port : PORT ;
                  net  : NET  ;
		  lay  : Layer ;
                  wid  : INTEGER ;
               END ;
               
      Bus    = POINTER TO BusRec ;
	       
      BusRec = RECORD
                  name : ARRAY [0..15] OF CHAR ;   
		  dirn : DIRN ;
                  size : INTEGER ;
		  dist : INTEGER ;
		  nops : INTEGER ;
                  els  : ARRAY [0..31] OF BusEl
               END ;

PROCEDURE instside (i:INST; d:DIRN) : Bus ;
PROCEDURE copybus (a:Bus; VAR b:Bus) ;
PROCEDURE findbus (name:ARRAY OF CHAR) : Bus ;
PROCEDURE makebus (name:ARRAY OF CHAR) : Bus ;

PROCEDURE squareoff (b:Bus) ;
PROCEDURE crossover (a,b:Bus) ;
PROCEDURE extract (a:Bus; spec:ARRAY OF CHAR; VAR b:Bus) ;
PROCEDURE combine (a,b:Bus; VAR c:Bus) ; 
PROCEDURE wirebus (a:Bus; minsep:INTEGER; b:Bus) ;
PROCEDURE turnbus (b:Bus; d:DIRN) ;

PROCEDURE tolayer (bus,subset:Bus; layer:Layer; width:INTEGER) ;
PROCEDURE sepbus (a:Bus; d:DIRN; minsep:INTEGER; b:Bus) ;

END BUS.
(*------------------------------------------------------------------------*)
