Execute from external SRAM

Generic boards that are not Maple or Maple mini clones, and don't contain the additional USB reset hardware
User avatar
Pito
Posts: 1109
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Execute from external SRAM

Post by Pito » Fri Jan 13, 2017 3:08 am

Now the real retro-computing feeling - Mandelbrot - Sea Horse Valley.
EXRAM, 200x200 pixels, converts to .bmp image, saves the .bmp on the Sdcard.
Double precision calcs (I hope so..). A torture for the stm32 @128M.
Color mapping is still a crap, but you get the feeling of eighties, when talking performance.. ;)

Code: Select all

> run Mandelbrot.bin
Reading file..
Loading the Mandelbrot.bin 32960 bytes large took 22997 usecs
First 8 bytes in EXRAM: 0 F8 7 68 21 22 0 68
Starting the Mandelbrot.bin ...

 Allocated 120000 bytes for image buffer..
 Mandelbrot starts..
 Elapsed 837912 msecs
 Writing .bmp to SDcard..
 Done..
SeaHorseValley.JPG
SeaHorseValley.JPG (42.69 KiB) Viewed 443 times
Last edited by Pito on Fri Jan 13, 2017 9:58 am, edited 2 times in total.
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1109
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Execute from external SRAM

Post by Pito » Fri Jan 13, 2017 9:51 am

The same when run from flash, and only the HEAP is located in EXRAM, picture buffer via malloc() in heap:

Code: Select all

 Allocated 120000 bytes for image buffer..
 Mandelbrot starts..
 Elapsed 101974 msecs
 Writing .bmp to SDcard..
 Done..
and still with HEAP in EXRAM only, but 400x400pixels:

Code: Select all

Allocated 480000 bytes for image buffer..
 Mandelbrot starts..
 Elapsed 409417 msecs
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1109
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Execute from external SRAM

Post by Pito » Sun Jan 15, 2017 9:52 am

A new Variant V3:
1. APP runs off the internal IRAM, and uses HEAP in EXRAM
2. xLOADER's ram is placed on top of IRAM
3. xLOADER runs as usual off the flash, and loads the APP into IRAM (0x20000000).

You may see the VT addresses below point to the internal IRAM.
Dhrystone and Mandelbrot 200x200, all at 128MHz.

Code: Select all

> run Dhrystone.bin
Reading file..
Loading the Dhrystone.bin 25844 bytes large took 33646 usecs
First 8 bytes in EXRAM: 0 DC 0 20 39 6 0 20
Starting the Dhrystone.bin ...

Dhrystone Benchmark, Version 2.1 (Language: C)
Execution starts, 300000 runs through Dhrystone

Execution ends
Microseconds for one run through Dhrystone: 9.50
Dhrystones per Second: 105309.90
VAX MIPS rating = 59.94
***

> run Mandelbrot.bin
Reading file..
Loading the Mandelbrot.bin 32976 bytes large took 43246 usecs
First 8 bytes in EXRAM: 0 DC 0 20 21 22 0 20
Starting the Mandelbrot.bin ...

Allocated 120000 bytes for image buffer..
 Mandelbrot starts..
 Elapsed 104978 msecs
 Writing the .bmp to SDcard..
 Done..
EXRAM Variants bench.JPG
EXRAM Variants bench.JPG (44.69 KiB) Viewed 409 times
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1109
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Execute from external SRAM

Post by Pito » Mon Jan 16, 2017 9:49 am

Return from a running APP via a jump to reset back to xLOADER works as expected.
In this session :) the Dhrystone runs 2x and then jumps back to xLOADER:

Code: Select all

### Hello from xLOADER v1.03 ! ###
    Usage:
          help
          dir
          run APP.bin

> dir
Root dir:
DATA.BMP
STM_Dhrystone128.ino.bin
STM_HelloToggle_fromEXRAM.ino.bin
STM_SDLOGGER_FreeRtos_FIFO__FIRFILTER.ino.bin
STM_Whetstone.ino.bin
STM_bench.ino.bin
STM_BubbleSort_EXRAM_ALL.ino.bin
Dhrystone.bin
STM_Mandelbrot_SeaHorseValley.ino.bin
Mandelbrot.bin
Dhrystone_jmp_rst.bin
> run Dhrystone_jmp_rst.bin
Reading file..
Loading the Dhrystone_jmp_rst.bin 25932 bytes large took 33657 usecs
First 8 bytes in EXRAM: 0 DC 0 20 79 6 0 20
Starting the Dhrystone_jmp_rst.bin ...

Dhrystone Benchmark, Version 2.1 (Language: C)
Execution starts, 300000 runs through Dhrystone

Execution ends
Microseconds for one run through Dhrystone: 9.56
Dhrystones per Second: 104601.60
VAX MIPS rating = 59.53
***

Dhrystone Benchmark, Version 2.1 (Language: C)
Execution starts, 300000 runs through Dhrystone

Execution ends
Microseconds for one run through Dhrystone: 9.56
Dhrystones per Second: 104601.56
VAX MIPS rating = 59.53
***


### Hello from xLOADER v1.03 ! ###
    Usage:
          help
          dir
          run APP.bin

>
And the jump itself - similar method as it is used in the xLOADER:

Code: Select all

..
  // jump back to xLOADER via reset - it runs through the bootloader too
  volatile uint32_t JumpAddress = *(volatile uint32_t*) (0x08000000 + 4);
  Jump_To_Reset = (pFunction) JumpAddress;
  Jump_To_Reset();
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1109
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Execute from external SRAM

Post by Pito » Tue Jan 17, 2017 12:32 pm

EXRAM_VARIANTS_CLASSIC_V1.JPG
EXRAM_VARIANTS_CLASSIC_V1.JPG (65.17 KiB) Viewed 365 times
EXRAM_VARIANTS_V2_V3.JPG
EXRAM_VARIANTS_V2_V3.JPG (72.34 KiB) Viewed 365 times
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1109
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Execute from external SRAM

Post by Pito » Fri Mar 24, 2017 3:50 pm

CP/M on Arduino Nano:

https://forum.arduino.cc/index.php?topi ... rdseen#new

That could easily be run with the CP/M_RAM placed into the 512kB Heap.
At 128MHz it will be faster a bit.. :)
Pukao Hats Cleaning Services Ltd.

User avatar
ahull
Posts: 1510
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Execute from external SRAM

Post by ahull » Fri Mar 24, 2017 11:25 pm

Pito wrote:CP/M on Arduino Nano:

https://forum.arduino.cc/index.php?topi ... rdseen#new

That could easily be run with the CP/M_RAM placed into the 512kB Heap.
At 128MHz it will be faster a bit.. :)
I don't see @foxylab's code. He mentions posting it on github, but I don't see any reference to the actual posting.
- Andy Hull -

User avatar
ahull
Posts: 1510
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Execute from external SRAM

Post by ahull » Fri Mar 24, 2017 11:55 pm

A quick chat with Uncle Google brought me to this though... https://github.com/companje/Altair8800
- Andy Hull -

User avatar
Pito
Posts: 1109
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Execute from external SRAM

Post by Pito » Sat Mar 25, 2017 11:55 am

I built my first 8085 computer in '82. I know well for what you are dreaming about.. :ugeek:
I think the ZET6 board with 512 or 1024kB of external ram is an ideal and cheap platform for such retro-computing stuff..
Pukao Hats Cleaning Services Ltd.

User avatar
ahull
Posts: 1510
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Execute from external SRAM

Post by ahull » Sat Mar 25, 2017 12:49 pm

Pito wrote:I built my first 8085 computer in '82. I know well for what you are dreaming about.. :ugeek:
I think the ZET6 board with 512 or 1024kB of external ram is an ideal and cheap platform for such retro-computing stuff..
Image

Back in the mists of time, one of my first paying jobs involved working with Altos CPM and MPM machines, and later Xenix based ones. Long before Windoze came on the scene. It just might be possible to run some sort of tiny unix on the STM32F103 :idea:
- Andy Hull -

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest