mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-23 21:39:10 -04:00
minor update
This commit is contained in:
parent
e214c0b2a8
commit
7e1417703f
1 changed files with 40 additions and 0 deletions
40
hw/rtl/libs/VX_elastic_adapter.sv
Normal file
40
hw/rtl/libs/VX_elastic_adapter.sv
Normal file
|
@ -0,0 +1,40 @@
|
|||
`include "VX_platform.vh"
|
||||
|
||||
`TRACING_OFF
|
||||
module VX_elastic_adapter (
|
||||
input wire clk,
|
||||
input wire reset,
|
||||
|
||||
input wire valid_in,
|
||||
output wire ready_in,
|
||||
|
||||
input wire ready_out,
|
||||
output wire valid_out,
|
||||
|
||||
input wire busy,
|
||||
output wire strobe
|
||||
);
|
||||
wire push = valid_in && ready_in;
|
||||
wire pop = valid_out && ready_out;
|
||||
|
||||
reg loaded;
|
||||
|
||||
always @(posedge clk) begin
|
||||
if (reset) begin
|
||||
loaded <= 0;
|
||||
end else begin
|
||||
if (push) begin
|
||||
loaded <= 1;
|
||||
end
|
||||
if (pop) begin
|
||||
loaded <= 0;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
assign ready_in = ~loaded;
|
||||
assign valid_out = loaded && ~busy;
|
||||
assign strobe = push;
|
||||
|
||||
endmodule
|
||||
`TRACING_ON
|
Loading…
Add table
Add a link
Reference in a new issue