AVLSI
ECE 474: Digital VLSI Design
Fall 2003
 
 

Lab 3: Datapath Design

Due: October 16, 11:50pm
  The purpose of this lab is to implement a simple datapath that can be used for a variety of purposes.

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.

NOTE: All designs must be accompanied by a CAST file containing the production rules that lvs against the layout (as in lab2).

In this lab you will design a complete 8-bit datapath. Some general comments:

  • For lvs, you must use the options lvs -svDEd file.ext file.prs. Please read the LVS tips page before starting so you understand what some of the common errors/warnings mean. Note that you may have to modify CAST files from lab2 to correct some of the errors/warnings as per the guidelines on the tips page.
  • Whenever we provide an irsim test script, it must work on your files UNMODIFIED.
  • I've installed a new script called slashes2dots that can be used to convert names of the form a/b/c to a.b.c in your .sim and .al files. This will allow you to use the same irsim test script for testing .sim files generated by ext2sim and prs2sim. Running slashes2dots file replaces all slashes with dots in files file.sim and file.al. Just make sure that you set Vdd! and GND! to the right values in your test scripts. Note that even if you cannot access names in the CAST hierarchy (because they are internal nodes in a subcell, for instance), you can STILL SEE THEM in irsim.
  • Any irsim test script must work on your CAST files as well as your extracted layout (after running slashes2dots on the output of ext2sim).
  • All irsim scripts that you submit must contain a convincing demonstration that the circuit behaves properly, not just one test case.
  • Run lvs while you are doing your layout, not just right at the end before submitting your design. Simulation can only find some errors; lvs does a thorough check of your layout against production rules. It is a huge waste of time trying to find errors using irsim if your layout does not pass lvs. Note that passing lvs means that lvs does not report ANY errors.
  • If you feel you need to modify any of your lab2 layout, feel free to do so.
  • All state-holding nodes must be staticized. Please read the section on staticizers on the LVS tips page.


CAST, Layout and LVS
  Part 1. Implement an 8-bit register using the safe design discussed in class in files reg.mag and reg.cast. Make the register have two output ports (you simply need to replicate the read part). The final register must have two read control lines (for the two output ports) and one write control line (for the one input port) that are common to each bit. Create a test file test_reg.cast to test the register, and an irsim script file test_reg.cmd containing the tests for your design. The CAST definition for your 8-bit register must begin: define reg() (node[8] in, out0, out1; node w,r0,r1) where in is the input bus, out0 and out1 are the two output buses, and w, r0 and r1 are the write select and read select signals (for out0 and out1 respectively).

Part 2. To support external inputs, we will include a "load" unit that consists of an inverter followed by a controlled pass gate. The production rules for one bit are:

_in&l->out-    ~_in&~_l->out+

l->_l-     ~l->_l+

in->_in-      ~in->_in+
When l is high, the input in is copied to the output out; when l is low, the output is state-holding. Design an 8-bit load unit called load.mag, with the production rules in load.cast, and irsim test script test_load.cmd. The CAST definition for the load unit must begin: define load() (node[8] in, out; node l).

Part 3. To support external output, we will include a "read" unit that consists of an inverter followed by a controlled pass gate. The production rules for one bit are:

in&r->_out-    ~in&~_r->_out+

r->_r-     ~r->_r+

_out->out-      ~_out->out+
When r is high, the input in is copied to the output out; when r is low, the output _out is state-holding, and keeps driving the previous value onto the output out. Design an 8-bit read unit called read.mag, with the production rules in read.cast, and irsim test script test_read.cmd. The CAST definition for the read unit must begin: define read() (node[8] in, out; node r).

Part 4. (For those who haven't done this already) Pitch-match the layout from lab2 and lab3, so that the layout for each block can be arrayed at the same bit pitch.

Part 5. Design a complete datapath that uses all the layout from lab2 and this lab. The layout should be in datapath.mag, and must lvs against the following datapath.cast (given below).

  • The datapath contains all the layout from lab2 and lab3. All the layout MUST BE pitch matched, otherwise wiring it up will be difficult. The layout should look like a sequence of vertical columns, with each column corresponding to a major 8-bit block. The order of the columns must be (from left to right, with cell identifier in parentheses): load (ld); fblock (fb); load (rfb); oneshift (os); load (ros); addsub (as); load (ras); reg (reg0); reg (reg1); read (rd).
  • The output of each combinational block must be connected to the input of the load block adjacent to it. That is, the output of fb, os, and as must be connected to the input of rfb, ros, and ras respectively (see the CAST file below for details). This effectively adds a tristate buffer on the output of each combinational logic block.
  • Finally, wire up the inputs and outputs using three buses.
    • Each bit of the "a" input to each combinational block must be wired together using a single, horizontal strip of either metal2 or metal3 per bit (this is bus rx in the CAST file). This bus is also connected to the input of the rd (read) block, and output port 0 of registers reg0 and reg1.
    • Each bit of the "b" input to each combinational block must be wired together using a single, horizontal strip of either metal2 or metal3 per bit (this is bus ry in the CAST file). This bus is also connected to output port 1 of registers reg0 and reg1.
    • Each bit of the output of each load block (rfb, ros, ras and ld) must be wired together using a single, horizontal strip of either metal2 or metal3 per bit (this is bus wz in the CAST file). This bus is also connected to the input port of registers reg0 and reg1.
A cartoon view of the layout and wiring is shown below:

Test your datapath CAST file by using the test_datapath.cast file shown below and creating an irsim script file test_datapath.cmd that performs the following operations:

  • Loads constant values into registers;
  • Reads the value of each regster using the external output;
  • Adds two values and stores the result in a register;
  • Shifts a value and stores the result in a register;
  • Computes some logical function using the two registers as inputs and stores the result in a register.
The link above provides a sample test script that should work with your layout. Note that just because your layout works against this script does not mean it is fully functional! The script is just a starting point for testing, and you should modify it to add additional test cases.

The file test_datapath.cast must be:


import "datapath.cast";
node[8] in, out;
node g0, g1, g2, g3;
node s, l, c;
node en_shift, en_addsub, en_fblock;
node w0,r00,r01,w1,r10,r11;
node ext_l, ext_r;
datapath d(in,out,g0,g1,g2,g3,en_fblock,s,l,en_shift,c,
           en_addsub,w0,r00,r01,w1,r10,r11,ext_l,ext_r);

The datapath CAST file datapath.cast must be:

import "fblock.cast";
import "oneshift.cast";
import "addsub.cast";
import "reg.cast";
import "load.cast";
import "read.cast";

define datapath() (node[8] in, out;  /* external IO */

                   node g0,g1,g2,g3; /* fblock control */
                   node en_fblock;

                   node s,l;         /* shift control */
                   node en_shift;

                   node c;           /* addsub control */
                   node en_addsub;

                   node w0,r00,r01;  /* register control, register 0 */
                   node w1,r10,r11;  /* register control, register 1 */
                   node ext_l;        /* load control */
                   node ext_r        /* read control */
                  )
{
   /* data buses */
   node[8] rx,ry,wz;
 
   /* fblock, with a load interface on the output */
   fblock fb(rx,ry,g0,g1,g2,g3);
   load rfb(fb.out,wz,en_fblock);

   /* shift, with a load interface on the output */
   oneshift os(rx,s,l);
   load ros(os.out,wz,en_shift);

   /* addsub, with a load interface on the output */
   addsub as(rx,ry,c);
   load ras(as.out,wz,en_addsub);

   /* two registers */
   reg reg0(wz,rx,ry,w0,r00,r01);
   reg reg1(wz,rx,ry,w1,r10,r11);

   /* external load */
   load ld(in,wz,ext_l);

   /* read, can only read bus rx */
   read rd(rx,out,ext_r);
}



Here is a summary of the files you will write in this lab. You can use more (especially for subcells in your .mag file hierarchy).
  • reg.mag, reg.cast: register implementation
  • test_reg.cast, test_reg.cmd: register test
  • load.mag, load.cast: load block
  • test_load.cast, test_load.cmd: load test
  • read.mag, read.cast: read block
  • test_read.cast, test_read.cmd: read test
  • datapath.mag, datapath.cast: datapath
  • test_datapath.cast, test_datapath.cmd: datapath test
  • fblock.cast, fblock.mag: fblock (lab2)
  • oneshift.cast, oneshift.mag: shifter (lab2)
  • addsub.cast, addsub.mag: add/subtract (lab2)
The bold files are ones that are provided. A starting point for test_datapath.cmd has also been provided.

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 each of your datapath;
  • The worst-case input to output delay for each of the blocks in the datapath (treat fb+rfb, os+ros, as+ras as single blocks; this means you need to report 6 numbers: 1: fb+rfb; 2: os+ros; 3: as+ras; 4: ld; 5: rd; 6: the slower of reg0 and reg1)
  • 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