The FPX KCPSM Module Exercise 1 Henry Fu The FPX KCPSM Module Exercise: Network Data Encryption / Decryption Using ROT13 Algorithm Henry Fu Washington.

Slides:



Advertisements
Similar presentations
Xilinx 6.3 Tutorial Integrated Software Environment (ISE) Set up basic environment Select Gates or Modules to Be simulated (Insert Program Code) Run Waveform.
Advertisements

Code Composer Department of Electrical and Computer Engineering
Utilizing the GDB debugger to analyze programs Background and application.
Processor System Architecture
Lab6 – Debug Assembly Language Lab
1-1 Embedded Software Development Tools and Processes Hardware & Software Hardware – Host development system Software – Compilers, simulators etc. Target.
1 Lab Session-IV CSIT-120 Fall 2000 Precedence Rules Machine Language Programming The “Micro” Machine The “Micro” Simulator The “Micro” Translator (Thanks.
ECE Department: University of Massachusetts, Amherst Lab 1: Introduction to NIOS II Hardware Development.
1 Introduction to Programming Environment Using MetroWerks CodeWarrior and Palm Emulator.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Shell and Flashing Images Commands and upgrades. RS-232 Driver chip – ST3232C Driver chip is ST3232C Provides electrical interface between UART port and.
Lab 1 – Assembly Language and Interfacing Start date: Week 3 Due date: Week 4 1.
How Java Programs Work MIS 3023 Business Programming Concepts II The University of Tulsa Professor: Akhilesh Bajaj All slides in this presentation ©Akhilesh.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 6
The FPX KCPSM Module Exercise 1 Henry Fu The Layered Protocol Wrappers Exercise: Network Data Encryption / Decryption Using ROT13 Algorithm Henry Fu Washington.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
The Layered Protocol Wrappers 1 Florian Braun, Henry Fu The Layered Protocol Wrappers: A Solution to Streamline Networking Functions to Process ATM Cells,
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 2.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 7.
CS/CoE 536 : Lockwood 1 CS/CoE 536 Reconfigurable System On Chip Design Lecture 4 : Demonstration of Machine Problem 1 : CAM-based Firewall Washington.
NIOS II Ethernet Communication Final Presentation
ECE 448 – FPGA and ASIC Design with VHDL Lecture 12 PicoBlaze Overview.
CS/CoE 536 : Lockwood 1 CS/CoE 536 Reconfigurable System On Chip Design Lecture 4 : Demonstration of Machine Problem 1 : CAM-based Firewall Washington.
Fall 08, Oct 31ELEC Lecture 8 (Updated) 1 Lecture 8: Design, Simulation Synthesis and Test Tools ELEC 2200: Digital Logic Circuits Nitin Yogi
Modes of transfer in computer
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Field Programmable Port Extender (FPX) 1 NCHARGE: Remote Management of the Field Programmable Port Extender (FPX) Todd Sproull Washington University, Applied.
CPS120: Introduction to Computer Science Compiling a C++ Program From The Command Line.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course explains how to use section setting and memory.
CDA 4253 FPGA System Design PicoBlaze Instruction Set Hao Zheng Comp Sci & Eng U of South Florida.
Teaching Digital Logic courses with Altera Technology
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Lab Environment and Miniproject Assignment Spring 2009 ECE554 Digital Engineering Laboratory.
Field Programmable Port Extender (FPX) 1 Remote Management of the Field Programmable Port Extender (FPX) Todd Sproull Washington University, Applied Research.
Instructions to build HIBI_PE_DMA testing system (SOPC+NIOS II Eclipse) Lasse Lehtonen Last modification:
Tutorial for Modelsim 1 Installation Download the Modelsim Student Edition: Follow the.
The FPX KCPSM Module 1 Henry Fu The FPX KCPSM Module: An Embedded, Reconfigurable Active Processing Module for the FPX Henry Fu Washington University.
CDA 4253 FPGA System Design PicoBlaze Interface Hao Zheng Comp Sci & Eng U of South Florida.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Input/Output Device Drivers
Using Build A Step-by-Step Guide
INTRODUCTION TO AVRASSEMBLY PROGRAMMING
Development Environment
Introduction to Vivado
Lecture 18 PicoBlaze Instruction Set & Assembler Directives
Lab 1: Using NIOS II processor for code execution on FPGA
Assembly Language Programming of 8085
Microprocessor T. Y. B. Sc..
Lecture 15 PicoBlaze Overview
PRU-ICSS Programming with CCS
CS 301 Fall 2001 – Chapter 3 Slides by Prof. Hartman, following “IBM PC Assembly Language Programming” by Peter Abel 9/17/2018.
Advisor: Prof. Gandhi Puvvada
Washington University
Washington University
Lecture 14 PicoBlaze Overview
Lecture 16 PicoBlaze I/O & Interrupt Interface
Lecture 16 PicoBlaze Overview
ECE 448: Lab 6 Using PicoBlaze Fast Sorting Class Exercise 2.
Hello Bob – An example application for the FPX
Lecture 13 PicoBlaze I/O & Interrupt Interface
Washington University, Applied Research Lab
CPRE 583 Reconfigurable Computing (Tools overview)
Remote Management of the Field Programmable Port Extender (FPX)
Lecture 15 PicoBlaze I/O & Interrupt Interface
Lecture 17 PicoBlaze I/O & Interrupt Interface
Lecture 14 PicoBlaze Instruction Set
Chapter 7 Network Applications
Computer components is a programmable machine that receives input, stores and manipulates data, and provides output in a useful format. Computer The computer.
Presentation transcript:

The FPX KCPSM Module Exercise 1 Henry Fu The FPX KCPSM Module Exercise: Network Data Encryption / Decryption Using ROT13 Algorithm Henry Fu Washington University Applied Research Lab Supported by: NSF ANI and Xilinx Corp.

The FPX KCPSM Module Exercise 2 Henry Fu The FPX KCPSM Module Software Exercise Network data encryption / decryption using ROT13 algorithm –Rotates characters by 13 places ‘A’  ‘N’, ‘M’  ‘Z’, ‘a’  ‘n’, ‘m’  ‘z’ –Encryption Example: ‘Hello World’ encrypts to ‘Uryyb Jbeyq’ –Decryption Example: ‘Uryyb Jbeyq’ decrypts to ‘Hello World’

The FPX KCPSM Module Exercise 3 Henry Fu Approach to the ROT13 Algorithm Consider the following four cases –IF (ch >= ‘A’) && (ch <= ‘M’) Rotate “Right” ch by 13 characters –IF (ch >= ‘N’) && (ch <= ‘Z’) Rotate “Left” ch by 13 characters –IF (ch >= ‘a’) && (ch <= ‘m’) Rotate “Right” ch by 13 characters –IF (ch >= ‘n’) && (ch <= ‘z’) Rotate “Left” ch by 13 characters

The FPX KCPSM Module Exercise 4 Henry Fu The FPX KCPSM Module Package The FPX KCPSM Module Package includes: –IPTESTBENCH (IP2FAKE) Generates fake ATM cells for simulation –UDPTESTBENCH (UDPTEST, UDPSTR) Sends and receives UDP program and data packets –KCPSM Package (KCPSMBLE, PSMDEBUG) Includes an assembler and a debugger for KCPSM –FPX KCPSM Module in VHDL Includes all the VHDL source codes for the module

The FPX KCPSM Module Exercise 5 Henry Fu The FPX KCPSM Module Package (More) The FPX KCPSM Module Package –Detailed information on the Internet: –Download the FPX KCPSM Module Package Right click on fpx_kcpsm.tar.gz Save it to h:\ –Extract the FPX KCPSM Module Package Open a cygwin window –cd /cygdrive/h/ –gunzip fpx_kcpsm.tar.gz –tar xvf fpx_kcpsm.tar

The FPX KCPSM Module Exercise 6 Henry Fu The FPX KCPSM Module Package The FPX KCPSM Module Package includes: –IPTESTBENCH/ Includes the source files, input / output files, and comiple script for the IP2FAKE program Build: Type ‘make’ in the prompt –UDPTESTBENCH/ Includes the source fiels, input files, and compile script for the UDPTEST, UDPSTR program Build: Type ‘make’ in the prompt

The FPX KCPSM Module Exercise 7 Henry Fu The FPX KCPSM Module Package (More) –KCPSM/ Includes the KCPSM package from Xilinx Corp. and all the VHDL source codes, simulation script, synthesis script, and COREGEN component files for the FPX_KCPSM Module

The FPX KCPSM Module Exercise 8 Henry Fu Programming the KCPSM The KCPSM executes programs stored in the program memory and accesses data stored in the data memory –Program memory stores up to two programs –Each program is limited to 255 instructions –Program should begin at address 0x00 –Interrupt input is used to reset the KCPSM –Data memory stores up to four data packets –Each data packet is limited to 255 bytes

The FPX KCPSM Module Exercise 9 Henry Fu Writing a KCPSM Program Access the KCPSM Package –cd KCPSM/package Create a subdirectory in the KCPSM package –mkdir ROT13 –cp kcpsmble.dat ROT13/ –cd ROT13 Create a KCPSM program using a plain text editor –vi ROT13.PSM

The FPX KCPSM Module Exercise 10 Henry Fu The KCPSM: Registers and Constants The KCPSM has 16 8-bit registers –Used in the program in the “sX” format, where ‘X’ is one of the following: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F –Example: s0, sA, sF The KCPSM supports constants –Specified in the program in the form of a two- digit hexadecimal value, where they ranges from 0x00 to 0xFF

The FPX KCPSM Module Exercise 11 Henry Fu The KCPSM: Special Instructions The KCPSM provides special instructions used to handle I/O and Interrupt operations: –INPUT sX, sY Enables 8-bit data values external to the KCPSM to be transferred to register sX, where the port address is indirectly specified by the contents of sY –INPUT sX, pp Enables 8-bit data values external to the KCPSM to be transferred to register sX, where the port address is directly specified as a two-digit hex constant

The FPX KCPSM Module Exercise 12 Henry Fu The KCPSM: Special Instructions (More) –OUTPUT sX, sY Enables 8-bit data values in register sX to be transferred to logic external to the KCPSM, where the port address is indirectly specified by the contents of register sY –OUTPUT sX, pp Enables 8-bit data values in register sX to be transferred to logic external to the KCPSM, where the port address is directly specified by the two-digit hex constant

The FPX KCPSM Module Exercise 13 Henry Fu The KCPSM: Special Instructions (More) –ENABLE INTERRUPT Enables future interrupt requests –DISABLE INTERRUPT Disables future interrupt requests –RETURNI ENABLE Concludes an interrupt service routine and specifies that future interrupt requests are enabled –RETURNI DISABLE Concludes an interrupt service routine and specifies that future interrupt requests are disabled

The FPX KCPSM Module Exercise 14 Henry Fu The KCPSM: Instructions For detailed explanations of every instruction available to the KCPSM, please refer to the KCPSM App Notes: –“8-bit Microcontroller for Virtex Devices” By Ken Chapman of Xilinx Corp. –Download URL:

The FPX KCPSM Module Exercise 15 Henry Fu The KCPSM Program Template All KCPSM programs should follow a template in order for them to work with the FPX KCPSM Module: –Enables the KCPSM for Interrupt requests –Checks if the data memory is empty –Processes data if data memory is not empty –Signals to the Interface when KCPSM is done –Suspends the KCPSM

The FPX KCPSM Module Exercise 16 Henry Fu The KCPSM Program Template (More) ;Enable KCPSM Interrupt so that the KCPSM Interface can reset the KCPSM ENABLE INTERRUPT ;Check if there is new data packet in memory ;if no data, signal KCPSM Interface that process is done with no write ;if there is data, proceed to process data INIT: INPUT SA,03 ;LOAD M[03] TO SA SUB SA,00 ;COMPARE SA TO 00 JUMP NZ,CHK ;DATA IN MEMORY, PROCEED LOAD SA,00 ;NO DATA, LOAD 00 TO SA, no write, signal done OUTPUT SA,FF ;WRITE 00 TO M[FF], no write, signal done JUMP WAIT ;WAIT ;Assembly code to process data CHK: ;Assembly code goes here ;Signal KCPSM Interface that process is done, and needs to write it out DONE: LOAD SA,FF ;LOAD FF TO SA, signal done OUTPUT SA,FF ;WRITE FF TO M[FF], write, signal done ;Suspend KCPSM ADDRESS FE WAIT: JUMP WAIT

The FPX KCPSM Module Exercise 17 Henry Fu Assembling a KCPSM Program An assembler called KCPSMBLE is included in the KCPSM package from Xilinx Corp. –KCPSMBLE needs to be executed in a PC –Programs need to be written in plain text –Programs needs to be saved in a DOS 8.3 file format with a extension –Usage:../KCPSMBLE ROT13.PSM

The FPX KCPSM Module Exercise 18 Henry Fu Assembling a KCPSM Program (More) After KCPSMBLE finishes assembling the program, a coefficient file (ROT13.COE) is generated: –Used by COREGEN to generate a single-port block RAM and initialize the block RAM content to the machine code of the program –Used by CONVERT to generate a dual-port block RAM coefficient file for COREGEN and a for simulation and lab testing

The FPX KCPSM Module Exercise 19 Henry Fu Debugging a KCPSM Program A debugger called PSMDEBUG is included in the KCPSM package from Xilinx Corp. –PSMDEBUG needs to be executed in a PC –The file used must be generated by KCPSMBLE and must be unmodified –Usage:../PSMDEBUG ROT13.COE –Detail instructions will appear on screen after PSMDEBUG is executed

The FPX KCPSM Module Exercise 20 Henry Fu Converting a KCPSM Program The file generated by KCPSMBLE is targeted to use with single-port block RAM The file generated by KCPSMBLE contains the machine code of the KCPSM program  Need a program that converts the file generated by KCPSMBLE so that it can be used for simulation, synthesis, and testing

The FPX KCPSM Module Exercise 21 Henry Fu Converting a KCPSM Program (More) A C program called CONVERT is used to convert the file generated by KCPSMBLE: –Converts the file so that it is targeted to use with dual-port block RAM –Extracts the machine code of the KCPSM from the file so that the program can be used in simulation and can be sent to the FPX KCPSM Module through an UDP packet

The FPX KCPSM Module Exercise 22 Henry Fu Converting a KCPSM Program (More) The CONVERT program –Usage:../CONVERT ROT13.COE –Two files are generated after the CONVERT program is executed A coefficient file used by COREGEN to generate a dual-port block RAM A input file used by the IP2FAKE program to generate simulation inputs and the UDPTEST program to send UDP program packet

The FPX KCPSM Module Exercise 23 Henry Fu Generating Fake ATM Cells for Simulation A C program called IP2FAKE is used to generate fake ATM cells for simulation –Generate a fake ROT13 program packet / cell using the from CONVERT Usage: –/cygdrive/h/iptestbench/ip2fake INST.TBP ROT13.DAT –Generate a fake input data packet / cell Use a plain text editor to create a HELLO.TBP file –vi HELLO.TBP

The FPX KCPSM Module Exercise 24 Henry Fu Contents of the HELLO.TBP File # demo testbench # # comments start with # # commands start with ! # parameters are optional # # to get familiar with the tools run "ip2raw TESTBENCH.TBP" # and check the outcoming TBRAW.TBP file # # UDP block, will be prepended by an UDP header # parameter: ip-address, dest-port, src-port !UDP C6C 6F20576F 726C6400 The first word specifies it is a data packet The second word specifies ‘Hell’ The third word specifies ‘o Wo’ The fourth word specifies ‘rld’

The FPX KCPSM Module Exercise 25 Henry Fu Simulating a KCPSM Program Modelsim is used to simulate the FPX KCPSM Module –Copy the fake ATM program and data packet / cell to the simulation directory cp ROT13.DAT KCPSM/sim/ cp HELLO.DAT KCPSM/sim/ –Go to the design simulation directory cd KCPSM/sim/ –Create the simulation input file cat WAIT.DAT ROT13.DAT HELLO.DAT > INPUT_CELLS.DAT

The FPX KCPSM Module Exercise 26 Henry Fu Simulating a KCPSM Program (More) –Compile the module and Start Modelsim make compile make sim –In Modelsim main window, type: do testbench.do run –In Modelsim wave window Edit > Select All –Right click on the selected waves Radix > Hexadecimal

The FPX KCPSM Module Exercise 27 Henry Fu Simulating a KCPSM Program (More) –In Modelsim wave window Go through the window and see the internal KCPSM processing details –In the cygwin window, open the simulation output file vi LC_CELLSOUT.DAT –Scroll through the simulation output file Each ATM cell is separated by a ‘new_cell’ line The first to the third to last cells are program packets The last two cells are the encrypted data packets

The FPX KCPSM Module Exercise 28 Henry Fu Simulating a KCPSM Program The input data cell The output data cell The 1 st – 2 nd word is the ATM Cell Header The 3 rd – 7 th word is the Internet Protocol Header The 8 th – 9 th word is the UDP Header The 10 th word specifies it is a data packet The 11 th – 13 th word is the data string ‘Hello World’ The 1 st – 2 nd word is the ATM Cell Header The 3 rd – 7 th word is the Internet Protocol Header The 8 th – 9 th word is the UDP Header The 10 th word specifies it is a data packet The 11 th – 13 th word is the data string ‘Uryyb Jbeyq’

The FPX KCPSM Module Exercise 29 Henry Fu Testing a KCPSM Program in the Lab FTP the.TBP file to fpx –sftp –put ROT13.TBP –quit Login to fpx using ssh (Secure Shell) –ssh -l yourlogin fpx.arl.wustl.edu –mkdir udptestbench/ –cd udptestbench/ –cp ~hwf1/udptestbench/*.

The FPX KCPSM Module Exercise 30 Henry Fu Testing a KCPSM Program in the Lab Use UDPTEST to send the ROT13 program packet –./udptest../ROT13.TBP Use UDPSTR to send the data packet –./udpstr –h –p 7

The FPX KCPSM Module Exercise 31 Henry Fu Testing a KCPSM Program in the Lab (More) Screenshot of the encryption example:

The FPX KCPSM Module Exercise 32 Henry Fu Testing a KCPSM Program in the Lab (More) Screenshot of the decryption example:

The FPX KCPSM Module Exercise 33 Henry Fu Conclusion In this FPX KCPSM Module Exercise –Write, assemble, and debug a KCPSM program using KCPSMBLE, PSMDEBUG –Generate fake program and data ATM cells for simulation using CONVERT, IP2FAKE –Simulate a KCPSM program using Modelsim –Test a KCPSM program in the lab using UDPTEST, UDPSTR