- -- Done in the first cycle (when l_in.valid = 1) for integer stores
- -- and DP float stores, and in the second cycle for SP float stores.
- store_data := r.store_data;
- if l_in.valid = '1' or (HAS_FPU and r.state = FPR_CONV) then
- if HAS_FPU and r.state = FPR_CONV then
- data_in := x"00000000" & r.st_sp_data;
- byte_offset := unsigned(r.addr(2 downto 0));
- byte_rev := r.byte_reverse;
- length := r.length;
- else
- data_in := l_in.data;
- byte_offset := unsigned(lsu_sum(2 downto 0));
- byte_rev := l_in.byte_reverse;
- length := l_in.length;
- end if;
- brev_lenm1 := "000";
- if byte_rev = '1' then
- brev_lenm1 := unsigned(length(2 downto 0)) - 1;
- end if;
- for i in 0 to 7 loop
- k := (to_unsigned(i, 3) - byte_offset) xor brev_lenm1;
- j := to_integer(k) * 8;
- store_data(i * 8 + 7 downto i * 8) := data_in(j + 7 downto j);
- end loop;
- end if;
- v.store_data := store_data;
+ -- Done in the second cycle (the cycle after l_in.valid = 1).
+ for i in 0 to 7 loop
+ k := (to_unsigned(i, 3) - r.byte_offset) xor r.brev_mask;
+ j := to_integer(k) * 8;
+ store_data(i * 8 + 7 downto i * 8) := r.store_data(j + 7 downto j);
+ end loop;