Commit 9783fe21 by farnoud

adding a readme file for c_baremetal directory, cleaning c_baremetal

parent 94bb16ae
================================================================================
Copyright © 2018-2019 by Cryptographic Engineering Research Group (CERG),
Copyright © 2019 by Cryptographic Engineering Research Group (CERG),
ECE Department, George Mason University
Fairfax, VA, U.S.A.
Author: Farnoud Farahmand
================================================================================
To create a new Vivado project for Software/Hardware co-design platform follow
To create a new Vivado project for Software/Hardware co-design platform perform
the following steps:
Note: this instruction is tested for Vivado version 2018.2 and may not work for
other versions.
Note: this instruction has been tested using Vivado version 2018.2 and may not
work for other versions.
1. Go to the script directory and run "bash ./run_vivado.sh BOARD_NAME MODE"
1. Go to the script folder and run "bash ./run_vivado.sh BOARD_NAME MODE"
command.
Available options for "BOARD_NAME" arguments are: ZCU104 (default), ZCU102
Available options for "MODE" argument are: BATCH (default), GUI
Here is an example to run the script for ZCU102 board in GUI mode:
Available options for the BOARD_NAME argument are: ZCU104 (default) and ZCU102.
Available options for the MODE argument are: BATCH (default) and GUI.
Here is an example of running the script for the ZCU102 board in GUI mode:
$bash ./run_vivado.sh ZCU102 GUI
This script start Vivado, creates a project and generates the bitstream.
If you would like to see the whole process in graphical interface, use the GUI
mode.
This script starts Vivado, creates a project, and generates the bitstream.
If you would like to see the whole process in the graphical interface, use the
GUI mode.
2. When the bitstream generated successfully The Xilinx SDK application should
will opened automatically. In SDK application follow the following steps:
1- Create new application project: go to File -> New -> Application Project.
in "Project name" enter your desired name and select "Next >". select Empty Application in "Available Templates:" and select "Finish".
2. When the bitstream is generated successfully, the Xilinx SDK application
should open automatically. In the SDK application perform the following steps:
1- Create a new application project by choosing File -> New -> Application
Project.
In "Project name" enter your desired name and select "Next >". Select Empty
Application in "Available Templates:" and then click on "Finish".
2- right click on your project name in "Project Explorer" tab and select
"Generate Linker Script".Increase "Heap Size:" and "Stack Size:" to 10 MB.
2- Right click on your project name in the "Project Explorer" tab and select
"Generate Linker Script". Increase "Heap Size:" and "Stack Size:" to 10 MB.
3- copy all C codes available in c_baremetal directory into the "src"
directory of your project
3- Copy all C codes available in c_baremetal directory into the "src"
directory of your project.
4- Turn on compiler optimization: right click on your project name in
4- Turn on compiler optimization: right click on your project name in the
"Project Explorer" tab and select "C/C++ Build Settings". In the opened
window select "Optimization" and change the Optimization Level to
"Optimize most (-O3)"
5- Program FPGA board: connect the FPGA board to your machine and in the SDK
click on Program FPGA icon and select Program
click on the Program FPGA icon and select Program.
6- build your project and then right click on your project name and select
Run As -> 1 Launch on Hardware (System Debugger)
Note: To see the output of print functions on Windows machine you can use
SDK Terminal. But, on Linux machines you should use a 3rd party application
like GtkTerm to see serial port output.
6- Build your project and then right click on your project name and select
Run As -> 1 Launch on Hardware (System Debugger).
Note: To see the output of print functions on Windows machine, you can use
SDK Terminal. However, on Linux machines you should use a 3rd party
application, like GtkTerm, to see a serial port output.
If you would like to generate a bitstream for accelerator core other than
If you would like to generate a bitstream for an accelerator core other than
NTRUEncrypt RTL polymult, you can open the Vivado project created in
vivado_project/platform_project and replace the polymult IP core with another
accelerator and generate a new bitstream.
================================================================================
Copyright © 2019 by Cryptographic Engineering Research Group (CERG),
ECE Department, George Mason University
Fairfax, VA, U.S.A.
Authors: Farnoud Farahmand, Viet Dang
Description: This directory contains the C implementation of NTRUEncrypt
algorithm which based on the reference implementation available in the
submission package to NIST PQC Round1 available at:
https://csrc.nist.gov/CSRC/media/Projects/Post-Quantum-Cryptography/documents/
round-1/submissions/pqNTRUsign.zip
The reference implementation is modified to support our SW/HW co-design platform
and baremetal execution on ARM A53 core.
================================================================================
List of source code and their description:
./main.c
Top-level C code to run the SW/HW co-design experiment and compute the total
speedup.
./DMA_Transfer_def.h
./DMA_Transfer_def.c
The C code provided for running DMA transactions in baremetal mode on Zynq
platforms.
./clk_wiz_driver.h
The driver for communicating with Clocking Wizard IP in the FPGA through
AXI Lite interface and changing the frequency of hardware accelerator during
run-time.
./platform.h
./platform.c
Viet
./API.h
./encrypt.c
./NTRUEncrypt.h
./NTRUEncrypt.c
Viet
./poly.h
./poly.c
./poly_rot.c
./poly_rot.h
Viet
./packing.h
./packing.c
Viet
./param.h
./param.c
NTRUEncrypt parameters definition.
./AES/aes.h
./AES/aes.c
./rng.h
./rng.c
./fastrandombytes.h
./fastrandombytes.c
./crypto_hash_sha512.h
./crypto_hash_sha512.c
Viet
./crypto_stream_salsa20.h
./crypto_stream.c
Viet
./shred.h
./shred.c
Empty application. Add your own sources.
/******************************************************************************
*
* Copyright (C) 2009 - 2014 Xilinx, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* Use of the Software is limited solely to applications:
* (a) running on a Xilinx device, or
* (b) that interact with a Xilinx device through a bus or interconnect.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of the Xilinx shall not be used
* in advertising or otherwise to promote the sale, use or other dealings in
* this Software without prior written authorization from Xilinx.
*
******************************************************************************/
/*
* helloworld.c: simple test application
*
* This application configures UART 16550 to baud rate 9600.
* PS7 UART (Zynq) is not initialized by this application, since
* bootrom/bsp configures it to baud rate 115200
*
* ------------------------------------------------
* | UART TYPE BAUD RATE |
* ------------------------------------------------
* uartns550 9600
* uartlite Configurable only in HW design
* ps7_uart 115200 (configured by bootrom/bsp)
*/
/*
#include <stdio.h>
#include "platform.h"
#include "xil_printf.h"
int main()
{
init_platform();
print("Hello World\n\r");
cleanup_platform();
return 0;
}
*/
// =============================================================================
// Copyright © 2017-2018 by Cryptographic Engineering Research Group (CERG),
// Copyright © 2018-2019 by Cryptographic Engineering Research Group (CERG),
// ECE Department, George Mason University
// Fairfax, VA, U.S.A.
// Author: Farnoud Farahmand, Viet Dang
......
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment