star_golden
Junior Member level 1
- Joined
- Jul 3, 2013
- Messages
- 16
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 99
Hi,
I open a text file which is there in the testbench.
I open it like this :
initial begin
fd = $fopen ("../testbench/includes/data.txt", "r");
end
Now I will have to open and process different text file each time I run the simulation. So, instead of changing the text file in the testbench every time, I am thinking of passing that as a argument to the TCL file and copy that input file to another text file. So, in the testbench - I will always to open and process the same file.
For example, I want to run my simulation as do run.tcl text1.txt
And now tcl has to copy text1.txt to a common file which is data.txt. And I open data.txt every time and not text1.txt or text2.txt.
I have written tcl logic as
# Copy text file
set result " "
if { $argc > 0} {
set i 0
foreach index $argv {
incr i
file copy ? -force? ?--? ../testbench/includes/$index ../testbench/includes/data.txt
}
}
But compiler throws the error :
# ** Error: error copying: target "../testbench/includes/data.txt" is not a directory
Can any one help me to resolve this..?
Thanks !!!
I open a text file which is there in the testbench.
I open it like this :
initial begin
fd = $fopen ("../testbench/includes/data.txt", "r");
end
Now I will have to open and process different text file each time I run the simulation. So, instead of changing the text file in the testbench every time, I am thinking of passing that as a argument to the TCL file and copy that input file to another text file. So, in the testbench - I will always to open and process the same file.
For example, I want to run my simulation as do run.tcl text1.txt
And now tcl has to copy text1.txt to a common file which is data.txt. And I open data.txt every time and not text1.txt or text2.txt.
I have written tcl logic as
# Copy text file
set result " "
if { $argc > 0} {
set i 0
foreach index $argv {
incr i
file copy ? -force? ?--? ../testbench/includes/$index ../testbench/includes/data.txt
}
}
But compiler throws the error :
# ** Error: error copying: target "../testbench/includes/data.txt" is not a directory
Can any one help me to resolve this..?
Thanks !!!