Академический Документы
Профессиональный Документы
Культура Документы
WinCUPL
Users Guide
i
WinCUPL Users Guide
Copyright
Copyright 1983, 1998 by Logical Devices, Inc.(LDI)
All rights reserved. No part of this publication may be reproduced, stored in a retrieval
system, or transmitted, in any form or by any means electronic, mechanical,
photocopying, recording, or otherwise without the written permission of LDI.
Logical Devices, Inc. provides this manual as is without warranty of any kind, either
expressed or implied, including, but not limited to, the implied warranties of
merchantability and fitness for a particular purpose. LDI may make improvements and/or
changes in the product(s) and/or program(s) described in this manual without notice.
Although LDI has gone to great effort to verify the integrity of the information herein,
this publication could contain technical inaccuracies or typographical errors. Changes are
periodically made to the information herein. These changes will be incorporated in new
editions of this publication.
TRADEMARKS
ii
WinCUPL Users Guide
TABLE OF CONTENTS
1. Overview..............................................................................................................................1
CUPL Data Flow...............................................................................................................3
2. File menu commands...........................................................................................................5
New(File menu)................................................................................................................6
Open (File menu)..............................................................................................................7
Open Project (File menu)..................................................................................................8
Close (File menu)..............................................................................................................8
Close Project (File menu).................................................................................................8
Save (File menu)...............................................................................................................8
Save As (File menu)..........................................................................................................8
Save All (File menu).........................................................................................................9
Printer Setup (File menu)..................................................................................................9
Print (File menu)...............................................................................................................9
MRU File List (File menu).............................................................................................10
Exit command (File menu).............................................................................................10
Import (File menu)..........................................................................................................11
Export (File menu)..........................................................................................................12
3. Edit menu commands........................................................................................................13
Undo (Edit menu)...........................................................................................................15
Cut command (Edit menu)..............................................................................................15
Copy command (Edit menu)...........................................................................................15
Paste command (Edit menu)...........................................................................................16
Find command (Edit menu)............................................................................................16
Find Next command (Edit menu)...................................................................................17
Replace command (Edit menu).......................................................................................17
Insert CUPL Macro Definition command (Edit menu)..................................................22
Update Macro Symbol Table (Edit menu)......................................................................25
Insert Table command (Edit menu).................................................................................27
4. View menu commands.......................................................................................................32
Toolbar command (View menu).....................................................................................33
StatusBar command (View menu)..................................................................................34
Project (View menu).......................................................................................................35
Font (View menu)...........................................................................................................36
5. Options menu commands..................................................................................................37
Compiler Options Dialog.................................................................................................38
Compiler Options - Library............................................................................................41
Compiler Options - Device.............................................................................................41
Compiler Options - Files.................................................................................................44
iii
WinCUPL Users Guide
iv
WinCUPL Users Guide
1. Overview
This chapter will show the features available in WinCUPL. These include graphical waveform
simulation, highlighted text editor, bubble entry to CUPL source, schematic to CUPL source,
macro insertion, and table wizard.
WinCUPL A powerful front end and user interface for all of the
WinCUPL tools including the compiler.
WinSim Designs can be graphically simulated with WinSim to test
the design with user defined inputs to verify the design.
Both the simulation inputs and the results of the simulation
can be graphically viewed and modified with WinSim.
Schematic Schematic is a tool used for creating schematic diagrams for
initial design analysis. Once the diagram has been created,
the diagram is validated to determine if all of the
components are connected by wires to other components or
to grounds, ports or power ports. In addition, several tests
are performed to insure that inputs and outputs are not tied
together, and that all components have been named. If the
diagram passes the validation process, CUPL source code
describing the behavior of the drawing is generated which
can be can be compiled and the design simulated using the
CUPL Compiler and simulators.
SMCupl SMCupl is a tool used for creating State Diagrams for initial
design analysis. Once the state diagram has been created,
the diagram is validated to determine if all of the states and
transitions are meaningful and can be reached. The
validation process also check the usage of all variables
within the diagram. If the state diagram passes the
validation process, a CUPL language source file can be
generated that can be compiled and the design simulated
using the CUPL Compiler and simulators
1
WinCUPL Users Guide
WinCUPL provides a powerful integrated development environment (IDE) for developing designs
using the CUPL compiler and tools. Key features of the IDE include:
Syntax highlighting in the WinCUPL editor that can be completely customized for any
language using color and other text attributes.
User customizable tool bar and menus for seamless integration of all WinCUPL tools and
any other tools and programs you desire.
Easy navigation of all WinCUPL tools using the toolbar
Truth table editor that allows you to enter binary truth tables into your CUPL source code
graphically.
Automated tools for generating and managing CUPL macros and for referencing CUPL
macros within source files.
Complete 32 bit version of the CUPL compiler and supporting tools.
Powerful file import features_import capabilities.
2
WinCUPL Users Guide
The following diagram illustrates the data flow for creating a design and implementing the design
using CUPL.
First, a logic description is created using the CUPL language which may be generated from
Schematic, SMCupl or manually created using the WinCUPL source editor.
Then, the design is compiled to create a fusemap file for downloading to a device programmer.
Optionally, a test specification file may be created to verify the design. CSIM is executed to
compare the expected values in the test file to the actual values in the absolute file created by
CUPL. When simulation is complete without any errors, the verified test vectors can be appended
to the download file generated by CUPL.
3
WinCUPL Users Guide
4
WinCUPL Users Guide
5
WinCUPL Users Guide
New(File menu)
If you choose Design, you will be prompted for the header information and the number of inputs,
outputs and pinnodes for the design. You may enter a number for the inputs, outputs and pinnodes
or you may select cancel to skip any of the sections. When you complete the dialogs, a new
design template will be opened for you.
6
WinCUPL Users Guide
If you choose Project, you will be prompted for all of the above information and the project
window will be opened as well. The project window will display new files as they are created by
the compiler or other WinCUPL tools.
If you choose Text, a new empty text file will be opened for you
Shortcuts
Toolbar: Opens a new Text file.
Keys: CTRL+N Opens a new Text file.
Shortcuts
Toolbar:
Keys: CTRL+O
7
WinCUPL Users Guide
This command opens an existing .PLD source file and also displays the associated project window.
Shortcuts
Toolbar:
Keys: CTRL+F4
Shortcuts
Toolbar:
Keys: CTRL+S
8
WinCUPL Users Guide
Shortcuts
Toolbar:
Keys: CTRL+P
9
WinCUPL Users Guide
Shortcuts
Keys: ALT+F4
10
WinCUPL Users Guide
The file formats that may be imported into CUPL include: PALASM, PLA, Altera TDF, and ABEL
and VHDL.
Select the import type and you will be prompted for the import file. Choose the import file and
Open. The file will be converted to CUPL source code and a document will be opened containing
the imported design.
11
WinCUPL Users Guide
Choose Export from the file menu and you will be presented with the File Export dialog as shown
below.
12
WinCUPL Users Guide
Figure 7 Edit
Undo
Cut Deletes selected text from the document and places
them on the clipboard.
Copy Copies selected text from the document to the
clipboard.
Paste Pastes text from the clipboard into the document at the
current cursor position.
Find Searches for text within the active document.
Find Next Searches for the next occurrence of the last text string
searched.
Replace Finds and replaces text within the active document.
Insert CUPL Macro Inserts a CUPL macro reference into the active
Reference document.
13
WinCUPL Users Guide
Insert CUPL Macro Inserts a CUPL macro definition into the active
Definition document.
Update Macro Symbol Table Updates the macro reference symbol table.
Insert Table Inserts a binary table into the active document.
14
WinCUPL Users Guide
Shortcuts
Keys: CTRL+Z
Cutting data to the clipboard replaces the contents previously stored there.
Shortcuts
Toolbar:
Keys: CTRL+X
Del
Copying data to the clipboard replaces the contents previously stored there.
Shortcuts
Toolbar:
Keys: CTRL+C
15
WinCUPL Users Guide
Shortcuts
Toolbar:
Keys: CTRL+V
Normally, the search will locate the text entered ignoring case. Select this option if you wish to
have a case sensitive search.
16
WinCUPL Users Guide
Normally, the search will locate text embedded within whole words. If you wish to have the
search find only whole words matching the search string, select this option.
Direction
Scope
To search for a string within a selected block of code, choose Selected text. To search the whole
file, choose Global.
Origin
Select the starting point for the search. Entire scope searches from the top of the file, Current
position searches using the current cursor position as the starting point.
17
WinCUPL Users Guide
Text to find
Replace with
Enter the text string you wish to use as the replacement text.
Normally, the search will locate the text entered ignoring case. Select this option if you wish to
have a case sensitive search.
Normally, the search will locate text embedded within whole words. If you wish to have the
search find only whole words matching the search string, select this option.
18
WinCUPL Users Guide
Select this option if you wish to confirm each replacement before it occurs.
Direction
Scope
To search for a string within a selected block of code, choose Selected text. To search the whole
file, choose Global.
Origin
Select the starting point for the search. Entire scope searches from the top of the file, Current
position searches using the current cursor position as the starting point.
Change All
Choose this option if you wish to globally replace all occurrences of the search text with the
replacement text.
19
WinCUPL Users Guide
Use this command to insert a CUPL Macro reference in the source file at the current cursor
position. The Insert Macro Reference dialog is displayed to allow you to choose the defined
macro to place into the source file.
Note: The macro file containing the macro definitions must be selected first. These are contained
in the MACRO subdirectory and are selected by the Insert CUPL Macro Definition
The Defined Macros drop down list will show all defined macros within the scope of the source
file. You may select any macro present in the drop down list.
When you select a macro, the Assign Arguments frame will be filled in.
20
WinCUPL Users Guide
Assign Arguments
The Argument List displays a list of the macros arguments and the variables which will replace
the argument values. The argument name is displayed followed by a colon and the replacement
variable name.
Initially, all arguments are assigned a No Connection variable which denoted with NC in CUPL
syntax. Use the Argument List to assign program variables to the macro arguments.
When you select an argument in the Argument List, the variable name that will replace the
argument name is displayed in the Variable list. Below the selected variable name is a list of all
program variables that may be assigned to an argument. Select the variable name from the list to
replace the argument when the macro reference is placed in the source file.
After you have assigned variables to all of the arguments, choose OK to place the macro reference
in the source file
21
WinCUPL Users Guide
This will paste the following code into the source file at the current cursor position.
T7482 C1 C2 X1 X2 Y1 Y2 Carry;
The Insert Macro Definition dialog allow you to easily insert a macro definition into your source
file. The Insert Macro Definition dialog is displayed to allow you to choose the defined macro to
place into the source file or a reference to the file containing the macro definition.
Select this option to place an include statement in the source file that includes the entire macro file
that is selected. This allows you to reference any macro that is in the included macro file from
anywhere in the source file.
22
WinCUPL Users Guide
This is the default option, and will result in a smaller source file.
Select this option to place a copy of the macros in the Selected Macros box directly into the source
file. This option is useful if you are only referencing a single macro from a file with several
macros.
Macro Selection
The macro files presented in the selection list are those macro files present in the \Macro directory
under the WinCUPL directory.
When you select a file from the drop down File/Name list, all named macros within the selected
file are displayed in the list below the file name drop down. Select a macro from the list and the
macro is displayed in the Definition box to the right of the selection lists. This allows you to
preview the selected macro to insure that it is the one you desire to use.
Once you find the macro you wish to use, you can insert it into the source file in one of two ways:
If you have the default Include the selected macro file in the source file option selected, all
you need to do is choose OK and an include statement referencing the macro file will be
placed in the source file.
$INCLUDE TTL.MAC
If you have selected the Insert the selected macro definitions into the source file option, you
must choose Add to create a copy of the selected macro and place it into the Selected Macros
box. Then, when you press OK, the macro definition will be placed into the source file at the
current cursor position.
$MACRO T7482 A1 A2 B1 B2 S1 S2 C2
/* 2-bit full adder */
S1 = A1 $ B1 $ C0;
S2 = A2 $ B2 $ (A1 & B1 # (C0 & (A1 $ B1)));
C2 = A2 & B2 # ((A1 & B1 # (C0 & (A1 $ B1))) & (A2 $ B2));
$MEND
New
23
WinCUPL Users Guide
You can create a new macro file or add a new macro to an existing file by choosing the New
button. This will guide you through the process of creating a new CUPL Macro. This process has
the following steps:
1. You will be prompted for the name of the new CUPL macro.
2. You will be prompted for the number of arguments for the new CUPL macro.
3. You will be prompted for the name of each of the arguments for the new CUPL macro.
4. The Create CUPL Macro dialog will be displayed with a template for creating the new CUPL
macro.
The Create CUPL Macro dialog provides a template for easily creating CUPL macros and
integrating them into the source file.
You may choose an existing macro file to save the newly created macro in, or you may choose
New Macro File from the drop down list. If you choose New Macro File, you will be prompted
for the new file name when you choose OK to save the macro.
Editor Window
Use the editor window to fill in the source code for the new macro. After adding the macro the
Editor Window will have the below code.
$MEND
The user then enters the macro characteristics and saves the file. A complete macro is shown
below for a two input AND gate.
24
WinCUPL Users Guide
Macro Selection
Multiple macros can be selected by double-clicking on the macro name. Selected macros will be
displayed in the text box.
Use this command to update the macro symbol table for matching symbols to macro references.
To automatically update the symbol table whenever a new reference is created, see the General
Tab of the WinCUPL options dialog
25
WinCUPL Users Guide
26
WinCUPL Users Guide
Use this command to define and insert a binary conversion table in the source file at the current
cursor position. The Insert Table dialog is displayed to allow you to define the binary conversion
table.
Use the binary table editor to create conversion and lookup tables in CUPL.
Input
Enter the name of the input variable for your table. Set the bit field width in the Width field.
Output
Enter the name of the Output variable for your table. Set the bit field width in the Width field.
27
WinCUPL Users Guide
Rows
Enter the number of rows for your table. Once the input, output and rows have been defined, an
initial table will be displayed. There are several options for automatically setting the input values.
Font Size
Choose the font size for the editor window. A smaller font will display more of the table in the
editor window.
Set Input
28
WinCUPL Users Guide
Fill Left
29
WinCUPL Users Guide
Fill Right
The bit patterns in either the input or output variable definitions can be changed simply by clicking
on the 0 or 1. The value will be toggled for each click.
You may also set a row of bits for the input or output values by clicking on the hex value
displayed in the first column of either variable. You will be prompted for a new hex value for the
row of bits.
When you are finished editing the table, choose OK. The table will be coded in CUPL syntax and
inserted at the cursor position in the source file.
Example
30
WinCUPL Users Guide
The input and output lists need to be defined using Field statements.
31
WinCUPL Users Guide
Toolbar
Status Bar Toggles the Status Bar On/Off
Project Window Displays and hides the project window on the right
hand side of the user interface.
Font Displays the font dialog to change the default editor
font settings.
Refresh Updates the editor display colors and formatting
32
WinCUPL Users Guide
Use this command to display and hide the Toolbar, which includes buttons for some of the most
common commands in WinCupl such as File Open and Print. A check mark appears next to the
menu item when the Toolbar is displayed.
Click To
Paste the contents of the windows clipboard into the active document.
33
WinCUPL Users Guide
To hide or display the Toolbar, choose Toolbar from the View menu (ALT, V, T).
To determine what the buttons on the toolbar do, hold the mouse pointer over the button for a few
seconds and a tip window will be presented describing the tool.
Use this command to display and hide the Status Bar, which describes the action to be executed by
the selected menu item or depressed toolbar button, and keyboard latch state. A check mark
appears next to the menu item when the Status Bar is displayed.
34
WinCUPL Users Guide
The status bar is displayed at the bottom of the main application window. To display or hide the
status bar, use the Status Bar command in the View menu.
The status bar is split into six panes. The left most pane displays a variety of informational
messages depending on what you are doing at the time. The second pane displays the current
position of the cursor within the file, and the remainder of the panes display the settings of
keyboard locks.
35
WinCUPL Users Guide
Use this command to refresh the document window. This command will update the syntax
highlighting.
36
WinCUPL Users Guide
37
WinCUPL Users Guide
Use the compiler options tabbed dialog for setting the options for the CUPL compiler.
Select a tab name below or click on a tab above to view the help for the specific tabs of the
Compiler Options dialog.
General
Library
Device
Output Files
Minimization
Optimization
38
WinCUPL Users Guide
Secure Device
Adds the necessary code in the JEDEC download file to automatically allow the device
programmer to blow the security fuse when programming. Not all programmers support this
option.
In IFL devices, the OR-gate output array is driven by each of the AND-gate product terms.
Normally, unused OR-gate inputs are left connected to the product term array so that new terms
may be added. However, with this option, the unused OR-gate inputs are removed (deactivated)
from the product term array. The result is reduced propagation delay from input to output.
Simulate
39
WinCUPL Users Guide
Creates the absolute file and automatically runs the CSIM logic simulator. CSIM is run with the
option to create a list file. If the JEDEC name = PLD name option is selected it will be passed to
CSIM creating a JEDEC download file with test vectors.
If the Download file format for JEDEC/POF/PRG option is selected on the Files Tab is selected,
this option will force the name of the JEDEG file to be generated from the name of the logic
description file rather than the NAME statement in the header section of the logic description file.
40
WinCUPL Users Guide
Device Library
Enter the path to the Device Library file used by CUPL and CSIM. The default library file is set
to ..WinCUPL\CUPL.DL. The device library contains a description of each of the target devices
supported in the current versions of CUPL and CSIM.
Library
41
WinCUPL Users Guide
This tab displays all of the devices which may be programmed using CUPL.
Device Type
Device Selection
Use this list to select a specific device. The selection made from this list overrides the DEVICE
statement in the header section of the logic description file
Find mnemonic
Use the Find mnemonic button to look up devices and their functionality. The Device Information
dialog is opened which displays information to aid in selecting a device.
Device Information
42
WinCUPL Users Guide
The Device Information dialog displays information for available devices that aids in the selection
of a specific device.
This dialog can be sized to make reading the device descriptions easier.
Find
Find allows you to enter a mnemonic to search for within the device information file. The device
name can also can be entered to search for the corresponding mnemonic.
Next
OK
43
WinCUPL Users Guide
Output Files
44
WinCUPL Users Guide
General
45
WinCUPL Users Guide
46
WinCUPL Users Guide
47
WinCUPL Users Guide
48
WinCUPL Users Guide
49
WinCUPL Users Guide
50
WinCUPL Users Guide
Generates a simulator listing file with an extension of .SO. The input and output values for each
variable are listed. Error messages are listed following each vector, with the signal name in error
displayed.
Append Vectors
Appends the structured test vectors generated by the simulation onto the existing JEDEC
download file.
Display Results
Displays the contents of the listing file in a window. When the display appears, press Ctrl-S to
freeze the display and any key to resume.
51
WinCUPL Users Guide
Use the VHDL options dialog for setting the options for the VHDL utilities.
Analyze Only
Specifies that only analysis be performed. Analysis is VHDL syntax checking, type checking, and
static usage checking.
Use Pinnodes
52
WinCUPL Users Guide
Forces the compiler to not use set or preset terms to implement the design.
Enables the inference of register clock enable. Allows synthesis of a clock enable structure from
certain VHDL coding conventions. Does not change the behavior of the design, but allows the
compiler to take advantage of a clock enable if it exists in the target hardware.
Forces all registers with preset to use reset. Transforms registers with asynchronous preset into
registers with asynchronous reset. The design behavior remains unchanged. Resisters with both
preset and reset are not transformed.
Optimization Level
A value of 0 means no optimization effort, a larger value indicates increased optimization effort.
53
WinCUPL Users Guide
Closes the VHDL window if there were errors in the compilation or not.
Only closes the VHDL window if there are no errors in the compilation.
The VHDL window stays open in all cases. The user must close the window manually.
54
WinCUPL Users Guide
Specifies verbose mode, which causes debug information about register and macrocell inference to
be displayed.
55
WinCUPL Users Guide
6. Customizing WinCUPL
This section explains how the user can customize WinCUPL. The available options include Syntax
Highlighting , Menu Customizing , Toolbar Setup , Editor Macros , and Default Directory
specification.
56
WinCUPL Users Guide
Working Directory
Set the default working directory for WinCUPL. The directory in this field will be used as the
default directory for storing all files created with WinCUPL. This directory is the default
whenever a file save or file open dialog is displayed.
Schematic
Select the schematic capture package that is being used with WinCUPL.
57
WinCUPL Users Guide
Select this option to automatically set the position of the Editor, Messages and Project windows.
Select this option to automatically update the macro symbol table whenever a macro reference is
inserted into the source file. See Insert Macro Reference for more information.
58
WinCUPL Users Guide
Standard Utilities
Use the Tools tab to customize the toolbar and editor macro capabilities of WinCUPL The top
section of the tab lists the standard utilities that can be added to the toolbar or Utilities menu.
Select the Toolbar or Menu check box next to a program to include it on the toolbar or menu.
Customize
59
WinCUPL Users Guide
This section allows you to add a program or to define an editor macro and assign the program or
macro to a button on the toolbar or to the utilities menu. You may add up to six programs or editor
macro definitions to the list box.
Add Tool
When you choose Add Tool, the following dialog is displayed to let you tell WinCUPL where the
program is and what to call it on the menu and toolbar.
Program
Enter the full path to the program. You may choose the Browse button to open a file
open dialog that will assist you in making an accurate selection. Find the program
executable file in the File Open dialog and choose Open. The full path to the program
will automatically be set in the Program field.
Name
Enter the name you wish to associate with the program. The name will appear on the
Utilities menu and/or in the Tool Tip window for the toolbar button.
Once you have a program defined, select the Toolbar or Menu check box to include the entry on
the menu or toolbar as desired. Macro command buttons on the toolbar appear as {bmc
macro.bmp}
Edit Tool
The Edit Tool button will be available to change the program or name of the selected item.
Review the section above (Add Tool) for more information on selecting a program and name.
Macro
60
WinCUPL Users Guide
The Macro button adds an Editor Macro entry to the toolbar or utilities menu. See Defining and
Using Editor Macros for more information on how to set up and use an Editor Macro.
61
WinCUPL Users Guide
The Syntax tab is used to define the syntax highlighting attributes to be used in the editor window.
Check this box to enable syntax highlighting in the editor window for .PLD source files. The
editor will respond faster if this option is not selected.
Keyword List
62
WinCUPL Users Guide
The keyword list contains all of the words that will be highlighted. Use this list to set the
attributes for the keywords in the list by selecting a word in the list and setting the appropriate
color and attributes for the word. Once you have selected the color and attributes for the word,
press the Apply button to save the settings. Each occurrence of the word in a PLD source file will
be displayed with the colors and attributes selected.
Add
This button allows you to add new words to the keyword list. You cannot enter standard CUPL
operators or white space to the list. Each word must be a complete single keyword, multiple
words or phrases are not allowed.
Remove
You may remove a keyword from the list by selecting the keyword and pressing the Remove
button.
The Current Text field displays the keyword with its the current setting. The Sample Text field
displays any selections you make on the dialog page. The Sample Text setting will become the
Current Text setting when the Apply button is pressed.
Defaults
This button resets the original default keywords and colors. The keyword list is composed of all
of the CUPL reserved words.
63
WinCUPL Users Guide
Use the Fonts tab to set the default fonts for each type of window. The default font will be applied
each time a new window is opened.
The Font button displays the common font selection dialog. Font color selections will be ignored.
64
WinCUPL Users Guide
Before you can define and use an editor macro you must provide a command for the macro. The
command may either be a menu item on the Utilities menu or a toolbar button. To define a macro
command, choose WinCUPL from the Options menu and choose the Tools tab. Press the Macro
button to add a Macro command the list, then select the Macro n item in the list and choose the
Toolbar or Menu checkbox to add the command to the toolbar or utilities menu.
There are two types of editor macros, block macros and keystroke macros. A block macro is
defined to be a block of text that can be repeatedly inserted into the source file. The block macro
does not use the Windows clipboard, therefore once the macro is defined is available until it is
redefined. The keystroke macro is defined as a sequence of keystrokes that are recorded. Once
the recording is complete, the macro will replay the keystrokes each time the macro is invoked.
Select the text in the editor window and Right Click the macro toolbar button. {bmc
macro.bmp} You will be prompted for a name to assign to the macro. This name will be
displayed as the tool tip when you pause the mouse pointer over the macro button.
To redefine the macro, simply select a new block of text and Right Click the macro toolbar
button.
Make sure that no text is selected in the editor window and Right Click the macro toolbar
button. {bmc macro.bmp} You will be prompted for a name to assign to the macro. This
name will be displayed as the tool tip when you pause the mouse pointer over the macro
button.
All keystrokes captured until Ctrl-Break is pressed will be recorded as the macro. When
you are finished recording, press Ctrl-Break to end the macro.
To redefine the macro, simply Right Click the macro toolbar button and repeat the above
procedures.
65
WinCUPL Users Guide
Select the text in the editor window and choose the macro from the Utilities menu you wish
to define. If there is no current definition for the macro, the currently selected text will be
assigned as the macro. You will be prompted for a name to assign to the macro. This name
will be displayed on the Utilities menu for the macro.
To redefine the macro, choose Clear Macro from the utilities menu. You will be prompted to
select the macro you wish to clear. Next, choose the macro you wish to clear from the
Utilities menu. The macro will now be undefined and can be defined following the above
procedures.
To redefine the macro, choose Clear Macro from the utilities menu. You will be prompted to
select the macro you wish to clear. Next, choose the macro you wish to clear from the
Utilities menu. The macro will now be undefined and can be defined following the above
procedures.
To invoke the macro, Left Click the toolbar button or select the macro from the Utilities menu.
66
WinCUPL Users Guide
This command compiles the design using the specified device. You may specify a device either
with the DEVICE statement in the header section or by selecting a device on the Device Tab of the
Compiler Options dialog.
If the specified device is virtual, the function of this command is same as Device Independent
Compile
Shortcut
Keys: F9
Toolbar:
Compile the design using the virtual device. If a device is specified in PLD file using the DEVICE
statement, or a device selected on the Device Tab of the Compiler Options dialog, the device will
be ignored.
Shortcut
Keys: Ctrl - F9
Toolbar:
67
WinCUPL Users Guide
Simulate the design using the specified device. You may specify a device either with the DEVICE
statement in the header section or by selecting a device on the Device Tab of the Compiler Options
dialog.
If a specified device is virtual, the function of this command is same as Device Independent
Compile
Shortcut
Keys: F7
Toolbar:
Simulate the design using the virtual device. If a device is specified in PLD file using the DEVICE
statement, or a device selected on the Device Tab of the Compiler Options dialog, the device will
be ignored.
Shortcut
Keys: Ctrl - F7
Toolbar:
Compiles a VHDL source file using the Metamor VHDL compiler. If the file compiles
successfully the CUPL compiler will be automatically be called.
Runs a VHDL analysis file using the Metamor VHDL compiler. The CUPL compiler is not called.
68
WinCUPL Users Guide
69
WinCUPL Users Guide
Removes all pin and pinnode numbers from the design file.
Places the fitter assigned pin and node numbers (.plc file) into the design file.
Places the fitters assigned pin numbers only. Pinnodes are allowed to remain
floating.
70
WinCUPL Users Guide
Setup PlPartition
Use this command to display the PlPartition Fitting Parameters dialog for setting the
options for the PlPartition utility
Run PlPartition
Use this command to run the PlPartition utility and display the results in the
PlPartition Results dialog.
71
WinCUPL Users Guide
Always makes most efficient use of product terms. Compares the fitting solutions and uses the set
that minimizes the number of chips and pin signals.
Starts with the first chip, fills that chip then adds another to the partition set until the design fits.
Has the advantage of being faster.
This option allows modification of the design without changing the previously assigned pin
configuration.
Allows the partitioner to split product terms that remain in the same device. This feature may
avoid the use of large devices if propagation delay is not critical.
Specifies the maximum number of chips that can be used to fit the design.
Percentage of product terms that can be used on any signal. Allows the possibility of future
expansion.
72
WinCUPL Users Guide
Generates a report file showing the details for each of the devices used. This includes signals in
each chip, signal type, product term usage, and chip utilization.
Writes the solution list window to a text file. The solution list window is arranged in ascending
order of cost. Redundant solutions are removed.
Generates the new source files. These files are named file@##.pld where the file numbers start at
01.
73
WinCUPL Users Guide
The solution list is sorted with the lowest cost fit being listed first
The solution list is sorted with the lowest power fit being listed first
The solution list is sorted with the least number of devices fit being listed first
74
WinCUPL Users Guide
Running PlPartition
Use this command to run the ISP download utility from Lattice. For details on
the Lattice software refer to the ISP reference manual.
75
WinCUPL Users Guide
Use this command to start the three standard CUPL tools and tile them on the
screen. The standard tools are: SMCupl, Schematic and WinSim.
Shortcut
Toolbar:
76
WinCUPL Users Guide
Use this command to arrange multiple opened windows from top to bottom in a non-overlapped
fashion.
Use this command to arrange multiple opened windows side by side in a non-overlapped fashion.
Use this command to arrange the icons for minimized windows at the bottom of the main window.
If there is an open document window at the bottom of the main window, then some or all of the
icons may not be visible because they will be underneath this document window.
77
WinCUPL Users Guide
Contents Offers you an index to topics on which you can get help.
Search Displays the search dialog for the online help topics
Reference Guide Displays the CUPL Language Reference Manual
Simulator Displays the WinSim Users Manual
Schematic Displays the Schematic Users Manual
Bubble Entry Displays the SMCUPL Users Manual
VHDL Displays the Metamor compilers Users Manual
About WinCupl Displays the version number of this application.
78
WinCUPL Users Guide
After filling in the header information we specify that our design has six inputs and eight outputs
with no pinnodes the following is loaded into the WinCUPL editor.
79
WinCUPL Users Guide
General editor settings such as font size and highlighting can be customized from the Options
menu.
We now enter our pin declarations as shown below.
80
WinCUPL Users Guide
The following code is then placed in the design file at the last cursor location before the Truth
Table Dialog is launched.
81
WinCUPL Users Guide
82
WinCUPL Users Guide
We then successfully compile the file. The documentation file generated is listed below.
*************************************************************************
TC74HC138
*************************************************************************
=========================================================================
Expanded Product Terms
83
WinCUPL Users Guide
=========================================================================
Outputs =>
Y0 , Y1 , Y2 , Y3 , Y4 , Y5 , Y6 , Y7
Select =>
A , B , C
Y0 =>
!A & !B & !C
Y0.oe =>
!G1
# !G2A
# !G2B
Y1 =>
!A & !B & C
Y1.oe =>
!G1
# !G2A
# !G2B
Y2 =>
!A & B & !C
Y2.oe =>
!G1
# !G2A
# !G2B
Y3 =>
!A & B & C
Y3.oe =>
!G1
# !G2A
# !G2B
Y4 =>
A & !B & !C
Y4.oe =>
!G1
# !G2A
84
WinCUPL Users Guide
# !G2B
Y5 =>
A & !B & C
Y5.oe =>
!G1
# !G2A
# !G2B
Y6 =>
A & B & !C
Y6.oe =>
!G1
# !G2A
# !G2B
Y7 =>
A & B & C
Y7.oe =>
!G1
# !G2A
# !G2B
=========================================================================
Symbol Table
=========================================================================
A 0 V - - -
B 0 V - - -
C 0 V - - -
G1 0 V - - -
! G2A 0 V - - -
! G2B 0 V - - -
Outputs 0 F - - -
Select 0 F - - -
! Y0 0 V 1 0 1
Y0 oe 0 X 3 0 1
! Y1 0 V 1 0 1
85
WinCUPL Users Guide
Y1 oe 0 X 3 0 1
! Y2 0 V 1 0 1
Y2 oe 0 X 3 0 1
! Y3 0 V 1 0 1
Y3 oe 0 X 3 0 1
! Y4 0 V 1 0 1
Y4 oe 0 X 3 0 1
! Y5 0 V 1 0 1
Y5 oe 0 X 3 0 1
! Y6 0 V 1 0 1
Y6 oe 0 X 3 0 1
! Y7 0 V 1 0 1
Y7 oe 0 X 3 0 1
86
WinCUPL Users Guide
The next step is to add the signals we want to test to the simulation file. We do this by selecting
Signal Add from the menu. This displays the Add Signal dialog. Signals that are not being
currently displayed can be selected. Buses are identified by a * at the end of the field name.
These fields must be declared in the pld file. Individual signals and the bus that contains them can
be displayed.
87
WinCUPL Users Guide
After selecting the signals to be tested the number of vectors to be displayed is then selected. For
this example we will use twelve. This is done by selecting Signal Add Vector and entering the
number of vectors.
The value of an individual signal can be specified by clicking on areas of the cell. To make this
easier right clicking on the mouse when in the signal display window will display the available
selections.
88
WinCUPL Users Guide
Bus values can be set by expanding the bus signal (right click in name box) and setting the
indivual signals or selecting that vector on the ruler and changing the value.
The finished vectors are displayed below.
The output values can be left Simulator Determined (*) and those results assigned to the
simulation file after the simulation is run.
89
WinCUPL Users Guide
90
WinCUPL Users Guide
INDEX
B S
Backpin.......................................................69, 70 Schematic....................1, 3, 11, 34, 46, 57, 76, 78
Simulator..........................................................67
Simulator Options.............................................51
C SMCupl...............................................1, 3, 34, 76
Compiler
Options. .38, 39, 41, 42, 43, 44, 48, 50, 67, 68, T
83
Compiling.........................................................67 Toolbar..............................................................33
Customizing WInCUPL..............................56, 69
V
D
VHDL Options............................................52, 54
Data Flow.......................................................3, 4
W
E
WinSim........................1, 34, 76, 78, 86
Editor Macros..................................34, 56, 61, 65
Export...........................................................5, 12
I
Import...........................................................5, 11
K
Key Features.......................................................2
M
Macros......................................13, 14, 20, 22, 24
Editor..........................................34, 56, 61, 65
P
Partitioning......................3, 69, 71, 72, 73, 74, 75
Printing...............................................................9
Project...................................5, 6, 7, 8, 32, 35, 58
91
WinCUPL Users Guide
92