[SOLVED] how to convert 2 dimensional array vector into 1 dimensional array vector in verilog?

Status
Not open for further replies.

kapil86

Newbie level 4
Joined
Jul 9, 2010
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
india
Activity points
1,328
I have designed my code in system verilog (Modelsim) and instantiated 2 dimensional array vector, there it shows no problem in compilation and simulation but for synthesizing (Xilinx) the code it shows error(illegal reference to net array) for 2 d array vector...
so I would like to convert this to 1 d array vector...kindly provide me the same.
Please someone help me its urgent.
Thank you.
 

const int N = 10;
const int M = 15;

int Matrix [N][M];
int Vector [N*M];
int k = 0;

int main ()
{
//insert elements in Matrix here

for (int i = 0; i < N; i++)
for (int j = 0; i < M; j++, k++)
V[k] = M [j];


int elem;
cin >> elem;

for (int k = 0; k < M*N; k++)
if (V[k] == elem)
break;

if (k < M*N)
cout << V[k] << endl;
else
cout << "No item founded\n";

return 0;
}

I hope this will work
 

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