Hello,
for the first time I have to make advanced testbenches accessing complex files. So i need to reach a position in the file that is flaged with markers like this
....
==Raw Data==
01010101010101
10010101010101
....
==Encoded Data==
01010101010101
10010101010101
....
but I'm struggling with strings that I'm not used to manipulate. I can now extract vectors from files thanks to a package I found here : web.archive.org/web/20070204123448/members.aol.com/vhdlcohen/vhdl/Models.html
but the thing I'm not able to do is to implement this algorithm...
open the file
while( not(endoffile) and (my_string /= "==Encoded Data==")) {
read a line
}
if endoffile return error;
read a line
register( my_range ) <= string_to_vector(my_line)
my main concern is the string comparison as "my_string" may be of any size while "==Encoded Data==" is of defined length so the compiler don't even let me compile this.
As this is probably a piece of cake for some of you, i decided to ask for help. Is there a common way to do what i'm trying to do? Could someone show me an example please?
Thanks!
for the first time I have to make advanced testbenches accessing complex files. So i need to reach a position in the file that is flaged with markers like this
....
==Raw Data==
01010101010101
10010101010101
....
==Encoded Data==
01010101010101
10010101010101
....
but I'm struggling with strings that I'm not used to manipulate. I can now extract vectors from files thanks to a package I found here : web.archive.org/web/20070204123448/members.aol.com/vhdlcohen/vhdl/Models.html
but the thing I'm not able to do is to implement this algorithm...
open the file
while( not(endoffile) and (my_string /= "==Encoded Data==")) {
read a line
}
if endoffile return error;
read a line
register( my_range ) <= string_to_vector(my_line)
my main concern is the string comparison as "my_string" may be of any size while "==Encoded Data==" is of defined length so the compiler don't even let me compile this.
As this is probably a piece of cake for some of you, i decided to ask for help. Is there a common way to do what i'm trying to do? Could someone show me an example please?
Thanks!