element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Summer of FPGA
  • Challenges & Projects
  • Design Challenges
  • Summer of FPGA
  • More
  • Cancel
Summer of FPGA
Blog Security Hardware Accelerator #7 SHA256 in UART port
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: fyaocn
  • Date Created: 29 Jan 2022 1:34 AM Date Created
  • Views 1075 views
  • Likes 4 likes
  • Comments 0 comments
Related
Recommended

Security Hardware Accelerator #7 SHA256 in UART port

fyaocn
fyaocn
29 Jan 2022

1. Brief

In previous blog, SHA256 has been elastrated and acomplished in software core and hardware core. 

Only with independant port, can sha256 accelerator runs. There have been choice of SPI, I2C, USB or UART. Fully understand of protocle is important  and UART is simplest one. 

2. UART in FPGA

There are UARTlite IP or customized synthesis.

As in https://china.xilinx.com/support/documentation/ip_documentation/axi_uartlite/v2_0/pg142-axi-uartlite.pdf

The uart input and output is ,

image

similarly, the simple uart can be done in verilog as attached uart.v.

3. Create new project and add verilog file top.v, uart.v and sha256_hash_hw.v as in attached zip file.

image

top.v 

`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 2022/01/28 14:55:06
// Design Name:
// Module Name: top
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////


module top(
input clk,
inout uart_tx,
inout uart_rx,

output led
//input btn_in
);
//not(led,btn_in);
//wire [0:0] ledon ;initial begin ledon = 1'b0; led=ledon; end
wire clk,tx,rx;
//reg in,out;
wire [0:31] in =32'h428a2f98 ;
wire [0:255] out;
assign led = 1'b0;

wire reset = 1;
reg start, send;
wire busy;

uart hashin(
.uart_clk(clk),
.uart_rx(rx),
.uart_tx(tx)
);
sha256_hash_hw hash(
.IN(in),
.OUT(out)
);

uart_tx tx(.clk(clk), .tx(uart_tx), .send(send), .data(out[0:7]), .busy(busy));

uart_rx rx(.clk(clk), .rx(uart_rx), .ready(ready), .data(in));

endmodule

4. Revise constrain file and open led, clk, uart_rx, uart_tx ports, as shown in variants in top.v

image

5. Then run synthesis and implementation,

image

Synthesis passed and run implementation then

image

Implementation passed and generated bitstream

image

Bitstream is generated and open hardware manager.

image

In hardware management, press autoconnect hardware,

imageimage

image

Program the device with bitstream file in .bin format

image

Then write bitstream complete, the code can work.

image

6. Summary

Within relatively short period, I have tried hardware accelerator and softcore accelerator in microblaze IP. Basic function is approved and passed the validation.

Further development on timing, clocking and bit-transition, there is one part not accomplished, IP packaging, Packing the verilog project into customized IP. It is prefererable in AXI porting, to be integrated into microblaze softcore. Fully enhance the function and flexiblilty of the Hardware Acceleration.

For further development, simulation can be very good helper as below. There is not enough time showing how the simulation works, but that function is fairly easy to use and not explained here.

image

sha256_hash_hw.zip
  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube