Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Verilog read file of any type

Status
Not open for further replies.

sherifsherif

Newbie
Newbie level 2
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top