- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to include a text file I want to read and write to. However, verilog is unable to find the text in the current directory. How do I determine relative path in System Verilog.
I have tried the following with no luck(for reading only) and none works.
file = $fopen("data.txt", "r");
file = $fopen("./data.txt", "r");
However, absolute path works though, but that is not what I want.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It should work, can you attached your design.qar here to have a look? file = $fopen("data.txt", "r");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My bad. So basically I am using a tool(connects to modelsim) which automates the simulation of this design module against a testbench. So it works with the individual files as opposed to the project file. This could be the problem.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page