hi
I know $memreadh, $memreadb are used to read data from a text file. I
have used a memory file for reading data.
reg [0:7] mem[1:500];
initial
$memreadh("input.mem", mem);
In this case, .mem file is created in Xilinx ISE only. But, if I want
to use .txt or .dat files, what is the syntax.
I mean, we should give any path to a file whre it is stored. If so,
tell me whre the file should be saved. I am usign Xilinx Ise. So,
should it be saved in xilinx ise installation files??
Similarly, what is the verilog command for writing data to a text
file.
what is the difference between fread and $memreadh??
Will the module programs with $memreadh, $memreadb, fread, fwrite
tasks be synthesized??
Please let me know these anss.
Thanks
|
|
0
|
|
|
|
Reply
|
PrAsHaNtH
|
5/27/2009 5:10:32 PM |
|
On May 27, 1:10=A0pm, "PrAsHaNtH@IIT" <prashaena...@gmail.com> wrote:
> hi
>
> I know $memreadh, $memreadb are used to read data from a text file. I
> have used a memory file for reading data.
>
> reg [0:7] mem[1:500];
> initial
> $memreadh("input.mem", mem);
>
> In this case, .mem file is created in Xilinx ISE only. But, if I want
> to use .txt or .dat files, what is the syntax.
> I mean, we should give any path to a file whre it is stored. If so,
> tell me whre the file should be saved. I am usign Xilinx Ise. So,
> should it be saved in xilinx ise installation files??
>
> Similarly, what is the verilog command for writing data to a text
> file.
>
> what is the difference between fread and $memreadh??
>
> Will the module programs with $memreadh, $memreadb, fread, fwrite
> tasks be synthesized??
>
> Please let me know these anss.
>
> Thanks
I think you mean $readmemh and $readmemb?
You can put files anywhere, but if you don't specify the
full path, your current directory will be the project
directory (for XST). You can specify relative paths
like "../source/memory.hex" (note the UNIX-style forward
slashes).
I would suggest finding a good Verilog reference book.
I use the Verilog Golden Reference Guide from Doulos.
Generally system functions (starting with "$") are
not synthesizable with the exception of those like
$readmemh and $readmemb when used to initialize memory.
Generally speaking the synthesized project has no "system"
to provide these functions, so only those that run during
synthesis will be synthesizable. Anything that might
run in the synthesized project after synthesis, like
writing a file from data collected while running the
project, will not be synthesized.
Regards,
Gabor
|
|
0
|
|
|
|
Reply
|
gabor
|
5/28/2009 1:23:46 PM
|
|
|
1 Replies
776 Views
(page loaded in 0.036 seconds)
|