Project 1 – LC-3300 Datapath

$35.00 $24.00
Category:

Description

Rate this product
  • Requirements

 

    • Download the proper version of CircuitSim. The proper version is version 1.9.1 or later. A copy of CircuitSim is available under Files on Canvas. You may also download it from the CircuitSim website (https://ra4king.github.io/CircuitSim/). In order to run CircuitSim, Java must be installed. If you are a Mac user, you may need to right-click on the JAR file and select “Open” in the menu to bypass Gatekeeper restrictions.

 

    • CircuitSim is still under development and may have unknown bugs. Please back up your work using some form of version control, such as a local/private git repository or Dropbox. Do not use public git repositories; it is against the Georgia Tech Honor Code.

 

    • The LC-3300 assembler is written in Python. If you do not have Python 3 or newer installed on your system, you will need to install it before you continue.

 

  • Project Overview and Description

 

Project 1 is designed to give you a good feel for exactly how a processor works. In Phase 1, you will design a datapath in CircuitSim to implement a supplied instruction set architecture. You will use the datapath as a tool to determine the control signals needed to execute each instruction. In Phases 2 and 3, you are required to build a simple finite state machine (the “control unit”) to control your computer and actually run programs on it.

 

Note: You will need to have a working knowledge of CircuitSim. Make sure that you know how to make basic circuits as well as subcircuits before proceeding. You are free to use any of CircuitSim’s provided components i.e. registers. The TAs are always here if you need help.

Project 1 CS2200 – Computer Systems and Networks

 

 

 

  • Phase 1 – Implement the Datapath

 

 

In this phase of the project, you must learn the Instruction Set Architecture (ISA) for the processor we will be implementing. Afterwards, we will implement a complete LC-3300 datapath in CircuitSim using what you have just learned.

 

You must do the following:

 

  1. Learn and understand the LC-3300 ISA. The ISA is fully specified and defined in Appendix A: LC-3300 Instruction Set Architecture. Do not move on until you have fully read and understood the ISA specification. Every single detail will be relevant to implementing your datapath in the next step.

 

  1. Using CircuitSim, implement the LC-3300 datapath. To do this, you will need to use the details of the LC-3300 datapath defined in Appendix A: LC-3300 Instruction Set Architecture. You should model your datapath on Figure 1.

 

  1. Put your name on your CircuitSim data path in a comment box so we know it is your work.

 

3.1 Hints

 

3.1.1 Subcircuits

 

CircuitSim enables you to break create reusable components in the form of subcircuits. We highly rec-ommend that you break parts of your design up into subcircuits. At a minimum, you will want to implement your ALU in a subcircuit. The control unit you implement in Phase 2 is another prime candidate for a subcircuit.

Project 1 CS2200 – Computer Systems and Networks

 

 

 

3.1.2 Debugging

 

As you build the datapath, you should consider adding functionality that will allow you to operate the whole datapath by hand. This will make testing individual operations quite simple. We suggest your datapath include devices that will allow you to put arbitrary values on the bus and to view the current value of the bus. Feel free to add any additional hardware that will help you understand what is going on.

 

3.1.3 Memory Addresses

 

Because of CircuitSim limitations, the RAM module is limited to no more than 16 address bits. Therefore, per our ISA, any 32-bit values used as memory addresses will be truncated to 16 bits (with the 16 most significant bits disregarded). If you use the RAM subcircuit we provide, this truncation has already been handled, and you can simply attach the 32-bit value from the MAR (Memory Address Register) to our custom RAM circuit. Otherwise, you will need to truncate the most significant bits of the the address value from the MAR before feeding it into the RAM.

 

3.1.4 Comparison Logic

 

The “comparison logic” box in Figure 1 is responsible for performing the comparison logic associated with the BEQ instructions. The comparison logic should read the current value on the bus. When executing BEQ, you should compute A − B using the ALU. While this result of the ALU is being driven on the bus, the comparison logic should read the result A − B and output a single “true” or “false” bit for the condition

  • == B.

 

Your comparison logic should be purely combinational. Feel free to use any CircuitSim components you wish to aid in your implementation.

 

3.1.5 Register File

 

You must implement your own register file. That is to say, you cannot use CircuitSim’s built-in RAM to create the register file. Consider what logic components you may want to use to implement addressing functionality (multiplexers, demultiplexers, decoders, etc). Your zero register must be implemented such that writes to it are ineffective, i.e., attempting to write a non-zero value to the zero register will do nothing. Do not forget to do this or you will lose points!

 

3.1.6 Register Select

 

From lecture and the textbook, you should be familiar with the “register select” (RegSel) multiplexer. The mux is responsible for feeding the register number from the correct field in the instruction into the register file. See Table 4 for a list of inputs your mux should have.

 

  • Phase 2 – Implement the Microcontrol Unit

 

In this phase of the project, you will use CircuitSim to implement the microcontrol unit for the LC-3300 processor. This component is referred to as the “Control Logic” in the images and schematics. The micro-controller will contain all of the signal lines to the various parts of the datapath.

 

You must do the following:

 

  1. Read and understand the microcontroller logic:

 

 

    • Note: You will be required to generate the control signals for each state of the processor in the next phase, so make sure you understand the connections between the datapath and the microcontrol unit before moving on.

Project 1 CS2200 – Computer Systems and Networks

 

 

 

  1. Implement the Microcontrol Unit using CircuitSim. The appendix contains all of the necessary in-formation. Take note that the input and output signals on the schematics directly match the signals marked in the LC-3300 datapath schematic (see Figure 1).

 

  • Phase 3 – Microcode and Testing

 

In this final stage of the project, you will write the microcode control program that will be loaded into the microcontrol unit you implemented in Phase 2. Then, you will hook up the control unit you built in Phase 2 of the project to the datapath you implemented in Phase 1. Finally, you will test your completed computer using a simple test program and ensure that it properly executes.

 

You must do the following:

 

  1. Open and fill out microcode.xlsx file we’ve provided you (note: the formulas in the provided file will only work with Excel). You will need to mark which control signal is high (that is 1) for each of the states.

 

  1. After you have completed all the microstates, convert the binary strings you just computed into hex and move them into the main ROM. You can just copy and paste the hex column (highlighted yellow) from the spreadsheet directly into the ROM component in Circuitsim. Do the same for the sequencer and condition ROMs.

 

  1. Connect the completed control unit to the datapath you implemented in Phase 1. Using Figures 1 and 2, connect the control signals to their appropriate spots.

 

  1. Finally, it is time to test your completed computer. Use the provided assembler (found in the “as-sembly” folder) to convert a test program from assembly to hex. For instructions on how to use the assembler and simulator, see README.txt in the “assembly” folder. Note: The simulator does not test your project, it simply provides a model. To test your design, you must load the assembled HEX into CircuitSim. We recommend using test programs that contain a single instruction since you are bound to have a few bugs at this stage of the project. Once you have built confidence, test your processor with the provided pow.s program as a more comprehensive test case.

 

  • Autograder

 

The autograder for Project 1 mainly serves as a debugging tool, so there is no point assigned to it, and your final grade will not be determined by whether you pass the autograder or not. The autograder will execute the test program pow.s using your datapath and tell you which instruction goes wrong, but it won’t evaluate anything else. Feel free to use it as a tool to help you debug your circuit, but you won’t be able to rely on it entirely. As the autograder only tells you which instruction leads to an error, you must still figure out which part of your datapath is not functioning as expected. However, it should be easier to reproduce the error knowing the address of the failing machine instruction! If you want to use the autograder, you must follow a few rules:

 

  • Don’t rename the main subcircuit ”Datapath”

 

  • Name your PC register as “PC”

 

  • Name your IR register as “IR”

 

  • Name your state register as “State”

 

  • Name your 3 ROMs as ”MAIN”, ”SEQ”, and ”CC” respectively

 

Project 1 CS2200 – Computer Systems and Networks

 

 

 

  • Use only one clock globally, which means you should not use clock components in any subcircuits besides the main datapath. Instead, you should use an input pin and connect the clock signal to that subcircuit in the main datapath.

 

  • Use only one RAM as memory

 

  • In microcode, use the first row as your first state of FETCH macrostate.

 

  • Don’t change the layout of the microcode Excel sheet

 

If the autograder fails you, please first double-check if you meet all the rules above. If the autograder points you to a line of code, try to load the assembled HEX of the pow.s program into your RAM, clock it until PC turns to that line number, and check state by state to see if any component goes wrong when executing that instruction. Sometimes, you may not reproduce the error when you reach that instruction for the first time. This is because there are some loop structures and subroutine calls in the test program, and you will execute some instructions multiple times. The error occurs when you reach that instruction again and the condition changes (e.g. a conditional branch instruction). When you get an error message, please first try to reproduce it locally and think about what you observe. If you still don’t know how to approach it, come to office hours or make a private post with a detailed explanation of your attempts of debugging, instead of just a post with the error message and a screenshot of your datapath. TAs won’t be able to help you solve the problem with that little amount of information.

 

  • Deliverables

 

To submit your project, you need to upload the following files to Gradescope:

 

  • CircuitSim datapath file (LC-3300.sim)

 

  • Microcode file (microcode.xlsx)

 

If you are missing one or both of those files, you will get a 0 so make sure that you have uploaded both of them. Always re-download your assignment from Gradescope after submitting to ensure that all necessary files were properly uploaded. If what we download does not work, you will get a 0 regardless of what is on your machine. This project will be demoed.In order to receive full credit, you must sign up for a demo slot and complete the demo.We will announce when demo times are released.

Project 1 CS2200 – Computer Systems and Networks

 

 

 

Project 1 - LC-3300 Datapath
$35.00 $24.00