Permalink
Browse files

fix timing closure issue on motor 208MHz PWM clock domain

  • Loading branch information...
1 parent 6e1593b commit ff002fd3e8ced2dcd3d3cdbba7f75281675a5956 @bunnie committed Mar 6, 2012
@@ -1254,6 +1254,7 @@ module kovan (
// - modify dim/bright settings for heartbeat to make it more apparent
// - fix DDR2 reset bug, core now runs instead of hanging in reset
// - fix LCDO_G7 pin missing in .UCF file
+ // - improve timing closure for 208 MHz motor register interface
/////// version FF.0001.0003 (log created 3/1/2012)
// - fix ADC bit width
@@ -267,9 +267,12 @@ module robot_iface(
reg pwm_clk_a;
reg [15:0] pwm_scaler;
wire pwmclk;
-
+ reg [15:0] mot_pwm_div_r;
+
always @(posedge clk_208MHz) begin
- if( (pwm_scaler > mot_pwm_div) || (&pwm_scaler) ) begin
+ mot_pwm_div_r <= mot_pwm_div; // decouple timing to local domain
+
+ if( (pwm_scaler > mot_pwm_div_r) || (&pwm_scaler) ) begin
pwm_scaler <= 0;
pwm_clk_a <= 1;
end else begin

0 comments on commit ff002fd

Please sign in to comment.