On 28/10/15 22:48, René Doß wrote:
Hallo Tristan,
Am 28.10.2015 um 20:59 schrieb Tristan Gingold:
On 28/10/15 19:45, René Doß wrote:
Hallo,
a record in the VHDL code and a struct in the C code.
I think inout is not nesesary. Both out parameter can be combined.
record <-----return struct
This can work. Now is the question, how is the correct syntax?
Yes, that's the best option: use a record and pass it as an inout
parameter.
Such a record is passed by reference, so you just have to declare the
corresponding C struct.
Tristan.
Ok you mean inout.
This is for me totally new. I used only in or out and only type int.
first what I need is like this in VHDL
record
value: std_logic_vector (31 downto 0); --
value
valid :
std_logic;
-- flag new valid value
ack:
std_logic; --
feedback value accepted
end record;
But I am unknowing how to handle std_logic in VHPI. I only use type
integer. For this I make cast.
The std_logic type is represented by a single byte. So the
corresponding C struct would be:
struct {
unsigned char value[32];
unsigned char valid;
unsigned char ack;
};
Tristan.
_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss