---
+ Post New Thread
Results 1 to 8 of 8
  1. #1
    Member level 3
    Points: 1,278, Level: 8
    sameh_yassin99's Avatar
    Join Date
    Feb 2010
    Location
    Egypt
    Posts
    60
    Helped
    13 / 13
    Points
    1,278
    Level
    8

    Matlab and Modelsim Cosimulation

    Hello everyone,
    I need to run the following Mathworks tutorial.
    Simulink and ModelSim Tutorial :: Linking Simulink to ModelSim (Link for ModelSim)
    The tutorial is simple. It simulates an inverter written in vhdl and compiled by modelsim, and the test patterns are generated using simulink.

    Most of the tutorial is easy except the part of making "socket" connection between matlab and simulink.
    I have the following error
    HDL Cosimulation Block Error
    Error reported by S-function 'shdlcosim' in 'DFE_Channel/HDL Cosimulation/S-Function':
    Handshaking with the server failed - Server was NOT an 'HDL Link' server, change the port.
    Please, I need to know how to solve this error if anyone faced it before.

    regards,
    S. Yassin

    •   Alt31st October 2011, 16:50

      advertising

        
       

  2. #2
    Advanced Member level 5
    Points: 24,623, Level: 38

    Join Date
    Jun 2010
    Posts
    4,731
    Helped
    1311 / 1311
    Points
    24,623
    Level
    38

    Re: Matlab and Modelsim Cosimulation

    first of all, you need at least the PE version of modelsim.

    Secondly, you have to start the simulation using the vsimulink command in modesim, instead of vsim.



  3. #3
    Member level 3
    Points: 1,278, Level: 8
    sameh_yassin99's Avatar
    Join Date
    Feb 2010
    Location
    Egypt
    Posts
    60
    Helped
    13 / 13
    Points
    1,278
    Level
    8

    Re: Matlab and Modelsim Cosimulation

    Hello,

    I solved the problem. I had the error because I didn't start the Modelsim simulation in the right way. I selected the following menu:
    simulation-> start simulation
    instead I used exactly what is written in the matlab help
    Code:
     ModelSim>vsimulink work.inverter
    Thats all. By the way I'm using modelsim SE 6.3c and Matlab 2011a.

    Thanks


    1 members found this post helpful.

    •   Alt1st November 2011, 09:01

      advertising

        
       

  4. #4
    Advanced Member level 5
    Points: 24,623, Level: 38

    Join Date
    Jun 2010
    Posts
    4,731
    Helped
    1311 / 1311
    Points
    24,623
    Level
    38

    Re: Matlab and Modelsim Cosimulation

    thats is a very old version of modelsim. You can get updates for free.



  5. #5
    Member level 3
    Points: 1,278, Level: 8
    sameh_yassin99's Avatar
    Join Date
    Feb 2010
    Location
    Egypt
    Posts
    60
    Helped
    13 / 13
    Points
    1,278
    Level
    8

    Re: Matlab and Modelsim Cosimulation

    Hello TrickyDicky,
    I'm using ModelSim 10.0c usually. However, I had an error stating that I should use one of ModeSim versions 6.3 or 6.4 or 6.5 only.



  6. #6
    Advanced Member level 5
    Points: 24,623, Level: 38

    Join Date
    Jun 2010
    Posts
    4,731
    Helped
    1311 / 1311
    Points
    24,623
    Level
    38

    Re: Matlab and Modelsim Cosimulation

    I have used 2011a with Modelsim 10.0b and 6.6c without any problems.


    1 members found this post helpful.

  7. #7
    Member level 3
    Points: 1,278, Level: 8
    sameh_yassin99's Avatar
    Join Date
    Feb 2010
    Location
    Egypt
    Posts
    60
    Helped
    13 / 13
    Points
    1,278
    Level
    8

    Re: Matlab and Modelsim Cosimulation

    Hello,

    I will try to use ModelSim 10.0 again. When I used Modelsim 10.0c it was the free student version. The error was something talking about "case statement" inside one m-file simulink.
    I entered the m-file and I found something like
    Code:
    case(6.3) 
    {....}
    case(6.4) 
    {.....}
    case (6.5)
    {.....}
    Therefore I used the older Modelsim and now it is working fine :)

    thanks



  8. #8
    Newbie level 1
    Points: 13, Level: 1

    Join Date
    Sep 2014
    Posts
    1
    Helped
    0 / 0
    Points
    13
    Level
    1

    Re: Matlab and Modelsim Cosimulation

    Hello everyone,

    I need to run the same tutorial of inverter but I could not solve it because the "vsimulink" command is invalid.
    I have the following error
    # invalid command name "vsimulink"
    In other side, "vsim" command is valid but I hadn't obtained a result and the following message of error will be appeared:
    Error reported by S-function 'shdlcosim' in 'inverter/inverter/S-Function':
    Handshaking with the server failed - Server was NOT an 'HDL Link' server, change the port
    By the way I'm using modelsim PE Student Edition 10.3c and Matlab 2013a.
    Please, I need to know how to solve this error if you faced it before.

    regards,
    Zou. Lil

    Quote Originally Posted by sameh_yassin99 View Post
    Hello everyone,
    I need to run the following Mathworks tutorial.
    Simulink and ModelSim Tutorial :: Linking Simulink to ModelSim (Link for ModelSim)
    The tutorial is simple. It simulates an inverter written in vhdl and compiled by modelsim, and the test patterns are generated using simulink.

    Most of the tutorial is easy except the part of making "socket" connection between matlab and simulink.
    I have the following error


    Please, I need to know how to solve this error if anyone faced it before.

    regards,
    S. Yassin



+ Post New Thread
Please login