Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CFU example: use XTEA as "real world" demo application #855

Merged
merged 4 commits into from Mar 19, 2024

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Mar 18, 2024

This PR is a rework of the Custom Functions Unit (CFU) that replaces the default example application by a "real world" application implementing the royalty-free Extended Tiny Encryption Algorithm (XTEA) as dedicated ISA extension implemented as CFU-based custom RISC-V instructions.

The according demo program computes the encryption and decryption of random data using a 1.) software-only reference and a 2.) hardware-accelerated version using 5 custom XTEA instructions:

neorv32/sw/example/demo_cfu$ make USER_FLAGS+=-DUART0_SIM_MODE clean_all sim
[...]

<<< NEORV32 Custom Functions Unit (CFU) - Custom Instructions Example >>>

[NOTE] This program assumes the default CFU hardware module that
       implements the Extended Tiny Encryption Algorithm (XTEA).

XTEA key: 0x207230ba1ffba710c45271efdd01768a

XTEA SW encryption (40 rounds, 64 words)...
XTEA HW encryption (40 rounds, 64 words)...
Comparing results... OK

XTEA SW decryption (40 rounds, 64 words)...
XTEA HW decryption (40 rounds, 64 words)...
Comparing results... OK

Execution benchmarking:
ENC SW = 51839 cycles
ENC HW = 12852 cycles
DEC SW = 72889 cycles
DEC HW = 12979 cycles

CFU demo program completed.

@stnolting stnolting added enhancement New feature or request HW hardware-related SW software-related labels Mar 18, 2024
@stnolting stnolting self-assigned this Mar 18, 2024
@stnolting stnolting marked this pull request as ready for review March 18, 2024 19:26
@stnolting stnolting merged commit c6fa219 into main Mar 19, 2024
10 checks passed
@stnolting stnolting deleted the cfu_xtea_example branch March 19, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request HW hardware-related SW software-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant