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:
If you are new to Synopsys and/or Xilinx M1, follow these steps to setup a project for synthesis:
synlibs -fc 4036ex-3 >> .synopsys_dc.setupThe 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.setupIf 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.
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:
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 = trueThese 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.
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.
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.
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:
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).
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.
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 PagePlease send comments to: grahamp@fpga.ee.byu.edu