Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17268 Discussions

Relative paths in SystemVerilog

MTett
Beginner
4,712 Views

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.

0 Kudos
2 Replies
KennyTan_Altera
Moderator
4,150 Views
It should work, can you attached your design.qar here to have a look? file = $fopen("data.txt", "r");
0 Kudos
MTett
Beginner
4,150 Views

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.

0 Kudos
Reply