Shop OBEX P1 Docs P2 Docs Learn Events
Propeller II: Emulation of the P2 on FPGA boards (Prop123-A7/A9, DE0-NANO, DE2-115, etc) - Page 3 — Parallax Forums

Propeller II: Emulation of the P2 on FPGA boards (Prop123-A7/A9, DE0-NANO, DE2-115, etc)

1356724

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2012-11-29 13:42
    "All the lower COM ports were in use, but I remapped it to COM1. I'll have another go." - probably not a good idea to re-map it to COM1 ... See my note in post #59
  • LeonLeon Posts: 7,620
    edited 2012-11-29 13:47
    Thanks, Beau and Tubular.

    It seems to be working on COM1, and loaded the code into the emulated cog. I'll follow your suggestions later, when I've had a play with it.

    Chalk up another success with the DE0-Nano. It was I who first suggested using it!
  • David BetzDavid Betz Posts: 14,516
    edited 2012-11-29 13:48
    "All the lower COM ports were in use, but I remapped it to COM1. I'll have another go." - probably not a good idea to re-map it to COM1 ... See my note in post #59
    I remapped mine to COM1 and it seems to work. This is on a Dell laptop. Maybe it doesn't have any actual COM ports.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2012-11-29 13:53
    COM1 and COM2 are usually reserved for a legacy MOUSE and are sometimes hardwired into the mother board.
  • David BetzDavid Betz Posts: 14,516
    edited 2012-11-29 13:54
    COM1 and COM2 are usually reserved for a legacy MOUSE and are sometimes hardwired into the mother board.
    Fair enough. I'll switch mine to COM9 just to be safe.
  • LeonLeon Posts: 7,620
    edited 2012-11-29 13:55
    I'm using a Dell laptop, as well.
  • TubularTubular Posts: 4,702
    edited 2012-11-29 14:12
    COM1 and COM2 are usually reserved for a legacy MOUSE and are sometimes hardwired into the mother board.

    I think its still possible even to redirect these (it seems to be a higher level handle style thing, not tied to traditional interrupts and i/o ports), but yes agreed, moving COM5~9 probably makes more sense.
  • Bill HenningBill Henning Posts: 6,445
    edited 2012-11-29 14:16
    It should be OK to redirect COM1-2 as long as there is no physical serial port on the computer

    Watch out for COM3/COM4, sometimes USB serial converters will show up as COM3/4, so if you move them and later plug in the adapter that used to be there, you may have issues.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-11-29 14:16
    cgracey wrote: »
    I don't have any tips. I just stay in PNUT, myself. It's minimal, but reliable. No scroll bars.
    Actually I was hoping that a *minor tweak* might be considered for PNUT which only involves that it check if it's own copy of the file has been updated and if it hasn't then check to see if the file itself has been updated (by another editor) and reload if necessary before compile.
    I've got the whole source for Tachyon sitting in there and it's very awkward trying to edit this large file in PNUT as you would know. Surely this tweak would be a good and simple solution?
  • Roy ElthamRoy Eltham Posts: 3,000
    edited 2012-11-29 15:12
    Actually I was hoping that a *minor tweak* might be considered for PNUT which only involves that it check if it's own copy of the file has been updated and if it hasn't then check to see if the file itself has been updated (by another editor) and reload if necessary before compile.
    I've got the whole source for Tachyon sitting in there and it's very awkward trying to edit this large file in PNUT as you would know. Surely this tweak would be a good and simple solution?

    Handling a file changing externally is not a minor tweak. Especially on Windows.
  • Cluso99Cluso99 Posts: 18,069
    edited 2012-11-29 16:33
    I have updated the original post with more info. Please let me know if there are errors or anything else I should post there.
  • David BetzDavid Betz Posts: 14,516
    edited 2012-11-29 20:35
    Is there a description of jmptask somewhere? I'm trying to understand Chip's monitor code and how it handles the serial interface.
  • SapiehaSapieha Posts: 2,964
    edited 2012-11-29 20:50
    Hi David

    NOT yet !!
    We all wait for complete instruction's set


    David Betz wrote: »
    Is there a description of jmptask somewhere? I'm trying to understand Chip's monitor code and how it handles the serial interface.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-11-29 21:10
    Roy Eltham wrote: »
    Handling a file changing externally is not a minor tweak. Especially on Windows.
    If no changes have been made to the local file then RELOAD = CLOSE then OPEN.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-11-29 21:22
    I am having a major lust for new silicon about this P2 emulation platform..... very difficult to ignore. Even with only 6 cogs, it is attractive and exciting.
  • cgraceycgracey Posts: 14,155
    edited 2012-11-29 21:35
    David Betz wrote: »
    Is there a description of jmptask somewhere? I'm trying to understand Chip's monitor code and how it handles the serial interface.

    There are 4 program counters in each cog. They are initialized as follows:

    PC0 = $000
    PC1 = $001
    PC2 = $002
    PC3 = $003

    At first, the task register, which is 32 bits (16 two-bit fields), is cleared to 0, making all time slots execute task0.

    JMPTASK sets up to all four PC's at once, using a bit field in S and an address in D.

    JMPTASK #substart,#%1111 ...would set all PC's to substart
    JMPTASK #substart,#%1000 ...would set PC3 to substart
    JMPTASK #substart,#%0100 ...would set PC2 to substart
    JMPTASK #substart,#%0010 ...would set PC1 to substart
    JMPTASK #substart,#%0001 ...would set PC0 to substart

    Until SETTASK is executed (initialized to $00000000), only PC0 is running, making the cog seem normal.

    SETTASK #%%3210 ...would enable all tasks. If no JMPTASK was done, PC1..PC3 would begin execution from $001..$003 (better have some JMP's there)

    When you do an immediate SETTASK #, the lower 8 bits of immediate data are replicated four times to fill 32 bits. To get more granularity, you could do a register, instead of an immediate, and 32 unique bits would be loaded into the task register, which rotates right after each instruction completion, with the 2 LSB's determining which task to execute next.

    Here's an example program:
            org
    
            jmp     #task0
            jmp     #task1
            jmp     #task2
            jmp     #task3
    
    task0   settask #%%3210     'turn on all tasks
    
    :loop   notp    #0          'toggle P0
            jmp     #:loop
    
    task1   notp    #1          'toggle P1
            jmp     #task1
    
    task2   notp    #2          'toggle P2
            jmp     #task2
    
    task3   notp    #3          'toggle P3
            jmp     #task3
    
  • cgraceycgracey Posts: 14,155
    edited 2012-11-29 21:37
    If no changes have been made to the local file then RELOAD = CLOSE then OPEN.

    I think detecting changes may be the hard part.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-11-29 21:39
    cgracey wrote: »
    I think detecting changes may be the hard part.
    No need to detect, just close and open. I can achieve the same effect by <ctrl> O <enter> before I hit F10 which just opens the last file.
  • cgraceycgracey Posts: 14,155
    edited 2012-11-29 21:39
    I am having a major lust for new silicon about this P2 emulation platform..... very difficult to ignore. Even with only 6 cogs, it is attractive and exciting.

    Do you have a DE2-115 running? Those boards are made in Taiwan.
  • cgraceycgracey Posts: 14,155
    edited 2012-11-29 21:44
    No need to detect, just close and open. I can achieve the same effect by <ctrl> O <enter> before I hit F10 which just opens the last file.

    I think I might have a solution for you.

    For each compile:

    1) copy your code to a Untitled.spin
    2) launch pnut.exe
    3) hit F10

    You could automate all but the F10.

    For me to change pnut.exe, I could just make it always reload the file if a certain mode was set, right?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-11-29 21:50
    cgracey wrote: »
    I think I might have a solution for you.

    For each compile:

    1) copy your code to a Untitled.spin
    2) launch pnut.exe
    3) hit F10

    You could automate all but the F10.

    For me to change pnut.exe, I could just make it always reload the file if a certain mode was set, right?
    This of course isn't a bit deal as there are far more important things which is why I said it's a minor tweak which you must be used to and it's just another line or two and recompile. What harm could it do if it always reloaded a file before compile? If local changes have been made it should come up with the normal save prompt which is fair enough but this one minor tweak means PNUT can just do what it does best and that is compile and load while we can pick our external editors to suit.
  • cgraceycgracey Posts: 14,155
    edited 2012-11-29 21:54
    This of course isn't a bit deal as there are far more important things which is why I said it's a minor tweak which you must be used to and it's just another line or two and recompile. What harm could it do if it always reloaded a file before compile? If local changes have been made it should come up with the normal save prompt which is fair enough but this one minor tweak means PNUT can just do what it does best and that is compile and load while we can pick our external editors to suit.

    What if we launch pnut.exe with a command switch that tells it to compile, download, and then shut down if there were no problems? That would be totally hands-free then. Would that work for you?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-11-29 21:55
    I'm compiling a large file but find that if I place my welcome string at the end of the code that it doesn't print. My obj file is 29K but the BIN file is only 2K.
    TESTLP
            mov    dirc,txmask
    
            mov    X,nameptr
            call    #PRT_STR
    
            mov    X,#1
            shl    X,#24
            djnz    X,$
            jmp    #TESTLP
    
    nameptr        long    @NAME+s
    
    PRT_STR
            rdbyte    tos,X wz
    PRT_STR_ret
         if_z    ret
            call    #TRANSMIT
            add    X,#1
            jmp    #PRT_STR
    
    ' <TACHYON KERNEL ------------------------ >
    
    ' then
    NAME        byte    $0D,$0A,"TACHYON P2 Forth ",0
    
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-11-29 21:58
    cgracey wrote: »
    What if we launch pnut.exe with a command switch that tells it to compile, download, and then shut down if there were no problems? That would be totally hands-free then. Would that work for you?
    Wouldn't that make it more complicated as we now have to tell it which file to open when it can already be open? I am finding it very necessary to use an external editor (CONTEXT) just so I can navigate and also UNDO all those little oopsies.
  • SapiehaSapieha Posts: 2,964
    edited 2012-11-29 22:06
    Hi Peter.

    What for external editor You use?

    I use NotePad++ that have that possibility's. ---> look on attached PDF

    Wouldn't that make it more complicated as we now have to tell it which file to open when it can already be open? I am finding it very necessary to use an external editor (CONTEXT) just so I can navigate and also UNDO all those little oopsies.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-11-29 22:14
    Sapieha wrote: »
    Hi Peter.

    What for external editor You use?
    I use NotePad++ that have that possibility's. ---> look on attached PDF

    I'm running this on WINXP inside of VirtualBox running in LinuxMint 14 so I use CONTEXT as an editor. Normally I would use medit in Linux. As I said, this is not a big deal as I can work around, but then if it's not a big deal to have PNUT close and open it's current file so as to perform a reload then that's all I need.
  • cgraceycgracey Posts: 14,155
    edited 2012-11-29 22:19
    I'm compiling a large file but find that if I place my welcome string at the end of the code that it doesn't print. My obj file is 29K but the BIN file is only 2K.

    Only $1F8 longs are being loaded.

    What we are doing is just loading what is actually the 'loader' that would perform further loading, decryption, etc. I will have to make a re-loader program to download, in lieu of the $1F8 longs which are now being sent, which will then load the user code in, up to the top of memory, if there is so much.
  • SapiehaSapieha Posts: 2,964
    edited 2012-11-29 22:20
    Hi Peter

    Thanks

    I run native winXP

    I'm running this on WINXP inside of VirtualBox running in LinuxMint 14 so I use CONTEXT as an editor. Normally I would use medit in Linux. As I said, this is not a big deal as I can work around, but then if it's not a big deal to have PNUT close and open it's current file so as to perform a reload then that's all I need.
  • cgraceycgracey Posts: 14,155
    edited 2012-11-29 22:20
    I'm running this on WINXP inside of VirtualBox running in LinuxMint 14 so I use CONTEXT as an editor. Normally I would use medit in Linux. As I said, this is not a big deal as I can work around, but then if it's not a big deal to have PNUT close and open it's current file so as to perform a reload then that's all I need.

    Let me see what I can do.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-11-29 22:25
    cgracey wrote: »
    Let me see what I can do.
    I can get around this with a key sequence or macro but the biggest problem at the moment is the 2K bin file limit, is that a bug?
Sign In or Register to comment.