UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 7338

2.1i NGD2VER - glbl.v has a different 'timescale from the .v and .tv output of NGD2VER

Description

Keywords: NGD2VER, glbl, Verilog, timescale

Urgency: Standard

General Description:
The current glbl.v in 2.1i has the following `timescale:

`timescale 100 ps / 10 ps

However, both the .tv file and the .v file written from NGD2VER have
the following `timescale:

`timescale 1 ns / 1 ps.

The `timescale can be declared in any file, and the smallest precision measurement
of all the timescale directives determines the time unit of the simulation.

Since `include glbl.v is written into the .tv file after the `timescale of the .tv file,
the `timescale from the glbl module will override the user's `timescale and cause
unexpected simulation duration.

`timescale 1 ns / 1 ps.
`include <path_to_xilinx>/verilog/src/glbl.v

module test ();
...
endmodule

The first timescale indicates that the time units for test are in multiples of 1 ns,
and that it is precise to 1 ps. Thus, the smallest time step for the simulator is 1 ps.

The second timescale is 100 ps/10 ps, which is read from glbl.v. Since 10 ps is
greater than 1 ps, the smallest time step remains 10 ps. However, the new time
unit of 10 ps overrides the previous one of 1 ns, and sets the time unit for
subsequent module definitions. Thus, the `timescale is defined as 10 ps/1 ps.

Solution

NGD2VER 2.1i Service Pack 1 correctly writes the `timescale after the `include in the
"testfixture" template file. However, the glbl.v file still contains a `timescale of 100ps/10ps.

For more information about the 2.1i Service Pack 1 update, please see
(Xilinx Solution #7317).
AR# 7338
Date Created 08/31/2007
Last Updated 07/31/2001
Status Archive
Type ??????