Jump to content
Muds

Writing a System C wrapper for C++

Recommended Posts

Errr... SystemC is C++. No wrapper needed. SystemC is not a new computer language. It is a library of classes and a methodology for modeling hardware.

 

Not sure what you are really asking. Give an example of your C++ class and what you want to do with it.

Share this post


Link to post
Share on other sites

Hi,

   Thanks for the reply.

 

  I have a C++ reference model to be used in UVM Environment.

MY approach was to wrap/call the C++ model in System C and connect it to System Verilog using ML_CONNECT.

 

the C++ model looks like this

 

void ex_top (int size, complex<double>* data_in, complex<double> * data_out))

{

 

 

};

Share this post


Link to post
Share on other sites

size - config input.

data_in - Data input changes in every clock..

 

I would to buffer data at the input and output.

Any suggestions would be helpful.

 

thanks.

Share this post


Link to post
Share on other sites

All you need is not only SystemC wrapper but ML-UVM wrapper also,  since I assume your C++ model is working on transaction level , you just need to register your port with ML-Library and create a replica of your seq_item in C++ and register the same with ML-UVM lib , on the UVM side connnect the analysis port with the ML-register_SC-export and through the transaction.

 

About SystemC registry, create a SC_MODULE and SC_CTOR to get register with SystemC Lib, rest functional call be used intact.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×