Jump to content

calling systemc wih mexFunction

Recommended Posts



We have been experimenting with wrapping SystemC sim with mexFunction so that it can be called within Matlab. What we find is that repeat calling of the mexFunction causes memory leak as if something was not cleaned up even each SystemC object is meticulaously deleted. Does anyone has experience with calling SystemC from Matlab? Was the memory leak issue encountered? Is there a solution?




Share this post

Link to post
Share on other sites

Hi Sam. 


The Accellera implementation of the SystemC simulator is intended to run to completion. 

At the end of a simulation, the simulation program exits. Thats why there is no total clean-up of the simulation kernel at the end of a simulation. 


We use SystemC in combination with Simulink, and we observed the same issue when starting a simulation a second time without closing and reopening Matlab/Simulink. Our solution: ignore it and restart Matlab from time to time. The leaks are not that much and we have a lot of memory :).




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