static void Main(string[] args) { aes220ClassLibrary.aes220Dev aes220 = new aes220ClassLibrary.aes220Dev(); int rv = 99, tmp; byte[] bufOut = new byte[5] { 1, 2, 3, 4, 5 }; byte[] bufIn = new byte[5] { 0, 0, 0, 0, 0 }; //string binFile = ("aes220a_Fifo_Example_ent.bin"); string binFile = ("aes220b_Fifo_Example_ent.bin"); Console.WriteLine("Opening aes220 Device"); rv = aes220.Open(0, 9); Console.WriteLine("Device opened with status {0}", rv); Console.WriteLine("Configuring the FPGA with the FIFO example binary"); rv = aes220.ConfigureFPGA(binFile); Console.WriteLine("Status returned: {0}", rv); Console.WriteLine("Sending payload out via pipe 1"); rv = aes220.PipeOut(bufOut, 5, 1); Console.WriteLine("Receiving payload back via pipe 4"); rv = aes220.PipeIn(bufIn, 5, 4); foreach (byte i in bufIn) { Console.Write("{0} ", i); } Console.WriteLine(); Console.WriteLine("Closing aes220 Device"); aes220.Close(); Console.WriteLine("Status returned: {0}", rv); tmp = Console.Read(); }
static void Main(string[] args) { aes220ClassLibrary.aes220Dev aes220 = new aes220ClassLibrary.aes220Dev(); int rv = 99, tmp; byte[] bufOut = new byte[5] { 1, 2, 3, 4, 5 }; byte[] bufIn = new byte[5] { 0, 0, 0, 0, 0 }; byte[] payloadLSB = new byte[1] { 5 }; byte[] payloadMSB = new byte[1] { 0 }; string binFile = ("aes220a_Loopback_Example_V1_2_1_ent.bin"); Console.WriteLine("Opening aes220 Device"); rv = aes220.Open(0, 9); Console.WriteLine("Device opened with status {0}", rv); Console.WriteLine("Configuring the FPGA with the loopback binary"); rv = aes220.ConfigureFPGA(binFile); Console.WriteLine("Status returned: {0}", rv); Console.WriteLine("Sending payload size LSB out"); rv = aes220.PipeOut(payloadLSB, 1, 1); Console.WriteLine("Sending payload size MSB out"); rv = aes220.PipeOut(payloadMSB, 1, 2); Console.WriteLine("Sending payload out"); rv = aes220.PipeOut(bufOut, 5, 3); Console.WriteLine("Sending payload size LSB out again to reset counter"); rv = aes220.PipeOut(payloadLSB, 1, 1); Console.WriteLine("Receiving payload back"); rv = aes220.PipeIn(bufIn, 5, 4); foreach (byte i in bufIn) { Console.Write("{0} ", i); } Console.WriteLine(); Console.WriteLine("Closing aes220 Device"); aes220.Close(); Console.WriteLine("Status returned: {0}", rv); tmp = Console.Read(); }