Home > Community > Forums > Functional Verification Shared Code > c interface with specman

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 c interface with specman 

Last post Wed, Apr 4 2007 8:56 PM by archive. 0 replies.
Started by archive 04 Apr 2007 08:56 PM. Topic has 0 replies and 1697 views
Page 1 of 1 (1 items)
Sort Posts:
  • Wed, Apr 4 2007 8:56 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,910
    c interface with specman Reply

    Hi,

     I need to call a  c function form specman . I had followed the below steps.


    File vb_pattern.e
    ---------------------------------

     
    struct vb_pattern_s
    {
      %data_in_ch0 : uint (bits : 4);   // data on channel 0
      %data_in_ch1 : uint (bits : 4);   // data on channed 1
      %data_in_ch2 : uint (bits : 4);   // data on channel 2
      %mode : uint (bits : 1);          // mode 
      %enable : uint (bits : 1);        // enable

    };

    C export vb_pattern_s;

    ------

    file  x_output_bfm.e
    --------------------------------------------

    check_patterns()@clk_e is
    {

      ...
     exp_viterbi_op();

    }

    routine exp_viterbi_op() is C routine viterbi_c_func;

    ---- EOF------

    X.c
    #include "vb_pattern.h"

    void viterbi_c_func ()
    {
     SN_TYPE(vb_pattern_s) vb_packet;
     SN_TYPE(mode)   mode;
     vb_packet = SN_SYS->ops
     mode = vb_packet->mode;
     printf("\n Printing from C environment MODE = %h \n", mode);

    }


    ------------------- EOF----

    x_top.e
    ------------
    import  tb/vb_pattern.e;
    import  tb/x_input_bfm.e;
    import  tb/x_output_bfm.e;
    import  tb/x_cover_dut.e;
    import  tb/x_env.e;




    I  did the following comand


    >> sn_compile.sh -h_only x_top.e -o vb_pattern.h
    >> gcc -c viterbi.c -o viterbi.o

    I am getting the following error


    viterbi.c: In function `viterbi_c_func':
    viterbi.c:6: error: `t__mode' undeclared (first use in this function)
    viterbi.c:6: error: (Each undeclared identifier is reported only once
    viterbi.c:6: error: for each function it appears in.)
    viterbi.c:6: error: syntax error before "mode"
    viterbi.c:7: error: `mode' undeclared (first use in this function)


    Please help me resolve this.

    Kesav



      








     


    Originally posted in cdnusers.org by kesava
    • Post Points: 5
Page 1 of 1 (1 items)
Sort Posts:
Started by archive at 04 Apr 2007 08:56 PM. Topic has 0 replies.