comparch-security / FlexiCAS

A Flexible Cache Architectural Simulator
Other
11 stars 3 forks source link

Make coherence policy implemented in static classes #138

Closed wsong83 closed 2 months ago

wsong83 commented 2 months ago

The previous policy classes utilize the COO virtual functions for supporting different policies. However, virtual function is a run-time feature which rely on an actual object in memory with indirect call using vtables. This would cost both memory and run-time cycles. This PR replace the runtime objects with static classes and rely on compile-time template parameters to decide coherence policy. The derived coherence functions are implemented using overload rather than override.