How to use cosimulation on a windows machine?

Just tried the myhdl.vpi on my Windows machine. Did’nt get it to work.
First i used the following statement to run cosimulation:

return Cosimulation(“vvp -m ./myhdl.vpi unit_control.o”, CLKIN=CLKIN,RESET_N=RESET_N, FAULT_N=FAULT_N, CLK8M=CLK8M,PULSE8K=PULSE8K,RELAY=RELAY,S1=S1,S2=S2,S3=S3,S4=S4,S5=S5,S6=S6,S7=S7, y10=y10, y20=y20, y30=y30)

this worked in exactly the same project on my ubuntu Computer.

As the error statement was that it didnt find ./myhdl.vpi.vpi i left away the .vpi and still got a similar error.

I then used the following Statement:
return Cosimulation(“vvp -m myhdl unit_control.o”, CLKIN=CLKIN,RESET_N=RESET_N, FAULT_N=FAULT_N, CLK8M=CLK8M,PULSE8K=PULSE8K,RELAY=RELAY,S1=S1,S2=S2,S3=S3,S4=S4,S5=S5,S6=S6,S7=S7, y10=y10, y20=y20, y30=y30)

but still no success, the output is as follows:

myhdl: Unable to find a `myhdl.vpi' module on the search path.
tb_unit_control.v:21: Error: System task/function $from_myhdl() is not defined by any module.
tb_unit_control.v:27: Error: System task/function $to_myhdl() is not defined by any module.
unit_control.o: Program not runnable, 2 errors.
Traceback (most recent call last):
  File "C:\Users\Stefan\Desktop\svn\fpga_bx\13control\tb_unitcontrol.py", line 115, in <module>
    tb=tb_unitcontrol()
  File "C:\Users\Stefan\AppData\Local\Programs\Python\Python37\lib\site-packages\myhdl\_block.py", line 196, in __call__
    self.srcline, *args, **kwargs)
  File "C:\Users\Stefan\AppData\Local\Programs\Python\Python37\lib\site-packages\myhdl\_block.py", line 218, in __init__
    self.subs = _flatten(func(*args, **kwargs))
  File "C:\Users\Stefan\Desktop\svn\fpga_bx\13control\tb_unitcontrol.py", line 105, in tb_unitcontrol
    return instances() , unit_controlX()
  File "C:\Users\Stefan\AppData\Local\Programs\Python\Python37\lib\site-packages\myhdl\_block.py", line 196, in __call__
    self.srcline, *args, **kwargs)
  File "C:\Users\Stefan\AppData\Local\Programs\Python\Python37\lib\site-packages\myhdl\_block.py", line 218, in __init__
    self.subs = _flatten(func(*args, **kwargs))
  File "C:\Users\Stefan\Desktop\svn\fpga_bx\13control\tb_unitcontrol.py", line 101, in unit_controlX
    return Cosimulation("vvp -m myhdl unit_control.o", CLKIN=CLKIN,RESET_N=RESET_N, FAULT_N=FAULT_N, CLK8M=CLK8M,PULSE8K=PULSE8K,RELAY=RELAY,S1=S1,S2=S2,S3=S3,S4=S4,S5=S5,S6=S6,S7=S7, y10=y10, y20=y20, y30=y30)
  File "C:\Users\Stefan\AppData\Local\Programs\Python\Python37\lib\site-packages\myhdl\_Cosimulation.py", line 104, in __init__
    raise CosimulationError(_error.SimulationEnd)
myhdl.CosimulationError: Premature simulation end

Maybe there are other ideas how to address the myhdl.vpi which is located in the same Directory as all of the files involved (on a windows machine).

My bad …
the command to run is:
return Cosimulation("vvp -m ./myhdl unit_test.o", clkin=clkin, clk8k=clk8k, reset_n=reset_n, y10=y10, y20=y20, y30=y30)
So without the .vpi in the command - at least for Win10

As a path to the myhdl.vpi file (in windows 10) i have tried:
./myhdl.vpi (works on linux)
./myhdl
myhdl

None of those finds the file

But it looks like
.\myhdl is the way to go. But still the following error appears:

.\myhdl:`.\myhdl.vpi’ failed to open using dlopen() because:
%1 ist keine zul�ssige Win32-Anwendung.

My Windows 10 System is in german and it looks like the system was executing
.\myhdl.vpi (in the way it would execute any .exe file).

Any more ideas?
(I’m glad things work in linux)

Maybe it also depends on the version of Icarus.
Or for some reason it hast to be compiled on the actual machine.
It runs on my notebook where I compiled it.
When I get back from my visit to our daughter I will try it on my other development machine. But this will have to wait until Christmas …

Today I re-used that compiled myhdl.vpi on my development machine with a freshly installed iverilog:


@davekeeshan Maybe we can add myhdl.vpi in a Windows directory in the repository and check with Github Actions whether it is up to date

@josyb Sure, let me have a look