summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/addrdec.h
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-10-16 11:59:28 -0800
committerTor Aamodt <[email protected]>2010-10-16 11:59:28 -0800
commit58459bf7a55010eccf9940cfdb53cbc854b0989c (patch)
treecbbace76fa7d517cc1b1c6d2d7789a851289df96 /src/gpgpu-sim/addrdec.h
parent6c33482bbdbcd289e6ee14605b0f2698c151c5af (diff)
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]
Diffstat (limited to 'src/gpgpu-sim/addrdec.h')
-rw-r--r--src/gpgpu-sim/addrdec.h55
1 files changed, 38 insertions, 17 deletions
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