From 58459bf7a55010eccf9940cfdb53cbc854b0989c Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Sat, 16 Oct 2010 11:59:28 -0800 Subject: 1. moving address decoding into a class (and out of cache entirely) 2. moving DRAM timing parameters into memory_config class 3. removing some likely useless statistics 4. other cleaning up of code passing CUDA 3.1 regression [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 7868] --- src/gpgpu-sim/addrdec.h | 55 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 17 deletions(-) (limited to 'src/gpgpu-sim/addrdec.h') diff --git a/src/gpgpu-sim/addrdec.h b/src/gpgpu-sim/addrdec.h index 8315bc9..60cbcf1 100644 --- a/src/gpgpu-sim/addrdec.h +++ b/src/gpgpu-sim/addrdec.h @@ -71,28 +71,49 @@ #ifndef ADDRDEC_H #define ADDRDEC_H -enum { - CHIP = 0, - BK = 1, - ROW = 2, - COL = 3, - BURST = 4, - N_ADDRDEC -}; +#include "../abstract_hardware_model.h" -typedef struct { +struct addrdec_t { + void print( FILE *fp ) const; + unsigned chip; unsigned bk; unsigned row; unsigned col; unsigned burst; -} addrdec_t; +}; + +class linear_to_raw_address_translation { +public: + linear_to_raw_address_translation(); + void addrdec_setoption(option_parser_t opp); + void init(unsigned int nchips); + + // accessors + void addrdec_tlx(new_addr_type addr, addrdec_t *tlx) const; + new_addr_type partition_address( new_addr_type addr ) const; + +private: + void addrdec_parseoption(const char *option); + + enum { + CHIP = 0, + BK = 1, + ROW = 2, + COL = 3, + BURST = 4, + N_ADDRDEC + }; + + const char *addrdec_option; + + int ADDR_CHIP_S; + unsigned char addrdec_mklow[N_ADDRDEC]; + unsigned char addrdec_mkhigh[N_ADDRDEC]; + new_addr_type addrdec_mask[N_ADDRDEC]; + + unsigned int gap; + int Nchips; +}; -void addrdec_tlx(unsigned long long int addr, addrdec_t *tlx); -void addrdec_setnchip(unsigned int nchips); -void addrdec_setoption(option_parser_t opp); -void addrdec_parseoption(const char *option); -extern unsigned long long int addrdec_packbits(unsigned long long int mask, - unsigned long long int val, - unsigned char high, unsigned char low); #endif -- cgit v1.3