-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathflopr.sv
39 lines (34 loc) · 853 Bytes
/
flopr.sv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 01/07/2018 10:19:34 PM
// Design Name:
// Module Name: flopr
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision: 0.04 - fix logic
// Revision: 0.03 - add flush
// Revision: 0.02 - add stall
// Revision: 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module flopr#
(parameter WIDTH = 8)
(input logic clk, reset,
input logic [WIDTH-1:0] d,
input logic stall,
output logic [WIDTH-1:0] q);
always_ff @(posedge clk, posedge reset)
begin
if (reset) q <= 0;
else if (!stall) q<=d;
end
endmodule