Giter Site home page Giter Site logo

rj45 / rj32 Goto Github PK

View Code? Open in Web Editor NEW
91.0 5.0 16.0 8.73 MB

A 16-bit RISC CPU with 32 instructions built with Digital for running on an FPGA.

License: MIT License

Makefile 1.83% Verilog 62.29% Assembly 5.81% Ruby 0.87% Go 21.11% C++ 5.22% SystemVerilog 2.87%
cpu verilog fpga vga dvi simulator simulation processor

rj32's People

Contributors

rj45 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rj32's Issues

Program memory waiting

Similar to #7

Support waiting potentially multiple cycles for program memory fetch to complete. Bonus if single cycle access is still supported. Should use ready/valid handshake.

This will unlock executing from potentially slow memory. It may also make it possible to have shared program and data memory.

Byte access to data memory

Implement the loadb and storeb instructions to load/store sign extended bytes.

Make the load and store instructions take byte addresses. The least significant bit will be ignored.

Implement new revision of the instruction set

In the new revision, the number of different immediate lengths has been reduced and room has been made for the imm instruction. There's also a spare bit on most instructions that might be useful in the far future.

Implement add/sub with carry

Implement addc and subc which set a temporary carry flag that causes the next instruction to take the carry output as an additional input. These should be not be interruptible via #11

Implement imm instruction

Add the imm instruction to carry the top 12 bits into the immediate of the next instruction. Add this as an automatic option to most instructions in the assembler using asserts.

Funnel shifter

Add a 32-bit funnel shifter able to shift up to 16 positions rightward. No left shift will be necessary.

Shift amount should come from an internal register.

The 32-bit input will be one of:

  • a sign extended register for implementing asr
  • a zero extended register for implementing shr
  • a register with zero for shl
  • or two different registers for ror / rol or multi-precision shifts

The internal shift amount register can be set from a register or immediate, and be set to either a N or 16-N.

Verilator simulation with video

It would be nice to be able to run the simulation a bit faster with verilator as opposed to only having the Digital simulation.

Bonus points if the video works and will display in a window.

VGA front panel microcode

The current character bus design in the VGA front panel is ....

long bus

Too long. Let's use the debug bus in #2 and build a small microcoded single-purpose state machine for drawing the frontpanel on the screen. Or it could be drawn into a text framebuffer. Not entirely sure yet.

Data memory waiting

Allow the processor to take multiple cycles to complete a memory read or write, controlled by a busy signal from the memory controller.

Should use a valid/ready handshake. Bonus points if same-cycle access is still supported.

Uninterruptible instructions

In #10 interrupts are implemented, but some instruction pairs lose their state if interrupted. Implement a temporary flag from the microcode that will not allow an interrupt to happen, which is cleared after the next instruction.

The imm instruction and addc/subc would set this flag.

Jump and Link / Function Calls

Need to implement a call or jump and link (jal) instruction in order to allow function calls. The return address should be put into register 15.

Interrupts

A single line can interrupt and cause the processor to jump to a specific address.

Debug bus

The CPU and front panel continue to grow inputs and outputs used only for debugging and are starting to get pretty hairy.

It would be better to have a debug bus that's implemented inside the CPU. The Digital front panel, vga front panel, and possibly a uart would all interact with this bus to pull the internal state.

The design could be similar to the ZipCPU's debug bus, but preferably simpler. Just an address, data, ready and valid. Each register and bus is available at an address, and the control signals are bundled into one or more 16-bit words.

Could contain a shadow copy of the register file by tying into any register file writes, this would allow reading the registers while the CPU is running.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.