Giter Site home page Giter Site logo

slothpu's People

Contributors

freesurfer-rge avatar

Watchers

 avatar

slothpu's Issues

[BUG] Fibonacci has extra instruction

I believe that now the 2-byte adder subroutine in fibonacci.txt is using a BRANCHZERO and not a JUMPZERO, line 86 can be removed. Or rather, moved into the 'padding' instructions which we have between subroutines.

Should we have a jump register?

Should the ProgramCounter acquire a 16-bit jump register, along with instructions:

  • JSR which would copy the current PC to the jump register, and copy A and B bus to the PC (and inhibit increment)
  • RET which would copy the jump register to the PC (and not inhibit increment)
  • LOADJUMP0/LOADJUMP1 which would put the low/high byte of the jump register onto C bus (for saving in Register C)
  • STOREJUMP which would copy A and B bus to the jump register

These would eliminate the LOADPC command, which is the only one to write to Register B.... and complicates the RegisterFile implementation. Since the jump register wouldn't be continually changing, it is safe to have separate load instructions for the low and high bytes.

[PCB] DALU r1 Decode

The rev1 of the DALU board has the outputs from the instruction decoder connected backwards (i.e. 'ADD' is 111 rather than 000). This can be 'fixed' by adjusting the instructions stored, but should be corrected when the board is revised.

Assembler belongs in slothpu

Most of the assembler really belongs in the slothpu package. The current script should be a thin caller into the refactored code (as should the run_slothpu.py script).

Update Jumps and Branches

The current selection of PC changing instructions (BRANCH, BRANCHZERO and JSR) are proving rather limiting. One particular factor in this is particularly acute when doing 16-bit addressing with 8-bit registers: they all take an absolute address, consuming 2 registers each time. When doing a memory copy, two branches are needed (conditional at the beginning as the loop test, unconditional at the end to close the loop), plus two addresses for the copies, plus the loop counter itself. We run out of registers really quickly.

To address this, I propose the following:

  • Establish a naming convention that BRANCH is for relative operations, and JUMP is for absolute ones
  • Rename the existing BRANCH instructions to JUMP and JUMPZERO to match this. They will be otherwise unchanged
  • Add four branching instructions

These four branching instructions will either add or subtract to the PC, and be unconditional or conditional on a zero. So:

  • PC BRANCH RA unconditionally advances the PC by RA
  • PC BRANCHBACK RA unconditionally reduces the PC by RA
  • PC BRANCHZERO RA RB advances the PC by RA if RB is zero
  • PC BRANCHBACKZERO RA RB reduces the PC by RA if RB is zero

Since we only use one register for the change, these can only jump by 127 instructions. However, that will cover a lot of loops. Note that setting RA to zero effectively turns this into a HALT instructions. Doing a branch back with RA equal to two will have a similar effect. It is slightly unfortunate that the BRANCH*ZERO instructions will test on RB but JUMPZERO will test on RC. However, that's an aspect of mixed bitness which we can't avoid.

Note that JSR and RET will not be affected. Nor will LOADJUMP0 and LOADJUMP1.

[PCB] Tester board bad voltage shifter

The voltage shifter (U202) for the IN_{DATA} line is connected incorrectly. All of the other 'A' side pins should be pulled low, not the 'B' side ones. This is causing the IC to run very hot.

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.