UCLONG / NetEmulation

Software Simulation and Hardware Synthesis of Electrical and Optical Interconnection Networks
GNU General Public License v3.0
9 stars 6 forks source link

packet_t definition #15

Open DannyNicholls opened 10 years ago

DannyNicholls commented 10 years ago

So, further to our discussion today about having measure bits in the definition of packet_t, I started working on my router test bench and was thinking about the packet structure.

I think the two extra fields that could be used are a measure bit, to indicate whether or not the packet has entered the network after the required warm up time, and a timestamp. Are there any more?

My packet_t definitions now looks something like this

    `ifdef TORUS

      // Network packet type for testing TORUS addressed designs (Mesh/Torus)
      typedef struct packed {
        logic [`PAYLOAD-1:0]         data
        logic [log2(`X_NODES)-1:0]   x_source;
        logic [log2(`Y_NODES)-1:0]   y_source;
        logic [log2(`Z_NODES)-1:0]   z_source;    
        logic [log2(`X_NODES)-1:0]   x_dest;
        logic [log2(`Y_NODES)-1:0]   y_dest;
        logic [log2(`Z_NODES)-1:0]   z_dest;    
        logic                        valid;
        logic [`TIME_STAMP_SIZE-1:0] timestamp;
        logic                        measure;
      } packet_t; 

    `else

      // Network packet type for simple addressed designs
      typedef struct packed {
        logic [`PAYLOAD-1:0]         data;
        logic [log2(`NODES)-1:0]     source;
        logic [log2(`NODES)-1:0]     dest;
        logic                        valid;
        logic [`TIME_STAMP_SIZE-1:0] timestamp;
        logic                        measure;
      } packet_t;

    `endif

I think Z_NODES may cause issues if it is not >1, but I will cross that bridge when I come to it. I guess it just needs surrounding with an if statement. But the second packet structure, which is similar to the one used by NEMU, is good.

Would any other fields be useful?

Obviously, anyone who wanted to use the network in a different situation would define there own packet_t, so I don't think it matters if we have fields specific to test?

DannyNicholls commented 10 years ago

It might be worth having a field for adaptive routing...