================================
  An Example Program Using ADM
================================

1. USAGE

adm_test ocpParams admParams TESTFILE RESULTFILE [ref] [mt [POLICY [RR_SLOT_SIZE]]]

ocpParams      OCP parameter file provided in adm_full.zip
admParams      ADM parameter file provided in adm_full.zip
TESTFILE       test file generated by test_file_gen, or with other methods
RESULTFILE     resulting .csv file
ref            reference model is used if ref is given; otherwise accurate model is used
mt             if mt is given, a scheduler will be used (with FIFO policy by default)
POLICY         can be one of fifo, prio and rr
RR_SLOT_SIZE   when rr (round-robin) is selected, the slot size must be specified (in cycles)


2. EXAMPLE TEST FILES

Some example test files can be found in test_files directory. These 
files can be used directly in simulation. For example, use 

adm_test ocpParams admParams test_refresh.txt result_refresh.csv

or

adm_test ocpParams admParams test_mt.txt result_mt_prio.csv mt prio


3. TEST FILE GENERATION

The adm_test program needs to read in a text file of a very simple 
format:

[[.r | .w] START ADDR THREAD LEN | .e]

.r and .w   are READ and WRITE commands, respectively.
.e          indicates end of the test file.
START       expected starting time of the transaction
ADDR        address of the memory access (multiple of word length) in hexadecimal (start with 0x)
THREAD      thread-ID of the transaction, 0 for single-thread applications
LEN         length of the data (in words)

A simple program is provided for generating a test file of certain 
constraints for single-thread testing (for multi-thread, changing 
of source code is needed):

test_file_gen.cpp

This is a standalone program that does not depend on any external 
libraries. It can be compiled using the Makefile in the top 
directory:

make test_file_gen

The program expects following command-line parameters:

test_file_gen FILENAME CYCLES r|w|rw ADDR_RANGE LEN RATE
FILENAME       file name of generated test file
CYCLES         number of cycles expected in simulation
r|w|rw         read/write mode selection (rw means randomly mixed read/write access)
ADDR_RANGE     range of the randomly-generated addresses (1 indicates one DRAM row)
LEN            length of transactions
RATE           transaction injection rate (expected value)

This program is very simple. For more complicated testing, the test 
file can be generated differently.
