CSE596 Homework 4

CSE596 Homework 4

Due: 6:30PM Thursday March 11th

Problem: Write a ZPL program to simulate an oblivous routing algorithm on a nxn torus network. Run the simulation for a few thousand iterations, and determine the average and longest packet delivery time.

Packet structure: Each packet is composed of a destination address, given in delta_x, delta_y form, followed by a double word of data. Thus, if left and down are negative and right and up are positive, then a packet arriving at a node with address (2,-1) goes right two hops and down one. The channel will be one word wide in each direction, so the packets will be 3 phits long.

Node structure: Each node is composed of four input frames capable of storing one word, and four output frames capable of storing one word, corresponding to each of the four directions. Additionally, there is a input frame and an output frame. There should be a full empty bit telling whether data is present in each frame. Additional state variables may be needed, say to count the number of phits that have passed in a given direction, etc.

Algorithm (Output drived): If all output frames are full, then the node setup is complete. Otherwise, there are free output frames. For each of these, packets in transit are moved from the input frame to the output frame, correcting the full/empty bits accordingly. If there are still unfilled output frames, and there are newly arrived packets in input frames, then for one whose direction of travel will fill an empty output frame, process as follows:

  • The header is moved from input to output frame
  • Full/empty bits are set accordingly
  • The direction of travel is recorded in a state variable
  • The count of phits remaining is set to 2.
  • Otherwise the node setup is complete. Remember, and address of (0,0) means the packet has arrived and should be delivered. Once the node setup is complete, then the packets advance across the wires moving from full output frames to empty input frames, with the full/empty bits reset accordingly. This completes the step. At the conclusion of the step, new traffic is generated.

    Traffic generation: Using the array random number generation process described in the ZPL manual (last topic, Chapter 9) generate packets at the nodes. This is the work load, and I recommend that it be 10% of bisection bandwidth of the network. The best way to determine the longest packet delivery time is to store a time stamp in each packet during the step on which it is generated, and compute the difference when it is fully delivered.

    Size of the Space: Your code should include a config var, Size. Make sure you name this config var properly, so I can grade more easily. Processors will be laid out in a SizexSize square.

    Turn in your solutions using electronic turnin, as you did on the first assignment.