Portable TCP/IP socket library

Discussion in 'VHDL' started by Amal, Jun 5, 2007.

  1. Amal

    Amal Guest

    Anyone has a good pointer to a portable (Windows, *nix) TCP/IP socket
    library that can be used with VHDL FLI, Verilog PLI/VPI, SystemC, or
    SystemVerilog DPI?

    -- Amal
     
    Amal, Jun 5, 2007
    #1
    1. Advertising

  2. Amal

    Guest

    On Jun 5, 11:10 am, Amal <> wrote:
    > Anyone has a good pointer to a portable (Windows, *nix) TCP/IP socket
    > library that can be used with VHDL FLI, Verilog PLI/VPI, SystemC, or
    > SystemVerilog DPI?


    Have you tried just using the common (BSD-derived I suppose) socket
    calls and found them not to work on both platforms, or somehow
    incompatible with the simulation interfaces you mention?

    I would think that if you just avoid vendor/os -specific extensions
    you should be fine.
     
    , Jun 5, 2007
    #2
    1. Advertising

  3. Amal

    HT-Lab Guest

    <> wrote in message
    news:...
    > On Jun 5, 11:10 am, Amal <> wrote:
    >> Anyone has a good pointer to a portable (Windows, *nix) TCP/IP socket
    >> library that can be used with VHDL FLI, Verilog PLI/VPI, SystemC, or
    >> SystemVerilog DPI?

    >
    > Have you tried just using the common (BSD-derived I suppose) socket
    > calls and found them not to work on both platforms, or somehow
    > incompatible with the simulation interfaces you mention?
    >
    > I would think that if you just avoid vendor/os -specific extensions
    > you should be fine.
    >


    I believe that you should pay attention to OS specific examples, thus if
    you use sockets on Modelsim's FLI running under windows then follow the
    winsock examples, if you are running SystemC under Cygwin then follow the
    libc/bsd coding style. In general they are very close and pragmas can make
    your code portable. These example might help you out:

    http://www.ht-lab.com/howto/fli_demo/uart2fli/uart2fli.htm
    http://www.ht-lab.com/howto/fli_demo/ferndemo/socket.html

    Hans.
    www.ht-lab.com
     
    HT-Lab, Jun 5, 2007
    #3
  4. Amal

    EdA Guest

    On Jun 5, 12:10 pm, Amal <> wrote:
    > Anyone has a good pointer to a portable (Windows, *nix) TCP/IP socket
    > library that can be used with VHDL FLI, Verilog PLI/VPI, SystemC, or
    > SystemVerilog DPI?


    Amal,

    Try this link: http://www.sutherland-hdl.com/pli_book_examples.html

    "David Roberts, of Cadence Design Systems, has provided a great
    example using sockets to communicate between a PLI application and an
    independently running C program. David has provided this example with
    no restrictions on usage, under the GNU freeware license agreement."

    Allegedly it works on Linux and Windows.

    Enjoy,
    /Ed
     
    EdA, Jun 6, 2007
    #4
  5. Amal

    Guest

    On Jun 6, 7:24 am, EdA <> wrote:

    > Try this link:http://www.sutherland-hdl.com/pli_book_examples.html
    >
    > "David Roberts, of Cadence Design Systems, has provided a great
    > example using sockets to communicate between a PLI application and an
    > independently running C program. David has provided this example with
    > no restrictions on usage, under the GNU freeware license agreement."
    >
    > Allegedly it works on Linux and Windows.


    Yeah, and it's pretty simple. I did something like that a few years
    back - I'd built a soft-core processor (at that point only in verilog
    simulation), and wanted to write a debug monitor that could run on
    it. So I grafted in some registers to make a little "dummy uart"
    device that some pli code would monitor, and proxy the data to/from a
    local tcp socket. Then I connected to that socket with hyperterminal
    and "used" my simulated computer.
     
    , Jun 6, 2007
    #5
  6. Amal

    Amal Guest

    On Jun 6, 8:24 am, EdA <> wrote:
    > On Jun 5, 12:10 pm, Amal <> wrote:
    >
    > > Anyone has a good pointer to a portable (Windows, *nix) TCP/IP socket
    > > library that can be used with VHDL FLI, Verilog PLI/VPI, SystemC, or
    > > SystemVerilog DPI?

    >
    > Amal,
    >
    > Try this link:http://www.sutherland-hdl.com/pli_book_examples.html
    >
    > "David Roberts, of Cadence Design Systems, has provided a great
    > example using sockets to communicate between a PLI application and an
    > independently running C program. David has provided this example with
    > no restrictions on usage, under the GNU freeware license agreement."
    >
    > Allegedly it works on Linux and Windows.
    >
    > Enjoy,
    > /Ed


    Ed,

    I tried this library, but I am having problem with sending and
    receiving data. I am not sure if Modelsim is doing something wrong,
    but when I setup a server on the SystemVerilog side using DPI and send
    data through a TCL client, the server keeps on one line of data and
    keeps spitting out only the first line of data.

    I wonder if anyone else has used this example?

    -- Amal
     
    Amal, Jun 7, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eli Bendersky
    Replies:
    1
    Views:
    1,168
    Mike Treseler
    Mar 1, 2006
  2. Replies:
    7
    Views:
    920
  3. Tiger
    Replies:
    5
    Views:
    973
    Dave Thompson
    May 1, 2006
  4. Laszlo Nagy
    Replies:
    1
    Views:
    4,852
    Mark Wooding
    Jan 27, 2009
  5. Jean-Paul Calderone
    Replies:
    0
    Views:
    970
    Jean-Paul Calderone
    Jan 27, 2009
Loading...

Share This Page