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.

[SOLVED] how to initialize an array with zeros in verilog

Status
Not open for further replies.

Mina Magdy

Member level 3
Member level 3
Joined
Jun 19, 2012
Messages
67
Helped
6
Reputation
12
Reaction score
5
Trophy points
1,288
Location
Cairo, Egypt
Visit site
Activity points
1,742
please i want to know how to initialize an array with zeros case when i do this

for(i=0;i<9000;i=i+1)
begin
parity=0;
end


it gives me this Loop count limit exceeded. Condition is never false.
please help thanks in advance
 

To get around this specific limitation do:

Right mouse button on "Synthesize - XST" ==> Process Properties => Synthesis Options => Other XST Command Line Options => and then add this option: "-loop_iteration_limit 12345"

And don't forget to put it in an initial block, so something like:


Code Verilog - [expand]
1
2
3
4
5
6
integer i;
initial begin
    for (i=0;i<9000;i=i+1) begin
        parity[i]=0;
    end
end


And this is all assuming that you chose this particular method because there is no other cleaner method to initialize it. And I am also assuming that when you say initialize, you actually mean initialize. Some other ideas as inspiration:


Code Verilog - [expand]
1
2
reg [8999:0] parity = 0; // This will also initialize it with zero's, no loop required
reg [8999:0] more_parity = {4500{2'b10}}; // initialize with 101010.... pattern



This will synthesize just fine, and will fill those flip-flops with the required initial values.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top