diff --git a/doc/README.md b/doc/README.md index f8ef8bc1..16220378 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,15 +1,19 @@ +# CacheSim Documentation -## Main tools -* [cachesim](quickstart_cachesim.md) -* [trace utils](quickstart_traceUtils.md) -* [trace analysis](quickstart_traceAnalysis.md) +## Quickstart Guides +- [CacheSim: Command-line cache simulator](quickstart_cachesim.md) +- [Trace Utilities](quickstart_traceUtils.md) +- [Trace Analyzer](quickstart_traceAnalyzer.md) +- [MRC Profiler](quickstart_mrcProfiler.md) +- [Plugin System](quickstart_plugin.md) -## Using libCacheSim as a library -* [library](lib.md) -* [add a new algorithm](lib_extend.md) -* [API](lib_api.md) - - -## Benchmarks -* [benchmarks](quickstart_benchmarks.md) +## Advanced Usage +- [Library Usage Guide](advanced_lib.md) +- [How to Add a New Algorithm](advanced_lib_extend.md) +- [API Reference (C)](API.md) +- [Performance Tuning](performance.md) +- [Memory Usage Profiling](memory_usage_profiling.md) +## Developer Documentation +- [Debugging Guide](debug.md) +- [Install & Build](install.md) diff --git a/doc/quickstart_plugin.md b/doc/quickstart_plugin.md index 2b0816cb..af754f98 100644 --- a/doc/quickstart_plugin.md +++ b/doc/quickstart_plugin.md @@ -17,7 +17,7 @@ graph LR D -->|No| F{libCacheSim Cache Full?} F -->|Yes| G["cache_eviction_hook()
plugin cache determines the object(s) to evict"] F -->|No| H["cache_miss_hook()
Update plugin cache stats"] - G --> H + G --> F style E fill:#bfb,stroke:#333,stroke-width:2px style G fill:#fbb,stroke:#333,stroke-width:2px @@ -300,6 +300,23 @@ For Python examples, see the `libCacheSim-python/README.md` file which contains * **Performance Issues**: Use `process_trace()` for large workloads instead of individual `get()` calls for better performance. * **Memory Usage**: Monitor cache statistics (`cache.occupied_byte`) and ensure proper cache size limits for your system. * **Custom Cache Issues**: Validate your custom implementation against built-in algorithms using test functions. +* **Implementation Issues**: When re-implementing an eviction algorithm in libCacheSim using the plugin system, note that the core hook functions are simplified. This may introduce some challenges. The central function for cache simulation is `get` and its common internal logic is: + + ```mermaid + graph LR + C["find() (Cache state is updated automatically, since update_cache = true by default)"] --> D{Found in cache?} + D -->|Yes| E["cache_hit_hook()"] + D -->|No| F{"Cache full?"} + F -->|"Yes (no space for new object)"| G["cache_eviction_hook()"] + F -->|No| H["cache_miss_hook()"] + G --> F + + style E fill:#bfb,stroke:#333,stroke-width:2px + style G fill:#fbb,stroke:#333,stroke-width:2px + style H fill:#bbf,stroke:#333,stroke-width:2px + ``` + + Because find is not exposed to plugins, any state-update logic that normally happens inside find must instead be implemented inside the relevant hook functions (cache_hit_hook, cache_eviction_hook, or cache_miss_hook) according to your algorithm’s needs. ---