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.

accessing multiple elements in array at the same time vhdl

Status
Not open for further replies.

Mashahh

Newbie level 1
Joined
Dec 7, 2014
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
9
how can i access four elements from a 2d array or array of array in one process at the same time? in this sample, i am trying to access intg1 at the same time, the synthesis is taking for ever.


Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
tempo:= to_integer(unsigned('0' & img1(i1_1,j1_1)));
 
if i1_1-1>=0 then
tempo:=intg1(i1_1-1)(j1_1)+tempo;
 
end if;
if j1_1-1>=0 then
tempo:=intg1(i1_1)(j1_1-1)+tempo;
 
end if; 
if i1_1-1>=0 and j1_1-1>=0 then
tempo:=tempo-intg1(i1_1-1)(j1_1-1);
 
end if;

 
Last edited by a moderator:

This is bad code. What if all three of your if conditions are true? What will the value of tempo be? It will get four different values before the process ends. It's not clear what you want, but I think what you should use is an if-then-else NOT a bunch of independent ifs.

In fact, your first and last if statements kind of collide with each other. You need to step back and figure out what you're really trying to do here.
 

It's legal VHDL, you can write code like this if you feel a need to.

A different question is what it means in hardware terms.

- it prevents intg1 from being implemented in RAM, because you can't access multiple RAM addresses in one clock cycle. The array will be implemented in logic cell registers, depending on the array size, synthesis may be hard or impossible

- it sets up a cascade of several nonpipelined adders/substractactors and multiplexers. Maximum design speed will be respectively low

In fact, your first and last if statements kind of collide with each other.
The conditions aren't mutual exclusive, I assume intentionally.

You need to step back and figure out what you're really trying to do here.
Yes, preferably.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top