AVLSI
ECE 474: Digital VLSI Design
Fall 2003
 
 

Lab 4: Control

Due: November 12, 11:50pm [Wednesday]
  The goal of this lab is to combine your datapath with control, so that the combination implements a simple microcontroller.

Reminder: All layout in this class will use the magic technology file SCN3ME_SUBM.30, which can be specified on the command line by saying: magic -T SCN3ME_SUBM.30. You might want to alias magic to magic -T SCN3ME_SUBM.30 in your .cshrc.

Make sure you read the ENTIRE lab before starting.

As always, all designs must be accompanied by a CAST file containing the production rules that lvs against the layout.

Microcontroller Description
  For this lab you will design a simple 8-bit accumulator-based microcontroller, "u474." u474 has 8 8-bit registers (R[0]..R[7]), a special accumulator register A, and an 8-bit program counter pc. Register R[0] is hardcoded as zero. Instructions are 8-bits long, and u474 has two 8-bit instruction types:
The I-format instructions are as follows:
  • bz imm: op=00: If A=0, pc:=pc+sext(imm) where sext sign-extends the 5-bit immediate field.
  • bnz imm: op=01: If A!=0, pc:=pc+sext(imm)
  • li imm: op=10: A:=sext(imm)
  • stpc: op=11: A:=pc
In all cases, the pc on the RHS is always the pc of the current instruction.

The R-format instructions are as follows:

InstructionopEffect
add r0000A:=A+reg[r]
sub r0001A:=A-reg[r]
sl0010A:=A<<1
sr0011A:=A>>1
and r0100A:=A&reg[r]
or r0101A:=A | reg[r]
nor r0110A:=A nor reg[r]
xor r0111A:=A xor reg[r]
mvi r1000A:=reg[r]
mvo r1001reg[r]:=A
ld r1010A:=mem[reg[r]]
st r1011mem[reg[r]]:=A
I/O description. The chip has 40 signals as its interface to the outside world. The pins are labelled p[0] .. p[39], and have the following meaning:
  • Clocks. p[0]: phi0, p[1]: phi1
  • Reset. p[2]: reset (active high)
  • Power. p[3]: Vdd, p[4]: GND
  • ZBus. p[5] ... p[12] should be connected to the "wz" bus after two inverters (lsb should be p[45]). This is for debugging purposes.
  • Addr. p[13] .. p[20] are the eight address pins used to access off-chip memory.
  • Dout. p[21] .. p[28] is data written out to the data memory (via the store instruction).
  • Din. p[29] .. p[36] is data read from off-chip data memory, used for both instruction access and load instructions.
  • RdC. p[37] used to send a read request to memory.
  • WrC. p[38] used to send a write request to memory.
  • Mdone. p[39] used by the memory to signal that the operation is done.
To access off chip memory, the following operations should be performed
  • Read. To read a value at address X, drive Addr with the value X, and set RdC high. These signals must be stable during the non-overlap period. The data will be available on Din on the same cycle when Mdone is high.
  • Write. To write value V at address X, drive Addr with the value X and Dout with V, and set WdC high. These signals must be stable during the non-overlap period. The data will be written to memory at the next period when either clock is high, and the signals being driven must be stable UNTIL Mdone goes high.


PLA Generation
  To generate a PLA automatically, you have to write a .eqn equation file. An example is shown here:

INORDER = a b c;
OUTORDER = p q r;
p = b|c;
q = !b&!c;
r = a&b;
After logic equations are generated, simply say eqntott -l file.eqn > file.tt, followed by cast2pla < file.tt > file.cast to get a CAST file that corresponds to the PLA. The CAST definition that is auto-generated will include signals like RESET (the reset signal, which should be connected to Reset when you instantiate the definition), p1, p1-, p2, and p2-. p1/p1- is one clock phase (the "-" corresponds to the negated version of the clock phase), and p2/p2- corresponds to the other clock phase. You can set these to phi0/_phi0 and phi1/_phi1 (or vice versa), depending on when you need the PLA to assert the control signals.

To generate layout, use mpla -I -O -t /usr/local/cad/lib/mpla/norSUBM file.tt -o file, which will generate file.mag. The PLA layout may have some well plugs missing; you should put those in by hand.

As mentioned in class, the PLA layout WILL NOT LVS against the automatically generated CAST file.

Design Guidelines
 
  • Your layout should fit in 3500x3500 lambda, since that will be the budget you get for lab 5.
  • All layout except for PLA layout must pass LVS. To make your life easy, the simplest solution is to have a top level mag file that contains two subcells: one containing all the PLAs you used, and the other containing the rest of the layout. Wire up the datapath to the PLAs in the top-level cell. Finally, lvs -CE can be used for connectivity checking. This just checks variable names and looks for shorts/miswired signals. You should be able to check the entire top level design using this command.
  • A simple state machine can be combined with simple logic to design this microcontroller. For instance, you can have a state machine that steps through states like "read instruction" and "read register operand" and "write results." The state information can then be combined with the instruction opcode to generate the necessary control signals for your entire datapath.
  • Any write signal (register write, write control to the memory) cannot have a glitch on it; otherwise, there could be a data corruption problem. This can be ensured by using a 2-input AND gate with a clock as input to the gate (think about which clock should be fed into the gate, and when the other input to the gate is allowed to change in order to ensure that the output can never have a spurious 1).
  • Use 2-phase non-overlapping clocks, and do not use flip-flops in your design.
  • The complemented senses of the clocks are not available as inputs; therefore, you will have to generate them yourself.
  • When simulating clocks in IRSIM, the clock definition will look like this:
    vector CLK p[0] p[1]
    clock CLK 00 10 00 01


Submitting your Lab
  For the written part, we expect a one page submission. There will be a box placed in 314 Rhodes where you can submit the written part. We expect one submission per group. The first page is the cover sheet and it must contain:
  • The lab number and the names of the group members and their CSL login ids.
  • A picture of the complete layout for your processor.
  • Cycle time estimate for your processor.
  • The dimensions of the bounding rectangle for your layout in lambda. (i.e. your layout has area x lambda by y lambda), and the area of your layout in lambda square.

Electronic Submission. Use the CMS system to submit your files electronically. Create a .tar.gz file and submit that file. Make sure that the file contains a plain text README file that documents your submission. As in Lab 1, make sure that the .tar.gz file ONLY contains the files that you wrote; do not include any file that is generated by a tool (e.g., no .ext files, no .trace files, etc etc). Instructions on testing the lab should be contained in the README.

 
 
 
Questions? Contact Rajit Manohar
cornell logo