summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/gpu-sim.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpgpu-sim/gpu-sim.h')
-rw-r--r--src/gpgpu-sim/gpu-sim.h57
1 files changed, 55 insertions, 2 deletions
diff --git a/src/gpgpu-sim/gpu-sim.h b/src/gpgpu-sim/gpu-sim.h
index 5908fd5..eddc2f4 100644
--- a/src/gpgpu-sim/gpu-sim.h
+++ b/src/gpgpu-sim/gpu-sim.h
@@ -198,8 +198,14 @@ struct memory_config {
bk_tag_length = i-1;
assert(nbkgrp>0 && "Number of bank groups cannot be zero");
tRCDWR = tRCD-(WL+1);
+ if(elimnate_rw_turnaround)
+ {
+ tRTW = 0;
+ tWTR = 0;
+ } else {
tRTW = (CL+(BL/data_command_freq_ratio)+2-WL);
- tWTR = (WL+(BL/data_command_freq_ratio)+tCDLR);
+ tWTR = (WL+(BL/data_command_freq_ratio)+tCDLR);
+ }
tWTP = (WL+(BL/data_command_freq_ratio)+tWR);
dram_atom_size = BL * busW * gpu_n_mem_per_ctrlr; // burst length x bus width x # chips per partition
@@ -213,7 +219,9 @@ struct memory_config {
m_L2_config.init(&m_address_mapping);
m_valid = true;
- icnt_flit_size = 32; // Default 32
+
+ sscanf(write_queue_size_opt,"%d:%d:%d",
+ &gpgpu_frfcfs_dram_write_queue_size,&write_high_watermark,&write_low_watermark);
}
void reg_options(class OptionParser * opp);
@@ -264,12 +272,25 @@ struct memory_config {
unsigned nbk;
+ bool elimnate_rw_turnaround;
+
unsigned data_command_freq_ratio; // frequency ratio between DRAM data bus and command bus (2 for GDDR3, 4 for GDDR5)
unsigned dram_atom_size; // number of bytes transferred per read or write command
linear_to_raw_address_translation m_address_mapping;
unsigned icnt_flit_size;
+
+ unsigned dram_bnk_indexing_policy;
+ unsigned dram_bnkgrp_indexing_policy;
+ bool dual_bus_interface;
+
+ bool seperate_write_queue_enabled;
+ char *write_queue_size_opt;
+ unsigned gpgpu_frfcfs_dram_write_queue_size;
+ unsigned write_high_watermark;
+ unsigned write_low_watermark;
+ bool m_perf_sim_memcpy;
};
// global counters and flags (please try not to add to this list!!!)
@@ -362,6 +383,32 @@ private:
friend class gpgpu_sim;
};
+struct occupancy_stats {
+ occupancy_stats() : aggregate_warp_slot_filled(0), aggregate_theoretical_warp_slots(0){}
+ occupancy_stats( unsigned long long wsf, unsigned long long tws )
+ : aggregate_warp_slot_filled(wsf), aggregate_theoretical_warp_slots(tws){}
+
+ unsigned long long aggregate_warp_slot_filled;
+ unsigned long long aggregate_theoretical_warp_slots;
+
+ float get_occ_fraction() const {
+ return float(aggregate_warp_slot_filled) / float(aggregate_theoretical_warp_slots);
+ }
+
+ occupancy_stats& operator+=(const occupancy_stats& rhs) {
+ aggregate_warp_slot_filled += rhs.aggregate_warp_slot_filled;
+ aggregate_theoretical_warp_slots += rhs.aggregate_theoretical_warp_slots;
+ return *this;
+ }
+
+ occupancy_stats operator+(const occupancy_stats& rhs) const{
+ return occupancy_stats( aggregate_warp_slot_filled + rhs.aggregate_warp_slot_filled,
+ aggregate_theoretical_warp_slots + rhs.aggregate_theoretical_warp_slots
+ );
+ }
+};
+
+
class gpgpu_sim : public gpgpu_t {
public:
gpgpu_sim( const gpgpu_sim_config &config );
@@ -407,6 +454,8 @@ public:
void gpu_print_stat();
void dump_pipeline( int mask, int s, int m ) const;
+ void perf_memcpy_to_gpu( size_t dst_start_addr, size_t count );
+
//The next three functions added to be used by the functional simulation function
//! Get shader core configuration
@@ -500,6 +549,9 @@ public:
unsigned long long gpu_tot_sim_insn;
unsigned long long gpu_sim_insn_last_update;
unsigned gpu_sim_insn_last_update_sid;
+ occupancy_stats gpu_occupancy;
+ occupancy_stats gpu_tot_occupancy;
+
FuncCache get_cache_config(std::string kernel_name);
void set_cache_config(std::string kernel_name, FuncCache cacheConfig );
@@ -528,4 +580,5 @@ public:
}
};
+
#endif