Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

controling `timescale from the testbench

Status
Not open for further replies.

cyboman

Member level 4
Member level 4
Joined
Mar 9, 2010
Messages
71
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
USA
Activity points
1,808
does anybody know if there is a way to control the `timescale values from the testbench

all the designs i have done so far (i'm new to digital design) have a `timescale 1ns/1ps in them. my testbenches have the same `timescale in it. i noticed that when i increase the `timescale to `timescale 10ns/1ns my simulations run faster (at least the behavioral ones). but in order to change the timescale i need to do it manually in the testbench and all the modules that are in the testbench

example:
say i have the following hierarchy:

Code:
testbench -> dut -> module3_u3
                 -> module2_u2
                 -> module1_u1
                 -> module0_u0

in order to change the timescale i need manually go to testbench and change the timescale, manually go to dut and change the timescale, go to module3, module2 etc and change the timescale in every module that is instantiated in the dut. does anybody know a way to pass a timescale value to the testbench, say like a parameter. this value will passed down to every subsequent module that is being simulated.

so it would probably look like this:

testbench #(.unit_step(10), precision(1))

meaning that dut will have `timescale 10ns / 1ns, module0 will have `timescale 10ns / 1ns, module1 will have `timescale 10ns/ 1ns etc.

any help is appreciated
 

$timeformat

timeformat_task ::=
$timeformat [ ( units_number , precision_number , suffix_string , minimum_field_width ) ] ;

The $timeformat system task performs the following two functions:
— It specifies how the %t format specification reports time information for the $write, $display,
$strobe, $monitor, $fwrite, $fdisplay, $fstrobe, and $fmonitor group of system tasks.
— It specifies the time unit for delays entered interactively.

The $timeformat system task performs the following two operations:
— It sets the time unit for all later-entered delays entered interactively.
— It sets the time unit, precision number, suffix string, and minimum field width for all %t formats
specified in all modules that follow in the source description until another $timeformat system task
is invoked.

Refer in
**broken link removed**


HTH
 

    cyboman

    Points: 2
    Helpful Answer Positive Rating
shitansh,

thanks for the help
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top