How do I calculate average delay of inputs in iverilog.

Guest #4359374
Rate this post
• ▲ useful
▼ not useful
I have built a 16 bit carry look ahead adder and randomized 5000 inputs 
I cant figure out how you would get an average delay of these inputs, 
also I am in structural iverilog.

Any help would be nice. i have added my testbench below

module testbench();
    wire [15:0] a,b,sum;
    wire cin,cout;
     testAdder test(a,b,sum,cout,cin);
     cla_16_two_level adder(sum,cout,a,b,cin);
    endmodule

    module testAdder(a,b,s,cout,cin);
    input [15:0] s;
    input cout;
    output [15:0] a,b;
    output cin;
    reg [15:0] a,b;
    reg cin;
    integer i;
    integer seed =16;
    integer f;
    initial begin
    $monitor($time,"a=%d, b=%d, cin=%b, s=%d, cout=%b",a,b,cin,s,cout);
     for(i=0; i<5000; i=i+1) begin
#10;
              a = $random(seed);
              b = $random(seed);
              cin = $random(seed);

            end
      end
    endmodule

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.