0
\$\begingroup\$

I tried to open a file ff.txt and write into it some random numbers say seven times. I used EDA playground website for it. Below is the link for that code as well as that code.

http://www.edaplayground.com/x/TCC

When I try to run I get error as

** Warning: (vsim-3533) [FOFIW] - Failed to open file "ff.txt" for writing.

Permission denied. (errno = EACCES) : design.sv(6)

My question is why don't I have access to the file ff.txt?

     module fopenclose();
       integer mcd,number;
       initial begin
         mcd=$fopen("ff.txt");
         repeat(7) begin
         number=$random;
         $fdisplay(mcd,"Number is",number);
       end
         $fclose(mcd);
       end
       initial #2 $display("%d",mcd);
     endmodule
\$\endgroup\$
1
\$\begingroup\$

EDA playground most likely does not provide filesystem access. You will probably need to run this in a simulator on your local computer.

\$\endgroup\$
0
\$\begingroup\$

This problem has been fixed in EDA Playground, and the code now works correctly.

The issue was that the ff.txt file was read-only.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.