Spectre does. I filed a PCR a while ago because string parameters weren't working in case statements, but that works now (in MMSIM60 and MMSIM61 versions for about a year). I just took the example I had with a case statement, and tried it out with fopen too - and that worked:
Code:`include "discipline.h"
`include "constants.h"
module resexample (a,b);
inout a,b;
electrical a,b;
branch (a,b) resbr;
parameter real w=1u,l=1u,rsh1=1000.0,rsh2=400.0,rsh3=200.0;
parameter string rtype="M1";
real rval;
integer FH;
analog begin
case (rtype)
"M1": rval=rsh1*w/l;
"M2": rval=rsh2*w/l;
default: rval=rsh3*w/l;
endcase
$strobe("rtype is %s, rval is %g",rtype,rval);
FH=$fopen(rtype,"w");
$fstrobe(FH,"rtype is %s, rval is %g",rtype,rval);
$fclose(FH);
V(resbr) <+ rval*I(resbr);
end
endmodule
with this netlist:
Code://
r1 (1 0) resexample w=2u l=0.5u rtype="M2"
v1 (1 0) vsource type=dc dc=1
ahdl_include "resexample.va"
dc dc write=stuff.dc
It wrote out:
rtype is M2, rval is 1600
both to the screen, and into a file called "M2".
Regards,
Andrew.