Jump to content

Memory Allocation In SystemC


Recommended Posts

Hi, 

I have to Allocate Memory for my data in SystemC.

We Use malloc in C Language and New in C++ to dynamically Allocate Memory. But today I have read that we cannot use New and Delete Operators in System C as they are not synthesizeable. Which command should I use for Memory Allocation in System C. Thanks.

Link to post
Share on other sites

Dynamic memory allocation in behavioural description is indeed not synthesizable, as there is no sensible mapping to digital hardware. You will have to use static memory allocation instead. Check the SystemC Synthesis Subset and the documentation of your HLS toolchain for details on how to write proper synthesizable code in SystemC.

Link to post
Share on other sites

Hi Maehne

But If I am defining Memory as SC_MODULE and using 4KB Memory Alignment for my data storage as I am reading the data from binary files. As I have to read from and store the respective output data in the Memory Module. Like I am confused How do i define the Memory Module using static allocation. Can You give me or refer to some example. That would be so nice of You. Thanks

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...