Jump to content


Recommended Posts


I am defining the input ports at the top module which will be the input ports also to all the sub-modules. But these input ports have to change the value as I have to run the for loop for multiple layers. Where exactly I have to run this for loop in the TOP MODULE. Whether i have to a make a process inside the top Module but then I will not be able to change the values of my ports. Thanks. The loop is given as:

for (int layer_id = 0; layer_id < 27; layer_id++)

		net_CFG = get_network_config();

		layer_t  layer = net_CFG->layers[layer_id];
		dimension_t    w_in = layer.width;           // 256 First Layer
		dimension_t    h_in = layer.height;          // 256
		channel_t      chi = layer.channels_in;      // 3
		channel_t      cho = layer.channels_out;     // 64
		stride_t         s = layer.stride;           // 2
		kernel_t         k = layer.kernel;




Share this post

Link to post
Share on other sites

I am running this loop in the constructor of the top module but I as the values i want to vary for the re-run of the simulation. How to restart the simulation with new set of values. I have instantiated this top module in the main and calling sc_start() command from there. help me Thanks

Share this post

Link to post
Share on other sites

Hello @wasim6691,

With the current implementation of the SystemC library available on the Accellera website, once the simulation has been started using sc_start you cannot dynamically change the number of modules instantiated.

I would once again refer the comment from @maehne, that you need to get your basics right for SystemC before continuing further on your project.



Ameya Vikram Singh


Share this post

Link to post
Share on other sites

I mean for Example I have two Modules A and  B. Once I use sc_start() command. Simulation runs only once and thread dies. But I want to keep the simulation run x times before getting the thread dead. Thats why In the Top module I am trying something to solve this. If You understand my question then let me know.Please or I should elaborate more. Thanks

Share this post

Link to post
Share on other sites

You don't seem to be familiar enough with the concept of discrete event driven simulation. Simulation stops once all events have been processed by the processes of your system or the simulation end time has been reached. If you want your simulation to continue, you have to modify your stimuli process(es) so that they keep generating stimuli as long as you wish.

Again, I recommend you to read a good introductory book on SystemC before continuing with your modelling efforts!

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