=============================
  Accurate DRAM Model (ADM)
=============================

0. LICENSING AND COPYRIGHT

All files in this zip file are / This document is licensed under the following license. 

Copyright 2006-2013 Accellera Systems Initiative Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 
except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0/

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 
OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language 
governing permissions and limitations under the License.



1. REQUIRED PACKAGES

SystemC 2.2.0
TLM 2.0.1
OCP TLM Kit 2.2x2.1

Other versions of the packages may also work, but the compatibility
is not guarenteed.

This release has been tested on the following platforms:

32-bit Linux Ubuntu 10.04 with gcc 4.4.3
32-bit Linux Ubuntu 9.10 with gcc 4.4.1
32-bit Windows XP Cygwin with gcc 4.3.4
64-bit Windows 7 Cygwin with gcc 4.3.4


2. INSTALLATION

No installation is required. Simply extract the contents of the
package. The model is written entirely in header files.


3. DIRECTORY STRUCTURE

include/    : contains the header files of the Accurate DRAM Model
test/       : contains an example program using the ADM model
params/     : contains example of the OCP parameter file and the 
              ADM parameter file
COPYING     : GNU General Public License (GPL) Version 3
COPYING.LESSER : GNU Lesser General Public License (LGPL) Version 3
Makefile    : Makefile used for compiling and running the example
README      : General introduction of the package


4. USAGE

All the files needed is in the include/ directory. 

File adm.h defines the Accurate DRAM Model, an OCP-IP TL1 slave device.
The slave socket is configured with an ocpParams file, which has the
same format as the examples in OCP TLM Kit. Additionally, an admParams
file is needed for the configuration of the DRAM model. Examples of both
configuration files can be found in params/ directory.

An Accurate DRAM Scheduler module is also provided in the package. The 
scheduler is defined in adm_scheduler.h, and is capable of collecting 
packages with different thread_id information, and passing them to the 
DRAM model under certain scheduling policy.


5. EXAMPLE

An example program is provided in the package. To compile the example,
please first modify the Makefile under this directory, and make sure
the paths are correctly assigned. Then, run:

make test

The program should compile with no error if all the required packages 
are correctly installed. However, there may be many warnings, but it
should not affect the compilation.

To run the example program, type

make run_test

The output should be something like this:

./adm_test params/ocpParams params/admParams test/test_files/test_mt.txt test/test_mt_prio.csv mt prio


             SystemC 2.2.0 --- Sep  7 2010 19:54:52
        Copyright (c) 1996-2006 by all Contributors
                    ALL RIGHTS RESERVED
clock period = 5 ns
data rate = DDR1
refresh Period = 1520 cycles
refresh Duration = 24 cycles
address bus width = 25 bits
bank address width = 2 bits
row address width = 13 bits
address bus width = 10 bits
Data Width = 4 bits
Mini Burst Length = 4
tHopRow = 11 cycles
tRCD = 3 cycles
tCAS = 2 cycles
tDQSS = 2 cycles
tWTR = 2 cycles
Mini Byte width = 2 bits
......Configuration Complete




Log file generated at cycle 10071 


The program reads a sample test file test/test_mt.txt, and generate a 
CSV file test/test_mt_prio.csv as a result. The file can be compared to
test/test_mt_prio.csv.ref for correctness.

More information on the usage of the test program can be found at
test/README.


6. ACKNOWLEDGEMENT

This package is based on a student project at Royal Institute of 
Technology (KTH), Sweden. The work is carried out by

Project supervisor: 
  Dr. Zhonghai Lu

Project Group Members:
  Nan Li
  Yi Wang
  Huisheng Zhou
  Lei Liang


7. CONTACT INFORMATION

Further questions about the package can be directed to

Nan Li
Email: nan3 at kth.se
