A Dynamic Scratchpad Memory Unit for Predictable Real-Time Embedded Systems