|
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:
| Instruction | op | Effect |
| add r | 0000 | A:=A+reg[r] |
| sub r | 0001 | A:=A-reg[r] |
| sl | 0010 | A:=A<<1 |
| sr | 0011 | A:=A>>1 |
| and r | 0100 | A:=A®[r] |
| or r | 0101 | A:=A | reg[r] |
| nor r | 0110 | A:=A nor reg[r] |
| xor r | 0111 | A:=A xor reg[r] |
| mvi r | 1000 | A:=reg[r] |
| mvo r | 1001 | reg[r]:=A |
| ld r | 1010 | A:=mem[reg[r]] |
| st r | 1011 | mem[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 | | |
|
|
|
| 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.
| |
|
|
|