Producer/Consumer Model: Producer Module
Producer sends a programmable number of packets to Consumer.
I/O ports Producer is connected to Master and Consumer via blocking FIFO ports. A thread accessing such a port will be paused, if the FIFO is empty (on a read) or full (on a write). Producer receives register read and write commands from Master over an input register bus, defined in bus_types.hpp. Upon a register read, Producer sends the content of that register to Master over an output register data bus. Producer sends packets to Consumer over an output packet bus. Threads Producer has two parallel threads: - register_file_handler() waits for a register read or write command from the Master, and then processes it. If the en field in the control register has just been set, an event notification is sent to the controller() thread, to wake it up. - controller() waits for an event from register_file_handler(), to start sending packets to Consumer. Once all packets have been sent, the en field in the control register is cleared. |
Print control Producer has print-control functionality to select which type of print-out debug messages are shown. Implemented in: producer_print_ctrl.cpp/.hpp |
Register definitions
Producer has 2 registers in its register-file.
Producer has 2 registers in its register-file.
Producer_Control_Register
-- Register --
Name Offset Description
control 0x0 Packet generation control
-- Fields --
Field_name lsb Width Description Reset_value RW_access
en 0 1 Enable sending num_pkt packets to Consumer 0x0 RW
ud_0 1 3 Undefined 0 0x0 R
num_pkt 4 4 Number of packets to produce per invocation 0x10 RW
ud_1 8 5 Undefined 1 0x0 R
ver 13 3 Unit version number 0x6 R
Producer_Status_Register
-- Register --
Name Offset Description
status 0x4 Packet generation status
-- Fields --
Field_name lsb Width Description Reset_value RW_access
num_pkt 0 8 Number of packets sent during last invocation 0x0 W
ud_0 8 8 Undefined 0 0x0 R