-
-
Save Zottel/72d281b9ddc8cf614f16dc74327c65c1 to your computer and use it in GitHub Desktop.
Failing assertions, may I read like this?
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 buffer_output #(ADDR_WIDTH=8, DATA_WIDTH=32, DEPTH=5) ( | |
input wire clock, | |
message_interface.producer dtn, | |
instruction_output_interface.consumer cu, | |
data_interface data); | |
wire data_valid; | |
wire addr_valid; | |
assign dtn.valid = data_valid && addr_valid; | |
wire shared_ack; | |
assign shared_ack = data_valid && addr_valid && dtn.ack; | |
fifo_pointers | |
#(.WIDTH(DATA_WIDTH), .DEPTH(DEPTH)) | |
data_fifo ( | |
.clock(clock), | |
.in(data.data), | |
.in_valid(data.valid), | |
.in_ack(data.ack), | |
.out(dtn.data), | |
.out_valid(data_valid), | |
.out_ack(shared_ack)); | |
fifo_pointers | |
#(.WIDTH(ADDR_WIDTH), .DEPTH(DEPTH)) | |
addr_fifo ( | |
.clock(clock), | |
.in(cu.move_to), | |
.in_valid(cu.move_valid), | |
.in_ack(cu.move_ack), | |
.out(dtn.to), | |
.out_valid(addr_valid), | |
.out_ack(shared_ack)); | |
`ifdef FORMAL | |
always @ (posedge clock) begin | |
only_together_valid: | |
assert (!dtn.valid || (data_fifo.out_valid && addr_fifo.out_valid)); | |
data_ack_only_when_both_valid: | |
assert (!data_fifo.out_ack | |
|| (data_fifo.out_valid && addr_fifo.out_valid)); | |
addr_ack_only_when_both_valid: | |
assert (!addr_fifo.out_ack | |
|| (data_fifo.out_valid && addr_fifo.out_valid)); | |
ack_only_together: | |
assert (data_fifo.out_ack == addr_fifo.out_ack); | |
end | |
`endif | |
endmodule |
Author
Zottel
commented
Oct 21, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment