5

I am currently setting up a Cocotb based verification environment.

I just discovered that the example provided with Cocotb don't work in my case if using VHDL, because my simulator has no FLI (foreign language interface). I get the following message:

Error (suppressible): (vsim-FLI-3155) The FLI is not enabled in this version of ModelSim.

(I have the Altera Starter version of ModelSim, and indeed FLI is not included).

What surprises me is that the example works with Verilog. From my understanding, Verilog is not using FLI, but VPI.

Can someone explain me a little bit if the need for FLI is mandatory, and what feature can enable it in Cocotb?

Another question: What if my top is in Verilog, but the rest of my design in VHDL? Should it work?

Paebbels
  • 15,573
  • 13
  • 70
  • 139
user1654361
  • 359
  • 3
  • 11

1 Answers1

6

Cocotb has an internal abstraction layer (GPI) for FLI, VPI and VHPI. E.g. if you use Cocotb with GHDL, it's using just VPI. You can try to compile Cocotb against VPI instead of FLI and load the VPI library instead of the FLI library.

Paebbels
  • 15,573
  • 13
  • 70
  • 139
  • Thanks a lot for your answer. Unfortunately, I look to unexperienced to be sure I got your point. From quickstart guide, I read :The Cocotb testbench can execute against either implementation using VPI for Verilog and VHPI/FLI for VHDL, and my understanding is that because I aim for VHDL, VPI is not suitable. Am I correct ? Thanks! – user1654361 Nov 10 '16 at 08:23
  • The mentioned GHDL simulator is a VHDL simulator. VPI is simpler then VHPI, so GHDL implements just the VPI interface to interface it's internal data structures and simulation runtime. The mechanism to register callbacks, query model data and so on is quite similar. Of cause some VHDL specialties are not accessible. I think my Altera ModelSim works with Cocotb through FLI. It should have a FLI interface. – Paebbels Nov 11 '16 at 21:29
  • Thanks for your reply, it makes sense ! And you are right mentioning ModelSim has a FLI interface ... with some license (not mine that is hte Altera version). – user1654361 Nov 13 '16 at 11:40
  • Hmmm maybe my local ModelSim Altera Edition installation has spotted my QuestaSim license (provided via `LM_LICENSE_FILE`), so its offering FLI to me by using a "bigger license" :). – Paebbels Nov 13 '16 at 21:47