Running AES 256 in CW305

Hello, I am trying to run AES 256 on CW305 fpga target. The way I tried is as follows:

  1. Changed the pKEY_WIDTH to 256 in cw305_reg_aes.v and some other variable width related to key. (before it was 128, I have just put 256).

  2. I have changed size_i fom 0 to 2 (assumed 2 is for AES 256 as its commented on the original file that 0 is for AES128)

But I get the wrong output I believe. I am using all zeros (256 zeros) as the key and a constant plaintext: 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff

The output i am getting is this: 28, 6, 15, 76, 158, 126, 168, 214, 202, 150, 26, 45, 100, 192, 92, 24 from ret.textout. What am I doing wrong and how can I debug and correct it? If anyone has an implementation of AES256 on CW305 please share.

I did a quick simulation-based test and it works for me. The only changes required are in cw305_top.v: pKEY_WIDTH=256 and aes_core.size_i=2.

If you changed pKEY_WIDTH in cw305_reg_aes.v only, it’ll get overwritten by the 128 that gets passed down from cw305_top.v.