Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tiny Instruction Set Computer

This is a for-fun implementation of a relatively simple micro-architecture, with an assembler to program the simulated implementation in Logisim, or an emulator implemented in vm/tvm.c.

TISC v2.4

My goal with this project is to aim for an instruction set architecture that is focused on minimal scale. I've written about the first ressurection of this project on my blog before and I am sporatically finding ways to explore the original idea of "minimal scale" through modifications and continuation of work contained within this repository.

Want to play with it too?

You may either load the logisim/CPU.circ within Logisim or compile the emulator..

It is helpful to refer to the architecture document and the ExamplePrograms directory to get a feel for what tisc is, but I reccomend reading + running some of the example programs to see it in action.

Assembling and running a program in the emulator

First, assuming you are on a unix-like system with a C toolchain, compile the emulator and the assembler like so:

make -C vm && make -C asm

Then you may compile + run programs:

$ asm/tasm bin ExamplePrograms/fibb_test.tac out && vm/tvm r out
Assembling tac file: 'ExamplePrograms/fibb_test.tac' TISC v2.4
label line  addr:out>op         args
      0003  0000:43| li  0xFD
            0001:fd|
      0004  0002:9f| sp  GRA
      0006  0003:c2| one  GRC
loop  0008  0004:ab| sb  GRB
      0010  0005:c9| xor  GRB GRC
      0011  0006:8d| xor  GRC GRB
      0012  0007:c9| xor  GRB GRC
      0014  0008:ba| op  GRB GRC GRB
      0016  0009:fb| cmp  GRB GRC
      0017  000a:83| jmp  loop
            000b:04|
      0019  000c:ab| sb  GRB
end   0020  000d:83| jmp  end
            000e:0d|
Finished assembling tac file: 'ExamplePrograms/fibb_test.tac', program size: 15 bytes
Running program, size: 15
OUT: 0
OUT: 1
OUT: 1
OUT: 2
OUT: 3
OUT: 5
OUT: 8
OUT: d
OUT: 15
OUT: 22
OUT: 37
OUT: 59
OUT: 90
OUT: e9

Loading + running a program in Logisim

The provided example application in the circuit ExampleConfigurationROM is a configuration with memory-mapped I/O. The I/O at memory address 0xFF is a ROM that acts as the program memory. Left-clicking on the component and selecting 'Load Image' will allow you to load memory images generated by the assembler.

TISC Example configuration

There is a program loaded in ExampleConfigurationROM that was built from ExamplePrograms/expanded_terminal.tac.

To "run" the program, navigate to "Simulate" in the menu bar and select "Ticks Enabled". This will cycle the clock, and the program should start to run.

About

tiny instruction set computer

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages