package Cache_Analysis public with Cheddar_Multicore_Properties; with Cheddar_Transformation_Properties; with memory_units; processor CPU_01 end CPU_01; processor implementation CPU_01.Core_01 subcomponents L1_Instruction_Cache : memory memory_units::Cache.impl { Memory_Size => 1024Bytes; Cheddar_Multicore_Properties::Line_Size => 16Bytes; Cheddar_Multicore_Properties::Cache_Type => Instruction_Cache; Cheddar_Multicore_Properties::Cache_Level => 1; Cheddar_Multicore_Properties::Associativity => 1; Cheddar_Multicore_Properties::Cache_Size => 1024; Cheddar_Multicore_Properties::Block_Reload_Time => 1 us .. 2 us; }; properties Scheduling_Protocol=>(POSIX_1003_HIGHEST_PRIORITY_FIRST_PROTOCOL); end CPU_01.Core_01; ------------------------------------------------ system Cache_benchmark end Cache_benchmark; system implementation Cache_benchmark.impl subcomponents Hard : processor CPU_01.Core_01; Soft : process Malardalen.impl; properties Actual_Processor_Binding => (reference (Hard)) applies to Soft; Cheddar_Transformation_Properties::Exported_Attribute_Time_Units => MicroSecond; end Cache_benchmark.impl; process Malardalen end Malardalen; process implementation Malardalen.impl subcomponents Bs : thread Task_Bs; Fac : thread Task_Fac; Fibcall : thread Task_Fibcall; InsertSort : thread Task_InsertSort; end Malardalen.impl; thread Task_Bs properties period => 1000us; Dispatch_Protocol => Periodic; Compute_Execution_Time => 76us..76us; Deadline => 1000us; Cheddar_Multicore_Properties::CFG_Name => "CFG_bs"; Cheddar_Multicore_Properties::CFG_Relocatable => True; Cheddar_Multicore_Properties::Text_Memory_Start_Address => 0; end Task_Bs; thread Task_Fac properties period => 1500us; Dispatch_Protocol => Periodic; Compute_Execution_Time => 125us..125us; Deadline => 1500us; Cheddar_Multicore_Properties::CFG_Name => "CFG_fac"; Cheddar_Multicore_Properties::CFG_Relocatable => True; Cheddar_Multicore_Properties::Text_Memory_Start_Address => 0; end Task_Fac; thread Task_Fibcall properties period => 1500us; Dispatch_Protocol => Periodic; Compute_Execution_Time => 300us..300us; Deadline => 1500us; Cheddar_Multicore_Properties::CFG_Name => "CFG_fibcall"; Cheddar_Multicore_Properties::CFG_Relocatable => True; Cheddar_Multicore_Properties::Text_Memory_Start_Address => 0; end Task_Fibcall; thread Task_InsertSort properties period => 2000us; Dispatch_Protocol => Periodic; Compute_Execution_Time => 450us..450us; Deadline => 2000us; Cheddar_Multicore_Properties::CFG_Name => "CFG_insertsort"; Cheddar_Multicore_Properties::CFG_Relocatable => True; Cheddar_Multicore_Properties::Text_Memory_Start_Address => 0; end Task_InsertSort; end Cache_Analysis;This model assume the following definition from package memory_units (from here)::
package memory_units public memory Cache end Cache; memory implementation Cache.impl end Cache.impl; ...The model above contains a processor component (called CPU_01). The processor has a single core unit (called Core_01) and a cache (called L1_Instruction_Cache). The solution models 4 threads : Task_Bs, Task_Fac, Task_Fibcall, and Task_InsertSort. They are programs taken from the Malardalen benchmark.
-- Cache properties -- Supported_Addressing_Type : type enumeration ( Virtual_Addressing, Physical_Addressing); Addressing_Type : Cheddar_Multicore_Properties::Supported_Addressing_Type applies to (memory, system); Supported_Cache_Type : type enumeration ( Data_Cache, Instruction_Cache, Unified_Cache); Cache_Type : Cheddar_Multicore_Properties::Supported_Cache_Type applies to (memory, system); Cache_Level : aadlinteger applies to (memory, system); Cache_Size : aadlinteger applies to (memory, system); Line_Size : size applies to (memory, system); Associativity : aadlinteger applies to (memory, system); Block_Reload_Time : Time_Range applies to (memory, system); Supported_Replacement_Policy_Type : type enumeration ( Random, LRU, LRR, FIFO); Replacement_Policy_Type : Cheddar_Multicore_Properties::Supported_Replacement_Policy_Type applies to (memory, system); Supported_Coherence_Protocol_Type : type enumeration ( Private_Cache, Shared_Cache, Private_Invalid_Cache, Private_MSI, Private_MESI); Coherence_Protocol_Type : Cheddar_Multicore_Properties::Supported_Coherence_Protocol_Type applies to (memory, system); Supported_Write_Policy_Type : type enumeration ( Write_Back, No_Allocated_Write_Through, Allocated_Write_Through, Write_Through); Write_Policy_Type : Cheddar_Multicore_Properties::Supported_Write_Policy_Type applies to (memory, system); -- CFG properties -- CFG_Name : aadlstring applies to (thread); CFG_Relocatable : aadlboolean applies to (thread); Text_Memory_Start_Address : aadlinteger applies to (thread); UCBs : list of aadlinteger applies to (thread); ECBs : list of aadlinteger applies to (thread);Properties applied to cache memory unit:
Cache interference in Cheddar is based on the concepts of Cache Related Preemption Delay (CRPD).
The bounds on the CRPD are computed by using :
- Useful Cache Block [LEE 98]
- Evicting Cache Block[BUS 95]
The following process is required to run the CRPD analyses implemented in Cheddar.
Cheddar provides supports for modeling the CFG of a task. An external tool is used to parse the object file of a task and then to compute and generate the CFG in a Cheddar-compatible format. Examples of the CFGs computed for tasks in the Malardalen benchmark are available on the Cheddar svn repository at this link.
The users can import an existing system model with several tasks in Cheddar or choose to create a new model.
After that, the CFGs of these tasks can imported by Cheddar :
Menu --> Tools --> Cache --> Import Control Flow Graph
The current GUI of Cheddar does not provide an interactive way to work (add/modify/delete) with CFGs. The features are to be implemented in the next version.
The sets of UCBs and ECBs of a program are computed by Cheddar from its CFG.
The sets of UCBs and ECBs can also be computed by external tools and put directly in Cheddar without passing by this step. In order to do this, the users need to modify the xml file of a Cheddar-ADL system model with the information about the UCBs and ECBs of tasks.
After this step, the following analyses are available in CheddarIn order to perform CRPD-Aware WCRT analysis in Cheddar, the following steps are required:
In order to perform CRPD-aware scheduling simulation in Cheddar, the following steps are required.
Tools --> Scheduling --> Scheduling Options
Our implementation of the CRPD-aware priority assignment is based on Audsley's Optimal Priority Assignment (OPA) algorithm. We extended this algorithm in order to take into account the CRPD. In order to perform CRPD-aware prority assignment in Cheddar, the following steps are required.
Tools --> Scheduling --> Scheduling Options --> Tasks Priority Assignment