Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -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)
19 changes: 18 additions & 1 deletion doc/quickstart_plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ graph LR
D -->|No| F{libCacheSim Cache Full?}
F -->|Yes| G["cache_eviction_hook()<br/>plugin cache determines the object(s) to evict"]
F -->|No| H["cache_miss_hook()<br/>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
Expand Down Expand Up @@ -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.

---

Expand Down
Loading