Jump to content

d flipflop output


Recommended Posts


I have came back to system c after 6 months, again.

I was trying to solve different basic examples of system c.

The code is getting compiled,but i am not able to view the desired output.

My output is not at all changing,i am not sure whether my function is getting hit or not.

Please have a look at the code below and any help would b appreciated.


In code,i have added stimulus first and then  monitor to check wheteher my function was getting invoked.Again ,in main file also i passed the input.

But from ,nowhere i am getting the output. Please help! 



Ps:Not only this example,the other examples such as combinational circuits,encoders,decoders.

I am facing the same issue with respect to all of them.There must be a common mistake which i am repeating.


Thanks & regards,


Link to comment
Share on other sites


Hi deepti,

Thanks for your reply.

I have tried the other examples also,but tats the commmon issue iam facing of not getting output.

By infinite loop, you mean to say i need to put sc_start(-1) which in turn makes my thread to run forever.

As far as my problem is concerned,even for combinational circuits if iam using sc_method ,i am not getting the desired output.


Update:-Started writing the fresh code and  i am getting some ouput now.Some issues are there with respect to timing,but i think it can be resolved. 





Edited by shubham_v
Got the output
Link to comment
Share on other sites

No, you need to have loop with the function registered as SC_THREAD. For your code, it will be:


  void d_operation()
    { while(1){
        if (reset.read()==1)
        d_out = 0;
    //    std::cout << "reset= " << reset << "...din=  " << d_in << ".....d_out" << d_out << std::endl;
        //    wait(1, SC_NS);
        //    std::cout << "reset= " << reset << "...din=  " << d_in << ".....d_out" << d_out << std::endl;


Link to comment
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.

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...