PLD Design Flow: GAL, ABEL

E.R.Doering

September 12, 2002

 

Software versions for this document:

·         Lattice ispLEVER version 2.0

·         Xeltek SUPERPRO 280 universal programmer software, version 3.0

 

Hardware versions for this document:

·         GAL22V10 generic array logic device

·         Xeltek SUPERPRO 280 universal programmer

 

 denotes directions that are especially critical to the success of your project.

 

 

 

What to Do:

How to Do It:

Create Conceptual Design:

Draw I/O block diagram of your circuit, i.e., draw a rectangle with pins sticking out, and write a name for each pin (signal).

Use a piece of paper, and a pen or pencil :-)

You will find it helpful to clarify some basic details before you jump in with the computer tools.

Draw diagram of your circuit components and their interconnections.

See above.

The diagram will help you visualize the hardware when you write your circuit descriptions.

Enter Your Design:

Start ispLEVER

In Windows, do Start | Programs | Lattice Semiconductor | ispLEVER

Start a new project in ispLEVER

Select “File | New Project”

Enter a name for your project. It is recommended that you also create a new folder for your project, since the software will generate many files for your single project.

Do not use any special characters in your project name or folder name. In particular, do not use spaces in your project name or in the directory path to your project. Spaces will cause an "Internal Error" when you try to simulate your design.

Select “Schematic/ABEL” for your project type.

Confirm that you have no spaces in your project name or project folder

Look at the top blue strip of the Project Navigator window to see the full name and location of your project.

Specify the device type

Double click the yellow and black device icon in the left panel.

Select “GAL Device” for Family.

Select “GAL22V10B” for Device.

Select “24DIP” for Package.

Select “-15” for speed grade.

Click “OK”, and say “Yes” to prompt about changing device kits, and say “Yes” to prompt about losing previous constraints.

Create a new ABEL file for the circuit description

Select “Source | New”.

Select “ABEL HDL-Module”

Enter a single word for Module Name. Begin with a letter, and use no special characters such as spaces, hyphens, etc.

 Do not use spaces in your file name.

 

Enter a single word for File Name. This is the name of the file that will store your ABEL code.

Enter a descriptive sentence for Title.

Click “OK”.

Enter your ABEL circuit description.

Enter your circuit test input stimulus (“test vectors”)

Enter text as needed.

Include a TEST_VECTORS section in your file.

Save your file (use Ctrl-S or push the save-to-disk icon).

NOTE: You can get on-line ABEL documentation by selecting Help | ABEL HDL Language in the Text Editor window. Click the Help Topics button to activate the index.

Example code:

MODULE Demo

TITLE 'This is a useful circuit'

" ----------------------------
" NOTE 1: Comments begin with
" double-quote

" NOTE 2: ABEL keywords are not
" case sensitive.

" NOTE 3: Your identifiers (signal
" names) ARE case sensitive.
" ----------------------------

" Input pins
A pin 2;
B pin 4;

" Output pins
C pin 15 istype 'com';

" ----------------------------
" Circuit functionality
EQUATIONS
C = !(A & B);

" ----------------------------
" Test inputs for simulation
TEST_VECTORS
" Specify inputs and outputs
([A,B] -> [C])

" Apply A=0 and B=0, expect C=1
[0,0] -> 1;

" Apply A=0 and B=1, expect C=1
[0,1] -> 1;

" Expected result is really 1,
" but this line demonstrates
" how simulator reports a mismatch
" between actual and expected
" result.
[1,0] -> 0;
 
" Apply A=1 and B=1, expect C=0
[1,1] -> 0;

" ----------------------------
" All done!

END
 

Verify Your Design Using Simulation:

Prepare your design for simulation

Select the Project Navigator window.

Single click the “filename-vectors” line in the left panel.

Double click “Functional Simulation” in the right panel.

If you have syntax errors, edit your ABEL file, save it, and click “Functional Simulation” again. Repeat until all syntax errors have been removed.

Simulate your design

Push the “Run” button (exclamation point icon) in the automatically opened Simulator Control Panel window. Your design will be simulated and the results displayed in the Waveform Viewer window.

Iterate until your design is correct.

Return to your ABEL file. Make edits as needed, then save your file.

Double click “Functional Simulation” to cause the system to re-read your file and prepare a new simulation.

Press the “Run” button in the Simulator Control Panel. Your updated waveforms should appear.

If you add new signals and do not see them in the Waveform Viewer, select “Edit | Show...” in the Waveform Viewer and select the desired signal(s) to be added to the display.

 

 Do not proceed until your design simulates correctly according to your design intent!

Implement Your Design to Produce a JEDEC File:

Create a JEDEC file

Return to Project Navigator window.

Single click the yellow and black device icon in the left panel.

Double click “JEDEC File” in the right-hand side panel.

Confirm that your inputs and outputs were connected to the correct pins

Double click “Chip Report”.

Review the pinout diagram to confirm that it is correct.

Always confirm that the input and output pins have been placed correctly before placing the GAL in your circuit.

NOTE: Do not be concerned if you see some of your outputs indicated as complemented (for example, your output signal is called "Dout" and it appears in the chip report as "!Dout"). This is merely an indication of the specific method used to create the Boolean expression for that output. The chip output levels will behave exactly as they did in simulation.

Locate your JEDEC file

 Open Windows Explorer window (hold down Windows key and press E).

Navigate to your project folder. Note that the path to your project is contained in the title bar of the Project Manager window. Alternatively, do “File | Full Project Path”.

Locate the .JED file.

Program GAL with JEDEC File:

Insert GAL in device programmer

Always carry your GAL chip in a piece of conductive foam to avoid causing damage from electrostatic discharge (ESD).

 Notched end of chip is oriented upwards (see the drawing on the left side of the programmer). If device does not have a notch, then ensure that pin 1 (marked by a dot) is at the upper left.

 Non-notched end of chip is placed flush at bottom of the socket.

Close the lever at the lower right corner of the socket to properly connect the chip to the socket.

Start Xeltek programmer application

In Windows, do Start | Programs | SUPERPRO 280.

Select GAL device

Select “Device | Select”.

Choose “PLD” option on the right side of the panel.

Select “Lattice” for Manufacturer.

Select “GAL22V10” for Device Name.

Load JEDEC file

Select “File | Load”.

Navigate to your .JED file and select it.

Program the GAL

Select “Device | Run”

Select “Program” for Function.

Click “Run” button to program the GAL

Test Your Design:

Apply external stimulus from your own circuitry.

The GAL is a 5-volt device.

Ensure that any clock waveforms you apply to the circuit are zero to five volts.