Getting Started with Xilinx M1

This document provides a brief summary of information which will help you set up your environment and start some of the Xilinx M1 tools installed in /cad/xilinx (Release M1.5.19).

Contents:

  1. Setting Up Your Environment
  2. Learning about the Xilinx M1 Tools
  3. Important Xilinx M1 Tools
  4. Advanced Xilinx M1 Techniques

Setting Up Your Environment

To setup your environment to run the Xilinx M1 software on the HP workstations, be sure to

source /cad/xilinx/setup

every time you log in. This latest script file has been updated so that the M1 software uses the necessary patches and updated FPGA speed and package files.

Viewlogic Setup

If you plan to use the Viewlogic interface for design entry, set your WDIR before "sourcing" the setup script. The following are some recommended values for your Viewlogic 6.0 environment:
setenv WDIR ~/viewlog:/tools/viewlogic/standard
setenv QUADHOME /tools/viewlogic/quad
setenv QUADBIN /tools/viewlogic/quad/exec
setenv XLM /cad/xilinx
if( $?LM_LICENSE_FILE ) then
	setenv LM_LICENSE_FILE ${LM_LICENSE_FILE}:/tools/viewlogic/standard/license.dat
else
	setenv LM_LICENSE_FILE /tools/viewlogic/standard/license.dat
endif
set path = (/tools/viewlogic /tools/viewlogic/quad/exec $path)
setenv VIPC_KILL_PRE_60_VNSD TRUE
If you are using the older Viewlogic 5.3 with the older XACT tools, then use the following:
set path=(/fpga3/cad/viewlogic /cad/xact/powerview/bin/hppa $path)
setenv WDIR {$HOME}/viewlog:/fpga3/cad/viewlogic/standard:/fpga3/cad/viewlogic/standard/53'
(Note that the Synopsys version of iview and the Viewlogic version conflict, so I would not recommend having both in your .cshrc by default.) Additionally, the following are .ini files which can be used for preparing to use Viewlogic:

  1. powerview.ini
  2. workview.ini
  3. viewdraw.ini (Created for use with Xilinx 4000EX/XL FPGAs. Must be modified for other parts.)
These .ini files should be placed in your design's project directory. (If you are using Viewlogic 6.0, you can and probably should remove the LICENSE_SERVER lines from the powerview.ini and the workview.ini--the license management system has changed.)

Synopsys Setup

To setup for using the Synopsys tools with the Xilinx M1 software, refer to the Setting Up for Synopsys tutorial page. Also, I suggest that you use the templates found in /cad/xilinx/synopsys/examples for your setup files. You will note that .synopsys_dc.setup is called template.synopsys_dc.setup_fc and .synopsys_vss.setup is called template.synopsys_vss.setup. Below are instructions for copying these to your directory and renaming them. Finally, there is a script called template.fpga.script.4kex you can use for synthesis using FPGA Compiler.

If you are new to Synopsys and/or Xilinx M1, follow these steps to setup a project for synthesis:

  1. Create your project directory, e.g., myproject. Your project directory should be the place where your VHDL designs reside.
  2. Copy the template.synopsys_vss.setup into your project directory, renaming it .synopsys_vss.setup. This file defines the environment for simulating VHDL designs.
  3. Create a subdirectory named WORK in your project directory. This is the place where the Synopsys temporary files for synthesis and simulation are put.
  4. Copy the template.synopsys_dc.setup_fc into your project directory, renaming it .synopsys_dc.setup (assuming you will be using the FPGA Compiler for synthesis). This file defines the environment for synthesizing VHDL designs.
  5. Use the synlibs command to add the appropriate libraries to your .synopsys_dc.setup file. To use synlibs you must first source the /cad/xilinx/setup file mentioned earlier. The template.synopsys_dc.setup file found in /cad/xilinx/synopsys/examples does not include the libraries required for synthesis, so these libraries should be appended to the end of the template.synopsys_dc.setup to make a complete .synopsys_dc.setup file. The following example uses synlibs to add the synthesis libraries to the .synopsys_dc.setup file for use with the FPGA Compiler and a Xilinx XC4036EX-3 FPGA:
    synlibs -fc 4036ex-3 >> .synopsys_dc.setup
    The following is an example for adding the synthesis libraries for the same Xilinx FPGA, except the libraries are intended for the Design Compiler instead:
    synlibs -dc 4036ex-3 >> .synopsys_dc.setup
    If you need additional help with synlibs, refer to the Xilinx M1 on-line documentation, or type synlibs -help. You should only add one set of libraries to a .synopsys_dc.setup file.

Learning about the Xilinx M1 Tools

The most complete source of information on the M1 tools is the on-line documentation. To read this documentation, make sure that you have sourced the setup script and then execute the command dtext. This will bring up a list of documents which you can read. For starting with Viewlogic designs, I would recommend reading the Viewlogic Interface/Tutorial Guide. For using the tools with Synopsys, of course, refer to the Synopsys (XSI) Interface/Tutorial Guide. For detailed information on the individual Xilinx M1 tools themselves, refer to the Development System Reference Guide.

Important Xilinx M1 Tools

Below is a list of the important tools for this release of the Xilinx tools:
xgen
This is a script generation tool which has been newly added to the M1 tool suite. The xgen script will prompt you for the relevant information required for processing your design. The script created by xgen can then be used to process your design without having to write your own script or having to use the Design Manager.
Design Manager
This is the "shell" that can be used to manage the translation of designs from netlists (EDIF,XNF,etc.) to bitstreams. It can be started by executing the dsgnmgr command.
Flow Engine
This is the program which processes the design project from netlist to bitstream. It will be started by the Design Manager. It can be executed using the floweng command.
Ngdbuild
This does much of the translation from the input netlist format to the internal netlist format used by the new tools. See the Development System Reference Guide for a more detailed explanation. It can be executed using the command ngdbuild.
Map
This command performs some logic optimization and design mapping to the given technology. See the Development System Reference Guide for a more detailed explanation. It can be executed using the command map.
Par
This command performs the actual placing and routing of the design onto a specified FPGA. See the Development System Reference Guide for a more detailed explanation. It can be executed using the command par.
Trace
This program performs the timing analysis for designs. It can be used to estimate design performance before and after placing and routing the design. See the Development System Reference Guide for a more detailed explanation. It can be executed using the command trce(this is correctly spelled).

Advanced Xilinx M1 Techniques

This section will provide some documentation for techniques which have been demonstrated in the lab but are not documented in the M1 tools' online documentation.

Merging Viewlogic and Synopsys Designs

To instance Viewlogic-created designs from within a Synopsys VHDL design, you just reference the sub-design as a "black box" in the VHDL code. For instance, say you have a multiplier named "mymult" which you have painstakingly designed and on which you have placed the appropriate attributes to create an RPM in Viewlogic. Suppose the name of the ports are: A[15:0], B[15:0], Prod[31:0]. In your VHDL design, you would create a component having the same name as the Viewlogic design and with the correct port names, such as:

component mymult
    port(
          A: in std_logic_vector(15 downto 0);
          B: in std_logic_vector(15 downto 0);
          Prod: out std_logic_vector(31 downto 0)
         );
end component;
Next, when you instantiate the Viewlogic sub-design, I would recommend the "named" style of the port map statement, though I suspect the "positional" style would work. So, an example of the component instantiation would be:

mymult0: mymult port map(A=>a_in,B=>b_in,Prod=>prod_out);
Before compilation, you must modify the Synopsys variables which control the bus naming style in Synopsys. This can be done by setting the variables in your .synopsys_dc.setup file or they can be set in a synthesis script. The variables and settings you should use are :

	bus_naming_style = "%s%d"
	bus_dimension_separator_style = ""
        bus_inference_style = "%s%d"
In Viewlogic, when you have a bus named B[15:0], the individual signals are called B15, B14, ..., B1, B0. In contrast, Synopsys uses angle brackets in naming the individual signals of buses, (e.g., B<15>). Because of this disparity, the ports which are buses in the VHDL will not associate properly with the corresponding ports of the Viewlogic objects when the designs are being merged by the Xilinx M1 tools. Changing the bus_* variables should fix this problem. If you don't have any ports which are buses in your Viewlogic design, then the variables do not need to be changed.

Here is a summary of the steps for the integration process:

  1. In the VHDL, create a dummy component with the exact same name as your Viewlogic design, naming the ports exactly as found in the Viewlogic design.
  2. Next, instance the component using "named" (as opposed to the "positional") association method. (Actually, positional would probably work since the component declaration defines the meaning of the positions in the port map).
  3. Generate your .sxnf (or .sedif) as usual. You will get the usual "unresolved references" warnings.
  4. Generate the .edn (the EDIF) of your Viewlogic design.
  5. To create a bitstream of your design, make sure that both the .sxnf (or .sedif) and .edn files are in the same directory so that ngdbuild can resolve the references to the Viewlogic design(s). Then, you can either use dsgnmgr or a script file, as usual, to process the top-level design.

Building and Using RPMs with Synopsys VHDL

This is still kind of an experimental process, but I have had several successful attempts in creating and locking down (relatively) the locations of RPMs.

First of all, to allow RLOCs to be used in a design, the following Synopsys variables must be set as shown:

edifout_netlist_only = true
edifout_power_and_ground_representation = cell
edifout_write_properties_list = "instance_number pad_location part RLOC"
edifout_no_array = true
These are essentially the same parameters used in the Xilinx's example file template.synopsys_dc.setup_dc with the additional stipulation that the RLOC properties also get written out in the EDIF. These variables can be set in your own .synopsys_dc.setup or in the synthesis script.

Building Your Own RPM with Synopsys
Not surprisingly, you can use structural VHDL to design circuits using the primitives and RPMs which are listed in either the Libraries Guide or in Appendix A of the Synopsys (XSI) Interface/Tutorial Guide. Both of these references are found in the on-line documentation which came with the M1 tools. (Actually, I found the printed versions of this documentation for the older XACT tools to be more complete and helpful in some ways. Of course, any new primitives and library elements will not be listed in the old documentation.) To use the elements from the Xilinx libraries, you can do one of two things.

So, using component instantiations, you can wire together your circuits. Again, I would recommend that named association be used in the component instantiations.

The only "gotcha" to creating RPMs with Synopsys VHDL and the Xilinx synthesis libraries is that RLOC attributes cannot be placed on the FMAP_PLC/PLU/PUC/PLO/PUO primitives in the library. (These are only mentioned in the old documentation though they do exist in the current synthesis libraries. The map program complains if you put RLOC attributes on these primitives. About all they can be used for is packing logic into LUTs, but no relative placement can be done, from what I can tell.) To get around this "gotcha", create your own FMAP component, having the same inputs and outputs as the FMAP component described in the Libraries Guide. Specifically, the following can be used for instancing "normal" FMAPs:

  component fmap
    port(i4,i3,i2,i1:in std_logic;
	 o:out std_logic
	 );
  end component;
Note that the FMAPs are wired in parallel with the logic which is supposed to be stuffed into the LUT. Also, you should tie the unused input ports of the FMAPs to ground using the following component (which is part of the Xilinx libraries):

  component gnd
    port(ground: out std_logic);
  end component;
Though the FMAP component you create is not directly in the Xilinx synthesis libraries, the Xilinx back-end tools recognize what an FMAP is directly. As far as Synopsys is concerned, the FMAP component is just another "black box" which will be resolved by some other tools. With your RPM totally defined, you can just use the read command to analyze and elaborate your RPM. Since your RPM is already using Xilinx primitives and macros, all that you need to do is perform the read. No compile, replace_fpga or insert_pads commands are necessary, nor should they be used on the RPM. If you must do a compile on the design for some reason, you should make sure that you set the dont_touch attribute on all of the instanced elements in the RPM to true. Otherwise, the Design Compiler/FPGA Compiler will probably change your design. If you would like to have just your RPM on a chip, I would recommend instancing the RPM in a wrapper, setting the dont_touch attribute on the RPM to true and then processing the higher level design as normal (set_port_is_pad, insert_pads, compile, etc.). This will preserve your RPM without you having to instance the individual I/O buffers in the design,though, this can be done.
Setting the RLOC Attributes for RPMs under Synopsys
Now for the last set of key procedures which make RPMs possible under Synopsys as well as allow RPMs to be relatively placed from within Synposys. Before you write out the hierarchical EDIF file of your top-level design, you must set the RLOC attributes on the FMAPs within RPM designs as well as on the RPMs themselves if you want them placed relative to one another. To set the RLOC attribute on an FMAP or RPM instance, you use the set_attribute command. The following command is an example:
set_attribute myinstance RLOC -type string "R1C2.F"
In this case, the RLOC with the value "R1C2.F" is being attached to myinstance, which an RPM or FMAP.

Realize that the RLOC attributes can only be applied directly to FMAPs at the top-level of a design's hierarchy. For instance, if you have an RPM written in VHDL called mymult which is instanced in a design named top, you can only set the RLOC attributes for the FMAPs in the design mymult. If you try to set the attributes directly in the top design by traversing the design hierarchy, those attributes will not be written to the resulting EDIF file. In other words, you can only set the RLOC attributes on instances at the top-level of a design---you cannot set the attributes on instances within other instances in a design.

Similarly, if you want to set RLOC attributes on RPMs, the attributes must be set at the design level which immediately instances the RPMs, otherwise, the attributes will not be written out properly. For example, assume you have the RPM named mymult which is instanced by a design named almost_top and almost_top is instanced by the design top. The RLOC attribute should be placed on the instance of mymult in the almost_top design and not by traversing the hierarchy of top to set the attribute on the instance of mymult within the almost_top instance contained in top.

Examples of Setting RLOC Attributes for RPMs under Synopsys
Since these explanations are surely confusing, I will provide several examples of scripts and designs which demonstrate the process below.

In the first example, the VHDL design named hybrid instances twice a Viewlogic-created signed multiplier RPM, mult16x16s, that resides in the file EDIF file mult16x16s.edn. To experiment with this first example, you can copy the hybrid.vhd file and the mult16x16s.edn file into a directory and use the synthesis script compile_hybrid.dc to synthesize the hybrid design. The synthesis script places RLOC attributes on the multipliers so that they are placed relative to one another. I have also provided the .synopsys.dc_setup used to synthesize the design. Make sure that the Xilinx part you map to is at least a 4028EX since the multipliers take up a lot of room.

The next two VHDL examples that I have provided use an RPM created in Synopsys VHDL. The first example is simply a complete RPM of an AND gate and NAND gate. I have manually included the IBUFs and the OBUFs so that it can be independently synthesized and placed on a chip by itself. The VHDL example is provided in ands.vhd and the accompanying sythesis script is included in compile_ands.dc. The .synopsys_dc.setup file from above will work for this example as well as the next example.

The third VHDL example shows how to apply RLOC attributes at the appropriate levels of the hierarchy. The top-level design is called andinst and is included in the file andinstd.vhd. The andinst design instances a version of the ands design which does not have the IBUFs and the OBUFs included. The modified ands design is found in ands2.vhd. The synthesis script compile_andinst.dc places the RLOC attributes on the FMAPs of the ands design as its read in. As I mentioned before, the RLOCs are applied to instances at the top-level of a design and not on instances within other instances of a design. Next, the script sets the "dont_touch" attribute on the ands design so that later synthesis stages do not effect the "hand" placed design. Once this is done, the script reads in the andinst design and synthesizes it normally. With the synthesis complete, the script places the RLOCs on the instances of the ands design which are in the andinst design. Again, only RLOC attributes applied to top-level instances in a design are written out to the EDIF file; if the attributes are applied to an instance within an instance, they will not be written to the EDIF file at the end of the synthesis script.

One last comment on this last example. I noticed warnings about how the FMAPs and the logic in the Synopsys RPMs are "driving" the same nets. This is to be expected and is a good sign. The warnings specifically mentioned how Synopsys is assuming that the nets are being driven by wired-AND logic. Since FMAPs are really not true components, these warnings can be ignored as long as they only apply to FMAPs.

Additionally, as far as simulation of these gate level RPMs are concerned you have two options:

Using balance_registers with Synopsys VHDL and Xilinx XC4000 parts

The balance_registers command in Synopsys is used to automatically pipeline designs, freeing the designer from some of manually specifying where the pipeline stages go. The problem is that Synopsys FPGA Compiler when using Xilinx XC4000 series parts maps the logic into CLBs and IOBs. This confuses the Synopsys tools when it tries to do balance registers. The following are quotes from Synopsys documentation which address these issues.
Balance_registers on FPGA libraries

         QUESTION: 

Does retiming or Balance_registers work with FPGA libraries?

ANSWER: 

Yes, it does work with all Look Up Table  based technologies like 
Xilinx XC3000,XC5200 .., Altera Flex family, AT&T ORCA and non-LUT-
based technologies like Actel. The only exception is the Xilinx 
XC4000 family which uses CLBs and IOBs models which consist of both
combinational and sequential devices embedded within each instead of
LUTs. Running  "balance_registers" on a XC4000 design will give you
the following error : RTDC-24 Retiming not supported with XC4000

The methodology for performing Balance_registers on XC4000 design is 
as follows:

        - Compile the design in the normal method till replace_fpga
        - Perform replace_fpga
        - Remove the xfpga_40XX.db from the link and target_library
       (else optimzation during the balance_registers will result 
           in regrouping modules as CLBs & IOBs and Balance_registers won't work)
        - Balance_registers

The improvement that you get from Balance_Registers of XC4000 QoR may not be as
dramatic as compared to other FPGA families since the timing after replace_fpga is
much less accurate (since the packing of the logic inside the CLB is not considered
at this stage).
Using balance_registers and the Xilinx XC4000 series


PROBLEM:

When using balance_registers with the Xilinx XC4000 architecture, I receive
the following error:

Error: Design contains generic logic.  Cannot balance registers. (RTDC-16)

However, my design is completely mapped and has no generic logic.

EXPLANATION:

balance_registers checks your target_library before starting.  In the 
case of the XC4000 architecture, it sees the xfpga library in the 
target_library list.  The xfpga library (i.e. xfpga_4005-5.db) contains 
the CLB and IOB primitives.  balance_registers considers these cells to 
be "generic" logic.

WORKAROUND:

Before running the balance_registers command, reset the target_library to
exclude the xfpga library, then balance_registers will complete.  See the
following example script.

link_library = {xfpga_4005-5.db xprim_4000-5.db xprim_4005-5.db}
target_library = {xfpga_4005-5.db xprim_4000-5.db xprim_4005-5.db}
read -f verilog test.v
compile
replace_fpga
target_library = {xprim_4000-5.db xprim_4005-5.db}
balance_registers

NOTE: Reoptimizing your design after replace_fpga will cause all CLB 
grouping information to be lost.
Why do I get the error RTDC-10 when I use balance_registers?
 Q. I am attempting to implement a multiplier followed by two
 registers, and cannot determine why balance_registers will not retime
 the design and move the registers to make the design meet timing with
 my create_clock constraints.

I get the error RTDC-10(error) No moveable flip-flops in design.
Nothing to retime.

process(reset,pnclk)

begin
if (reset='0') then
 mult_out <= "00000000000000000000000000000000";
 mult_int1 <= "00000000000000000000000000000000";
elsif(pnclk='1' and pnclk'event) then
 mult_int1 <= in1 *in2;
 mult_out <= mult_int1;
end if;
end process;



A. The cause is the asynchronous reset, the tool considers these
registers unmoveable.

Hints and Restrictions for Flip-Flops

The balance_registers command will treat any flip-flop that has an
asynchronous set/reset as dont_touched and will not move it. This
restriction is enforced because balance_registers does not currently
determine the initial state of the flip-flop when it is asynchronously
set through the set/reset pins.

Balance_registers will try to decrease the clock cycle, but might not
be able to produce optimal cycle-times for the same reasons given
earlier in the first two sections of the article (dont_touching
flip-flops, maintaining hierarchy through dont_touches etc.). For this
reason, it is important that the dont_touch attribute be used sparingly
when using balance_registers.
 
If there are any questions about the procedures mentioned here or if there are any problems with the examples, please let me know. My e-mail address is supplied at the end of this WWW page.

Good luck.


Go to the CCL Tutorials Page Go to the CCL Home Page
Last modified: Fri Jan 8 14:44:07 MST 1999

Please send comments to: grahamp@fpga.ee.byu.edu