Last active
November 6, 2017 15:03
-
-
Save ZipCPU/149c258a98f55e51939da3db81b41512 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module sub(i_clk, r, ce, a, b); | |
parameter N = 64; | |
input wire i_clk, r, ce, a; | |
output wire b; | |
reg [(N-1):0] pipe; | |
initial pipe = 0; | |
always @(posedge i_clk, posedge r) | |
if (r) | |
pipe <= 0; | |
else if (ce) | |
pipe <= { pipe[(N-2):0], a }; | |
assign b = pipe[N-1]; | |
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module top(i_clk, r, ce, a, b); | |
input wire i_clk, a, r, ce; | |
output wire b; | |
wire s1, s2; | |
sub sub1(i_clk, r, ce, a, s1); | |
sub sub2(i_clk, r, ce, a, s2); | |
assign b = (s1 ^ s2); | |
initial assume(r); | |
initial assume(a==0); | |
always @(posedge i_clk) | |
assert(b == 0); | |
endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment