newtosystemc Posted June 16, 2023 Report Share Posted June 16, 2023 Hello, I am trying to create an array of sc_modules in systemc, but I need the code to be synthesizable. If the code wasn't for synthesis a pointer array or an sc_vector would be okay for creating the modules. But how would you create a set number of modules if it is for synthesis? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
David Black Posted June 16, 2023 Report Share Posted June 16, 2023 This is highly dependent on your synthesis vendor's support. Please ask the vendor. Worst case you could probably use something like m4 to do the job. Quote Link to comment Share on other sites More sharing options...
newtosystemc Posted June 17, 2023 Author Report Share Posted June 17, 2023 16 hours ago, David Black said: This is highly dependent on your synthesis vendor's support. Please ask the vendor. Worst case you could probably use something like m4 to do the job. Thanks for the answer! I am using vivado hls and as far as I know the only way to initialize modules is this way: Mymodule m; SC_CTOR(Mymodule2): m("m"){ } I don't see a way of initialising an array with this limitation. Also may I ask what is m4? Thanks! Quote Link to comment Share on other sites More sharing options...
maehne Posted June 21, 2023 Report Share Posted June 21, 2023 Quote Also may I ask what is m4? Thanks! Meant is GNU M4, an implementation of the traditional Unix macro processor. You can check out a tutorial, e.g. this one, to get a first glimpse on how to use it. David Black 1 Quote Link to comment Share on other sites More sharing options...
David Black Posted June 21, 2023 Report Share Posted June 21, 2023 Thanks @maehne. @newtosystemcRe. your initialization issue, if Vivado HLS supports sc_vector, then I recommend that approach. Your response suggests to be me that you may not have sufficient C++ background to understand constructors. SystemC requires a solid understanding of C++ (i.e., more than just hacking examples). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.