amitk3553 Posted November 14, 2013 Report Share Posted November 14, 2013 Hello, i had used fifo in systemC in following way sc_fifo<int> cmd_fifo; //fifo decleration in constructor hci_top(sc_module_name nm):sc_module(nm), cmd_fifo(buffer_size) its showing no compilation errros but i want its depth like 20, and buffer size of each location of 8 bits(1 byte). Is there something we cannot change the default value of depth 16 of sc_fifo? How it would be possible? i also done in following way, but its not working sc_fifo<int depth> cmd_fifo(buffer size); Regards cam Annossyenudge 1 Quote Link to comment Share on other sites More sharing options...
apfitch Posted November 14, 2013 Report Share Posted November 14, 2013 Your first code is correct. How do you know the depth is not working? You should have a depth of 20. What do you get if you do std::cout << cmd_fifo.num_free() << std::endl; in the constructor? You should see 20 printed I hope, regards Alan Quote Link to comment Share on other sites More sharing options...
amitk3553 Posted November 15, 2013 Author Report Share Posted November 15, 2013 Thanks Alan, Now its working well. Actually I was confused with fifo depth(No of locations) and size of each location. like there are 16 fifo depth then there are 16 locations. What is the default size of each location(like How much data can be stored like 1 byte, 2 byte or how many bytes ) and could it be configured like the depth of fifo? Regards cam Quote Link to comment Share on other sites More sharing options...
apfitch Posted November 15, 2013 Report Share Posted November 15, 2013 The size of each location depends on the template argument. e.g. sc_fifo< sc_biguint<1000000> > fifo; A fifo of depth 16 where each entry is 1 million bits (!) wide, If you use int, then it is typically 32 bits on a workstation, regards Alan amitk3553 1 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.