• Picture on the screen!

    Martin Cejp05/25/2022 at 20:25 0 comments

    This marks a major milestone of a working (-ish) framebuffer with software 3D rendering. It is slow to the extreme (the screenshot indicates 36 ms per frame, but this is actually 36 seconds as the poor 32-bit nanosecond-resolution timer had to be slowed down in order not to overflow during a single frame!)

    The system diagram illustrates some of the current limitations:

    • Stupidly slow system clock. This should be bumped up to at least 50 MHz for the CPU and 100-125 MHz for the DRAM controller (presenting a virtual 32-bit bus to the CPU to hide some of the access latency)
    • Lack of any burst transfers between CPU and SDRAM. A series of 8 32-bit reads (a data cache line fill) executes 16 individual 16-bit accesses with a lot of handshaking overhead.
    • Overloaded "Memory Control" module which should be split up into more maintainable units.

    I am using the public domain sdram_pnru controller, hacked up to support burst transfer which is needed for frame buffer output. This controller was originally written with generic clock domain crossing support, which adds extra synchronization cycles to every transaction. The plan is to write a new controller which will better fit the platform's needs.

    The CPU is also compiled without any hardware multiply support and so on. There is a lot of work ahead.

  • Gitlab CI template for ULX3S + cocotb

    Martin Cejp05/20/2022 at 19:27 0 comments

    This installs the OSS CAD Suite, builds the bitstream ('ulx3s.bit') in one job, and runs your cocotb tests in another.

    default:
      image: ubuntu:20.04
    
      before_script:
        - apt update
        - apt install -y curl make
        - curl -sL https://github.com/YosysHQ/oss-cad-suite-build/releases/download/2022-05-20/oss-cad-suite-linux-x64-20220520.tgz | tar xz
        - export PATH=`pwd`/oss-cad-suite/bin:$PATH
        - echo $PATH
    
    build_ulx3s:
      stage: build
      needs: []
    
      script:
        - make ulx3s.bit
    
      artifacts:
        paths:
          - ulx3s.bit
    
    test_cocotb:
      stage: test
      needs: []
    
      script:
        - make -f Makefile.cocotb
    
      artifacts:
        paths:
          - "*.vcd"
    

    This could be improved further by automatically picking the latest nightly release of the OSS CAD Suite.