- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
how to initialize array registers
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-22-2011 11:30 PM
Hi,everyone.
I wanna initialize the array registers in verilog code for implementation, such as [25:0] data[31:0], how should I do? THX.
Solved! Go to Solution.
Re: how to initialize array registers
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-23-2011 06:48 PM - edited 12-31-2011 04:31 AM
Take a look at the thread below:
http://forums.xilinx.com/t5/Virtex-Family-FPGAs/Ho
syalk1120 wrote:
Hi,everyone.
I wanna initialize the array registers in verilog code for implementation, such as [25:0] data[31:0], how should I do? THX.
Jim
Re: how to initialize array registers
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-27-2011 10:10 PM
Thanks,Jim.I have added the initialize code,but it comes out such error "Address xx is invalid in call of system task $readmemb." whatever I changed the address,the error existed. what 's the matter with my code? my initialize code is as following:
reg[21:0] ram[31:0]
initial
begin
$readmemb("ram.mif",ram,0,31);
end
ps: the "ram.mif" is the binary code in 22*31bits.
Re: how to initialize array registers
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-28-2011 12:51 PM
Can you attach ram.mif file?
syalk1120 wrote:
Thanks,Jim.I have added the initialize code,but it comes out such error "Address xx is invalid in call of system task $readmemb." whatever I changed the address,the error existed. what 's the matter with my code? my initialize code is as following:
reg[21:0] ram[31:0]
initial
begin
$readmemb("ram.mif",ram,0,31);
end
ps: the "ram.mif" is the binary code in 22*31bits.
Jim
Re: how to initialize array registers
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-29-2011 12:57 AM
Thanks,Jim.
I have attached "ram.mif"file,pls check it.
Re: how to initialize array registers
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-31-2011 06:09 AM
The old parser in XST is very picky. You will need to get rid of unwanted white spaces, especially the "Tab" character, at the very end of the file. Make sure the ram.mif file has exactly 32 lines.
syalk1120 wrote:
Thanks,Jim.
I have attached "ram.mif"file,pls check it.
Jim
Re: how to initialize array registers
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-04-2012 12:12 AM
Thanks,Jim. It's done now.
Re: how to initialize array registers
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-06-2012 04:13 AM











