From: Stephen W. <st...@ic...> - 2009-05-27 18:10:02
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The behavior you get will depend on the scheduling order of the initial statements, and to a lesser degree on the operating system. Icarus Verilog uses fopen(<P>,"w") to open MCD files, and in your case, opening twice, the second open will truncate the first. It appears that VCS and ncsim agree with Icarus Verilog, at least in the broader sense. Modelsim seems to be making some special effort to detect that you opened the file twice and combine file descriptors, which may make a small bit of sense given that mcd descriptors are precious. But really, that strikes me as a lot of effort to support a bad input. I think this situation is (and should be) left unspecified. Just don't do that!-) Andrei Purdea wrote: > Hello! > I have found a weird modelsim behavior where if you open the same > filename twice with the one-parameter (multichannel descriptor) $fopen > then one of the fopens will not overwrite the other one, but instead > both outputs end up in the output file. > > Iverilog behaves the way i'd expect it to. > > Do other simulators behave like modelsim? > > (result of the attached .v file) > iverilog:(all versions) > > andrew@charon:~$ cat test.txt; rm test.txt > second > second after first is closed > andrew@charon:~$ cat test.txtb; rm test.txtb > second > second after first is closed > andrew@charon:~$ cat test.txtc; rm test.txtc > first > > > modelsim: > > andrew@charon:~$ cat test.txt; rm test.txt > first > second > andrew@charon:~$ cat test.txtb; rm test.txtb > second > second after first is closed > andrew@charon:~$ cat test.txtc; rm test.txtc > first > second - -- Steve Williams "The woods are lovely, dark and deep. steve at icarus.com But I have promises to keep, http://www.icarus.com and lines to code before I sleep, http://www.picturel.com And lines to code before I sleep." -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFKHYG7rPt1Sc2b3ikRAiZ1AKCdlj0Yt9QN4eqOX260OlFj6AXCXwCdE4NZ 12LcylRNdAgfXFfhx7EHayk= =vGwY -----END PGP SIGNATURE----- |