Thanks Tom for your suggestions.
Unique variable naming can be achieved by adding a prefix to the local
variable name. The prefix could be the function name that must be
unique.
I'm a bit uncertain about variables allocation. There is going to be a
temporary area for local variables. How about this:
cblock
Abc, Def //global variables
Temp0, Temp1, ..., TempN //local variables
endc
Fun1_x equ Temp0
Fun1_y equ Temp1
Fun2_a equ Temp0
Fun3_t0 equ Temp2
Fun3_t1 equ Temp3
Fun3_t2 equ Temp4
We plan to include options in the code generator for processor type,
clock frequency, possible optimization options are code size, speed,
used RAM size. Probably the optimization options should be passed
individually to each function to fine tune the optimization in
addition to global settings.
Nikolai
Brandon, Tom <Tom
spam_OUTPSY.UNSW.EDU.AU> wrote on Wednesday, March 15, 2000:
{Quote hidden}> Indeed it is an interesting idea. I would like to see it extended. It's
> along the same sort of lines as Scenix's Virtual Peripheral idea. I thought
> that was a good idea it just didn't really have any substance to it. Yeah
> great, modules that integrate together seamlesly. But this wasn't the case.
> To put 2 modules together still required a fair degree of manual massaging.
> However, If you had a preprocessor that used information in the modules
> (code generator components, virtual peripherals etc) and did the messy
> integration for you...
> The sorts of things I'd like to see it do are taking care of things such as
> clock speed issues, variable allocation, unique variable naming. For
> instance, each module would specify ISR code, the frequency it needs to be
> run at and if it's timing critical. Then the preprocessor would look at all
> the ISR code needed, and create a single ISR, the neccesary timer
> initialisation, add the various ISR segments and sort out their priority. In
> some cases it may have problems with largely incompatible frequencies but
> apart from that it wouldn't be too complicated. Just this would eliminate a
> large part of the work of integrating code modules together.
> In terms of module specification I would suggest that C style headers may be
> a little simplistic. You could follow the same style but is it suitable? I
> would have thought such information may better be stored as some sort of
> markup (property\value pairs) to the code, embedded in comments so standard
> compilers ignore it. Due to the variance in the sort and ammount of
> information stored on each module it's less suited to a fully specified C
> style header and more suited to a more freeform markup header (i.e. you can
> define new properties not just values for defined ones and still be
> backwards compatible).
> One limitation may be having to work with standard compilers. A lot of
> optimisation could be better done at the compilation stage with module
> information. For instance allocation of variables, if the modules contained
> basic information on variables used (e.g. if they need to be maintained
> between calls) then a companion compiler could more heavily optimise them
> based on such information. Another such situation is optimisation. In my
> view it would be nice if you could optimise modules for either size or
> speed, for instance if you choose speed, it would put commonly used portions
> of code inline, increasing speed at the cost of program memory. Ideally you
> would be able to tell the program how much program code\instruction cycles
> were allowable and it would minimise the other. However this would really
> need to be done as part of compilation.
> Tom.
> {Original Message removed}