Re: spin2cpp
Verfasst: Sa 19. Mär 2016, 18:06
----------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:
Compiling:
...and liftoff!
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:
...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:
...erhellende Kommentare zum Übergang von "beta2" auf "final" werden uns wohl bald im Parallaxforum gereicht...
----------8<-----{Hurz!}----->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
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
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(%%%$$$$$######""""""""""
!!!!!!!!!!!!!!!""""""""""""#####################################""""""""""""""""
$ _
...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.
$ _
\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)~$ _
----------8<-----{Hurz!}----->8----------