I'm playing with some cool stuff at work: interaction of VHDL and C. The Modelsim VHDL simulator supports an API called VHDL FLI (Foreign Language Interface), which allows to link a DLL to some model and control the simulation from it. C is a higher-level language than VHDL and its interaction with the outer world is far better, so it's a good way to write clever test-benches for designs.

The examples provided by Modeltech didn't really work. I had to tinker with env vars here, linker options there (it's all on Win2k, with MSVC++ 6) and got it to work eventually. Hey, it's the first time I actually built a Windows DLL and got it to do something useful ! It wasn't even hard :-)

This FLI API is pretty heavy and Modelsim provides only a reference. Though it's pretty good (explains exactly what each function does), it wouldn't hurt to get my hands on some docs with tutorial-like material. Also, it would be nice to link it to C++. Shouldn't be hard, they already took care of extern "C" clauses in their header files.

So, I'm going back to the fun (= work, whee !). Hopefully this will also turn useful for me, and I'll be able to build nice testbenches and simulation environments in C++.


Comments

comments powered by Disqus