Module PISO
Module PISO
Module PISO
parameter DATA_WIDTH = 8
)(
input wire clk_rx,
input wire rst,
input wire valid_in,
input wire [DATA_WIDTH-1:0] Data_in,
output wire valid_out,
output wire [DATA_WIDTH-1:0] Data_out,
output reg ready_in,
output reg ready_out,
input wire clk_tx
);
// Internal register to store parallel input
reg [DATA_WIDTH-1:0] temp;
// Internal state
reg [DATA_WIDTH-1:0] shift_reg;
// Assign outputs
assign Data_out = next_data_out;
assign valid_out = next_valid_out;
Endmodule
module PISO_ShiftRegister_TB;
reg clk_rx, rst, clk_tx;
reg valid_in;
reg [7:0] Data_in;
wire valid_out;
wire [7:0] Data_out;
reg ready_in, ready_out;
// Clock generation
initial begin
clk_rx = 0;
rst = 1;
clk_tx = 0;
#5 rst = 0;
end
always #5 clk_rx = ~clk_rx;
always #2 clk_tx = ~clk_tx;
#100 $finish;
end
// Receive the serial data from the design through Data_out port in clk_tx speed
initial begin
#20;
ready_out = 1;