C
Charles Gardiner
Guest
Hi,
for a BFM I am trying to do the following:
I would like to have the USER test program running from a single initial task,
something like:
initial begin
$config1(...)
$config2(....)
$config3(....)
$config1(...)
$reada(...)
$writeb(...)
$reada(...)
$stop_test()
end
The problem is that most of the hardware operations behind the above are split
transactions. My idea was to define a c++ object containing a queue. Each call to
the above puts a new entry in the queue, the incoming responses are checked
against the scoreboard and the entries then removed. The outgoing requests would
essentially initiate a chain of callbacks (wait_for_grant(), start_xfer(),
emit_data(), generate_xfer_end() etc.) when each one gets shifted to the head of
the outbound queue
But where can I store the reference to the c++ root object? As far as I can see,
vpi_get/put_userdata() is only persistent across calls to the _same_ system
function. vpi_get/put_data() don't seem to be designed for accessing persistent
data at all. The way I read the spec, an interleaved (but possibly staggered)
sequence of vpi_put_data() and vpi_get_data() is expected which is no use to me
either.
Changing the above to:
initial begin
$wrapper(config1, ...)
$wrapper(config2, ....)
$wrapper(config3, ....)
$wrapper(config1, ...)
$wrapper(reada, ...)
$wrapper(writeb, ...)
$wrapper(reada, ...)
$wrapper(stop_test())
end
wouldn't really solve things either. Where does the VPI application handle live
when stop_test() has returned? The simulation itself and the hardware activity
initiated by the test sequence will still be running for quite a while. I'm
pretty sure (without having tried it) that having a C++ method looping until a
callback has fired will hang the simulator and I don't see any vpi synchronisation
methods for passing control back to the simulation with returning from a
user-defined system function.
Grateful for any helpfull suggestions.
for a BFM I am trying to do the following:
I would like to have the USER test program running from a single initial task,
something like:
initial begin
$config1(...)
$config2(....)
$config3(....)
$config1(...)
$reada(...)
$writeb(...)
$reada(...)
$stop_test()
end
The problem is that most of the hardware operations behind the above are split
transactions. My idea was to define a c++ object containing a queue. Each call to
the above puts a new entry in the queue, the incoming responses are checked
against the scoreboard and the entries then removed. The outgoing requests would
essentially initiate a chain of callbacks (wait_for_grant(), start_xfer(),
emit_data(), generate_xfer_end() etc.) when each one gets shifted to the head of
the outbound queue
But where can I store the reference to the c++ root object? As far as I can see,
vpi_get/put_userdata() is only persistent across calls to the _same_ system
function. vpi_get/put_data() don't seem to be designed for accessing persistent
data at all. The way I read the spec, an interleaved (but possibly staggered)
sequence of vpi_put_data() and vpi_get_data() is expected which is no use to me
either.
Changing the above to:
initial begin
$wrapper(config1, ...)
$wrapper(config2, ....)
$wrapper(config3, ....)
$wrapper(config1, ...)
$wrapper(reada, ...)
$wrapper(writeb, ...)
$wrapper(reada, ...)
$wrapper(stop_test())
end
wouldn't really solve things either. Where does the VPI application handle live
when stop_test() has returned? The simulation itself and the hardware activity
initiated by the test sequence will still be running for quite a while. I'm
pretty sure (without having tried it) that having a C++ method looping until a
callback has fired will hang the simulator and I don't see any vpi synchronisation
methods for passing control back to the simulation with returning from a
user-defined system function.
Grateful for any helpfull suggestions.