wasim6691 Posted January 7, 2018 Report Posted January 7, 2018 Hi, Can we pass arguments inside the process in SystemC. If Yes then how we have to register the process in the constructor? Thanks . Below is the MODULE Wcache0 and I am trying to write getAddrForSingleWeight process which will be called inside another process which is register as SC_THREAD. void Wcache0::getAddrForSingleWeight(const channel_t co, kernel_t kernel_1, const weightaddr_t ci_offset, PEID_t &PEID, blockID_t &blockID, rowID_t &rowID, weightID_t &weightID) Quote
maehne Posted January 7, 2018 Report Posted January 7, 2018 You can use sc_bind() for this purpose, which is described in clause 5.5.6 of IEEE Std 1666-2011. Though, you might need to use sc_spawn instead of SC_THREAD to register your process with the SystemC kernel. If your compiler supports C++'11, you can also use a Lambda function instead of sc_bind(). Cf. to the Doulos white paper "What C++11 means to SystemC?" by David C. Black for details. David Black 1 Quote
David Black Posted January 7, 2018 Report Posted January 7, 2018 Before you go passing arguments to processes in SystemC, I would ask you to be careful of the lifetimes of your variables if passed by reference. Also consider that you could also pass values as class (module) member data. maehne 1 Quote
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.