Memory system optimization of embedded software




















CS Embedded Systems Optimization. Instructional Team Santosh Pande Creator, Instructor Catherine Gamboa Course Developer Tyson Bailey Head TA Overview In the 21st century, embedded systems are the systems of future with cellular phones, smart-phones, and tablets becoming the dominant platforms for computing and communication.

Network Processors: Processing in the network, Network processors, Dual Bank Register Allocation for Network Processors, Multi-threading in network processors, Context switch and latency, Register allocation across threads to minimize latency This course counts towards the following specialization s : Computing Systems Course Goals To understand the tight coupling and synergies that exist between hardware and software in embedded processors and that are exposed through the abstraction of instruction sets including DSPs, VLIWs, etc.

To understand machine specific features such as data paths, register and memory banks of the underlying processor and machine specific code optimizations based on them for high performance, compact code and low energy. Course Videos You can view the lecture videos for this course here. Before Taking This Class Suggested Background Knowledge It is recommended that students who take this course have previously taken at least an undergraduate-level course in computer architecture.

Technical Requirements and Software Students will be required to purchase a Raspberry Pi for one of the projects. Browser and connection speed: An up-to-date version of Chrome or Firefox is strongly recommended. Arrays and look-up tables can be good "low-hanging fruit".

If you can get a memory map from the linker, check that for large items in RAM. Perhaps your linker config reserves large amounts of RAM for heap and stack, larger than necessary for your application. If you measure your stack usage and it's well under the allocation, you may be able to reduce the allocation.

For ARM processors, there can be several stacks, for several of the operating modes, and you may find that the stacks allocated for the exception or interrupt operating modes are larger than needed. If you've checked for the easy savings, and still need more, you might need to go through your code and save "here a little, there a little".

You can check things like:. Check for unnecessary use of static or global variables, where a local variable on the stack can be used instead. I've seen code that needed a small temporary array in a function, which was declared static , evidently because "it would take too much stack space". If this happens enough times in the code, it would actually save total memory usage overall to make such variables local again. As a side benefit, the functions are more likely to be re-entrant, thread-safe.

Variables that can be smaller, e. I can't remember what ARM compilers typically do, but some compilers I've used in the past by default made enum variables 2 bytes even though the enum definition really only required 1 byte to store its range. Check compiler settings. Rework your algorithms. AES encryption can use an on-the-fly key calculation which means you don't have to have the entire expanded key in memory. That saves memory, but it's slower.

The same goes for code. I'd look for arrays that can be resized and unused varaibles. Also, it's best to avoid dynamic allocation because of the danger of memory fragmentation. Aside from that, you'll want to make sure that constant data such as lookup tables are stored in ROM. This can usually be achieved with the const keyword. IF you have the linker map file it's also easy to attack the modules which are using the most RAM first.

Make sure that the number of parameters passed to a functions is deeply analysed. Also consider the case of using a global rather than passing the data to a function which is most frequently called with the same parameter.

The deeper the function calls, the heavier is the use of the stack. In this case registers can't be at all levels to pass the parameters and so obviously stack will be used. Try for venues for clubbing the two parameters into one wherever applicable. Have a re-look on nested interrupt vectors. In any architecture, we use to have scratch-pad registers and preserved registers.

Preserved registers are something which needs to be saved before the servicing the interrupt. In case of nested interrupts it will be needing huge stack space to back up the preserved registers to and from the stack. This can be changed to pass by reference.

If you are running your program from RAM for faster execution, you can create a user defined section which contains all the initialization routines which you are sure that it wont run more than once after your system boots up.

Embedded software design and compilation can take advantage of two important facts: the hardware target is known; and we can spend more time and computational effort to optimize the sofhvare. This paper surveys techniques for optimizing memory behavior of embedded software and points to some future trends in the field.

Memory system optimization of embedded software. Digital Object Identifier N2 - The memory system often determines a great deal about the behavior of an embedded system: performance, power, and manufacturing cost.

AB - The memory system often determines a great deal about the behavior of an embedded system: performance, power, and manufacturing cost. Overview Fingerprint.



0コメント

  • 1000 / 1000