Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wishlist?] spinsim integration? #44

Open
drawkula opened this issue Aug 24, 2016 · 2 comments
Open

[wishlist?] spinsim integration? #44

drawkula opened this issue Aug 24, 2016 · 2 comments

Comments

@drawkula
Copy link

drawkula commented Aug 24, 2016

Is it possible to integrate Spinsim?

Maybe as an alternative program downloader (having a terminal window)?

Spinsim still coughs on many programs but definitely already is useful to test coding on the Propeller without a real board.

If Spinsim were available in PropellerIDE, lots of bugs would be found faster and it would improve fast and get even more useful much soon(er)...

@bweir
Copy link
Collaborator

bweir commented Aug 25, 2016

Hi there,

Can you tell me a little more about Spinsim? How it works? What it does? What language it's written in? I know very little about that application or how it works under the hood. I've been interested in added some kind of simulation to PropellerIDE, but because of the specific nature of the application and the limited scenarios under which its applicable, its functionality that might be better suited as a plugin than a core part of the application. So then, how does it work? :P

@drawkula
Copy link
Author

drawkula commented Aug 25, 2016

Dave Hein's Spinsim simulates Propeller-1 and -2.

Forum threads:

A console log says more than a thousand pictures... ;-)

$ ls -l mandelbrot-20140623-fds-80x25.spin FullDuplexSerial.spin 
-rw-r--r-- 1 yeti yeti 24962 Aug 25 06:20 FullDuplexSerial.spin
-rw-r--r-- 1 yeti yeti   772 Aug 25 06:18 mandelbrot-20140623-fds-80x25.spin
$ cat mandelbrot-20140623-fds-80x25.spin
' 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
$ /opt/openspin/bin/openspin mandelbrot-20140623-fds-80x25.spin -u
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...
mandelbrot-20140623-fds-80x25.spin
|-FullDuplexSerial.spin
Done.
Unused Method Elimination:
    7 methods removed
    0 objects removed
  244 bytes saved
--------------------------
Program size is 708 bytes
$ /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(%%%$$$$$######""""""""""
!!!!!!!!!!!!!!!""""""""""""#####################################""""""""""""""""
$ _

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants