is there any way two compare two text files using verilog???
actually i need to compare expected output stored in a text file with the output of my program.is there any way to do this directly like c program.
Use fileIO system tasks to read the "golden" file and compare word for word data from the UUT. This type of self checking testbench code is pretty easy to write and there are a lot of examples of using the fileIO system tasks to read in files on various websites.
i have used $readmemb("input.txt",mem); to read the text file into a register and done the same to the other text file. then i compared the both registers . and finally used $fwrite to print the result into a another text file .
thanks for the help..
regards
You did it in verilog for specific reason or you just wanted to explore it?
I always do the same in sw like Beyond compare, did you face any problem with that?
You did it in verilog for specific reason or you just wanted to explore it?
I always do the same in sw like Beyond compare, did you face any problem with that?
actually i need to verify the output of a verilog program in which output writting into a text file. so i did this as a part of the testbench.
this comparison is a part of my program . so i done it in verilog itself