mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-23 13:27:29 -04:00
generic stack reset
This commit is contained in:
parent
4bfdbb5188
commit
292c792339
1 changed files with 6 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue