> Le 2014-04-10 07:58, [email protected] a écrit : > > What about: > > function set_fbp (adde : screen_p) return boolean; > > attribute foreign of set_fbp : function is "VHPIDIRECT set_fb"; > > > > constant dummy : boolean := set_fbp (pixel); > > I don't see how it helps me or how it applies to my case : > a boolean is not a pointer, you're transmitting a access to C, > which is fine but how do you initialise this access ?
It could be initialised at declaration: shared variable pixel ... := new ... > two possibilities : with new, or with a function. > i don't see how you can declare an access and initialise > it to point to a shared variable :-/ Indeed, you cannot do that. > I have uploaded two examples that I've tried tonight: > > http://ygdes.com/GHDL/access_c/ : variable in C, accessed from GHDL > http://ygdes.com/GHDL/direct_c/ : shared variable in a package, > accessed by C with extern > > The last one is good but has one drawback : it > requires manipulations to extract the actual variable name > from objdump. I'd like to find a way to avoid that. I don't think you need objdump. The name of the symbol is: LIBRARY__PACKAGE__VARIABLE Tristan. _______________________________________________ Ghdl-discuss mailing list [email protected] https://mail.gna.org/listinfo/ghdl-discuss
