## Email

Recipients email * (separate multiple addresses with commas)

Message *

 Send yourself a copy

## Subscribe

Intro copy of the newsletter section here, some intro copy of the newsletter. Instruction of how to subscribe to this newsletter.

First Name *

Last Name *

Email *

Company / Institution *

 Send Yourself A Copy

# passing 2-dimension array in DPI-SC

Last post Tue, Jun 12 2012 1:34 AM by vjain419. 1 replies.
 Started by ravi999 21 May 2012 06:20 AM. Topic has 1 replies and 3725 views
• #### Mon, May 21 2012 6:20 AM

• ravi999
• Joined on Wed, Apr 1 2009
• Posts 6
• Points 60
passing 2-dimension array in DPI-SC
 HiI am able to pass one bit vector as an argument for DPI-SC.test.v:module test;import "DPI-SC" function int c_func(input bit [7:0] data);bit [7:0] data;int j;initial begin data=8'h1; j=c_func(data);endendmodulecode.cpp#include using namespace std;#define NCSC_INCLUDE_TASK_CALLS#include "systemc.h"#include "svdpi.h"int c_func(svBitVecVal h) { cout<
• Post Points: 20
• #### Tue, Jun 12 2012 1:34 AM

• vjain419
• Joined on Tue, Jun 12 2012
• Posts 1
• Points 5
Re: passing 2-dimension array in DPI-SC
 may be you will get some help from this example program main;            import "DPI-C" function void get_nums(output logic [15:0] nums[10]);            logic [15:0] nums[10];            initial begin                get_nums(nums);                foreach (nums[i]) \$display(i,nums[i]);            end       endprogram #include "svdpi.h"       void fib(svLogicVecVal nums[10]) {           int i;           for (i=0; i<10; i++) {               nums[i] = i ;           }       }  Regards,Vinay
• Post Points: 5
###### Sort Posts: Oldest to newest Newest to oldest
 Started by ravi999 at 21 May 2012 06:20 AM. Topic has 1 replies.