Shop OBEX P1 Docs P2 Docs Learn Events
Prop2 FPGA files!!! - Updated 2 June 2018 - Final Version 32i - Page 113 — Parallax Forums

Prop2 FPGA files!!! - Updated 2 June 2018 - Final Version 32i

1110111113115116160

Comments

  • cgraceycgracey Posts: 14,206
    ozpropdev wrote: »
    Chip
    I suspect i'm losing cordic results, if that helps..

    I'll look into it shortly.
  • cgraceycgracey Posts: 14,206
    My Prop123-A9 has the CORDIC working okay. What could the trouble could be?
  • cgraceycgracey Posts: 14,206
    edited 2017-12-19 18:15
    The v30 BeMicro-A9 and Prop123-A9 images all include the CORDIC.
  • cgraceycgracey Posts: 14,206
    evanh wrote: »
    What has changed since v26? The loader doesn't seem to work now. Sysclock default? CLKSET changes/defaults? ....

    Oh oh OH never mind, Smile, PNut now downloads in Wine!!! :D

    We are using Prop_Txt exclusively to download now, so no funny binary characters to upset other O.S.'s and what not. That must be why it works now. No more two-stage loading, either.
  • cgraceycgracey Posts: 14,206
    Has anyone figured out, yet, what the trouble with the CORDIC instructions might be? I haven't seen any problems, myself, so far.
  • USB demo running OK on P2v30, and the CRCNIB instruction is the cat's meow :-D

    On-the-fly CRC calculation in four instructions and the CRC16 lookup table is history! Haven't gotten to the CRC5 code yet, but should be able to soon.
  • cgracey wrote: »
    Has anyone figured out, yet, what the trouble with the CORDIC instructions might be? I haven't seen any problems, myself, so far.
    Still trying to isolate the problem here.

  • cgraceycgracey Posts: 14,206
    garryj wrote: »
    USB demo running OK on P2v30, and the CRCNIB instruction is the cat's meow :-D

    On-the-fly CRC calculation in four instructions and the CRC16 lookup table is history! Haven't gotten to the CRC5 code yet, but should be able to soon.

    Great!
  • Chip
    Here's my code that ran fine on V29 P123-A9.
    Only changes made for V30 were 3 x DJNS instructions updated to DJJNF.

    Appears to be hub/cordic related as can be seen by screen (VGA) artifacts and erratic code execution.

  • jmgjmg Posts: 15,175
    garryj wrote: »
    USB demo running OK on P2v30, and the CRCNIB instruction is the cat's meow :-D

    On-the-fly CRC calculation in four instructions and the CRC16 lookup table is history! Haven't gotten to the CRC5 code yet, but should be able to soon.

    How much code space does that table removal save ?
  • evanhevanh Posts: 16,032
    cgracey wrote: »
    JP/JNP were removed from the design a long time ago because they took too long to settle, and those slots became do-nothing. However, I just now thought to remove them from the assembler. Sorry about that.
    Ha, I guess I never called that code.

  • jmg wrote: »
    garryj wrote: »
    USB demo running OK on P2v30, and the CRCNIB instruction is the cat's meow :-D

    On-the-fly CRC calculation in four instructions and the CRC16 lookup table is history! Haven't gotten to the CRC5 code yet, but should be able to soon.

    How much code space does that table removal save ?
    The CRC16 table lookup code is two instructions longer and the table takes up half of the host cog's LUT space.
  • cgracey wrote: »
    ikemschn wrote: »
    Being an "old" Prop1-fan and following the progress of your work for years, here a question a bit apart from the ongoing context in this thread:

    Are there any Prop123-A9-boards left for sale?
    (and if yes: how to get one to germany?)

    Would be great !

    We have some in stock. They are part #60065. They are $475.00.

    If you email Chantal at Parallax, she can get the order going: cwoods@parallax.com.

    Welcome aboard!!!


    Thanks a lot! Just ordered one. Yihaa!
  • Cluso99Cluso99 Posts: 18,069
    garryj wrote: »
    USB demo running OK on P2v30, and the CRCNIB instruction is the cat's meow :-D

    On-the-fly CRC calculation in four instructions and the CRC16 lookup table is history! Haven't gotten to the CRC5 code yet, but should be able to soon.

    Excellent news !

    The CRC5 can mostly be precalculated anyway.

  • cgraceycgracey Posts: 14,206
    ozpropdev wrote: »
    Chip
    Here's my code that ran fine on V29 P123-A9.
    Only changes made for V30 were 3 x DJNS instructions updated to DJJNF.

    Appears to be hub/cordic related as can be seen by screen (VGA) artifacts and erratic code execution.

    I've been out running around today, so I have not had a chance to look at this code yet. I'm certainly going to look at it when I get home in a few hours.
  • Cluso99Cluso99 Posts: 18,069
    V30 running fine here :)
  • Cluso99Cluso99 Posts: 18,069
    Attached is SD Boot Test v116 for use with pnut.exe v30

    The program will output to the serial port (P62/63) at 115,200 baud once the SD Card has been initialised and read. Below is what I get on PST.

    I would welcome any test results on any SD Cards you may have. While currently all cards are supported, I think we should probably only support Type 3 (SDHC block mode addressing) and future.
    === Cluso's P2v30 SD Test & Debugger v.116a ===
    SD type = 3
    
    CSD
     addr-  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
     -----------------------------------------------------
    03FE0: 40 0E 00 32 5B 59 00 00 3B 7F 7F 80 0A 40 00 09  '@..2[Y..;....@..'
    
    CID
     addr-  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
     -----------------------------------------------------
    03FF0: 12 56 78 41 53 54 43 00 34 00 00 14 6C 01 03 5B  '.VxASTC.4...l..['
    
    MBR
     addr-  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
     -----------------------------------------------------
    04004: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04014: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04024: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04034: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04044: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04054: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04064: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04074: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04084: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04094: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    040A4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    040B4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    040C4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    040D4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    040E4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    040F4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04104: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04114: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04124: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04134: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04144: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04154: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04164: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04174: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04184: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04194: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    041A4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    041B4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 82  '................'
    041C4: 03 00 0B E6 DC CA 00 20 00 00 00 E0 ED 00 00 00  '....... ........'
    041D4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    041E4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    041F4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA  '..............U.'
    
    VOL
     addr-  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
     -----------------------------------------------------
    04204: EB 58 90 4D 53 44 4F 53 35 2E 30 00 02 40 22 11  '.X.MSDOS5.0..@".'
    04214: 02 00 00 00 00 F8 00 00 3F 00 FF 00 00 20 00 00  '........?.... ..'
    04224: 00 E0 ED 00 6F 07 00 00 00 00 00 00 02 00 00 00  '....o...........'
    04234: 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04244: 80 03 29 56 EF F7 0A 4E 4F 20 4E 41 4D 45 20 20  '..)V...NO NAME  '
    04254: 20 20 46 41 54 33 32 20 20 20 33 C9 8E D1 BC F4  '  FAT32   3.....'
    04264: 7B 8E C1 8E D9 BD 00 7C 88 56 40 88 4E 02 8A 56  '{......|.V@.N..V'
    04274: 40 B4 41 BB AA 55 CD 13 72 10 81 FB 55 AA 75 0A  '@.A..U..r...U.u.'
    04284: F6 C1 01 74 05 FE 46 02 EB 2D 8A 56 40 B4 08 CD  '...t..F..-.V@...'
    04294: 13 73 05 B9 FF FF 8A F1 66 0F B6 C6 40 66 0F B6  '.s......f...@f..'
    042A4: D1 80 E2 3F F7 E2 86 CD C0 ED 06 41 66 0F B7 C9  '...?.......Af...'
    042B4: 66 F7 E1 66 89 46 F8 83 7E 16 00 75 39 83 7E 2A  'f..f.F..~..u9.~*'
    042C4: 00 77 33 66 8B 46 1C 66 83 C0 0C BB 00 80 B9 01  '.w3f.F.f........'
    042D4: 00 E8 2C 00 E9 A8 03 A1 F8 7D 80 C4 7C 8B F0 AC  '..,......}..|...'
    042E4: 84 C0 74 17 3C FF 74 09 B4 0E BB 07 00 CD 10 EB  '..t.<.t.........'
    042F4: EE A1 FA 7D EB E4 A1 7D 80 EB DF 98 CD 16 CD 19  '...}...}........'
    04304: 66 60 80 7E 02 00 0F 84 20 00 66 6A 00 66 50 06  'f`.~.... .fj.fP.'
    04314: 53 66 68 10 00 01 00 B4 42 8A 56 40 8B F4 CD 13  'Sfh.....B.V@....'
    04324: 66 58 66 58 66 58 66 58 EB 33 66 3B 46 F8 72 03  'fXfXfXfX.3f;F.r.'
    04334: F9 EB 2A 66 33 D2 66 0F B7 4E 18 66 F7 F1 FE C2  '..*f3.f..N.f....'
    04344: 8A CA 66 8B D0 66 C1 EA 10 F7 76 1A 86 D6 8A 56  '..f..f....v....V'
    04354: 40 8A E8 C0 E4 06 0A CC B8 01 02 CD 13 66 61 0F  '@............fa.'
    04364: 82 74 FF 81 C3 00 02 66 40 49 75 94 C3 42 4F 4F  '.t.....f@Iu..BOO'
    04374: 54 4D 47 52 20 20 20 20 00 00 00 00 00 00 00 00  'TMGR    ........'
    04384: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    04394: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    043A4: 00 00 00 00 00 00 00 00 00 00 00 00 0D 0A 44 69  '..............Di'
    043B4: 73 6B 20 65 72 72 6F 72 FF 0D 0A 50 72 65 73 73  'sk error...Press'
    043C4: 20 61 6E 79 20 6B 65 79 20 74 6F 20 72 65 73 74  ' any key to rest'
    043D4: 61 72 74 0D 0A 00 00 00 00 00 00 00 00 00 00 00  'art.............'
    043E4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  '................'
    043F4: 00 00 00 00 00 00 00 00 AC 01 B9 01 00 00 55 AA  '..............U.'
    
  • Cluso
    Here's a txt format image for downloading to the Prop2.
  • cgraceycgracey Posts: 14,206
    edited 2017-12-20 07:10
    Ozpropdev,

    I'm running your bug demo code and I'm seeing strange things, for sure.

    Okay. I think I know what it is. I made a mistake that caused pipelined and cancelled CORDIC instructions to generate spurious hub commands during the next valid instruction.

    I'm recompiling now.
  • cgracey wrote: »
    Ozpropdev,

    I'm running your bug demo code and I'm seeing strange things, for sure.

    Okay. I think I know what it is. I made a mistake that caused pipelined and cancelled CORDIC instructions to generate spurious hub commands during the next valid instruction.

    I'm recompiling now.
    Thanks Chip for checking that. :)

  • cgraceycgracey Posts: 14,206
    edited 2017-12-20 08:06
    ozpropdev wrote: »
    cgracey wrote: »
    Ozpropdev,

    I'm running your bug demo code and I'm seeing strange things, for sure.

    Okay. I think I know what it is. I made a mistake that caused pipelined and cancelled CORDIC instructions to generate spurious hub commands during the next valid instruction.

    I'm recompiling now.
    Thanks Chip for checking that. :)

    Of course. Good thing this came up, because I discovered another potential pitfall during hubexec: On the right combination of hub slice timing and hubexec fetching, the slice could come up before 'get' and the flop that only allows one slice opportunity would have gone to 0, causing the instruction to hang. Got that fixed.
  • cgraceycgracey Posts: 14,206
    edited 2017-12-20 08:46
    New Version 30a at the top of this thread fixes the hub-instruction bug that Ozpropdev found. Currently, there's only an 8-cog Prop123-A9 image, but I'm compiling an 8-cog BeMicro-A9 image that I'll add in the next hour.
  • V30a is looking rock solid Chip! Thanks.
  • cgraceycgracey Posts: 14,206
    ozpropdev wrote: »
    V30a is looking rock solid Chip! Thanks.

    Thank you for finding that problem. There are some things that are hard to anticipate. I'm going through the design looking for any other such pitfalls. I don't think there's occasion for any others, but I need to look.
  • cgraceycgracey Posts: 14,206
    edited 2017-12-20 10:05
    I just added the BeMicro-A9 image to the .zip file at the top of this thread.
  • cgraceycgracey Posts: 14,206
    I finished all the v30a compiles and posted an updated .zip file at the top of this thread.
  • v30a looking good. USB CRC5 calculations all being done using CRCBIT/CRCNIB. All lookup tables gone!

    Outgoing CRC5 calculation on a token packet is only about six clocks more expensive than the table lookup, but easy enough to interleave between tx byte output. CRC5 verify on incoming token packets is faster than table lookup because you only need to use CRCNIB as data + CRC length is 16 bits. Way too easy :D

    Thanks, Chip, for adding CRCBIT/CRCNIB!
  • jmgjmg Posts: 15,175
    garryj wrote: »
    v30a looking good. USB CRC5 calculations all being done using CRCBIT/CRCNIB. All lookup tables gone!

    Outgoing CRC5 calculation on a token packet is only about six clocks more expensive than the table lookup, but easy enough to interleave between tx byte output. CRC5 verify on incoming token packets is faster than table lookup because you only need to use CRCNIB as data + CRC length is 16 bits. Way too easy :D

    Thanks, Chip, for adding CRCBIT/CRCNIB!

    Sounding very good - no tables means more room for larger data packet buffers, and a CRC opcode just looks polished.... :)

    USB is going to be very important for P2 - have you tried larger packet payloads yet ?
    IIRC Mouse/Kbd is quite small packets ?

    Meanwhile, in the small MCU sandpit, the STC8F series indicate USB bootloaders (direct USB pins) on even the cheapest 8 & 16 pin ones. My Chinese is not great, but earlier SCH showed 24MHz crystal for USB, now gone.
    I suspect this is SW based, bit-bang LS-USB as was done in AVR (so miles from passing approvals) - more detail on just how they do this, is hard to find, but it appears 'good enough' to load code.
  • Gosh, if we could get soft USB running out of the boot rom, we could save the whole FTDI problem.

    But I would be pretty happy with @Cluso99's SD-boot or TAQOZ or both, able to pull needed stuff from SD.

    I really do like the decision for the text-based serial boot, this is really system agnostic and will even allow COBOL based systems to boot and program a P2, treating it as a serial printer...

    What I am worried about is that all this last-minute changes of the last couple of weeks, may introduce side-effects.

    @Chip, please, tiding up things on the end, before release, is a common urge any programmer has. I do it also, anybody does. But it is a very dangerous thing to do after long development. It happens that one 'simplifies' stuff kept apart intentionally years ago for some forgotten reason, but done so after long and deep thinking, also forgotten.

    Sure the CRC stuff is useful and it is important that you apply your skill to make the instruction-set beautiful, squeezing another use out of one or some other instructions.

    That is what makes the P1 so wonderful. A beautiful instruction-set giving access to hardware and misused(?) over the last decade to do amazing things not even planned for when released.

    What I hope for is that the instruction-set finally settles down and @Chip could work on SPIN2 again. And the PropGCC guys could start to work on a new compiler with confidence.

    Peter J. can handle opcode changes in minutes, but say PropBasic2 or other things will not start before opcodes settle down, I guess.

    anyways,

    Mike
  • jmgjmg Posts: 15,175
    edited 2017-12-21 05:02
    msrobots wrote: »
    Gosh, if we could get soft USB running out of the boot rom, we could save the whole FTDI problem.
    I was not quite meaning that - the example of small-MCU boot, was really to show how widespread USB is, in the MCU space.
    The P2 ROM is too small to hold USB loader, but a 2nd stage loader could offer USB.
    I've not seen large-data-block download numbers yet, for P2-USB.

    A cheaper, more flexible P2-USB solution than 'the whole FTDI problem', is the new EFM8UB3 - that has 40K flash, and is sub-90c
    - it could do a useful P2 Debug interface, and Power Monitoring / Metering support.
Sign In or Register to comment.