.c1.Using CBLD 3 CBLD permits the maintaining and personalizing of CUPL device libraries. It can list the contents of a library and build new libraries from existing ones. A CUPL device library is a file containing descriptions of one or more PLDs. CUPL and CSIM use device libraries to determine the characteristics of target devices. CUPL provides device libraries to describe all the PLDs instead of supplying individual files for each PLD. The advantage of device libraries is that they are easier to keep track of than multiple device files and they enable quicker program operation. The use of device libraries also resolves compatibility problems between the compiler and device descriptions. Each version of CUPL and its corresponding device library is given a matching key. If a library is used that has a different key than the CUPL compiler, an error message is generated during compilation and the compilation is aborted. The library that is created when the BUILD batch file is executed, CUPL.DL, contains descriptions for each device that is supported by the current version of CUPL. o .c2.RUNNING CBLD Run CBLD with the following command line format: cbld [-flags] [build] [library] [devices] where -flags is the following set of options: -b generate library using build file. -e list allowable extensions. -l list long contents of library. -m list allowable macros by pin. -t list short contents of library. -u use specified library for listings. build is the name of a file to be used with the -b option flag library is a device library name and path name to be used with the -u option flag. devices is one or more device names to be used with the -t or -l options. ======================================================== Note The square brackets indicate optional items. ======================================================== CBLD can be typed without any flags to see the command line format and a list of the option flags. CBLD provides two distinct functions: listing the contents of a library (the -t and -l options) and building a new library (the -b option). These two functions are described in the following sections. o .c2.LISTING THE CONTENTS OF A LIBRARY To list the contents of a device library, use one of the following command line formats: cbld -t [-u library] [devices] cbld -l [-u library] [devices] where library is a device library name and path name. devices is one or more device names. ======================================== Note The square brackets indicate optional items. ======================================== Use the -t flag to specify the short form, which lists only the device names and the revision number of the library. Use the -l flag to specify the long form, which lists the revision number of the library and the names of the devices, and provides the revision number, the number of pins, the number of fuses, and the number of product terms for each device. By default, CBLD lists the entire contents of the library; however, certain devices can be specified to be listed. For example, by typing: cbld -l p16h8 p16l8 p16hd8 p16ld8 [Enter] CBLD lists the characteristics of the p16h8, p16l8, p16hd8 and p16ld8 devices in the CUPL.DL library as follows: Device Rev Pins Fuses Pterms pl6h8 08 20 2048 64 pl6l8 08 20 2048 64 pl6hd8 06 20 2048 64 pl6ld8 06 20 2048 64 Use the -u flag and a library name with either the -l or -t flag to list the contents of a library other than the default library specified in the environment file. For example, to see the contents of a library named small.dl, type: cbld -l -u small.dl [Enter] o .c2.LISTING ALLOWABLE EXTENSIONS The -e flag allows the listing of the valid extensions for devices. For example: cbld -e p22v10 The screen will display: Device Extension p22v10 OE D AR SP This shows that the valid extensions for the P22V10 are: OE output enable control D D-type register AR asynchronous reset SP synchronous reset If more than one device type must be listed, specify multiple device names. For example: cbld -e p22v10 ep600 The screen will display: Device Extensions ep600 OE D T AR CK IO DFB TFB p22v10 OE D AR SP If a particular device is not specified, CBLD will, by default, list all the devices of the library. o .c2.BUILDING DEVICE LIBRARIES To build a new library from an existing library, first create an ASCII build file (filename.BLD) that specifies the name of the new library, the name of the source library, and the devices to use from it. Any text editor can be used, once it can produce a standard ASCII Text file. ======================================================== Note The vertical line ( | ) separates items in the syntax that are mutually exclusive. Do not type it in. ======================================================== The build file uses the following syntax: TARGET library SOURCE library1 devices | * SOURCE library2 devices | * . . . where TARGET is a keyword to identify the new library. SOURCE is a keyword to identify the source libraries. library is a target library name. library1 and library2 are source library names. devices are device names contained in the source libraries. * is a "wildcard" representing all devices in the specified library. When building a new library, devices from more than one source library can be specified by using more than one SOURCE keyword. Comments may be used in the build file. Enclose comments between the /* and */ symbols. To compile the build file, use the following command line format: cbld -b filename.bld ======================================================== Note There is no standard extension for build files. The .BLD extension is for mnemonic convenience only. When running CBLD, the entire filename, including the extension, must be typed in. ======================================================== The following example shows the contents of a build specification file, small.bld. Small.bld specifies that a new library, smallib.dl, be built containing the devices p22v10, f105, and p16rp8 from the cupl.dl library, and all the devices in the biglib.dl TARGET smallib.dl SOURCE cupl.dl p22v10 f105 p16rp8 SOURCE biglib.dl * To run CBLD and build the smallib.dl library specified in the sample file above, type: cbld -b small.bld [Enter]