arithmetic surprise?

From: Marq Kole <marq.kole_at_.....>
Date: Thu Jan 26 2006 - 06:59:02 PST
All,

I've found a piece of very simple looking Verilog-A code which 
nevertheless produces some very interesting results without giving a 
compilation error/warning or a run-time error/warning. Just try performing 
a DC simulation with the following model:

`include "constants.h"
`include "discipline.h"

module arith (a, b);
inout a, b;
electrical a, b;

integer ii;

analog begin

  @(initial_step) begin
    ii = 15;
    $display("ii = %d, (ii-16)/2*`M_PI = %g", ii, (ii-16)/2*`M_PI);
  end

end

endmodule // arith

I have found erroneous answers with at least two simulators: is this 
something that needs attention in the standard?

Regards,
Marq


Marq Kole
Competence Leader Analog Simulation, Philips ED&T
Received on Thu Jan 26 07:06:17 2006

This archive was generated by hypermail 2.1.8 : Thu Jan 26 2006 - 07:07:19 PST