Producer/Consumer Model
|
This is the producer/consumer hardware model.
Structure
The model includes 3 modules, that operate in parallel to each other:
Producer, Consumer and Master.
These modules are connected to each other via point-to-point FIFOs, mimicking bus interfaces. The type of those interfaces is defined in:
TOT/event_driven_model/src/bus_types.hpp .
Producer and Consumer contain a register file with 2 registers each. These registers are based of Register and Field classes which are defined in:
TOT/event_driven_model/src/register
Master can program Producer and Consumer by sending register write commands, that include write data, over a Register-bus type of FIFO. Such data gets written into the target's register file.
Master can also receive the content of those register files, in response to a register read command, over a Data bus type of FIFO.
Operation
Master programs Producer to send a given number of packets to Consumer.
Master programs Consumer to expect a given number of packets from Producer.
When Consumer receives the expected number of packets, it notifies Master via the Done bus FIFO.
When Master is notified by Consumer, that all packets have been received, Master ends the simulation.
This model uses functionality from a utility library, simlib :
- Command line processing
- Print-out control
Module Testing
Each module has its own accompanying test, for debugging purposes.
How to Build
To compile and build the included code, you first need to define 2 environment variables in your shell:
Module Building
Compile each module and its test from their respective source directory, by calling make.
The build is done in a directory related to the selected build type - either debug, release or profile.
By default, make will build the debug version of your code, and place it in the build/debug directory.
To build any other type, add 'BUILT=type' on the command line. E.g., to build the release version of your code, and place it in the build/release directory, do:
make BUILD=release
Model Building
Compile the entire model from its base directory, TOT/event_driven_model/src/top, by calling make.
The build is done in a directory related to the selected build type - either debug, release or profile.
By default, make will build the debug version of your library, and place it in the build/debug directory.
To build any other type, add 'BUILT=type' on the command line. E.g., to build the release version of your library, and place it in the build/release directory, do:
make BUILD=release
The build process can be seen in build.log.
Model Running
See Top.
Structure
The model includes 3 modules, that operate in parallel to each other:
Producer, Consumer and Master.
These modules are connected to each other via point-to-point FIFOs, mimicking bus interfaces. The type of those interfaces is defined in:
TOT/event_driven_model/src/bus_types.hpp .
Producer and Consumer contain a register file with 2 registers each. These registers are based of Register and Field classes which are defined in:
TOT/event_driven_model/src/register
Master can program Producer and Consumer by sending register write commands, that include write data, over a Register-bus type of FIFO. Such data gets written into the target's register file.
Master can also receive the content of those register files, in response to a register read command, over a Data bus type of FIFO.
Operation
Master programs Producer to send a given number of packets to Consumer.
Master programs Consumer to expect a given number of packets from Producer.
When Consumer receives the expected number of packets, it notifies Master via the Done bus FIFO.
When Master is notified by Consumer, that all packets have been received, Master ends the simulation.
This model uses functionality from a utility library, simlib :
- Command line processing
- Print-out control
Module Testing
Each module has its own accompanying test, for debugging purposes.
How to Build
To compile and build the included code, you first need to define 2 environment variables in your shell:
- TOT
This is the directory where you extracted the ZIP file.
All code and builds reside here. - MAKEFILES_DIR
This is the directory where the helper Makefiles reside.
In the ZIP file, this directory is called makefiles, and is right under TOT.
Module Building
Compile each module and its test from their respective source directory, by calling make.
The build is done in a directory related to the selected build type - either debug, release or profile.
By default, make will build the debug version of your code, and place it in the build/debug directory.
To build any other type, add 'BUILT=type' on the command line. E.g., to build the release version of your code, and place it in the build/release directory, do:
make BUILD=release
Model Building
Compile the entire model from its base directory, TOT/event_driven_model/src/top, by calling make.
The build is done in a directory related to the selected build type - either debug, release or profile.
By default, make will build the debug version of your library, and place it in the build/debug directory.
To build any other type, add 'BUILT=type' on the command line. E.g., to build the release version of your library, and place it in the build/release directory, do:
make BUILD=release
The build process can be seen in build.log.
Model Running
See Top.