First let me tell you my targeted intention with GHDL/co-sim: I want to do advanced verification of my large VHDL design in software with c++. So the idea is, I have the most top level synthesizeable design file: top.vhd, and there won't be any VHD testbench above it. That top.vhd will be written and read the data from its top pins by a software coroutine.
Alright so I went through a long route of building the gcc backend version of GHDL in Linux (Debian), ghdl is working.
My next thing is to run some starter example.
I went ahead and studied the shghdl example from this co-sim repo and decided that the proper elaboration route for me would be using gcc as entry point (Linking GHDL object files to C).
Which is great, which means its all working. However, printing from top VHD file is cool, but now I need to start doing the real scenario which for me is: actually start driving data to the input pins of top.vhd and reading data from output pins of top.vhd (in this current simple example that file is tb.vhd, in my case I plan it to be non-testbench type synthesizeable vhdl file)
Can I have some hint on how to do it? would be nice to have similar to shghdl but more practical example.
So am I supposed to send/receive data through the ghdl_main function, or what is the proper mechanism?
First let me tell you my targeted intention with GHDL/co-sim: I want to do advanced verification of my large VHDL design in software with c++. So the idea is, I have the most top level synthesizeable design file: top.vhd, and there won't be any VHD testbench above it. That top.vhd will be written and read the data from its top pins by a software coroutine.
Alright so I went through a long route of building the gcc backend version of GHDL in Linux (Debian), ghdl is working.
My next thing is to run some starter example. I went ahead and studied the shghdl example from this co-sim repo and decided that the proper elaboration route for me would be using gcc as entry point (Linking GHDL object files to C).
I do this:
And I get the output:
Which is great, which means its all working. However, printing from top VHD file is cool, but now I need to start doing the real scenario which for me is: actually start driving data to the input pins of top.vhd and reading data from output pins of top.vhd (in this current simple example that file is tb.vhd, in my case I plan it to be non-testbench type synthesizeable vhdl file)
Can I have some hint on how to do it? would be nice to have similar to shghdl but more practical example.
So am I supposed to send/receive data through the ghdl_main function, or what is the proper mechanism?