This directory contains an example of automatic OCP TL1 timing distribution:

1. Edit the SYSTEMC and TARGET_ARCH variables in the Makefile

2. run gmake

3. run ocp_tl1_timing (command line options all have defaults.  documentation
of command line options is provided to stdout when the simulation is run)



System Architecture
=========================================================================================


Masters                   mA             mB             mC             mD
                           |              |              |              |
  thread/OCP: 1            ------    ------              ------    ------
                                 |  |                          |  |
1st-tier Mergers                 mgAB                          mgCD
                                   |                             |
  threads/OCP: 2                   -------------    --------------
                                                |  |
2nd-tier Merger                                mgABCD
                                                  |
  threads/OCP: 4                                  |
                                                  |
2nd-tier Splitter                              spABCD
                                                |  |
  threads/OCP: 4                   -------------    --------------
                                   |                             |
1st-tier Splitters               spAB                          spCD
                                 |  |                          |  |
  threads/OCP: 4           ------    ------              ------    ------
                           |              |              |              |
Slaves                    sA             sB             sC             sD


The system is a shared bus, constructed from a cascade of request-merger/response-
splitter and request-splitter/response-merger modules.  All the splitter/merger
modules map two OCP ports onto one single OCP port.
The bus is multi-threaded, non-blocking and has zero minimum latency.  A request
can be propagated from an OCP master to an OCP slave through the bus, and the
associated response be propagated from the OCP slave back to the OCP master, all
in the same clock cycle.

In the example system there are 4 OCP masters.  Each is single threaded.  The
request-mergers map each input thread to an output thread, so the merged OCP
has as many threads as the two non-merged OCPs together.  The request-splitters
have the same number of threads on all ports.  There are 4 OCP slaves and
each has the same number of threads as there are OCP masters (4).

=========================================================================================



Output Times
=========================================================================================
This table gives the times (relative to the clock rising edge) when each type of
module produces its outputs (that is, when it calls StartOCPRequest(),
putSThreadBusy(), etc.).

STB = SThreadBusy
MTB = MThreadBusy
RQ = Request
RS = Response
XX.st = sample time (internal parameter of the module)
XX.in = input time (one delta more than the output time of the source module)
XX.out = output time (the content of this table)
na = not applicable

                         SThreadBusy     Request         Response        MThreadBusy

Masters                  na              STB.st          na              0



Mergers                  0      max(STB.st,max(RQ.st))   RS.in           max(MTB.st)
                         attached slave is threadbusy-exact => RS.in>MTB.out>MTB.st
                         => merger always has MTB available when a resonse comes

Splitters                0  max(max(STB.st),RQ.st)  max(max(RS.st),MTB.st)  0



Slaves                   0               na           max(RQ.st,MTB.st)  na


=========================================================================================



Sample Times
=========================================================================================
This table gives the times when the different modules sample the OCP-TL1-Channel,
all in SC_PS(*).  These times can be calculated manually.  The OCP-TL1-Channel provides
infrastructure for the calculation to be done automatically and invisibly to
the programmer instantiating and connecting the modules.  Mergers do not need
to sample the responses: they are able to react exclusively to the ResponseStartEvent.
(*) or whatever the minimum time resolvable is.

                         SThreadBusy  Request      Response     MThreadBusy

Masters                  1            na           cycle end    na



1st-tier Mergers         1            2            na           1



2nd-tier Merger          1            3            na           2



2nd-tier Splitter        1            4            8            3



1st-tier Splitters       1            5            7            1



Slaves                   na           6            na           1


=========================================================================================

