/* Author : Rick van der Zwet * S-number : 0433373 * Version : $Id: memory.h 363 2007-12-03 06:07:31Z rick $ * Copyright : FreeBSD Licence * Description : standard memory with random access time of RAS clock * cycles */ #include #include #include #include "common.h" void memory_std(const int RAS) { struct bus2_t line; struct result_t output = {0, 0, 0, 0}; while (fscanfbus2(&line) != EOF) { /* Process the counts */ setstats(&line, &output); /* fprintfbus2(stderr, &line); * Every request will need a call to memory and as all * is simple, every call will be a blocking one and * request will need to wait for previous request to * memory to be ready. We could simple say every * request to memory will be 9 cycles (8 memory, 1 * bus transfer) */ output.cycles += RAS + TRANSFER; output.conflicts++; } /* Compensation, cause first call is not a actual conflict */ output.conflicts--; output.misses--; printfresult(stdout, &output); }