Subject: Re: ISSUE:DirectC:DirectC i/f should support mechanism for calling Verilog task/function from a DirectC application
From: Swapnajit Mittra (mittra@juno.com)
Date: Wed Oct 23 2002 - 01:15:03 PDT
On Mon, 21 Oct 2002 09:55:02 -0700 (PDT) "Kevin Cameron x3251"
<Kevin.Cameron@nsc.com> writes:
> > From owner-sv-cc@server.eda.org Sat Oct 19 20:56:07 2002
> > X-Original-From: "Swapnajit Mittra" <mittra@juno.com>
> > To: sv-cc@server.eda.org
> > cc: mittra@juno.com
> > Subject: ISSUE:DirectC:DirectC i/f should support mechanism for
> calling
> > Verilog task/function from a DirectC application
> > From: "Swapnajit Mittra" <mittra@juno.com>
> >
> > ISSUE:DirectC:DirectC i/f should support mechanism
> > for calling Verilog task/function from a DirectC
> > application
> >
> > [...]
> >
> > o The called Verilog task or function can be specified from
> > the DirectC domain by Verilog full pathname. (This will
> > allow us to call a specific Verilog task or function in
> > the design hierarchy. We need to think about the actual
> > syntax of this).
>
> I would suggest considering module instances as being like class
> instances in C++. You could get the handle to a module instance
> using the standard PLI mechanisms and then use it in C++ as a
> class instance pointer with the tasks and functions of the module
> as virtual functions.
>
> Doing this stuff in C rather than C++ is awkward because C doesn't
> support overloading of names, so you would have to come up with
> some name mangling scheme.
>
> Kev.
>
> PS:
> Previous post - http://www.eda.org/sv-cc/hm/0005.html
>
Kevin,
I like what you are proposing. I have few concerns:
o I believe we should not depend on a PLI feature
in order to implement a DirectC mechanism. IMHO,
these two mechanisms, as far as possible, should be
independent of each other.
o If we need to get a handle to a module instance etc.,
that may confuse people who only plan to use the
direct access.
o As you have mentioned, we can not ignore people
who will be using only C. (Let us not give them the
impression that this is actually Direct"C++" :-).
May I propose this:
DirectC will provide a built-in function (for both
direct and abstract access)
dc_call_vlog_tf(&return_val, "verilog_full_pathname");
The function dc_call_vlog_tf() will essentially implement
your scheme, but will hide the details from the end user.
The &return_val will be a NULL pointer for tasks.
Comments ?
-- Swapnajit Mittra Project VeriPage ::: http://www.angelfire.com/ca/verilog________________________________________________________________ Sign Up for Juno Platinum Internet Access Today Only $9.95 per month! Visit www.juno.com
This archive was generated by hypermail 2b28 : Wed Oct 23 2002 - 01:21:03 PDT