accel-sim / accel-sim-framework

This is the top-level repository for the Accel-Sim framework.
https://accel-sim.github.io
Other
289 stars 110 forks source link

Cache config string format is inconsistent #209

Open FJShen opened 1 year ago

FJShen commented 1 year ago

Action need to be taken to unify the inconsistent formatting of cache configuration strings scattered around in the code.

The full-fledged config string for caches is supposed to have 15 entries, as indicated in cache_config::init():

  void init(char *config, FuncCache status) {
    ...
    int ntok =
        sscanf(config, "%c:%u:%u:%u,%c:%c:%c:%c:%c,%c:%u:%u,%u:%u,%u", 
            &ct, &m_nset, &m_line_sz, &m_assoc, 
            &rp, &wp, &ap, &wap, &sif,
            &mshr_type, &m_mshr_entries, &m_mshr_max_merge,
            &m_miss_queue_size, &m_result_fifo_entries, 
            &m_data_port_width);
    ...
}

The release note however only shows 14 of them:

Our GPU cache model supports sectored, banked L1 cache design. Our sector size is constant=32B, so for 128B cache line configuration, each cache line has 4 sectors. Example to define L1 sector cache with four banks: 

Add the 'S' character at the header as shown below, for non-sector cache design, use 'N'
cache configuration string: <sector?>:<nsets>:<bsize>:<assoc>,<rep>:<wr>:<alloc>:<wr_alloc>:<set_index_fn>,<mshr>:<N>:<merge>,<mq>:**<fifo_entry>
-gpgpu_cache:dl1  S:4:128:64,L:L:m:N:L,A:512:8,16:0,32

And the default values defined in gpu-sim.cc are also outdated, containing only 11 entries, here's just one example among many:

void shader_core_config::reg_options(class OptionParser *opp) {
  ...
  option_parser_register(opp, "-gpgpu_cache:dl1", OPT_CSTR,
                         &m_L1D_config.m_config_string,
                         "per-shader L1 data cache config "
                         " {<nsets>:<bsize>:<assoc>,<rep>:<wr>:<alloc>:<wr_"
                         "alloc>,<mshr>:<N>:<merge>,<mq> | none}",
                         "none");
   ...
}
William-An commented 3 days ago

We would need a better way to manage simulation configuration. Probably a python frontend?

JRPan commented 3 days ago

https://github.com/accel-sim/accel-sim-framework/pull/329 I actually submitted a PR to revert the Python frontend, lol. But we can keep it and extend it if people like it more.