| |
|
|
 |

Many of you already received communications about the move of the Cadence user community into cadence.com. And many of you have already joined, with over 4000 registrations in the first two weeks.The new Cadence Community enhances the ability of Cadence users to connect and collaborate. In addition to moving the community into cadence.com -- enabling single sign-on for community, Sourcelink and Cadence events -- the new site is organized around nine technology segments, giving you easy access to product information, training, forums and blogs. Some of the new features include: - Ability to respond to posts via e-mail
- Technology-specific blogs
- Latest Web 2.0 social networking capabilities
- Public profile options
- Private messaging
- Friends lists
Visit the new Cadence Community today at www.cadence.com/community and join the discussions! Registration note: Due to the scope of the enhancements and the new SSO registration system, we were not able to migrate existing cdnusers.org member accounts. So new registrations are required, but this enables a broader set of functionality we think you'll enjoy. Forum note: Under the guidance of forum moderators, we have taken the 20+ cdnusers.org forums and consolidated them into 11 forums on the new site. Posts have been brought over so you can leverage that posting history. CDNusers forums will be set to read only starting 7/30, and cdnusers.org will be redirected to the new community on 8/4.Best regards, Mike and Tom Michael A. Catrambone - Steering Committee Chairman Distinguished Engineer PCB/Mechanical UTStarcom, Inc. Tom Diederich Cadence Community Manager
|
|
|
| Home |
 |
 |
 |
|
 |
 |
Posting to forums is available to community members only. Login or Register |
|
| Author |
Messages |
|
bennik Posts: 4 Online:
 |
| 12/07/2006 7:41 AM |
|
Hi,
I'm trying to compile C file that contain the following:
#include #include #include #include "veriuser.h" #include "acc_user.h" .... ....
s_tfcell veriusertfs[] = { //{userfunction, 0, 0, fio_size32, myfclose, 0, "$myfclose"}, {usertask, 0, 0, 0, myfopen, 0, "$myfopen"}, {usertask, 0, 0, 0, myfclose, 0, "$myfclose"}, ... ... {0} // };
the problem is that the compiler (gcc c-file.c -c -I /include -o c-file.o) didn't recognize s_tfcell veriusertfs[], I have get the following message:
//372: parse error before "veriusertfs" //374: warning: braces around scalar initializer //374: warning: (near initialization for `veriusertfsΎ]') //374: `usertask' undeclared here (not in a function) //374: initializer element is not constant //374: (near initialization for `veriusertfsΎ]') //374: warning: excess elements in scalar initializer //374: warning: (near initialization for `veriusertfsΎ]') //374: warning: excess elements in scalar initializer ... ...
All the include files are exist, what I'm missing?? are the include files too old??
Thanks, Benni. |
|
|
|
stephenh Posts: 77 Online:
 |
| 12/08/2006 3:58 AM |
|
Hi Benni.
Two points I noticed, though maybe you found these already...
1) You should probably include "vxl_veriuser.h" which defines the s_tfcell struct. 2) On you gcc line, make sure you have "-I `ncroot`/tools/include" in order to search the IUS include directory.
If you want to test the sanity of your Unix environment, you could also try compiling one of the example PLI applications that come with IUS. Look in the `ncroot`/tools/examples/pli directory and follow the README files there.
Steve.
|
|
Steve H. |
|
bennik Posts: 4 Online:
 |
| 12/10/2006 12:56 AM |
|
Thank you I forgot to inclode "vxl_veriuser.h". Now the C file is compiled but I don't know how to do the link to C function, my C file is:
int myfopen() //myfopen("./filename",FILE *stream),return 0; { char *filename; FILE *fp; acc_initialize(); //filename = (char*)(int)acc_fetch_tfarg(1); filename = tf_getcstringp(1); fp = fopen(filename, "r" ); if(fp) { tf_putp(2, (int)(fp));//return the fp acc_close(); if(DEBUG) io_printf("open the %s success!\n",filename); tf_putp(ARG_RET, true); //return the true } else { acc_close(); if(DEBUG) io_printf("open the %s fail!\n",filename); tf_putp(ARG_RET, false); } return 0; }
my SV code for using the C file is: initial begin integer fp; $myfopen("./script.txt",fp); .... end
I tried to use the DPI-C declaration as the followin: import "DPI-C" function myfopen(input char filename, output integer FILE); import "DPI-C" function myfopen(input char "./script.txt", output integer FILE); import "DPI-C" context function myfopen(input char "./script.txt", output integer FILE); import "DPI-C" function int myfopen();
and more but I have some cpmpilation error. Do you have any idea what I should do?
Thanks in advanced, Benni. |
|
|
|
bennik Posts: 4 Online:
 |
| 12/10/2006 1:23 AM |
|
sorry, "myopen(...)" is task and I changed the import accordingly but it still not work
import "DPI-C" context task myfopen(input string "./script.txt", output FILE fp); | ncvlog: *E,EXPIDN (../monitor/mon_top.sv,48|65): expecting an identifier Α.2]Α.8]Α.9(IEEE)]. import "DPI-C" context task myfopen(input string "./script.txt", output FILE fp); | ncvlog: *E,EXP1RD (../monitor/mon_top.sv,48|73): expecting at least one register variable Α.2.2(IEEE)]. import "DPI-C" context task myfopen(input string "./script.txt", output FILE fp); | ncvlog: *E,SVNOTY (../monitor/mon_top.sv,48|78): Syntactically this identifier appears to begin a datatype but it does not refer to a visible datatype in the current scope. import "DPI-C" context task myfopen(input string "./script.txt", output FILE fp); | ncvlog: *E,EXPCORP (../monitor/mon_top.sv,48|81): Expecting a ',' or ')' [A.1.4(IEEE-2001)]. import "DPI-C" context task myfopen(input string "./script.txt", output FILE fp); | ncvlog: *E,EXPRPA (../monitor/mon_top.sv,48|81): expecting a right parenthesis (')') [A.2.6(IEEE)]. import "DPI-C" context task myfopen(input string "./script.txt", output FILE fp); | ncvlog: *E,EXPENM (../monitor/mon_top.sv,48|82): expecting the keyword 'endmodule' ⎘.1(IEEE)].
|
|
|
|
nitin_sharma Posts: 12 Online:
 |
| 12/10/2006 8:30 AM |
|
HI Benni
It is not clear to me whether you are trying to use PLI or DPI. If you want to use DPI, you do not need to include any vxl_veriuser.h files and do not need to code it like a PLI method. While using DPI, simply code up your C function as you would as if you were calling that function from within C. Then you put your import DPI-C calls in the verilog/system verilog code and use as if they are verilog/system verilog task. You do not need to use $myopenfunc instead use myopenfunc.
Also while using DPI, use the following declaration: import "DPI-C" function int myfopen (string filename); (I am not sure if NC supports string as argument presently)
Nitin |
|
|
|
bennik Posts: 4 Online:
 |
| 12/11/2006 12:23 AM |
|
Sorry it's my mistake I confused between PLI and DPI. of course I want to use PLI. I compiled the C file by: gcc open_cmd.c -c -I/include -o open_cmd.o ld -G open_cmd.o -o libpli.so
and I get the following errors
Elaborating the design hierarchy: $myfopen("./script.txt",fp); | ncelab: *W,MISSYST (../monitor/mon_top.sv,51|7): Unrecognized system task or function (did not match built-in or user-defined names) ΐ.7.4(IEEE Std 1364-2001)]. If item was defined in a shared-object library, the problem could be: ld.so.1: ncelab: fatal: libvpi.so: open failed: No such file or directory ld.so.1: ncelab: fatal: libpli.so: open failed: No such file or directory. while (!$myfeof(fp)) | ncelab: *W,MISSYST (../monitor/mon_top.sv,52|14): Unrecognized system task or function (did not match built-in or user-defined names) ΐ.7.4(IEEE Std 1364-2001)]. $myfgets(inline_vari,LINE_SIZE,fp); | ncelab: *W,MISSYST (../monitor/mon_top.sv,54|8): Unrecognized system task or function (did not match built-in or user-defined names) ΐ.7.4(IEEE Std 1364-2001)]. $mystokstr(inline_vari,cmd_str); | ncelab: *W,MISSYST (../monitor/mon_top.sv,55|10): Unrecognized system task or function (did not match built-in or user-defined names) ΐ.7.4(IEEE Std 1364-2001)]. $mystokdec(inline_vari,int_int); | ncelab: *W,MISSYST (../monitor/mon_top.sv,59|13): Unrecognized system task or function (did not match built-in or user-defined names) ΐ.7.4(IEEE Std 1364-2001)]. $mystokint(inline_vari,int_int); | ncelab: *W,MISSYST (../monitor/mon_top.sv,64|13): Unrecognized system task or function (did not match built-in or user-defined names) ΐ.7.4(IEEE Std 1364-2001)]. $mystokhex(inline_vari,hex1,hex2); | ncelab: *W,MISSYST (../monitor/mon_top.sv,69|16): Unrecognized system task or function (did not match built-in or user-defined names) ΐ.7.4(IEEE Std 1364-2001)]. $myfclose(fp); | ncelab: *W,MISSYST (../monitor/mon_top.sv,94|8): Unrecognized system task or function (did not match built-in or user-defined names) ΐ.7.4(IEEE Std 1364-2001)]. ... ... Writing initial simulation snapshot: worklib.sv_utils:sv ncverilog: *E,SIMERR: Error during Simulation (status 1), exiting.
|
|
|
|
|
Posting to forums is available to community members only. Login or Register |
|
|
|
ActiveForums 3.6
|
|
|
|
 |
| |
|
|
|