Spin2CPP, FlexSpin, FlexCC, FlexProp (PASM, Spin, BASIC, C)

Offtopic Themen bitte hier hinein.
Benutzeravatar
yeti
Beiträge: 2300
Registriert: Fr 27. Aug 2010, 14:48
Wohnort: Wrong Planet
Kontaktdaten:

Re: spin2cpp

Beitrag von yeti »

----------8<-----{20160319-1706-GMT}----->8----------

"spin2cpp" heißt jetzt "spincvt",
aber sonst ändert sich nix...


...oder so ähnlich...

...naja... zumindest das ZIP-File, das man da abgrabschen kann, heißt nun so... das GIT-Repo heißt noch "spin2cpp" und auch das entstehende Binary bei meinem letzten Versuch (heut janz früh...) hatte noch den alten Namen.

+++EDIT-20160403-1002-GMT
Das Kommandozeilenprogramm "spin2cpp" heißt noch wie zuvor und das hinzugekommene GUI-Drumrum heißt "spincvt".
Ich betrachte hier nur "spin2cpp" und das ist auch gut so! ;-)
---EDIT-20160403-1002-GMT


"Spin2cpp" ist auf dem besten Weg, ein eigener Spincompiler zu sein...

\begin(((Schamloses Cut&Paste von einer eigenen Quelle an anderem Ort)))

Let There Be LMM!

From preview-8 onwards (I used preview-9 here), generating LMM code is possible:

Code: Alles auswählen

' mandelbrot-20140623-fds-80x25
'
con
  _clkmode = xtal1+pll16x
  _clkfreq = 80_000_000

  xmin=-8601    ' int(-2.1*4096)
  xmax=2867     ' int( 0.7*4096)

  ymin=-4915    ' int(-1.2*4096)
  ymax=4915     ' int( 1.2*4096)

  maxiter=25

obj
  ser : "FullDuplexSerial"

pub main | c,cx,cy,dx,dy,x,y,xn,yn,rsq,iter

  ser.start(31, 30, 0, 115200)

  dx:=(xmax-xmin)/79
  dy:=(ymax-ymin)/24

  cy:=ymin
  repeat while cy=<ymax
    cx:=xmin
    repeat while cx=<xmax
      x:=0
      y:=0
      rsq:=0
      iter:=0
      repeat while iter=<maxiter and rsq=<16384
        xn:=((x*x-y*y)~>12)+cx
        yn:=((x*y)~>11)+cy
        x:=xn
        y:=yn
        rsq:=(x*x+y*y)~>12
        iter+=1
      cx+=dx
      ser.tx(iter+32)
    cy+=dy
    ser.tx(10)

  waitcnt(_clkfreq+cnt)
  ser.stop
Compiling:

Code: Alles auswählen

$ /opt/spin2cpp/bin/spin2cpp --asm --binary --code=hub -I /opt/parallax.spin.src/spin mandelbrot-20140623-fds-80x25.spin
$ LANG= TZ=UTC ls -l
total 20
-rw-r--r-- 1 yeti yeti  1848 Mar 19 05:31 mandelbrot-20140623-fds-80x25.binary
-rw-r--r-- 1 yeti yeti 11838 Mar 19 05:31 mandelbrot-20140623-fds-80x25.pasm
-rw-r--r-- 1 yeti yeti   772 Mar 19 05:24 mandelbrot-20140623-fds-80x25.spin
...and liftoff!

Code: Alles auswählen

$ /opt/spinsim/bin/spinsim mandelbrot-20140623-fds-80x25.binary -b
!!!!!!!!!!!!!!!"""""""""""""####################################""""""""""""""""
!!!!!!!!!!!!!"""""""""#######################$$$$$$$%'+)%%%$$$$$#####"""""""""""
!!!!!!!!!!!"""""""#######################$$$$$$$$%%%&&(+,)++&%$$$$$$######""""""
!!!!!!!!!"""""#######################$$$$$$$$$$%%%%&')*4:/+('&%%$$$$$$#######"""
!!!!!!!!""""#####################$$$$$$$$$$%%%&&&''),:::::::,'&%%%%%$$$$########
!!!!!!!"""####################$$$$$$$$%%%&'())((())*,::::::/+))('&&&&)'%$$######
!!!!!!""###################$$$$$%%%%%%&&&'+.:::/::::::::::::::::/++:..9:%%$#####
!!!!!"################$$$%%%%%%%%%%&&&&'),+1:::::::::::::::::::::::::1(&&%$$####
!!!!"##########$$$$$%%&(-(''''''''''''(*,5::::::::::::::::::::::::::::+)-&%$$###
!!!!####$$$$$$$$%%%%%&'(*-:1.+.:-4+))**:::::::::::::::::::::::::::::::4-(&%$$$##
!!!!#$$$$$$$$$%%%%%%'''++.6:::::::::8/0::::::::::::::::::::::::::::::::3(%%$$$$#
!!!#$$$$$$$%&&&&''()/-3.5::::::::::::::::::::::::::::::::::::::::::::::'&%%$$$$#
!!!(**+/+:523/:0/46::::::::::::::::::::::::::::::::::::::::::::::::4+)'&&%%$$$$#
!!!#$$$$$$$%&&&&''().-2.:::::::::::::::::::::::::::::::::::::::::::::::'&%%$$$$#
!!!!#$$$$$$$$$%%%%%&'''/,.7::::::::::/0::::::::::::::::::::::::::::::::0'%%$$$$#
!!!!####$$$$$$$$%%%%%&'(*-:2.,/:-5+))**:::::::::::::::::::::::::::::::4+(&%$$$##
!!!!"##########$$$$$%%&(,(''''(''''''((*,4:::::::::::::::::::::::::::4+)-&%$$###
!!!!!"################$$$%%%%%%%%%%&&&&'):,4:::::::::::::::::::::::::/('&%%$####
!!!!!!""##################$$$$$$%%%%%%&&&'*.:::0::::::::::::::::1,,://:)%%$#####
!!!!!!!"""####################$$$$$$$$%%%&(())((()**-::::::/+)))'&&&')'%$$######
!!!!!!!!""""#####################$$$$$$$$$$%%%&&&''(,:::::::+'&&%%%%%$$$########
!!!!!!!!!"""""#######################$$$$$$$$$$%%%%&')*7:0+('&%%%$$$$$#######"""
!!!!!!!!!!!"""""""######################$$$$$$$$$%%%&&(+-).*&%$$$$$$######""""""
!!!!!!!!!!!!!"""""""""#######################$$$$$$%%'7(%%%$$$$$######""""""""""
!!!!!!!!!!!!!!!""""""""""""#####################################""""""""""""""""
$ _
Translating the simple mandelbrot code is not a big deal... the big task is to get "FullDuplexSerial" compiled. Obvoiusly this succeeded!

...and neither Propeller-GCC, nor OpenSpin are in the PATH:

Code: Alles auswählen

$ which openspin || echo no.
no.
$ which propeller-elf-gcc || echo no.
no.
$ _
...so let's hear a big applause for "spin2cpp" now!

\end(((Schamloses Cut&Paste von einer eigenen Quelle an anderem Ort)))

----------8<-----{20160324-0752-GMT}----->8----------

Die PASM-bezogenen Änderungen in "spin2cpp" sind nun in den Master-Branch gewandert und "spin2cpp" hat nun den "beta2" Stempel bekommen...

Ich bin mal gespannt, ob vor Ostern noch andere nette Süßigkeiten dazu kommen...

----------8<-----{20160325-1620-GMT}----->8----------

Es ostert sehr ... und das Osterlangohr hat das "beta2" weggeknabbert:

Code: Alles auswählen

(yeti@aurora:12)~$ /opt/spin2cpp/bin/spin2cpp 
Spin to C++ converter version 3.0.0
Usage: /opt/spin2cpp/bin/spin2cpp [options] file.spin
Options:
  --asm:     output (user readable) PASM code
  --binary:  create binary file for download
  --catalina: convert to C and run Catalina on result
  --ccode:   output C code instead of C++
  --code=x : PASM output only: control placement of code
             x can be cog (default) or hub (for LMM)
  --data=x : PASM output only: control placement of data
             x can be cog or hub; only --data=hub works for now
  --dat:     output binary blob of DAT section only
  --elf:     create executable ELF file with propgcc
  --files:   print list of .cpp files to stdout
  --gas:     create inline assembly out of DAT area;
             with --dat, create gas .S file from DAT area
  --main:    include C++ main() function
  --noheader: skip the normal comment about spin2cpp version
  --noopt:   turn off all optimization in PASM output
  --nopre:   do not run preprocessor on the .spin file
  --normalize: normalize case of all identifiers
  -Dname=val: define a preprocessor symbol
  -g:         add debug info to output (original source for PASM output)
  -I dir:     add dir to the object search path
  -L dir:     same as -I
  -o file:    place final output in file
  -y:         debug parser
(yeti@aurora:12)~$ _
...erhellende Kommentare zum Übergang von "beta2" auf "final" werden uns wohl bald im Parallaxforum gereicht...

----------8<-----{Hurz!}----->8----------
Zuletzt geändert von yeti am So 3. Apr 2016, 11:10, insgesamt 2-mal geändert.
𝖂𝖎𝖗 𝖐𝖔̈𝖓𝖓𝖊𝖓 𝖆𝖑𝖑𝖊𝖘 𝖆𝖚𝖘𝖘𝖊𝖗 𝖎𝖓 𝕱𝖗𝖚̈𝖍𝖑𝖎𝖓𝖌, 𝕾𝖔𝖒𝖒𝖊𝖗, 𝕳𝖊𝖗𝖇𝖘𝖙 𝖚𝖓𝖉 𝖂𝖎𝖓𝖙𝖊𝖗! – 𝕯𝖊𝖚𝖙𝖘𝖈𝖍𝖑𝖆𝖓𝖉.
"Du willst hier nicht klicken. Dies interessiert Dich nicht." — Yeti.
"DNA is a four letter word!" — Yeti.
Benutzeravatar
yeti
Beiträge: 2300
Registriert: Fr 27. Aug 2010, 14:48
Wohnort: Wrong Planet
Kontaktdaten:

Re: spin2cpp

Beitrag von yeti »

----------8<-----{20160326-0420-GMT}----->8----------

...und es wurd offiziell v3.0.0...

...was ein guter Anlaß scheint, den zuvorigen Beitrag nicht ewig nur zu verlängern...

----------8<-----{20160330-22:22-ZELZ (ZentralEuropäïscheLügenZeit)}----->8----------

Söööööö...

Spin2cpp hab ich auf außer auf 08/15-PCs unter Debian8 mittlerweile auch auf Cubietruck unter Cubieez/Wheezy und PI2 unter Raspian/Jessie gebaut und kurz probebeschnüffelgetestet...

Es musste wieder das 16-Bit-Integerarrithmetik-Apfelmännchen mit Ausgabe über FullDuplexSerial herhalten, welches mit Spin2cpp ohne die Zuhilfenahme von PropGCC via je PASM und LMM-PASM und durch OpenSpin direkt zum durch Spinsim ausgeführten Binärchen übersetzt wurde.

***luft-hol***

Also nochmal langsam von Vorne:
  • Spin-->PASM-->Binary durch Spinsim.
  • Spin-->LMM-PASM-->Binary durch Spinsim.
  • Spin-->Binary durch OpenSpin.
OpenSpin kommt nur zum Vergleich ins Spiel, es wird bei den durch Spin2cpp angeworfenen Übersetzungen in keiner Weise benötigt.

So wurden also neben Spin2cpp auch OpenSpin und Spinsim auf allen Rechner mitbemüht...

Die Laufzeit des Apfelmännchenberechnens wurde nur über die Berechnung und Ausgabe des Mandelbrötchens genommen, die Initialisierung und der Shutdown von FullDuplexSerial wurde nicht einbezogen.

FullDuplexSerial kommt bei jedem ausgegebenen "Pixel" ins Spiel und das durch die Baurdate (115200) erzwungene Timing ist natürlich ein Aufwand, den keiner der Codegeneratoren austricksen kann, stellt aber eine ernstzunehmende Code-Komplexität dar, so daß es mir als Testerei geeignet schien... ääähhh... you know what I mean... ;-)

Code: Alles auswählen

$ make
/opt/spin2cpp/bin/spin2cpp --asm --binary -o mb.spin2pasm.cog.binary mb.spin # --code=cog is implicit
/opt/spinsim/bin/spinsim -p mb.spin2pasm.cog.binary -b | tee mb.spin2pasm.cog.log | egrep '^[0-9]+ ticks$'
57342232 ticks
/opt/spin2cpp/bin/spin2cpp --asm --code=hub --binary -o mb.spin2pasm.hub.binary mb.spin
/opt/spinsim/bin/spinsim -p mb.spin2pasm.hub.binary -b | tee mb.spin2pasm.hub.log | egrep '^[0-9]+ ticks$'
70297872 ticks
/opt/openspin/bin/openspin -u -o mb.openspin.binary mb.spin
Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.
Version 1.00.78 Compiled on Mar 30 2016 21:32:42
Compiling...
mb.spin
|-FullDuplexSerial.spin
Done.
|-FullDuplexSerial.spin
Done.
Program size is 860 bytes
/opt/spinsim/bin/spinsim -p mb.openspin.binary -b | tee mb.openspin.log | egrep '^[0-9]+ ticks$'
247142672 ticks
rm mb.spin2pasm.hub.binary mb.spin2pasm.cog.binary mb.openspin.binary
$ _
Da isses:
mb-test.zip
Apfelmännchen-Spieler-Ei
(5.18 KiB) 554-mal heruntergeladen
----------8<-----{20160331-18:09-ZELZ (ZentralEuropäïscheLügenZeit)}----->8----------

Der Versionsnummernsprung scheint Auferkelsamkeit zu erregen und mehr Tester finden mehr Bugs... ;-) ...also gibt es derzeit häufiger kleiner Updates... in dieser Frequenz immer auf allen hiesigen unterschiedlichen Kisten Schritt halten ist nicht drin... ein paar Kompilate hab ich außerhalb dieses Forums versteckt, aber Hinweise darauf sind naheliegend... den GUI-Kram habe ich nicht mit gepackt, denn ich hab eh keine Ahnung wie man das benutzt... den kann sich jeder Mausliebhaber aus den Quellen kratzen...

----------8<-----{20160401-01:23-ZELZ (ZentralEuropäïscheLügenZeit)}----->8----------

...nochmal aufgebohrt, rumgeschraubt, tiefer gelegt und C- und C++-Übersetzung einbezogen:

Code: Alles auswählen

      57342232 ticks ... mb.spin2pasm.cog.log
      70297872 ticks ... mb.spin2pasm.hub.log
      82238688 ticks ... mb.spin2cpp.c.log
      82950752 ticks ... mb.spin2cpp.cpp.log
     247142672 ticks ... mb.openspin.log
mb-test2.zip
Jetzt mit Spoiler...
(6.54 KiB) 570-mal heruntergeladen
----------8<-----{20160401-19:22-ZELZ (ZentralEuropäïscheLügenZeit)}----->8----------

Peppigeres Makefile, tollere Directory-Struktur, mehr Geschmacksrichtungen und mehr Zahlen zum Interpretieren...

Code: Alles auswählen

Size
----
           860 bytes    build/openspin/main.binary
          2108 bytes    build/s2c.pasm-cog/main.binary
          2360 bytes    build/s2c.pasm-hub/main.binary
          3332 bytes    build/s2c.c-cmm/main.binary
          3332 bytes    build/s2c.cpp-cmm/main.binary
          4016 bytes    build/s2c.c-lmm/main.binary
          4016 bytes    build/s2c.cpp-lmm/main.binary

Speed
-----
      49260944 ticks    build/s2c.c-lmm/main.log
      49260944 ticks    build/s2c.cpp-lmm/main.log
      57342232 ticks    build/s2c.pasm-cog/main.log
      70297872 ticks    build/s2c.pasm-hub/main.log
     104763600 ticks    build/s2c.c-cmm/main.log
     104763600 ticks    build/s2c.cpp-cmm/main.log
     247142672 ticks    build/openspin/main.log
mb-test3.zip
Chili-Version
(6.91 KiB) 540-mal heruntergeladen
----------8<-----{Kthxbye!}----->8----------
𝖂𝖎𝖗 𝖐𝖔̈𝖓𝖓𝖊𝖓 𝖆𝖑𝖑𝖊𝖘 𝖆𝖚𝖘𝖘𝖊𝖗 𝖎𝖓 𝕱𝖗𝖚̈𝖍𝖑𝖎𝖓𝖌, 𝕾𝖔𝖒𝖒𝖊𝖗, 𝕳𝖊𝖗𝖇𝖘𝖙 𝖚𝖓𝖉 𝖂𝖎𝖓𝖙𝖊𝖗! – 𝕯𝖊𝖚𝖙𝖘𝖈𝖍𝖑𝖆𝖓𝖉.
"Du willst hier nicht klicken. Dies interessiert Dich nicht." — Yeti.
"DNA is a four letter word!" — Yeti.
Benutzeravatar
yeti
Beiträge: 2300
Registriert: Fr 27. Aug 2010, 14:48
Wohnort: Wrong Planet
Kontaktdaten:

Re: spin2cpp

Beitrag von yeti »

----------8<-----{20160425-0554-GMT}----->8----------

Psssst...
Gaaaanz heißer Stoff: http://forums.parallax.com/discussion/1 ... r-for-spin
...musste einfach probieren!

----------8<-----{20160425-1035-GMT}----->8----------

Hmmm... "fastspin" braucht "bison3"... auf meinen Wheezy-Cubienchen mag's so nicht kompilern. Der Autor ist informiert und will sich das nochmal anschauen. Wenn er keine "bison2"-Kompatibilität einbaut, werd ich einfach einen "bison3" im /opt-Zoo einquartieren... da kenn ich nix!

Es wird echt Zeit für Jessie auf den Cubienen... Ich brauch endlich 6 Hände und den 100-Stunden-Tag!

----------8<-----{20160724-0338-GMT}----->8----------

Code: Alles auswählen

(yeti@kumari:3)/opt/spin2cpp/src/spin2cpp$ git describe --tags 
v3.0.5-40-gf155944
(yeti@kumari:3)/opt/spin2cpp/src/spin2cpp$ /opt/spin2cpp/bin/spin2cpp |& head -2
Spin to C++ converter version 3.1.0-beta4
Usage: /opt/spin2cpp/bin/spin2cpp [options] file.spin
Noch Fragen, Hauser?

----------8<-----{20160820-2123-ZELZ}----->8----------

\o\   \o/   /o/   Version 3.1.1   \o\   \o/   /o/

Es hat sich Einiges getan. Einen Überblick erhalten kann man bei https://github.com/totalspectrum/spin2c ... tag/v3.1.1.

----------8<-----{20160823-1616-GMT}----->8----------

\o\ \o/ /o/ Version 3.1.2 \o\ \o/ /o/

----------8<-----{In seinem nudeligen Namen: Pasta und Ramen!}----->8----------
Zuletzt geändert von yeti am Di 31. Jan 2017, 18:57, insgesamt 1-mal geändert.
𝖂𝖎𝖗 𝖐𝖔̈𝖓𝖓𝖊𝖓 𝖆𝖑𝖑𝖊𝖘 𝖆𝖚𝖘𝖘𝖊𝖗 𝖎𝖓 𝕱𝖗𝖚̈𝖍𝖑𝖎𝖓𝖌, 𝕾𝖔𝖒𝖒𝖊𝖗, 𝕳𝖊𝖗𝖇𝖘𝖙 𝖚𝖓𝖉 𝖂𝖎𝖓𝖙𝖊𝖗! – 𝕯𝖊𝖚𝖙𝖘𝖈𝖍𝖑𝖆𝖓𝖉.
"Du willst hier nicht klicken. Dies interessiert Dich nicht." — Yeti.
"DNA is a four letter word!" — Yeti.
Benutzeravatar
yeti
Beiträge: 2300
Registriert: Fr 27. Aug 2010, 14:48
Wohnort: Wrong Planet
Kontaktdaten:

Re: spin2cpp

Beitrag von yeti »

----------8<-----{20161002-1524-GMT}----->8----------

\o\ \o/ /o/ Version 3.2.0 \o\ \o/ /o/

----------8<-----{20161002-1800-GMT}----->8----------

Der Mandelbrötchen-Test von vor ein paar Versionen nochmal, aber diesmal mit und ohne "--cse" bei "spin2cpp":

Code: Alles auswählen

Size
----
           860 bytes    build/openspin/main.binary
          1828 bytes    build/s2c.pasm-cog-cse/main.binary
          1828 bytes    build/s2c.pasm-cog/main.binary
          2188 bytes    build/s2c.pasm-hub-cse/main.binary
          2188 bytes    build/s2c.pasm-hub/main.binary
          3504 bytes    build/s2c.c-cmm/main.binary
          3504 bytes    build/s2c.cpp-cmm/main.binary
          3516 bytes    build/s2c.c-cmm-cse/main.binary
          3516 bytes    build/s2c.cpp-cmm-cse/main.binary
          4400 bytes    build/s2c.c-lmm/main.binary
          4400 bytes    build/s2c.cpp-lmm/main.binary
          4424 bytes    build/s2c.c-lmm-cse/main.binary
          4424 bytes    build/s2c.cpp-lmm-cse/main.binary

Speed
-----
      24745884 ticks    build/s2c.pasm-cog-cse/main.log 
      24745884 ticks    build/s2c.pasm-cog/main.log     
      27398352 ticks    build/s2c.pasm-hub-cse/main.log 
      27398352 ticks    build/s2c.pasm-hub/main.log     
      49260944 ticks    build/s2c.c-lmm/main.log        
      49260944 ticks    build/s2c.cpp-lmm/main.log      
      49310800 ticks    build/s2c.c-lmm-cse/main.log    
      49310800 ticks    build/s2c.cpp-lmm-cse/main.log  
     104763600 ticks    build/s2c.c-cmm/main.log        
     104763600 ticks    build/s2c.cpp-cmm/main.log      
     105144400 ticks    build/s2c.c-cmm-cse/main.log    
     105144400 ticks    build/s2c.cpp-cmm-cse/main.log  
     247142672 ticks    build/openspin/main.log         
Rieche ich da ein "-mfcache"?
Die Zahlen allein sind ja hybsch, aber interpretationsabweisend.
Irgendwann muß ich mal die Assembler-Listings gegeneinander "diff"-en.
Später!

----------8<-----{In seinem nudeligen Namen: Pasta und Ramen!}----->8----------
𝖂𝖎𝖗 𝖐𝖔̈𝖓𝖓𝖊𝖓 𝖆𝖑𝖑𝖊𝖘 𝖆𝖚𝖘𝖘𝖊𝖗 𝖎𝖓 𝕱𝖗𝖚̈𝖍𝖑𝖎𝖓𝖌, 𝕾𝖔𝖒𝖒𝖊𝖗, 𝕳𝖊𝖗𝖇𝖘𝖙 𝖚𝖓𝖉 𝖂𝖎𝖓𝖙𝖊𝖗! – 𝕯𝖊𝖚𝖙𝖘𝖈𝖍𝖑𝖆𝖓𝖉.
"Du willst hier nicht klicken. Dies interessiert Dich nicht." — Yeti.
"DNA is a four letter word!" — Yeti.
Benutzeravatar
yeti
Beiträge: 2300
Registriert: Fr 27. Aug 2010, 14:48
Wohnort: Wrong Planet
Kontaktdaten:

Re: spin2cpp

Beitrag von yeti »

----------8<-----{20161018-1255-GMT}----->8----------

Version 3.2.1

----------8<-----{20161019-0440-GMT}----->8----------

Version 3.2.2

...ööööiiiiiiiiijjjjjjjjjj... ich hab doch noch nichtmal auf allen Rechnern version 3.2.1 am Rennen...

----------8<-----{20161025-1423-GMT}----->8----------

Version 3.4.0
This version (3.4.0) has a completely revamped --gas mode for putting the Spin DAT section into C or C++ code. The inline assembly produced by --gas is readable and modifiable by the end user, and PASM comments are preserved in it. Without the --gas option the DAT section is compiled into a single large array of bytes, which can't really be changed in any useful way.
...er war schon wieder schneller... ich hab noch nicht mal die vorherige Version ordentlich testen können...

*seufz!*

----------8<-----{...später mehr ... vielleicht...}----->8----------
𝖂𝖎𝖗 𝖐𝖔̈𝖓𝖓𝖊𝖓 𝖆𝖑𝖑𝖊𝖘 𝖆𝖚𝖘𝖘𝖊𝖗 𝖎𝖓 𝕱𝖗𝖚̈𝖍𝖑𝖎𝖓𝖌, 𝕾𝖔𝖒𝖒𝖊𝖗, 𝕳𝖊𝖗𝖇𝖘𝖙 𝖚𝖓𝖉 𝖂𝖎𝖓𝖙𝖊𝖗! – 𝕯𝖊𝖚𝖙𝖘𝖈𝖍𝖑𝖆𝖓𝖉.
"Du willst hier nicht klicken. Dies interessiert Dich nicht." — Yeti.
"DNA is a four letter word!" — Yeti.
Benutzeravatar
yeti
Beiträge: 2300
Registriert: Fr 27. Aug 2010, 14:48
Wohnort: Wrong Planet
Kontaktdaten:

Re: spin2cpp

Beitrag von yeti »

http://forums.parallax.com/discussion/1 ... iling-spin ist vielleicht ein netter Starter für den SPIN2CPP/FASTSPIN-Erstkontakt...
𝖂𝖎𝖗 𝖐𝖔̈𝖓𝖓𝖊𝖓 𝖆𝖑𝖑𝖊𝖘 𝖆𝖚𝖘𝖘𝖊𝖗 𝖎𝖓 𝕱𝖗𝖚̈𝖍𝖑𝖎𝖓𝖌, 𝕾𝖔𝖒𝖒𝖊𝖗, 𝕳𝖊𝖗𝖇𝖘𝖙 𝖚𝖓𝖉 𝖂𝖎𝖓𝖙𝖊𝖗! – 𝕯𝖊𝖚𝖙𝖘𝖈𝖍𝖑𝖆𝖓𝖉.
"Du willst hier nicht klicken. Dies interessiert Dich nicht." — Yeti.
"DNA is a four letter word!" — Yeti.
Benutzeravatar
yeti
Beiträge: 2300
Registriert: Fr 27. Aug 2010, 14:48
Wohnort: Wrong Planet
Kontaktdaten:

Re: spin2cpp

Beitrag von yeti »

Code: Alles auswählen

(yeti@kumari:12)~/wrk/propeller/spinsim/fibsnippet$ cat main.spin 
con
  _clkmode = xtal1+pll16x
  _clkfreq = 80_000_000

obj
  ser : "FullDuplexSerial"

pub main

  ser.start(31, 30, 0, 115200)

  fib(10)

  waitcnt(_clkfreq >> 3 + cnt)
  ser.stop

pub fib(i) : a | b
  b := a := 1
  repeat i
    a := b + (b := a)
    ser.dec(a)
    ser.tx(13)
(yeti@kumari:12)~/wrk/propeller/spinsim/fibsnippet$ cat Makefile 
#==============================================================================

FASTSPIN    = /opt/spin2cpp/bin/fastspin
OPENSPIN    = /opt/openspin/bin/openspin
SPINSIM     = /opt/parallax/bin/spinsim
SPINSTDLIB  = /opt/parallax.spin.src/spin

#------------------------------------------------------------------------------

all: main.openspin.log main.fastspin.log

#------------------------------------------------------------------------------

main.openspin.binary: main.spin Makefile
        @printf '$$ '
        $(OPENSPIN) -L $(SPINSTDLIB) -u $< -o $@

main.openspin.log: main.openspin.binary Makefile
        @printf '$$ '
        $(SPINSIM) $< -b

#------------------------------------------------------------------------------

main.fastspin.binary: main.spin Makefile
        @printf '$$ '
        $(FASTSPIN) -L $(SPINSTDLIB) -O $< -o $@

main.fastspin.log: main.fastspin.binary Makefile
        @printf '$$ '
        $(SPINSIM) $< -b

#------------------------------------------------------------------------------

clean: Makefile
        @printf '$$ '
        rm -f *~ *.binary *.pasm

#==============================================================================
(yeti@kumari:12)~/wrk/propeller/spinsim/fibsnippet$ make clean
$ rm -f *~ *.binary *.pasm
(yeti@kumari:12)~/wrk/propeller/spinsim/fibsnippet$ make
$ /opt/openspin/bin/openspin -L /opt/parallax.spin.src/spin -u main.spin -o main.openspin.binary
Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.
Version 1.00.80 Compiled on Jun  6 2016 12:22:32
Compiling...
main.spin
|-FullDuplexSerial.spin
Done.
Unused Method Elimination:
    5 methods removed
    0 objects removed
  136 bytes saved
--------------------------
Program size is 648 bytes
$ /opt/parallax/bin/spinsim main.openspin.binary -b
2
3
5
8
13
21
34
55
89
144
$ /opt/spin2cpp/bin/fastspin -L /opt/parallax.spin.src/spin -O main.spin -o main.fastspin.binary
Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2016 Total Spectrum Software Inc.
Version 3.4.1 Compiled on: Jan 14 2017
main.spin
|-FullDuplexSerial.spin
Done.
Program size is 1748 bytes
$ /opt/parallax/bin/spinsim main.fastspin.binary -b
2
4
8
16
32
64
128
256
512
1024
(yeti@kumari:12)~/wrk/propeller/spinsim/fibsnippet$ _
...erstmal sacken lassen...

OmmmMMMmmmMMMmmm...
𝖂𝖎𝖗 𝖐𝖔̈𝖓𝖓𝖊𝖓 𝖆𝖑𝖑𝖊𝖘 𝖆𝖚𝖘𝖘𝖊𝖗 𝖎𝖓 𝕱𝖗𝖚̈𝖍𝖑𝖎𝖓𝖌, 𝕾𝖔𝖒𝖒𝖊𝖗, 𝕳𝖊𝖗𝖇𝖘𝖙 𝖚𝖓𝖉 𝖂𝖎𝖓𝖙𝖊𝖗! – 𝕯𝖊𝖚𝖙𝖘𝖈𝖍𝖑𝖆𝖓𝖉.
"Du willst hier nicht klicken. Dies interessiert Dich nicht." — Yeti.
"DNA is a four letter word!" — Yeti.
Benutzeravatar
yeti
Beiträge: 2300
Registriert: Fr 27. Aug 2010, 14:48
Wohnort: Wrong Planet
Kontaktdaten:

Re: spin2cpp

Beitrag von yeti »

----------8<-----{20170220-1250-GMT}----->8----------

...und es ward 3.5.0...

Mehr dazu: ----------8<-----{20170226-2042-GMT}----->8----------

3.5.1 ist da, aber ich hab irgendwie gar keine Lust, das zu erwähnen... :-P

----------8<-----{20170329-1746-GMT}----->8----------

Kurz und schmerzlos:

Spin to C++ / C/ PASM converter version 3.6.0

----------8<-----{20170330-0852-GMT}----->8----------

Man kommt ja gar nich' hinterher:

Spin to C++ / C/ PASM converter version 3.6.1

----------8<-----{20170423-1953-GMT}----->8----------

Spin to C++ / C/ PASM converter version 3.6.2
...kann ich aus Zeitmangel grad leider nicht erwähnen...
:-P

----------8<-----{201700504-1329-GMT}----->8----------

Kurz und schmerzlos:

Spin to C++ / C/ PASM converter version 3.6.3

----------8<-----{20170817-1228-GMT}----->8----------

Spin to C++ / C/ PASM converter version 3.6.4

----------8<-----{Pasta & Ramen!}----->8----------
𝖂𝖎𝖗 𝖐𝖔̈𝖓𝖓𝖊𝖓 𝖆𝖑𝖑𝖊𝖘 𝖆𝖚𝖘𝖘𝖊𝖗 𝖎𝖓 𝕱𝖗𝖚̈𝖍𝖑𝖎𝖓𝖌, 𝕾𝖔𝖒𝖒𝖊𝖗, 𝕳𝖊𝖗𝖇𝖘𝖙 𝖚𝖓𝖉 𝖂𝖎𝖓𝖙𝖊𝖗! – 𝕯𝖊𝖚𝖙𝖘𝖈𝖍𝖑𝖆𝖓𝖉.
"Du willst hier nicht klicken. Dies interessiert Dich nicht." — Yeti.
"DNA is a four letter word!" — Yeti.
Benutzeravatar
yeti
Beiträge: 2300
Registriert: Fr 27. Aug 2010, 14:48
Wohnort: Wrong Planet
Kontaktdaten:

Re: spin2cpp

Beitrag von yeti »

----------8<-----{20180310-1610-GMT}----->8----------

Seltsame Dinge dingeln in Ingenskirchen!

Unter Debian9 mit gcc-6.3.0-18+deb9u1 kompiliertes fastspin crasht.
Unter Debian9 mit clang-3.8.1-24 kompiliertes fastspin löpt.
Unter Debian8 mit dessen gcc kompiliertes fastspin löpt unter Debian9.

Maaaamaaaaa!!! Die wollen mich verarschen!!!

Also... Testcode ist ein leeres "pub main":

Code: Alles auswählen

$ echo pub main >main.spin
Hier fällt das mit gcc gebaute fastspin auf die Schneidezähne:

Code: Alles auswählen

$ /opt/spin2cpp/bin/fastspin main.spin
Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2016 Total Spectrum Software Inc.
Version 3.6.4 Compiled on: Mar 10 2018
main.spin
Speicherzugriffsfehler
Das mit clang gebaute fastspin hingegen braucht keine teuren Kronen:

Code: Alles auswählen

$ /opt/spin2cpp/src/spin2cpp/build/fastspin main.spin 
Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2016 Total Spectrum Software Inc.
Version 3.6.4 Compiled on: Mar 10 2018
main.spin
Done.
Program size is 328 bytes
Darüber muß ich noch 'ne Weile mediYETIeren bevor ich das in einen Bugreport destilliere...

----------8<-----{20180317-0958-GMT}----->8----------

Der Schluckauf ist jetzt gemeldet: https://github.com/totalspectrum/spin2cpp/issues/26

----------8<-----{20180322-0734-GMT}----->8----------

Der Schluckauf ist vorbei: https://github.com/totalspectrum/spin2cpp/issues/26 \o/

----------8<-----{20180412-0918-GMT}----->8----------

https://github.com/totalspectrum/spin2c ... tag/v3.6.6

Alles klar?

----------8<-----{OmmmMMMmmmMMMmmmPtimistisch bleiben!}----->8----------
𝖂𝖎𝖗 𝖐𝖔̈𝖓𝖓𝖊𝖓 𝖆𝖑𝖑𝖊𝖘 𝖆𝖚𝖘𝖘𝖊𝖗 𝖎𝖓 𝕱𝖗𝖚̈𝖍𝖑𝖎𝖓𝖌, 𝕾𝖔𝖒𝖒𝖊𝖗, 𝕳𝖊𝖗𝖇𝖘𝖙 𝖚𝖓𝖉 𝖂𝖎𝖓𝖙𝖊𝖗! – 𝕯𝖊𝖚𝖙𝖘𝖈𝖍𝖑𝖆𝖓𝖉.
"Du willst hier nicht klicken. Dies interessiert Dich nicht." — Yeti.
"DNA is a four letter word!" — Yeti.
Benutzeravatar
yeti
Beiträge: 2300
Registriert: Fr 27. Aug 2010, 14:48
Wohnort: Wrong Planet
Kontaktdaten:

Re: spin2cpp

Beitrag von yeti »

----------8<-----{20180417-0135-GMT}----->8----------

Jetzt geht's aber voll ab mit FastSpin:

Automatically converting Spin objects to PASM

...man kann nun in Spin explizit für den COG-Modus coden und übersetzen.
Spannend!

----------8<-----{20180428-1330-GMT}----->8----------

Habemus release: Spin to C / C++ / PASM converter version 3.7.1

...und einen vermutlich lesenswerten im Forum erwähnten Bugfix und mehr...

----------8<-----{20180510-2005-GMT}----->8----------

Na also!!!
    Geht doch!!!
        Vaddatach ist nicht nur Hirnzellen-Killen:

Spin to C / C++ / PASM / binary converter version 3.7.2

----------8<-----{Muß ich mich nun beim SPINen anschnallen?}----->8----------
𝖂𝖎𝖗 𝖐𝖔̈𝖓𝖓𝖊𝖓 𝖆𝖑𝖑𝖊𝖘 𝖆𝖚𝖘𝖘𝖊𝖗 𝖎𝖓 𝕱𝖗𝖚̈𝖍𝖑𝖎𝖓𝖌, 𝕾𝖔𝖒𝖒𝖊𝖗, 𝕳𝖊𝖗𝖇𝖘𝖙 𝖚𝖓𝖉 𝖂𝖎𝖓𝖙𝖊𝖗! – 𝕯𝖊𝖚𝖙𝖘𝖈𝖍𝖑𝖆𝖓𝖉.
"Du willst hier nicht klicken. Dies interessiert Dich nicht." — Yeti.
"DNA is a four letter word!" — Yeti.
Antworten