Verilog! Use $readmem for decimal values

Status
Not open for further replies.

UFK

Member level 3
Joined
Mar 8, 2010
Messages
60
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Pakistan
Activity points
1,728
Hi

Can anyone please help me read decimal values from a text file using readmem.
I tried using $readmemh for hex values but it cannot read negative values. Can someone please help me read values (both positive and negative) in either hex or decimal format from text file?

Thanks in advance
 

$readmemh is not a very good function. Try using $fread instead. Works better, can read decimal or hex numbers and has a syntax similar to C programming.
 

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