Modelsim FLI/PLI microsoft C++ 5.0 
Author Message
 Modelsim FLI/PLI microsoft C++ 5.0

Hi Everyone
I hop someone can give me some help on simulating C preferable C++ with
Modelsim. I'm a hardware designer and have use Modelsim for VHDL for some
time know. I have learned the basic C syntax and have a little programming
experience in other languages. We wan't to include C++ code in simulation
so we can simulate the HW and FPGA code against the C code to be used on
the OEM HW modules. I know I have to make some simplified models of the
OEM HW in C or VHDL. I have found some details information in the Modelsim
EE 5.2 (for PC) reference manual page 463. My problem is I don't understand
the big picture and many of the terms?
What is the difference between FLI and PLI etc?
Can somebody help me with out or point me to litterature etc?
Hi Peter


Fri, 25 Jan 2002 03:00:00 GMT  
 Modelsim FLI/PLI microsoft C++ 5.0
Hi again
I have got the example to work.
Have anyone experience on how to use C++ objectoriented code with
modelsim? It may be best to keep all interface functions in plain C?

There are some small errors in the example and the documentation:
Here is what I did:

Environment variable:
MGC_WD = d:\hw\sar++\vhdl\c_lib
Copy foreignsp.c to above and called microsoft Visual C++ 5.0 from here:
    cl /c /I<modeltech path>\..\include foreignsp.c
    link /dll /export:in_params /export:out_params foreignsp.obj
    <modeltech path>\mtipli.lib

Note link export of all functions!

Foreignsp.vhd was copied to d:\hw\sar++\vhdl\test_c and changed:
--    attribute foreign of in_params : procedure is "in_params test.so";
attribute foreign of in_params : procedure is "in_params foreignsp.dll";
--   attribute foreign of out_params : procedure is "out_params test.so";
attribute foreign of out_params : procedure is "out_params foreignsp.dll";

In Modelsim EE:
change dir: d:\hw\sar++\vhdl\test_c
compile foreignsp.vhd
load test
view variables
view source
break point inside loop
run
..
run



Quote:
>Hi Everyone
>I hop someone can give me some help on simulating C preferable C++ with
>Modelsim. I'm a hardware designer and have use Modelsim for VHDL for
>some time know. I have learned the basic C syntax and have a little
>programming experience in other languages. We wan't to include C++ code
>in simulation so we can simulate the HW and FPGA code against the C code
>to be used on the OEM HW modules. I know I have to make some simplified
>models of the OEM HW in C or VHDL. I have found some details information
>in the Modelsim EE 5.2 (for PC) reference manual page 463. My problem is
>I don't understand the big picture and many of the terms?
>What is the difference between FLI and PLI etc?
>Can somebody help me with out or point me to litterature etc?
>Hi Peter



Fri, 25 Jan 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. FLI C++ Modelsim

2. simple examples of pli in C++ like a counter with Modelsim

3. Microsoft Assembler and Visual C++ 5.0

4. MODELSIM FLI PROBLEM

5. ModelSim FLI (Foreign Language Interface)

6. Modelsim: Control simulator via FLI

7. Problems with Modelsim′s FLI

8. Returning strings from ModelSim FLI functions

9. Modelsim FLI with gcc for Windows

10. VHDL FLI/Tcl in Modelsim and wait statement

11. PLI,FLI,FMI abstraction layer

 

 
Powered by phpBB® Forum Software