mirror of
https://github.com/pConst/basic_verilog.git
synced 2025-01-14 06:42:54 +08:00
Minor fixes for Quartus test project
This commit is contained in:
parent
a2f57048dc
commit
4c6c8eabb7
@ -28,27 +28,27 @@ module main(
|
||||
logic [`WIDTH-1:0] in_data_reg = 0;
|
||||
always_ff @(posedge clk) begin
|
||||
if( ~nrst ) begin
|
||||
in_data_reg <= '0;
|
||||
in_data_reg[`WIDTH-1:0] <= '0;
|
||||
end else begin
|
||||
in_data_reg <= in_data;
|
||||
in_data_reg[`WIDTH-1:0] <= in_data;
|
||||
end
|
||||
end
|
||||
|
||||
// place your test logic here ==================================================
|
||||
|
||||
logic [31:0] divided_clk;
|
||||
logic [31:0] div_clk;
|
||||
clk_divider #(
|
||||
.WIDTH( 32 )
|
||||
) cd1 (
|
||||
.clk( clk ),
|
||||
.nrst( nrst ),
|
||||
.ena( 1'b1 ),
|
||||
.out( divided_clk[31:0] )
|
||||
.out( div_clk[31:0] )
|
||||
);
|
||||
|
||||
logic [`WIDTH-1:0] out_data_comb = 0;
|
||||
always_comb begin
|
||||
out_data_comb[`WIDTH-1:0] <= out_data_comb[`WIDTH-1:0] ^ divided_clk[31:0];
|
||||
out_data_comb[`WIDTH-1:0] <= in_data_reg[`WIDTH-1:0] ^ div_clk[31:0];
|
||||
end
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user