Skip to content

Support up to N memory models for verification components #462

@umarcor

Description

@umarcor

I have a C application that allocates some memory space. Then, GHDL is started inside the application, so the allocated space is available to the simulation. In the testbench, I execute buffer.init() in order to initialize a shared variable of type array of integers with the address pointer provided by the C application. From there on, I can read/write in the application memory space with buffer.get(y) and buffer.set(y, to_integer(signed(o))).

I would like to integrate that with an AXI4 Master UUT, using VUnit's verification components. I have successfully instantiated axi_write_slave and axi_read_slave. I have created a constant of type memory_t, then a signal buf : buffer_t := allocate(memory, 1024) and last constant axi_slave : axi_slave_t := new_axi_slave(memory => memory).

So far everything works as expected, but I need to copy all the data from buffer to memory/buf before starting the UUT and copy it back when the task is done. On the one hand, I am allocating twice the required space. On the other hand, it is not easy to use the shared memory for synchronization between the software and the UUT, since it is effectively duplicated, so coherency is a problem.

Now, I would like to associate axi_slave to the buffer I have already allocated, instead of requiring buf. I.e., I want the verification components to read from and write to the application memory space directly. Is it possible to wrap my buffer.get and buffer.set functions so that the verification components can use them directly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions