Will hub FIFO abuse be consistent across FPGA, P2-ES, P2 final, etc.?

While fooling around with the VGA birds demo, I had several different RDFAST lines in the initialization section, all of which were commented out but one. I accidentally ran the code once with all the RDFASTs commented out, and it seemed to default to a RDFAST of all of hubram: the image would quickly wrap around, with regions of junk and black.

Now I'm curious and want to explore ways in which I can abuse the hub FIFO. Chip, please don't answer any of the questions in this paragraph, since I'm sure you have much more important things to do; they're just examples of things I want to try. What if you issue instructions read from or write to the FIFO while it's in the opposite write/read mode, or while in hubexec or XBYTE mode, or while the streamer is running? What if you start the streamer while in hubexec? If you call RDFAST with D[31] set after finishing a WRFAST with stuff still in the buffer, can you sneak in a few more writes before the FIFO runs out and switches directions? Can you store constants inside hubexec code with RFVAR if you account for pipelining? If you get too creative, can you crash the FIFO? Can you crash the whole cog, and will a cogstop/coginit fix it or is a reset necessary?

My question is this: is this behavior well-defined in the verilog, i.e. is it guaranteed to be the same on an FPGA, the P2ES, and chips from the second run? Or might the synthesizer decide to make these unintended cases do different things on different versions of the chip? In other words, if useful behavior through FIFO abuse is found possible on my P2-ES, will the same tricks work on the final silicon?


  • Maybe, maybe not!
    Might not even be consistent across clock frequencies, depending on what quirk you find.
    My Prop boards: P8XBlade2 , RamBlade , CpuBlade , TriBlade
    P1 Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    P1: Tools (Index) , Emulators (Index) , ZiCog (Z80)
    P2: Tools & Code , Tricks & Traps
  • You can't crash the FIFO, but if you do a RDFAST or WRFAST while you are executing from hub memory (which uses the FIFO), you could cause unintended instructions to execute and effectively crash the cog.
  • oh that sounds interesting, good news you can't crash the FIFO! :smile:

    Chip, as more as I play with the P2 as more I like it. I loved P1 assembly already but P2 just beats it. It is a joy to program because when I rewrite old to new I sometimes end up with a quarter of needed instructions. It is just amazing.


    I am just another Code Monkey.
    A determined coder can write COBOL programs in any language. -- Author unknown.
    Press any key to continue, any other key to quit

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
Sign In or Register to comment.