added altera fpu modules
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
module VX_shift_register #(
|
||||
parameter DATAW = 1,
|
||||
parameter DEPTH = 0
|
||||
parameter DEPTH = 1
|
||||
) (
|
||||
input wire clk,
|
||||
input wire reset,
|
||||
@@ -10,41 +10,33 @@ module VX_shift_register #(
|
||||
input wire [DATAW-1:0] in,
|
||||
output wire [DATAW-1:0] out
|
||||
);
|
||||
if (0 == DEPTH) begin
|
||||
reg [DEPTH-1:0][DATAW-1:0] entries;
|
||||
|
||||
assign out = in;
|
||||
|
||||
end if (1 == DEPTH) begin
|
||||
|
||||
reg [DATAW-1:0] ram;
|
||||
if (1 == DEPTH) begin
|
||||
|
||||
always @(posedge clk) begin
|
||||
if (reset) begin
|
||||
ram <= '0;
|
||||
entries <= '0;
|
||||
end else begin
|
||||
if (enable) begin
|
||||
ram <= in;
|
||||
entries <= in;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
assign out = ram;
|
||||
|
||||
end else begin
|
||||
|
||||
reg [DEPTH-1:0][DATAW-1:0] ram;
|
||||
end else begin
|
||||
|
||||
always @(posedge clk) begin
|
||||
if (reset) begin
|
||||
ram <= '0;
|
||||
entries <= '0;
|
||||
end else begin
|
||||
if (enable) begin
|
||||
ram <= {ram[DEPTH-2:0], in};
|
||||
entries <= {entries[DEPTH-2:0], in};
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
assign out = ram [DEPTH-1];
|
||||
end
|
||||
|
||||
assign out = entries [DEPTH-1];
|
||||
|
||||
endmodule
|
||||
Reference in New Issue
Block a user