[Oberon] Wojtek's comment

Chris Burrows chris at cfbsoftware.com
Thu Aug 27 00:43:16 CEST 2015


> -----Original Message-----
> From: skulski at pas.rochester.edu [mailto:skulski at pas.rochester.edu]
> Sent: Thursday, 27 August 2015 12:59 AM
> To: paulreed at paddedcell.com; ETH Oberon and related systems
> Cc: greim at schleibinger.com
> Subject: Re: [Oberon] Wojtek's comment
> 
> How can the language do better? Imagine a BRAM into which we are
> collecting the waveform from the ADC. (We are doing just that.) I
> would like to see a high level declaration:
> 
>   VAR my_samples: ARRAY 8191 OF SHORT AT ADDRESS <address>;
> 
> Then I can use this array in the code in a type-safe way. As of today
> I must use Chris' SYSTEM.Get, which is low-level, error prone, and
> more difficult to maintain. 

If you want to have that level of control over which type of memory you use
for particular variables then by definition it is low-level, error prone and
difficult to maintain. 

However, we do have a simple solution used in Astrobe that could be used for
this sort of thing - assuming you don't want too many different levels of
control. Read my posts with associated example source code on the Astrobe
forum. This solution requires no change to the Oberon language:

"Using the additional 16 / 32kB of RAM on LPC175x/6x MCUs":

http://www.astrobe.com/forum/viewtopic.php?f=7&t=267

and the similar:

"Using the additional 2kB of RAM on LPC131x / LPC134x MCUs"

http://www.astrobe.com/forum/viewtopic.php?f=7&t=408

If you wanted more levels of control, we have implemented NEW in a similar
way to how it is done in Modula-2. i.e. calls to NEW are transformed to
calls to an underlying 'Storage' module which handles the dynamic memory
storage allocation scheme. You can customise the source code of that to your
heart's content e.g. allocate records of a particular size to one area of
memory, allocate larger records to another area etc. You are free to make it
as complicated as you wish.

Regards,
Chris

Chris Burrows
CFB Software
http://www.astrobe.com





More information about the Oberon mailing list