I have a Verilog block (Block A) that samples a serial signal with a relatively slow clock and then puts data in several registers based on the contents of the serial data.
Ultimately, these data need to go into several AXI slave register, since Block A is part of a larger AXI slave peripheral. A faster AXI clock drives another block (Block B) that handles the AXI transactions with the ARM core.
The sampling clock clocks the data into the Block A output registers, so these data are sitting there waiting to be placed in the AXI registers. (I think) I want some kind of multi-dimensional shift register to get these data into the AXI clock domain, something like:
...
input wire axi_clk,
input wire [5:0] data_in,
output wire [5:0] data_out,
...
reg [5:0] data_buf[2:0];
assign data_out = data_buf[2];
...
always @ (posedge axi_clk) begin
data_buf[2:0] <= {data_buf[1:0], data_in};
end
Instead of shifting one bit at a time every clock, I want to shift all 6 bits of data_buf in parallel each clock.
How should I set this up? Forgive the pseudocode; everything I've done so far has thrown errors, and I haven't found example code of what I'm trying to do, or confirmation that it's even possible with easily readable code.
PS - My team does not want to use SystemVerilog, but any version of VHDL or Verilog is acceptable.