Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@diningyo
Last active August 12, 2018 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diningyo/5d0bb6b1b943b3b16022b53b8be764b9 to your computer and use it in GitHub Desktop.
Save diningyo/5d0bb6b1b943b3b16022b53b8be764b9 to your computer and use it in GitHub Desktop.
シミュレーションテスト用FF
`timescale 1ns / 1ps
// FF
module test_ff(
input wire clk
,input wire rst_n
,input wire [31:0] i_data
,input wire wren
,output reg [31:0] o_data
);
always @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
o_data <= #1 {32{1'b0}};
end
else if (wren) begin
o_data <= #1 i_data;
end
end
endmodule // test_ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment