I've created a verilog module for a SPI peripheral that is fed 2 clocks, both generated by the same xilinx clocking wizard block. The main clock is a 80MHz clock which feeds the internal logic and determines SPI clk. A secondary clock of 1 MHz is used as a sample clock (that is, triggering an action of the SPI peripheral). in the screenshot below the names are sys_clk and sample_clk, respectively
the module:
module DAC80501 (
input clk,
input update,
input rst_n,
//...
);
reg update_last = 1'b1;
always @ (posedge clk or negedge rst_n) begin
if (!rst_n) begin
//...
end
else begin
case (state)
STATE_IDLE: begin
if (!update & update_last) begin
//...
end
end
//...
endcase
update_last <= update;
end
end
DAC80501SPI DAC (din_q, update_dac, clk, ready_dac, sclk, mosi, cs);
endmodule
this results in a hold time violation which I can't figure out how to fix:
Question
connoisseur_de_mimi
Hi,
I've created a verilog module for a SPI peripheral that is fed 2 clocks, both generated by the same xilinx clocking wizard block. The main clock is a 80MHz clock which feeds the internal logic and determines SPI clk. A secondary clock of 1 MHz is used as a sample clock (that is, triggering an action of the SPI peripheral). in the screenshot below the names are sys_clk and sample_clk, respectively
the module:
this results in a hold time violation which I can't figure out how to fix:
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now