aboutsummaryrefslogtreecommitdiff
path: root/rtl
diff options
context:
space:
mode:
Diffstat (limited to 'rtl')
-rw-r--r--rtl/alpha_fmc_top.v18
-rw-r--r--rtl/alpha_regs.v2
2 files changed, 17 insertions, 3 deletions
diff --git a/rtl/alpha_fmc_top.v b/rtl/alpha_fmc_top.v
index 1bc1ce2..a07beee 100644
--- a/rtl/alpha_fmc_top.v
+++ b/rtl/alpha_fmc_top.v
@@ -140,6 +140,20 @@ module alpha_fmc_top
// hashes, RNGs and ciphers to different regions (segments) of memory.
//----------------------------------------------------------------
+ // A note on byte-swapping:
+ // STM32 is little-endian, while the register interface here is
+ // big-endian. The software reads and writes 32-bit integer values,
+ // which means transmitting the least significant byte first. Up to
+ // now, we've been doing byte-swapping in software, which is
+ // inefficient, especially for bulk data transfer. So now we're doing
+ // the byte-swapping in hardware.
+
+ wire [31:0] write_data;
+ assign write_data = {sys_fmc_dout[7:0], sys_fmc_dout[15:8], sys_fmc_dout[23:16], sys_fmc_dout[31:24]};
+
+ wire [31 : 0] read_data;
+ assign sys_fmc_din = {read_data[7:0], read_data[15:8], read_data[23:16], read_data[31:24]};
+
core_selector cores
(
.sys_clk(sys_clk),
@@ -148,8 +162,8 @@ module alpha_fmc_top
.sys_fmc_addr(sys_fmc_addr),
.sys_fmc_wr(sys_fmc_wren),
.sys_fmc_rd(sys_fmc_rden),
- .sys_write_data(sys_fmc_dout),
- .sys_read_data(sys_fmc_din),
+ .sys_write_data(write_data),
+ .sys_read_data(read_data),
.noise(ct_noise),
diff --git a/rtl/alpha_regs.v b/rtl/alpha_regs.v
index a53d2d3..ce17863 100644
--- a/rtl/alpha_regs.v
+++ b/rtl/alpha_regs.v
@@ -68,7 +68,7 @@ module board_regs
// Core ID constants.
localparam CORE_NAME0 = 32'h414c5048; // "ALPH"
localparam CORE_NAME1 = 32'h41202020; // "A "
- localparam CORE_VERSION = 32'h302e3130; // "0.10"
+ localparam CORE_VERSION = 32'h302e3230; // "0.20"