Professional Documents
Culture Documents
1 Preparation
2.1 Overview
Use SystemC and transaction-level modeling
(TLM) to implement the system in figure shown
at the side, which executes a matrix
multiplication
as
a
hardware/software
partitioned design consisting of a software
component (SW), hardware coprocessor (HW),
and memory communicating over a shared bus
(bus).
The complete algorithm is shown below. The data of the matrix c[][] shall be stored in the memory, the
ADDMUL operation shall be executed in the HW component, which can also store one integer value, and the bus
control as well as the execution of the algorithm shall be realized by the SW component.
#define SIZE 5
int main() {
int i,j,k;
for(i=1;i<=SIZE;i++)
for(j=1;j<=SIZE;j++)
c[i][j] = 0;
for(i=1;i<=SIZE;i++)
for(j=1;j<=SIZE;j++)
for(k=1;k<=SIZE;k++)
c[i][j] += a[i][k] * b[k][j];
return 0;
}
The bus Request() should provide all information necessary to indicate what transaction is requested on the bus.
During the Request(), sufficient information should be provided such that any servant component listening to
the bus will receive the required information for responding (or determining if they should respond) to the
request. For example, consider an implementation in which only one bus master is present. In this scenario, the
bus master's Request() would need to include all information for the request such that the servants listening
(i.e., waiting within Listen() function) to the bus can respond with the Acknowledge() if the request is for them.
In this scenario, the acknowledge comes directly from the servant component as no arbiter is be present and
only one master is waiting for the acknowledge.
In a TLM implementation, components acting as bus masters should not be aware of the arbitration method.
Instead, all bus masters are provided the same protocol that hides the details of the arbitration such that the
WaitForAcknowledge() will wait until an Acknowledge() has been made by a servant component in response to
the bus master's request. While the bus arbitration is responsible for sending the acknowledge to correct master
component, the acknowledge comes from the servant component.
The WaitForAcknowledge() called by a master component should not return until an Acknowledge() has been
provided by a servant component in response to the current bus request. In other words, the bus component is
not responsible for generating the acknowledge, but rather simply forwarding an acknowledge from a servant
component.