diff options
author | Clifford Wolf <clifford@clifford.at> | 2013-01-05 11:13:26 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2013-01-05 11:13:26 +0100 |
commit | 7764d0ba1dcf064ae487ee985c43083a0909e7f4 (patch) | |
tree | 18c05b8729df381af71b707748ce1d605e0df764 /tests/simple/aes_kexp128.v | |
download | yosys-7764d0ba1dcf064ae487ee985c43083a0909e7f4.tar.gz yosys-7764d0ba1dcf064ae487ee985c43083a0909e7f4.tar.bz2 yosys-7764d0ba1dcf064ae487ee985c43083a0909e7f4.zip |
initial import
Diffstat (limited to 'tests/simple/aes_kexp128.v')
-rw-r--r-- | tests/simple/aes_kexp128.v | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/simple/aes_kexp128.v b/tests/simple/aes_kexp128.v new file mode 100644 index 000000000..3ee034789 --- /dev/null +++ b/tests/simple/aes_kexp128.v @@ -0,0 +1,24 @@ + +// test taken from aes_core from iwls2005 + +module aes_key_expand_128(clk, kld, key, wo_0, wo_1, wo_2, wo_3); + +input clk, kld; +input [15:0] key; +output [3:0] wo_0, wo_1, wo_2, wo_3; +reg [3:0] w[3:0]; + +assign wo_0 = w[0]; +assign wo_1 = w[1]; +assign wo_2 = w[2]; +assign wo_3 = w[3]; + +always @(posedge clk) begin + w[0] <= kld ? key[15:12] : w[0]; + w[1] <= kld ? key[11: 8] : w[0]^w[1]; + w[2] <= kld ? key[ 7: 4] : w[0]^w[1]^w[2]; + w[3] <= kld ? key[ 3: 0] : w[0]^w[1]^w[2]^w[3]; +end + +endmodule + |