Verilog read file of any type

Status
Not open for further replies.

sherifsherif

Newbie
Joined
Oct 17, 2013
Messages
2
Helped
0
Reputation
0
Reaction score
1
Trophy points
1,281
Visit site
Activity points
1,298
I want to read a file as binary. I don't mean that the contents are ascii characters for ones and zeros, but I mean i want to read a file of any type, picture, text or anything.
I have encryption core and want to read a file to test the block. The file can be a movie, text or any thing.
I tried $fgets function but if the read value from the file is zero, the function returns zero. I tried $fscanf function but somewhere in the file it returns 0 although Iam very sure the file still has data.
Thanks
 

Why don't you refer to the Verilog language specification? The said file functions are for formatted files and can't work for binary data. Use $fread() or $freadmemb().
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…