Page 1 of 1

salvo "resources calculator"

PostPosted: Tue Oct 01, 2002 8:13 am
by JS
I'm evaluating Salvo and would like to know if you have or could post a spreadsheet or something like that to calculate the resources (RAM and ROM) needed by a Salvo app. The user could provide the info on the system 8-16 bits, RISC/CISC, number of task, semaphores, libs used, etc. and the spreadsheet calculates the RAM and ROM that is going to be needed.

Re: salvo "resources calculator"

PostPosted: Tue Oct 01, 2002 8:24 am
by aek

We don't have one yet ... maybe we could work one into a near-future release ...

For now, here's a quick outline on how to figure Salvo's RAM usage. It works for library and source-code builds (assumes mem.c is a project node in all builds).

1: Successfully compile a small Salvo project. Identify the start and end address of the Salvo global objects. In some caes (e.g. PIC16, this will be easy, as most users place all the Salvo global objects in a particular bank, and the PICC compiler displays memory usage in each bank).

2) Increment OSTASKS in salvocfg.h by 1 and re-build the project. The difference in RAM usage is the sizeof(tcb), i.e. the RAM per task.

3) Repeat with OSEVENTS. The difference gives the sizeof(ecb), i.e. the RAM per event.

4) Repeat with OSEVENT_FLAGS and OSMESSAGE_QUEUES if applicable. This gives sizeof(efcb) and sizeof(mqcb).

5) Once you know all the sizeof()'s for the tcbs, ecbs, efcbs and mqcbs, then the remaining memory usage is the stuff for counters, queue head pointers, etc.

Note a couple of things:

RAM usage is nearly identical across all the 8-bit targets. It does rise when, say, pointers are 16 bits.

There are so many different permutations that depend on Salvo configuration options, target architecture and compiler switches / options that I'm not at all sure that such a spreadsheet would remain current/correct. That's one reason why the next iteration of Salvo documentation, which will be organized on a compiler-specific basis, will always include "hard numbers" on RAM utilization for the (example) tutorials tu1-tu6. This way, you'll have a good overview of RAM (and ROM) usage for standardized apps that are available on all targets.