generic stack reset
This commit is contained in:
@@ -5,6 +5,7 @@ module VX_generic_stack
|
||||
)
|
||||
(
|
||||
input wire clk,
|
||||
input wire reset,
|
||||
input wire push,
|
||||
input wire pop,
|
||||
input reg [WIDTH - 1:0] q1,
|
||||
@@ -16,10 +17,12 @@ module VX_generic_stack
|
||||
reg [DEPTH - 1:0] ptr;
|
||||
reg [WIDTH - 1:0] stack [0:(1 << DEPTH) - 1];
|
||||
|
||||
integer i;
|
||||
always @(posedge clk) begin
|
||||
// if (reset)
|
||||
// ptr <= 0;
|
||||
// else
|
||||
if (reset) begin
|
||||
ptr <= 0;
|
||||
for (i = 0; i < (1 << DEPTH); i=i+1) stack[i] <= 0;
|
||||
end else
|
||||
if (push)
|
||||
ptr <= ptr + 2;
|
||||
else if (pop)
|
||||
|
||||
Reference in New Issue
Block a user