Hi YG, you might want to check vpiwrapper.c from the ghdlex code. It walks through the top hierarchy and creates property nodes for RPC fun. But this just works for simple logic signals, if I remember right. To avoid threading issues, you might want to call your C handler somewhere in a 'VHDL main loop' or introduce mutexes.
Cheers, - Martin >> >> an idea crossed my mind, and I seem to remember that GHDL has some >> cool >> features under the hood, so it might be useful :-) >> I'd like to automatically generate a VHDL wrapper for somewhat >> arbitrary designs. I can try to parse the top level's entity >> declaration >> but 1) GHDL already parses so why rewrite a parser ? >> and 2) the VHDL declaration might contain stuff defined in other >> files. >> >> This means that I would have to export the interface after >> elaboration, >> while interfacing with the program with some additional code, >> but how would I do ? Is VPI a good solution or overkill ? > > Can you sketch a little example ? Do you want to drive a design > from C ? In that case, VPI/VHPI would be the obvious solution > (although may not be available yet in ghdl). > > Tristan. > > _______________________________________________ > Ghdl-discuss mailing list > [email protected] > https://mail.gna.org/listinfo/ghdl-discuss > _______________________________________________ Ghdl-discuss mailing list [email protected] https://mail.gna.org/listinfo/ghdl-discuss
