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 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.
 

gaurav467

Banned
Joined
May 11, 2011
Messages
7
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
0
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top