File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,15 @@ module keccak_iota #(
1010 for (genvar i = 0 ; i < 5 ; i++ ) begin : sheet_select
1111 for (genvar j = 0 ; j < 5 ; j++ ) begin : lane_select
1212 if ((i == 4 ) & (j == 4 )) begin : apply_rc
13- // If yosys supported streaming operators, we'd flip the rc bytes like so:
14- // assign y[i][j] = x[i][j] ^ {<<8{rc}};
15- // Unfortunately yosys doesn't support the {<<{}} streaming operator :(
16- // Instead we have to swap bytes manually, adding this gross for loop
17- for (genvar b = 0 ; b < w/ 8 ; b++ ) begin : swap_bytes
18- assign y[i][j][8 * (b+ 1 )- 1 : 8 * b] = x[i][j][8 * (b+ 1 )- 1 : 8 * b] ^ rc[w- 8 * b- 1 : w- 8 * (b+ 1 )];
19- end
13+ `ifdef YOSYS
14+ // Unfortunately yosys doesn't support the {<<{}} streaming operator :(
15+ // Instead we have to swap bytes manually, adding this gross for loop
16+ for (genvar b = 0 ; b < w/ 8 ; b++ ) begin : swap_bytes
17+ assign y[i][j][8 * (b+ 1 )- 1 : 8 * b] = x[i][j][8 * (b+ 1 )- 1 : 8 * b] ^ rc[w- 8 * b- 1 : w- 8 * (b+ 1 )];
18+ end
19+ `else
20+ assign y[i][j] = x[i][j] ^ { << 8 { rc}} ;
21+ `endif
2022 end else begin : passthrough
2123 assign y[i][j] = x[i][j];
2224 end
You can’t perform that action at this time.
0 commit comments