FPGA IPUG 02067 1 3 NX CRE Module Radiant
FPGA IPUG 02067 1 3 NX CRE Module Radiant
User Guide
FPGA-IPUG-02067-1.3
December 2022
CRE Module IP
User Guide
Disclaimers
Lattice makes no warranty, representation, or guarantee regarding the accuracy of information contained in this document or the suitability of its
products for any particular purpose. All information herein is provided AS IS, with all faults and associated risk the responsibility entirely of the Buyer.
Buyer shall not rely on any data and performance specifications or parameters provided herein. Products sold by Lattice have been subject to limited
testing and it is the Buyer's responsibility to independently determine the suitability of any products and to test and verify the same. No Lattice
products should be used in conjunction with mission- or safety-critical or any other application in which the failure of Lattice’s product could create a
situation where personal injury, death, severe property or environmental damage may occur. The information provided in this document is
proprietary to Lattice Semiconductor, and Lattice reserves the right to make any changes to the information in this document or to any products at
any time without notice.
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
2 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
Contents
Acronyms in This Document ................................................................................................................................................. 5
1. Introduction .................................................................................................................................................................. 6
2. Functional Description .................................................................................................................................................. 7
2.1. Block Diagram ..................................................................................................................................................... 7
2.2. Security Functions and Features ......................................................................................................................... 7
2.2.1. Secure Hash Algorithm (SHA-256) .................................................................................................................. 7
2.2.2. Advance Encryption Standard (AES-128/256) ................................................................................................ 7
2.2.3. True Random Number Generation................................................................................................................. 7
2.2.4. Differential Power Analysis (DPA) Mitigation................................................................................................. 8
2.2.4.1. Clock Randomization.............................................................................................................................. 8
2.2.4.2. Random Noise Generation ..................................................................................................................... 8
2.3. Functional Overview ........................................................................................................................................... 8
2.3.1. LMMI Interface ............................................................................................................................................... 8
2.3.2. LMMI + FIFO Interface (Generic Interface) .................................................................................................... 8
2.3.3. AHB-Lite Interface .......................................................................................................................................... 8
2.3.4. APB Interface .................................................................................................................................................. 8
2.4. Signal Descriptions .............................................................................................................................................. 9
2.5. Attribute Summary............................................................................................................................................ 10
2.6. Register Map ..................................................................................................................................................... 11
2.7. CRE Function Access .......................................................................................................................................... 13
2.8. CRE Timing Diagrams ........................................................................................................................................ 20
2.9. Interface Limitations ......................................................................................................................................... 21
3. Getting Started ........................................................................................................................................................... 22
3.1. Generated Files and Top Level Directory Structure .......................................................................................... 23
3.2. Instantiating the Module .................................................................................................................................. 24
3.3. Running Functional Simulation ......................................................................................................................... 24
Appendix A. Resource Utilization ....................................................................................................................................... 29
References .......................................................................................................................................................................... 30
Technical Support Assistance ............................................................................................................................................. 31
Revision History .................................................................................................................................................................. 32
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 3
CRE Module IP
User Guide
Figures
Figure 2.1. CRE Module Block Diagram.................................................................................................................................7
Figure 2.2. SHA-256 Hash Done on Size N-Bytes Message .................................................................................................20
Figure 3.1. IP on Local, with CRE Selected Under Architecture ..........................................................................................22
Figure 3.2. Module / IP Block Wizard .................................................................................................................................22
Figure 3.3. IP Structure .......................................................................................................................................................23
Figure 3.4. IP Testbench Block Diagram..............................................................................................................................24
Figure 3.5. Adding the Simulation File ................................................................................................................................25
Figure 3.6. Simulation Wizard .............................................................................................................................................25
Figure 3.7. File List ..............................................................................................................................................................26
Figure 3.8. Parse HDL Files ..................................................................................................................................................26
Figure 3.9. Simulation Wizard Summary.............................................................................................................................27
Figure 3.10. Active-HDL Simulation Start ............................................................................................................................27
Figure 3.11. Active-HDL Simulation Finished ......................................................................................................................28
Tables
Table 2.1 CRE Module Ports..................................................................................................................................................9
Table 2.2. CRE Module Parameters ....................................................................................................................................10
Table 2.3. CRE Instruction Register Map.............................................................................................................................11
Table 2.4. CRE Data Register Map ......................................................................................................................................12
Table 2.5. SHA Message Generation Procedure (DATA_SOURCE = bus) ............................................................................13
Table 2.6. SHA Message Generation Procedure (DATA_SOURCE = FIFO)...........................................................................14
Table 2.7. HMAC-SHA Message Generation Procedure......................................................................................................14
Table 2.8. AES Encryption Procedure (DATA_SOURCE = bus).............................................................................................15
Table 2.9. AES Decryption Procedure (DATA_SOURCE = bus) ............................................................................................16
Table 2.10. AES Encryption Procedure (DATA_SOURCE = FIFO) .........................................................................................17
Table 2.11. AES Decryption Procedure (DATA_SOURCE = FIFO).........................................................................................18
Table 2.12. AES-Key Size Change (128-bit to 256-bit).........................................................................................................19
Table 2.13. True Random Number Generator Procedure ..................................................................................................19
Table 2.14. DPA Feature Access ..........................................................................................................................................19
Table 2.15. CRE Interface Limitations .................................................................................................................................21
Table 3.1 CRE Generated File Description ..........................................................................................................................23
Table A.1. Resource Utilization1 (LIFCL) ..............................................................................................................................29
Table A.2. Resource Utilization1 (LFD2NX) ..........................................................................................................................29
Table A.3. Resource Utilization1 (LFCPNX) ..........................................................................................................................29
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
4 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 5
CRE Module IP
User Guide
1. Introduction
This document provides technical information about the CRE Module that is supported in Lattice FPGA devices built on the
Lattice Nexus™ platform. This aims to provide information essential for IP/System developers, Verification and Software
for integration, testing and validation. In general, design specification from RTL up to IP packaging, IP generation and
integration with Lattice Radiant software is covered in this document.
CRE stands for Cryptographic Engine. This module is based on the built-in Security Hard IP having the following features:
• Supports the following user mode security features
• High throughput Secure Hash Algorithm – 256 bits (SHA 256)
• Hash Based Message Authentication Code – HMAC-SHA
• High throughput Advance Encryption Standard – 128/256 bits (AES-128/256)
• Supports True Random Number Generation
• Supports multiple bus interfaces:
• Lattice Memory Mapped Interface (LMMI)
• LMMI + FIFO (High-speed SHA/AES)
• Advanced High Performance Bus (AHB) – Lite
• Advanced Peripheral Bus (APB)
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
6 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
2. Functional Description
Notes:
• The CLK and RST needs to be connected to the CRE Module. If user do not use the OSC primitive, the IP has the
option to automatically include the IP during generation to avoid encountering Synthesis Errors.
• The FIFO I/O only applies to FIFO control pins; the data pins are shared with the LMMI. The FIFO interface also
requires the information to be sent through the LMMI bus, hence the FIFO pins are only available if the LMMI
interface is also selected. More information would be discussed below.
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 7
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
8 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 9
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
10 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 11
CRE Module IP
User Guide
HMAC-SHA:
0x1 F820 0x0000 0020 Generation:
OUTPUT (after process): SHA message (32B)
HMAC-SHA:
0x1 F840 0x0000 0040 Generation:
INPUT (before process): message (n bytes depending on length)
TRNG:
0x1 F880 0x0000 0080
OUTPUT (after process): Q (32B), output of TRNG engine
AES:
0x2 2000 0x0000 2800
Input (before process): AES Key (32B) [Big Endian]
AES:
Encryption Mode:
• Input (before process): Private Message (16B) [Big Endian]. Total Message Size can
0x2 2020 0x0000 2820 be larger than 16B, but must be processed at 16B at a time.
Decryption Mode:
• Output (after process): Decrypted Message (16B) [Big Endian]. Total Message Size
can be larger than 16B, but must be processed at 16B at a time.
AES:
Encryption Mode:
• Output (after process): Encrypted Message (16B) [Big Endian]. Total Message Size
0x2 2030 0x0000 2830 can be larger than 16B, but must be processed at 16B at a time.
Decryption Mode:
• Input (before process): Encrypted Message (16B) [Big Endian]. Total Message Size
can be larger than 16B, but must be processed at 16B at a time.
SHA:
Input (before process): SHA data size (n bytes depending on message length) [Big
0x2 304C 0x0000 384C Endian]
1
Address does not increment, data must be written on the same address for every word
SHA:
0x2 3050 0x0000 3850
Output (after process): SHA message (32B)
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
12 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 13
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
14 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 15
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
16 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 17
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
18 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 19
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
20 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 21
CRE Module IP
User Guide
3. Getting Started
The Module/IP Block Wizard in Lattice Radiant Software allows the user to generate, create, or open modules for the
target device.
To generate the module:
1. From the Lattice Radiant Software, select the IP Catalog tab, and select IP on Local.
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
22 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 23
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
24 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
3. Once the simulation file is added, simulate the project. Click Tools > Simulation Wizard to open Lattice Radiant
Software’s simulation wizard.
4. The splash window opens. Configure the testbench and click Next.
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 25
CRE Module IP
User Guide
6. The list of files to be added appears. Make sure that at least two files are added: the generated IP and the top level
testbench. Click Next.
7. Simulation Wizard does not parse the entire set of included RTL. In this section, make sure that the Simulation Top
Model is tb_top. Click Next.
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
26 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
8. Verify that the options Run simulator, Add top-level signals to waveform display, and Run simulation are checked.
9. Click Finish to automatically open Active-HDL and run the first 1 µs of the simulation.
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 27
CRE Module IP
User Guide
10. Click Play to continue the simulation and view the rest of the waveform.
11. Once the simulation is completed, a list of all tests ran with their results, either data, pass, or fail are viewable. The
speed of the test is dependent on the configuration of the clocks and if the USE_OSC parameter is enabled or
disabled.
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
28 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
Table A.2 shows configuration and resource utilization for LFD2NX-40-9BG256I using Lattice LSE of Lattice Radiant
Software 3.1.
Table A.2. Resource Utilization1 (LFD2NX)
Cryptographic Maximum
Interface Registers LUTs2 EBR
Block Frequency
LMMI 0 1 0 1 200 MHz
Generic (LMMI +
0 1 0 1 200 MHz
FIFO)
AHB-L 200 342 0 1 200 MHz
APB 3 19 0 1 200 MHz
Notes:
1. In all configurations, the oscillator clock and reset pins are connected externally to the CRE module.
2. The distributed RAM utilization is accounted for in the total LUT4s utilization. The actual LUT4 utilization is distribution among
logic, distributed RAM, and ripple logic.
Table A.3 shows configuration and resource utilization for LFCPNX-100-7LFG672I using Lattice LSE of Lattice Radiant
Software 2022.1.
Table A.3. Resource Utilization1 (LFCPNX)
Cryptographic Maximum
Interface Registers LUTs2 EBR
Block Frequency
LMMI 0 1 0 1 200 MHz
Generic (LMMI +
0 1 0 1 200 MHz
FIFO)
AHB-L 200 261 0 1 200 MHz
APB 3 14 0 1 200 MHz
Notes:
1. In all configurations, the oscillator clock and reset pins are connected externally to the CRE module.
2. The distributed RAM utilization is accounted for in the total LUT4s utilization. The actual LUT4 utilization is distribution among
logic, distributed RAM, and ripple logic.
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 29
CRE Module IP
User Guide
References
• AMBA 3 AHB-Lite Protocol Specification
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
30 FPGA-IPUG-02067-1.3
CRE Module IP
User Guide
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-IPUG-02067-1.3 31
CRE Module IP
User Guide
Revision History
Revision 1.3, December 2022
Section Change Summary
Appendix A. Resource Utilization Added Table A.3. Resource Utilization1 (LFCPNX).
Technical Support Assistance Added Lattice FAQ website link.
© 2020-2022 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
32 FPGA-IPUG-02067-1.3
www.latticesemi.com