--- PeterMatthias@web.de wrote:
Until a generalized solution is found I would simply scan for the module names in linker that need code and/or data in fast ram and allocate it there. A generalized solution would be to mark code/date in a special way and let the linker do the allocation automatically.
In one of the later versions of the Oberon compiler, Prof. Wirth added a special mark to denote leaf procedures. This kinda bugged me, as the compiler can easily determine whether a procedure is a leaf procedure or not, but it makes sense if you are writing a quick-and-dirty one-pass generate-IMMEDIATELY compiler, as opposed to building an abstract syntax tree and waiting until you have the entire procedure in front of you and can generate the code for it all at once. I'd suggest (based on DSP experience) that, if you allow procedures to be marked for fast RAM, you restrict such marking to leaf procedures. The alternative is to do a transitive closure on the marked procedure: Any procedure called by a procedure marked to be located in fast RAM must also be located in fast RAM. This is a good way to use up fast RAM very quickly, if you make one bad call decision. I also agree with the guy who said you want all of the fast RAM allocation information in ONE place, to make it easier to manage it all, which argues against marking individual procedures, and argues in favor of a linker control file. I've had to do this, on a fair-sized embedded DSP project. It was a headache and it remained an ongoing headache. --John R. Strohm
John, good day.
I'd suggest (based on DSP experience) that, if you allow procedures to be marked for fast RAM, you restrict such marking to leaf procedures.
We have not seen yet the exact scope of work that needs to be done fast. This is a data gathering , with perhaps some DSP, application. So lets wait and see first. Your suggestion is valuable though, if this is at all possible. A question: how did you handle the stack between slow and fast execution parts of the program? Or did it run in separate threads, making the stack business automatic? You see, I know zippo about embedded DSP. Have you got a link to some data sheet / application notes perhaps? cheers, j. On Sat, Aug 29, 2015 at 1:40 PM, John R. Strohm <strohm@airmail.net> wrote:
--- PeterMatthias@web.de wrote:
Until a generalized solution is found I would simply scan for the module names in linker that need code and/or data in fast ram and allocate it there. A generalized solution would be to mark code/date in a special way and let the linker do the allocation automatically.
In one of the later versions of the Oberon compiler, Prof. Wirth added a special mark to denote leaf procedures. This kinda bugged me, as the compiler can easily determine whether a procedure is a leaf procedure or not, but it makes sense if you are writing a quick-and-dirty one-pass generate-IMMEDIATELY compiler, as opposed to building an abstract syntax tree and waiting until you have the entire procedure in front of you and can generate the code for it all at once.
I'd suggest (based on DSP experience) that, if you allow procedures to be marked for fast RAM, you restrict such marking to leaf procedures.
The alternative is to do a transitive closure on the marked procedure: Any procedure called by a procedure marked to be located in fast RAM must also be located in fast RAM. This is a good way to use up fast RAM very quickly, if you make one bad call decision.
I also agree with the guy who said you want all of the fast RAM allocation information in ONE place, to make it easier to manage it all, which argues against marking individual procedures, and argues in favor of a linker control file. I've had to do this, on a fair-sized embedded DSP project. It was a headache and it remained an ongoing headache.
--John R. Strohm
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
I suggest looking at www.dspguide.com
Oh laugh of laughs, I read through sections of that book about a year ago to see what I could use. Ok, this is the trouble: I dont know about it, because the wiring from my eyes to my brain to my fingers doing, has not been properly developed yet. Perhaps I should stop blaming myself and start doing . . . cheers, j. On Tue, Sep 1, 2015 at 3:53 AM, <skulski@pas.rochester.edu> wrote:
Jan:
You see, I know zippo about embedded DSP. Have you got a link to some data sheet / application notes perhaps?
I suggest looking at www.dspguide.com. You can download the entire PDF of this book for free from that website.
Wojtek
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Am 29.08.2015 um 13:40 schrieb John R. Strohm:
--- PeterMatthias@web.de wrote:
Until a generalized solution is found I would simply scan for the module names in linker that need code and/or data in fast ram and allocate it there. A generalized solution would be to mark code/date in a special way and let the linker do the allocation automatically. ... I'd suggest (based on DSP experience) that, if you allow procedures to be marked for fast RAM, you restrict such marking to leaf procedures.
The alternative is to do a transitive closure on the marked procedure: Any procedure called by a procedure marked to be located in fast RAM must also be located in fast RAM. This is a good way to use up fast RAM very quickly, if you make one bad call decision.
Both true. However, marking code on procedure level would be difficult to implement. On module level it's easy to implement and can be restricted to leaf modules. If someone wants a stack in fast ram, allocate same data and let the exported procedures do the change of the stack pointer. Don't use exported procedures local.
I also agree with the guy who said you want all of the fast RAM allocation information in ONE place, to make it easier to manage it all, which argues against marking individual procedures, and argues in favor of a linker control file. I've had to do this, on a fair-sized embedded DSP project. It was a headache and it remained an ongoing headache.
Also true. If you can't get your code into one fast ram module it gets complicated. If it fits, it should be easy. Peter
Peter,
If someone wants a stack in fast ram, allocate same data and let the exported procedures do the change of the stack pointer. Don't use exported procedures local.
Do you mean to say: "Don't use exported procedures locally *because* they will confuse the stack pointer"? (since you advise to let the exported procedures do the change of the stack pointer.) Do I understand that right? j. On Sat, Aug 29, 2015 at 9:22 PM, Peter Matthias <PeterMatthias@web.de> wrote:
Am 29.08.2015 um 13:40 schrieb John R. Strohm:
--- PeterMatthias@web.de wrote:
Until a generalized solution is found I would simply scan for the module names in linker that need code and/or data in fast ram and allocate it there. A generalized solution would be to mark code/date in a special way and let the linker do the allocation automatically. ... I'd suggest (based on DSP experience) that, if you allow procedures to be marked for fast RAM, you restrict such marking to leaf procedures.
The alternative is to do a transitive closure on the marked procedure: Any procedure called by a procedure marked to be located in fast RAM must also be located in fast RAM. This is a good way to use up fast RAM very quickly, if you make one bad call decision.
Both true. However, marking code on procedure level would be difficult to implement. On module level it's easy to implement and can be restricted to leaf modules. If someone wants a stack in fast ram, allocate same data and let the exported procedures do the change of the stack pointer. Don't use exported procedures local.
I also agree with the guy who said you want all of the fast RAM allocation information in ONE place, to make it easier to manage it all, which argues against marking individual procedures, and argues in favor of a linker control file. I've had to do this, on a fair-sized embedded DSP project. It was a headache and it remained an ongoing headache.
Also true. If you can't get your code into one fast ram module it gets complicated. If it fits, it should be easy.
Peter
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Am 29.08.2015 um 21:52 schrieb Jan de Kruyf:
Peter,
If someone wants a stack in fast ram, allocate same data and let the exported procedures do the change of the stack pointer. Don't use exported procedures local.
Do you mean to say: "Don't use exported procedures locally *because* they will confuse the stack pointer"? (since you advise to let the exported procedures do the change of the stack pointer.) Do I understand that right?
If you change the stack pointer in that procedure, of course you either have to check from where you are being called or you must not use that procedure from within the wrong stack. Peter
On Sat, Aug 29, 2015 at 9:22 PM, Peter Matthias <PeterMatthias@web.de <mailto:PeterMatthias@web.de>> wrote:
Am 29.08.2015 um 13:40 schrieb John R. Strohm: > ---PeterMatthias@web.de <mailto:PeterMatthias@web.de> wrote: >> Until a generalized solution is found I would simply scan for the module >> names in linker that need code and/or data in fast ram and allocate it >> there. A generalized solution would be to mark code/date in a special >> way and let the linker do the allocation automatically. ... > I'd suggest (based on DSP experience) that, if you allow procedures to be marked for fast RAM, you restrict such marking to leaf procedures. > > The alternative is to do a transitive closure on the marked procedure: Any procedure called by a procedure marked to be located in fast RAM must also be located in fast RAM. This is a good way to use up fast RAM very quickly, if you make one bad call decision.
Both true. However, marking code on procedure level would be difficult to implement. On module level it's easy to implement and can be restricted to leaf modules. If someone wants a stack in fast ram, allocate same data and let the exported procedures do the change of the stack pointer. Don't use exported procedures local.
> I also agree with the guy who said you want all of the fast RAM allocation information in ONE place, to make it easier to manage it all, which argues against marking individual procedures, and argues in favor of a linker control file. I've had to do this, on a fair-sized embedded DSP project. It was a headache and it remained an ongoing headache.
Also true. If you can't get your code into one fast ram module it gets complicated. If it fits, it should be easy.
Peter
-- Oberon@lists.inf.ethz.ch <mailto:Oberon@lists.inf.ethz.ch> mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Peter,
If you change the stack pointer in that procedure, of course you either have to check from where you are being called or you must not use that procedure from within the wrong stack.
Ja thats clear, I was checking if there was more on your mind, Thanks. j. On Tue, Sep 1, 2015 at 5:38 PM, Peter Matthias <PeterMatthias@web.de> wrote:
Peter,
If someone wants a stack in fast ram, allocate same data and let the exported procedures do the change of
Am 29.08.2015 um 21:52 schrieb Jan de Kruyf: the
stack pointer. Don't use exported procedures local.
Do you mean to say: "Don't use exported procedures locally *because* they will confuse the stack pointer"? (since you advise to let the exported procedures do the change of the stack pointer.) Do I understand that right?
If you change the stack pointer in that procedure, of course you either have to check from where you are being called or you must not use that procedure from within the wrong stack.
Peter
On Sat, Aug 29, 2015 at 9:22 PM, Peter Matthias <PeterMatthias@web.de <mailto:PeterMatthias@web.de>> wrote:
Am 29.08.2015 um 13:40 schrieb John R. Strohm: > ---PeterMatthias@web.de <mailto:PeterMatthias@web.de> wrote: >> Until a generalized solution is found I would simply scan for the
module
>> names in linker that need code and/or data in fast ram and
allocate it
>> there. A generalized solution would be to mark code/date in a
special
>> way and let the linker do the allocation automatically. ... > I'd suggest (based on DSP experience) that, if you allow
procedures to be marked for fast RAM, you restrict such marking to leaf procedures.
> > The alternative is to do a transitive closure on the marked
procedure: Any procedure called by a procedure marked to be located in fast RAM must also be located in fast RAM. This is a good way to use up fast RAM very quickly, if you make one bad call decision.
Both true. However, marking code on procedure level would be
difficult
to implement. On module level it's easy to implement and can be restricted to leaf modules. If someone wants a stack in fast ram, allocate same data and let the exported procedures do the change of
the
stack pointer. Don't use exported procedures local.
> I also agree with the guy who said you want all of the fast RAM
allocation information in ONE place, to make it easier to manage it all, which argues against marking individual procedures, and argues in favor of a linker control file. I've had to do this, on a fair-sized embedded DSP project. It was a headache and it remained an ongoing headache.
Also true. If you can't get your code into one fast ram module it
gets
complicated. If it fits, it should be easy.
Peter
-- Oberon@lists.inf.ethz.ch <mailto:Oberon@lists.inf.ethz.ch> mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
participants (4)
-
Jan de Kruyf -
John R. Strohm -
Peter Matthias -
skulski@pas.rochester.edu