2

I need to divide two delay parameter values which are in ps. The result has to be an integer value. I have tried the code below, but the result is incorrect. N, a parameter which I need at compile/elaboration time, needs to be calculated to 60. Link on edaplayground.

module test #(parameter delay=3000ps, unitDelay = 50ps, integer N=$ceil(delay/unitDelay)) (input logic L, output logic R); initial begin $display ("delay=%d, unitDelay=%d, N=%d", delay, unitDelay, N); $display ("delay=%t, unitDelay=%t, N=%d", delay, unitDelay, N); end endmodule 

1 Answer 1

3

The problem is your global timescale is 1ns, so unitDelay will be 0. So you either need to make your timescale 1ps, or change your parameter types to real

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.