The Adventure Begins...

Well, let's assume that you've taken the tips on writing synthesizable VHDL to heart.  You still
have to know about how to use and deal with the synthesis tools.  They aren't really all
that friendly when it comes down to it but it could be worse - you could be designing your system
with TTL chips exclusively...

Before you start synthesizing, make sure you do the following (assuming you work under Unix):

Also, I won't be covering the use of the Actgen macro generator.  I haven't used it extensively,
and it's a bit of a pain to integrate Actgen macros into your code.  The Actel site "Guru" has
more information on this if you want.
 

Tools Overview

The diagram below represents the general design flow that may be used with the tools.
Depending on what you're trying to do, you take a different route.

Starting Off With Actmap

Start up a terminal or shell window, and type:
    actmapw&
which starts the Actmap program.  You'll see a large text screen come up with Actmap in the
menu bar.  Click on:
    File -> VHDL Compiler
and a new window will come up.  There's lots to look at here, but don't worry - it's all fairly
straightforward.

In the "Source" box, you type the complete file name and path of the individual components
you're using.  Going back to the "display" example, you'd type:
    /ceb531/users/studentlogin/VHDLfiles/display.vhd
within the box (or simply use the "Browse" button to search within your directory).  If you leave
the "Target" box blank, you'll have a file name automatically generated with the .edn extension
as the compiler runs.  But you want your files to compile inside the "work" directory.  Copy
the above path into the "Target" box and modify it to read:
    /ceb531/users/studentlogin/VHDLfiles/work/display.edn
That will generate the .edn file within the directory.  A .edn file is an EDIF format file, so make
sure that the generated file type is set to EDIF in the select box (as opposed to Verilog or
whatever other choice it gives you).

There are other compile options which I'll go over here:

Select your compile options and click on "Run".  You'll see the text window scrolling
messages fairly quickly.  If there are any errors, the compiler will tell you.  Go back and
modify your code accordingly.  Once it compiles, you can then run the Netlist Optimizer.
A transcript of the last compile action is generated, so when it asks to overwrite, just
answer yes.  This transcript has important information about the FPGA.  Even if you don't
get errors, you may get warnings.  Pay attention to them, and make sure that if they will
affect your design that you modify the code and/or the

Remember, you can only have 295 modules for the A1010 part, and 547 modules for the
A1020 part.  You can't exceed this under any circumstance, so if tit happens just minimize
your design by modifying the VHDL code or using the Netlist Optimizer (see below).

Beware:  you cannot have more than one clock buffer for the Act1 FPGAs.  If
you compile your code and you have 2 or more ClkBufs in your design, Designer
will not be able to do its job properly.  This can happen because of multiple
processes with event triggers from signals other than the system clock.

To run the Netlist Optimizer, close the Compile window and select:
    File -> Netlist Optimizer
from the main Actmap window.  It should bring up a window similar to the VHDL
compiler window.  It also should fill in the "Source" with the name of the EDIF file you
just created (the .edn file), and in the same path.  Modify this accordingly if it isn't, and
just leave the "Target" blank.  Set your options as you did before with the compiler
and run.  You can compare your optimized file (a .edo file, same EDIF format) to the
previous file and see the changes in timing and modules, if any.

The best way to familiarize yourself with this process is to experiment with the options and
find what best works for you.  Ultimately, your goal with Actmap is to compile your top
level file so it meets the constraints as indicated above, and obtain a .edo file from that top
level (which I will refer to as toplevel.edo).
 

Fun With Designer

Now that you have your top level compiled as an EDIF file, you can use Designer to
lay out pins, specify delay targets, extract timing information and write a fuse file.  The nice
thing about Designer is that there is a quasi-flowchart that's clickable, so you're not totally
lost.  In fact, it's fairly intuitive.

First, click on "Compile".  Designer will ask you whether or not you want to start a new
or existing design.  Just click on "New".  You'll then be presented with a new window that
contains several options.  Make sure the "Netlist Type" is set at "EDIF".  Also make sure
that the style parameters are both set at "Generic".  Then use the browse button to find the
toplevel.edo file.  Load this and click on "Ok".

A window will appear which has a list of the available Actel parts on the left, and the
possible packages for each.  So, say you have a 270 module design for your toplevel.edo
file.  You can choose an A1010B with a 44-pin PLCC, or an A1020B with a 68-pin
PLCC.  As long as the design fits both in modules and available I/O pins, you'll have no
problems.  Note: the 44-pin packages have 34 I/O pins, while the 68-pin packages have
57 I/O pins.  Make sure that your top-level entity doesn't have more I/O than you need.

Click "Ok".  Yet another window will pop up, called the Operating Conditions,
which contains Speed Rating, Temperature Grade and Operating Voltage.  Unless you
have something different than the standard, just leave these alone and click on "Ok".  The
design will compile and indicate any errors or warnings about the design.  If there are any
errors, you have to go back and remodify your code, recompile the toplevel.edo file in
Actmap and try again, or modify some of the Actmap compile options.

Once this process is finished, you can do two things - edit timing specifications with the
DTEdit tool, and edit pin assignments with PinEdit.  I'm not going to cover DTEdit since
I've never needed to use it, but PinEdit is very useful...

If you click on PinEdit after compiling, you'll be presented with a window that has a
symbol of the FPGA you're compiling for on the left, and two lists of pins:  assigned and
unassigned.  If, for example, you want to keep pins for an 8-bit wide signal together,
you just drag the unassigned pin names to each of the empty I/O pads.  Once you've
assigned your pins, you can click on:
    File -> Commit
to commit those pin assignments.  You can also print the diagram you've created by
using:
    File -> Print
and save the diagram image as a Postscript file (.eps format).  There are two important
points to remember in this step:

Once this is done, you can click on the "Analyze" button in the main Designer window.
A small dialog box pops up, but just click on "Ok".  After this is completed, you can
look at your pin timings through DTAnalyze, or (this is really neat) look at the actual
macros laid out on chip by using ChipEdit.  (I personally wouldn't mess around with
ChipEdit and move a macro where it shouldn't - Designer knows best).

Now you've come to the final step.  Almost.  Sort of.  You can either write a fuse file
with the Fuse button, or extract your timings for back-annotated simulation with the
"Extract" command.  If you want a fuse file to burn, click on "Fuse" and a small window
will pop up with a prenamed fuse file in .afm format.  Click on "Ok" and you'll get the
fuse file to use with the FPGA burner.

The "Extract" command is extremely important.  What it allows you to do is extract the
delays created by the FPGA implementation of Designer, so that they can be used to
simulate the actual design, as it would behave, with all delays accounted for.  To get
this file, click on the "Extract" button.  A small window appears, which lists the target
directory (should be "." or the current directory), the "CAE" and the file name.  If you
want, you can change the file name to something other than what it gives you.  But the
important point is to change the CAE format to one compatible with the simulation
tools you use.  The default format is "Generic", but for Mentor's QHSIM, you should
change this to "SDF" (not SDF1.0).  Click on "Ok" and you'll generate a file in .sdf
format (which I'll assume to be called toplevel.sdf).  Then close Designer and, if you
wish, save the project when prompted.
 

Back-Annotated Simulation

Before you can run a back-annotated simulation, you have to prepare several files.
First, copy your toplevel.edo file to another name, for example:
    cp toplevel.edo toplevel_final.edn
It's important to copy to a file with a .edn extension.  Now, providing you ran your
library mapping program, you can convert this copied edn file (which is actually your
optimized EDIF file from Actmap) to a structural VHDL file again by issuing the
command:
    edn2vhdl fam:act1 toplevel_final
Don't use the .edn extension with the file name, or edn2vhdl won't find the file.  This
generates a file called "toplevel_final.vhd".  You can compile this either under Design
Architect or with qvhcom.  Assuming that the libraries are properly referenced, you
will get a compiled design.  If you open toplevel_final.vhd in a text editor, you'll see
that your entity is basically unchanged, but that your architecture is totally different.
This is because it uses standard Actel macros for gates and flip-flops.  And note that
the architecture is now called DEF_ARCH.

Now, to use the .sdf delay file with your design, you start QHSIM by typing at the
command line (not through Design Architect, which you can close):
    qhsim -sdftyp toplevel.sdf &
QHSIM will come up with designs in the work directory, or modify the quickhdl.ini
file if this isn't the case.  Click on the "toplevel" entity, and choose the DEF_ARCH
architecture if not selected.  Then QHSIM will load the .sdf file and all of the
libraries it needs to simulate your top level design.  You can use a command file to
simulate all of your signals.  I personally prefer the command file to the test bench,
unless I have extremely detailed test cases.
 

So Is That It?

Well, not quite.  You may find that your design doesn't run properly under QHSIM
when back-annotated.  Sometimes things don't synthesize properly, and sometimes
they may synthesize into "black boxes" or modules that are never intended to be
used in the way you want them to be used.  It's important to back-annotate your
simulation, or at the very least simulate your extracted VHDL file from your .edo
file.  I've found in my EE552 project that our design worked perfectly in behavioral
simulation, only to have problems when back-annotated.  No evidence of anything
bad ever came to me while going through the procedure.  Yet, had I burned the
FPGA with the fuse file before simulating it, I would've used my chip for nothing.

My most sage piece of advice when it comes to FPGA design is don't assume that
a design works because its simulation works.  It's reassuring to see that I have
setup time violations on my flip-flops when I run my clock frequency too fast, and
that I don't find this out after I've implemented my design.  It's a lot easier to change
a piece of code or modify a technique than it is to waste money and silicon.

Click here to see some miscellaneous items not covered above for our project.

Copyright 1997 Mike Daskalopoulos and Ishfaqur Rahman.  All rights reserved.
Read this legal notice before using any information contained in this document.