-
Notifications
You must be signed in to change notification settings - Fork 0
CISC CPU design, emulator, microcode, and assembler written for Computer Architecture project, spring 2014
License
solb/comparchcpu
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
+----------------------------------------+ | THE FABULOUS COMPUTATIONAL MACHINE | | Presented by Sol Boucher and Evan Klei | +----------------------------------------+ The FABULOUS COMPUTATIONAL MACHINE is a arch library simulation of a chip that uses a microcontroller. Files Submitted =============== In addition to the Object Files as listed below Files nessessary for run time ----------------------------- CPU.cpp - The file that runs all of the code to construct and run the Machine on input provided FlipRegister.cpp - Contains the implementation of a register that allows single bit flipping. FlipRegister.h - The header file for the implementation of the flip register accessors.cpp - A file full of helpful functions and constants to assist in running the Machine accessors.h - The header file that defines all of the functions in accessors.cpp control_path.cpp - Defines the microcontroller and all of its components control_path.h - The associated header file for control_path.cpp data_path.cpp - Defines the data path and all of its components data_path.h - The associated header file for data_path.cpp microcontroller.cpp - Contains the code to decode and operate based on micro-instructions microcontroller.h - The associated header file for microcontroller.cpp opcodes.cpp - Used for converting between opcodes and mnemonics opcodes.h - The associated header file for opcodes.cpp ucode.fu - The CPU microcode, corresponding to our RTL jmptab.fl - The control unit's jump table, containing microcode addresses Object files ------------ addrmodeTest.fo - Tests reading and writing to all address modes. Also checks the shorter versions of some instructions bequality.fo - Tests the BEQ and BNE commands bitwiseTest.fo - Tests all of the bitwise commands, such as AND and OR. Also tests NOT and NEG. branchTest.fo - Tests all of the branching commands, should result in 0 if fully functional halt.fo - Tests that the program can assemble, run microinstruction fetching and decoding, then halt imm.fo - Tests that the program can handle immediate values immaddr.fo - Tests that the program can handle immediate values logicTest.fo - Tests all of the logical commands loop.fo - Tests jumping and JAL loopy.fo - Sums up all of the values in an array mathTest.fo - Tests all of the mathematic commands memadd.fo - Tests adding between memory addresses, and storing to memory addresses memnz.fo - Tests snz, and using set instructions with 1 operand opt.fo - Tests basic addition, as well as microprogram flow perimeter.fo - Calculates the perimeter of a bunch of rectangles. Tests doubly scaled displacement and double displacement print.fo - Tests the PRNT function regind.fo - Tests register indirect address mode rel.fo - Tests program counter relative address mode reladd.fo - Tests adding to memory from memory, then accessing using pc relative address mode sequality.fo - Tests set equality function series.fo - Computes the sum of a finite series setTest.fo - Tests all of the set functions subtract.fo - Tests the subtract function test.fo - Check a multitude of functions, should result in $t0 being zero word.fo - Test that FASM can properly store words The assembly files are be provided in the archive Additional files ---------------- FlipTest.cpp - This file contains code to test the FlipRegister implementation ADDENDUM - Contains corrections made to the ISA and Hardware documents README - This file fabcomp_support.tar - Contains the files listed below. Files are additional to what is provided, none are necessary for running the program, but they are part of this project. fabcomp_support.tar files ------------------------- fasm -> Makefile - The file to make fasm -> fasm.cpp - This file contains the code for the Fabulous Assembler or FASM. This program takes human readable code and converts it to code for the Computational Machine to run. Style for FASM is documented below -> test_progs -> Makefile - Runs fasm on all of the .fs files in this folder -> All of the .fs files for the object files described above will be included in here. In order to get the object files, run FASM as described below ucode -> Makefile - Makes all of the calls to construct the jmptab and ucode files -> rtlparser.sh - Reads the RTL from hard.tex, parses and assign numbers to unique commands -> ucodegenerator.py - Creates the ucode based on output from rtlparser -> jtabgenerator.py - Creates the jump table based on output from rtlparser Makefile - Allows the construction of isa.pdf and hard.pdf isa.tex - Contains the raw LaTeX code for isa.pdf hard.tex - Contains the raw LaTeX code for hard.pdf controlpath.svg - Contains the image of the control path. Openable with an internet browser, but do not update datapath.svg - Contains the image of the data path. Openable with an internet browser, but do not update isa.pdf - Documentation of the ISA for the Computational Machine hard.pdf - Documentation of the hardware for the Computational Machine Debugging Switches ================== By default, the simulator prints a rudimentary breakdown of each instruction word and its following immediate words, as well as its result, or the value it computes into MDR, if any. (This is in addition to revealing the outline of PRNT instructions and ERROR and FATAL diagnostics whenever the system does an emergency halt.) However, additional debugging information can be achieved by adding the following preprocessor defines to the CPPFLAGS: -DPRINT_UINSTRUCTS - Also prints a (very basic) breakdown of microinstructions as they are executed -DDEBUG_SWITCHES - Prints cases taken in the ctrl (control point) and cond (conditional clause) switches in microcontroller.cpp -DDEBUG_DUMPGPRS - Dumps all GPRs each time an instruction executes -DDEBUG_DUMPCNTL - Dumps the control registers every time a microprocedure call is performed -DDEBUG_DUMPMDR - Dumps the MDR on every microprocedure return -DDEBUG_ARCH - Enables the Arch package's cycle-by-cycle debugging Command Line Arguments ====================== CPU <ucode> <jmptab> <code to run> <ucode> - The microcode for the chip. Use ucode.fu provided <jmptab> - The micro jump table for the chip, used for jumping between micro instructions. Use jmptab.fl provided <code to run> - The actual code that the system will run. If the code was generated using FASM, the code will be stored in a .fo file Additional Notes ================ When address modes modify any value used in their calculations, the modes are considered from left to right, or from destination to source, and the components change accordingly +-------------------------------------+ | Fabulous Assembler | | An assembler written by Sol Boucher | | with help from Evan Klei | +-------------------------------------+ Fabulous Assembler (FASM) is the assembler for the FABULOUS COMPUTATIONAL MACHINE. It takes assembly style commands and converts them into machine code that the Computational Machine can understand. Format Requirements =================== Comments -------- # Comment Storing data ------------ .word value [reps] Labels ------ name: If a label is called main, FASM will set that to be the first position accessed in the file. If there is no main, the program will start at program counter 0; Instruction format ------------------ opcode operand 1, operand 2, operand 3 For a list of opcodes, see ISA.pdf The number of required operands is based on opcode. For a list how many operands are required for each opcode, see ISA.pdf Operand format -------------- Immediate Value - value Immediate Address - %address PC Relative - %offset@ Register - $name Register Indirect - $name% Scaled - $name($displacement[,scaleFactor]) Doubly Scaled - $name($displacement[,scaleFactor])($displacement[,scaleFactor]) Auto-Increment - $name+ Auto-Decriment - $name- Scaled Displacement - %address($displacement[,scaleFactor]) Doubly Scaled Displacement - %address($displacement[,scaleFactor])($displacement[,scaleFactor]) Doubly formats consider the first displacement, go to memory, then consider the second displacement Bugs and Limitations ==================== There is no support for negative literals; instead, input them as two's complement 16-bit integers. Do *not* use address mode syntax such as 0($s0): even though fasm will sometimes allow this (depending on which argument it appears as), it will be treated as a plain immediate, 0 in this case. The notation you're looking for is actually %0($s0). Command Line Arguments ====================== fasm <code to assemble> <code to assmeble> - The code that you want to comp. Usually stored in .fs files
About
CISC CPU design, emulator, microcode, and assembler written for Computer Architecture project, spring 2014
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published