CSE 566 Reconfigurable System On Chip Design
John W. Lockwood
Fall 2004

Machine Problem 1

Simulation of a
TCP/IP PortTracking Module

Due: Thursday, September 30, 2004, 2:30pm

50 Points

Instructions

Part 1: Simulation of the TCP/IP Module in MP1

Using the files provided via CVS in the previous machine problem,
simulate the operation of PortTracker circuit to determine how many flows of occur on a network.

  1. In the base directory, run
    make clean

  2. If you are in WINDOWS: Source the cygset file to set up your environment:
    source cygset
    If you are in LINUX: Source the simset file to set up your environment:
    source simset

  3. Compile the VHDL files:
    make compile

  4. Ready the simulation environment:
    make sim

  5. Copy the INPUT_CELLS_LC.DAT file from the base directory into the sim directory:
    cp INPUT_CELLS_LC.DAT sim/
    This must be done every time you run a make clean!

  6. Change to the sim directory and execute the following command (also listed in the command file in the sim directory):
    vsim -lib work testbench -do "testbench.do" &

  7. Wait patiently, as it will take a while to simulate. The simulation will go for 85us.

This tutorial is designed to familiarize you with ModelSim as well as give you a grounding in the operation of a circuit that uses the TCP Processor.

When ModelSim opens it will open three windows. The one we are interested in is the wave window.

Start out by making the wave window as large as you can (this will make things easier). Something to keep in mind as you go along is that if you click on a waveform, it will jump the cursor there to where you clicked and show you the values of the signals at that time in the left column. However, if you are not zoomed in enough, as you move the cursor in the right window (say, by clicking and dragging), the values updated on the left may actually not be consecutive values within the waveform. So if you are not seeing the results you expect, don't forget to zoom in closely and ensure that you aren't simply missing data.

The middle mouse button (the wheel button, or if you have a two-button mouse it may be both buttons together) is an important one -- it allows for easy zooming. Middle-clicking and dragging the mouse down and to either side will allow you to zoom in on a region. Middle-clicking and dragging the mouse up and to the right wil let you zoom out to a specified degree, and middle-clicking and dragging the mouse up and to the left will cause you to zoom out fully (and fit the waveforms in the window).

Look at the signals. For the sake of simplicity, many of the signals within the overall PortTracker application have been removed from the default view. If you wish to add these back in, you can do so by highlighting the desired signals in the singals window, right-clicking on them, and selecting Add. If you add signals or change colors or anything like that and wish to save the waveform view, be sure to click the Save button (the floppy disk icon) and save the file as wave.do in the sim directory.

The signals that you can see in the default view are as follows (the colors are in parentheses):

First, search for a signal called int_data, which is what the data_in input signal maps to. Do this by going to the Edit menu and selecting Find. Find is good for looking for a specific signal, while Search (underneath Find in the Edit menu) is good for scouring the entire waveforms looking for a value. You may have to click on a signal first before selecting Find, if it complains, and may have to search up or down, depending on which signal you've clicked on. Look for the signal data_in that is part of porttracker_application.

Note how it is showing the data that is being read in from the file (you can verify this by looking at the INPUT_CELLS_LC.DAT file if you wish). Right click on the signal, choose Radix, and select ASCII. Note that you can also select the signal's radix to be binary, octal, etc.

Just above the int_data signal you should see a large number of signals that are mostly staying at a low level. These are the signals that the porttracker_application asserts when it finds a packet with a port of interest.

Just below the int_data signal are several signals that show the status of the incoming packet. sof stands for "Start of Frame" while soip stands for "Start of IP" for IP packets. Note how the int_istcp signal is asserted when the int_sof signal is asserted; this is the TCP Processor's way of saying that this is a valid TCP packet. Note how at about 14.5us, as well as a few other times, the int_sof signal is asserted but the int_istcp signal is not. What do you think this means? (Hint: does the int_soip signal get asserted at these times?)

Questions

Remarks

Part 2: Extend the functionality of PortMapper Module

Build a circuit that detects traffic on a different port number than those already define in the existing PortTracker module. In particular, extend the functionality of the PortTracker circuit to detect packets arriving on port 5524 [decimal].

Requirements

  1. Describe the the relationships between structural components found in each of the following three files:
    • porttracker_module.vhd
    • porttracker.vhd
    • control_proc.vhd
    In particular, describe which groups of signals map to which components, and why.

    ____________________________________________________________

    ____________________________________________________________

    ____________________________________________________________

    ____________________________________________________________

  2. Build a circuit that detects packets on port 5524 in the same fashion as it detects packets on other ports.
    • Note that the port number, 5524, is given to you in the decimal radix
    • Name the new service that you are detecting "CSE566MP1."

  3. Include count statistics for this packet in the statistics packet that the circuit sends out.

  4. Use the following, new INPUT_CELLS_LC.DAT to source traffic into your circuit.

  5. Modify the wave.do file to include the new signals in the simulation.
    • Make the color of all of the new signals the same but distinct from all other signals in the waveform

  6. Run ModelSim to simulate the operation of your circuit. Note that you should generate an image of the relevant waveforms as a part of the project submission.

Hints

Submission