| UDP sequence item - debug tip
                            
                            For the  UDP 
							generation scheme, I have considered a few approaches of layered sequence drivers. Since I do this project as a self study project, all by myself, I decided on a simple generation.
                            
                            In this page I discuss ways for initial code debug. The UDP item consists three parts:
                            Common part, ARP only part, UDP IP only part. 
                            Since I have limited access to training license and since the code is developed after work time, it is highly important to do an initial check for the code:
                            Cleanup any syntax errors.Check that default values are generated properly.
                            For quick compilation and simulation of a single file, I selected irun, quick multipurpose compile simulation utility, to load and test my file.
                            At the end of the file, add a debug instantiation under sys:
                            
extend sys {
  dbg : ARP pkt_s;
  post_generate() is also {
    outf("dbg l3_data_l\n");
    print dbg;
    for each in dbg.l3_data_l {
      if(index > 0 && (index % 8) == 0) then { outf("\n");};
      outf("%02x ", it);
    };
    outf("\n");
    print dbg.mac_dst_add_l using hex;
    print dbg.mac_src_add_l using hex;
  };
};
                            Commands for compilation:
                            
                            Using irun:
irun udp_ip_pkt.e
test
exit
                            
                            Using specman:
                            specman
                            load  udp_ip_pkt.e
                            test
                            exit
                             
                            The code of the initial  UDP sequence item is available on this site.
                             |