Test $fatal() in initialization

load "initfatal.va"
load "capacitor.osdi"

model res resistor
model cap capacitor
model vsrc vsource

v1 (1 0) vsrc dc=0 type="pulse" val0=0 val1=1 delay=1m rise=1u
c1 (1 0) cap c=0.1u
r1 (1 0) res r=10k 

control
  abort always
  analysis tran1 tran step=0.1m stop=10m maxstep=0.1m
endc

embed "initfatal.va" <<<FILE
`include "constants.vams"
`include "disciplines.vams"

module resistor(A,B);
	inout A, B;
	electrical A, B;
	
	branch (A,B) br;
	
	(*desc= "Resistance", type="instance", units = "Ohm"*) parameter real r = 1 from [0:inf];
	
	analog begin
        if (r>=1e3) begin
            $fatal(0, "Aborting simulation in initialization.");
        end
        I(br) <+ V(br)/r;
	end
endmodule
>>>FILE
