P
Peter Riocreux
Guest
I have a PLI routine where the return size varies with the values of
the parameters used on the instance of the function. I want to check
(in my check function) that the size of reg being assigned into is the
same as the size I want to return.
I haven't found any documentation, either shipped with the simulators
or on the web or Google on how one uses acc_set_value to return
function values. I have been working on the assumption that it is by
using tfarg index 0. Is this right? If so, can this be made also to
work on XL which, AFAICT gives acc_handle_tfarg(0) == 0.
I can't make sure the size is right with a registered function to
return the size (in XL and ncverilog) as you don't get the parameter
that a function was instantiated with in that phase in ncverilog and
therefore I cannot determine what the size will be. Also, my
understanding is that this is a once-per-compile check for each
registered function, and I want to compare sizes on a
once-per-instance basis. Thus I have to set it to 0 in the
registration structure and this, I assume, is what results in it
reporting 32 with acc_fetch_size(acc_handle_tfarg(0))
So there are several questions in this:
1. How can I get the parameters in the size function and get that to
be done for each instance (probably impossible)
2. Can I modify what size the simulator thinks the return size is
later on, to correct it.
3. I can't work out how to get from the handle for the sysfunc or the
0th argument to the handle for the thing being assigned to - can
anyone help?
Pete
--
Peter Riocreux, Amulet Group, Dept. Computer Science, Manchester University,
Oxford Road, MANCHESTER, M13 9PL, UK. <http://www.cs.man.ac.uk/apt/>
the parameters used on the instance of the function. I want to check
(in my check function) that the size of reg being assigned into is the
same as the size I want to return.
I haven't found any documentation, either shipped with the simulators
or on the web or Google on how one uses acc_set_value to return
function values. I have been working on the assumption that it is by
using tfarg index 0. Is this right? If so, can this be made also to
work on XL which, AFAICT gives acc_handle_tfarg(0) == 0.
I can't make sure the size is right with a registered function to
return the size (in XL and ncverilog) as you don't get the parameter
that a function was instantiated with in that phase in ncverilog and
therefore I cannot determine what the size will be. Also, my
understanding is that this is a once-per-compile check for each
registered function, and I want to compare sizes on a
once-per-instance basis. Thus I have to set it to 0 in the
registration structure and this, I assume, is what results in it
reporting 32 with acc_fetch_size(acc_handle_tfarg(0))
So there are several questions in this:
1. How can I get the parameters in the size function and get that to
be done for each instance (probably impossible)
2. Can I modify what size the simulator thinks the return size is
later on, to correct it.
3. I can't work out how to get from the handle for the sysfunc or the
0th argument to the handle for the thing being assigned to - can
anyone help?
Pete
--
Peter Riocreux, Amulet Group, Dept. Computer Science, Manchester University,
Oxford Road, MANCHESTER, M13 9PL, UK. <http://www.cs.man.ac.uk/apt/>