// This file was originally written by Matthew Naylor, University of // Cambridge, based on code already present in the groundtest repo. // // This software was partly developed by the University of Cambridge // Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 // ("CTSRD"), as part of the DARPA CRASH research programme. // // This software was partly developed by the University of Cambridge // Computer Laboratory under DARPA/AFRL contract FA8750-11-C-0249 // ("MRC2"), as part of the DARPA MRC research programme. // // This software was partly developed by the University of Cambridge // Computer Laboratory as part of the Rigorous Engineering of // Mainstream Systems (REMS) project, funded by EPSRC grant // EP/K008528/1. package groundtest import Chisel._ import uncore._ import junctions._ import rocket._ import scala.util.Random import cde.{Parameters, Field} // ======= // Outline // ======= // Generate memory traces that result from random sequences of memory // operations. These traces can then be validated by an external // tool. A trace is a simply sequence of memory requests and // responses. // ========================== // Trace-generator parameters // ========================== // Compile-time parameters: // // * The id of the generator (there may be more than one in a // multi-core system). // // * The total number of generators present in the system. // // * The desired number of requests to be sent by each generator. // // * A list of physical addresses from which an address is drawn when // generating a fresh request. case object AddressBag extends Field[List[Int]] trait HasTraceGenParams { implicit val p: Parameters val numGens = p(NGenerators) val numBitsInId = log2Up(numGens) val numReqsPerGen = p(MaxGenerateRequests) val memRespTimeout = 4096 val numBitsInWord = p(WordBits) val numBytesInWord = numBitsInWord / 8 val numBitsInWordOffset = log2Up(numBytesInWord) val addressBag = p(AddressBag) val logNumAddrsInTrace = log2Up(addressBag.length) require(numBytesInWord * 8 == numBitsInWord) require(1 << logNumAddrsInTrace == addressBag.length) } // ============ // Trace format // ============ // Let denote a generator id; // denote an address (in hex); // denote a value that is stored at an address; // denote a unique request/response id; // and