cyboman
Member level 4
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:
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
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