How to pass a string from PLI to verilog/vcs 
Author Message
 How to pass a string from PLI to verilog/vcs

_______________________________________________________________

void passString( )
{

static s_setval_delay   delay_s = {accNoDelay};
static s_setval_value   value_s = { accStringVal };
handle                  reg     = acc_handle_tfarg(1);

        value_s.value.str = "Hello world";
        delay_s.time.real = 0;

        acc_set_value (reg, &value_s, &delay_s );

Quote:
}

_______________________________________________________________

Comments:
1)      This is not what I want because I have to use:
            __________________________________________
                reg [120:1] STRING;

                intial begin
                        $passString( STRING );

                        $display( "%s", STRING );
                end
            __________________________________________

        and not
            __________________________________________

                        $display("%s", $passString );
            __________________________________________

2)      It is possible to get a handle to the function with:
                acc_handle_tfinst

3)      The acc_set_value can not handle something else than registers or UDPs.

4)      The function tf_putp can deliver only 32 bit integer this will make
        only 4 charackters.

6)      The use of io_mcdprintf is not recomanded because it will make things
        even more complicated.

7)      It looks like it is impossible to use tf_strdelputp to send back a value
        to the operator %s or even to a register maby you could find the problem:

______________________________________________________________________________
void try_to_send_text_from_a_function()
{
        char *textASCI = "text";
        char Hexa[2];
        char textHexa[31];
        textHexa[0] = '\0';

        while ( *textASCI != '\0' ) {
                sprintf( Hexa, "%x" , textASCI[0] );
                strcat( textHexa, Hexa);
                *textASCI++;
        }
        tf_strdelputp( 0,                       /* because it is a function */
                        32,                     /* the size of the string   */
                        'h',                    /* it is hexa decimal       */
                        textHexa,               /* The string               */
                        0,                      /* no delay                 */
                        2                       /* no effect on anything    */
                                );              

Quote:
}

__________________________________________________________________________________

8)      I hope OVI will define a rutine that can pass a string as a result
        of a userfunction.

Yehoshua

*********************************************************
* Yehoshua Shoshan      * tel   int + 46 8 727 3442     *
* ELLEMTEL Utv. AB      * ECN   851 3442                *
* Box 1505              * Fax   int + 46 8 647 8276     *
* S-125 25  Alvsjo      * Memo  ERI.EUA.EUASHO          *

*********************************************************



Sat, 11 Jan 1997 18:49:27 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How to pass a string from PLI to verilog/vcs

2. Verilog PLI and VCS

3. Verilog - PLI passing args.

4. Passing strings through registers to the PLI

5. PLI: How to change the string value in verilog from C

6. Controlling VCS from the PLI

7. VCS 5.2 PLI Capabilities?

8. how to convert pli written for vcs to modeltech

9. Passing strings to modules in Verilog

10. passing filename at runtime to synopsys vcs

11. Passing filename to $dumpfile with VCS

12. vcs compile and verilog coding

 

 
Powered by phpBB® Forum Software