Task involves creating an app from scratch using SystemC library.
App should implement the standard producer-consumer problem where it is possible to have multiple consumers. Producer and consumers should be connected with the sc_fifo channel.
- generate random integer (from 1,30 range) every p cycles and send it to the consumer(s)
- generate 1000 transactions
- in case of multiple consumers, feed the consumers according to the writing policy - Round Robin or Load Balancing
- read the input number from the producer and wait for input cycles
- print the received input number
Round Robin | Load Balancing | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
It is easy to spot that there is no difference in the simulation time when there is only one consumer regardless of the arbitration. That is caused by the fact that there is no way to shorten the waiting time for the consumer to become ready to receive a new message.
However, the higher the number of consumers, the more visible the difference in the simulation time happens to occur. Due to the fact that with Load Balancing the system performs the wait only when all of the consumers are busy processing messages, it was feasible to save some time that would be lost by the waits forcing the sequential order using the Round Robin arbitration.