File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -454,13 +454,13 @@ always @(posedge clk) begin
454454 adder_b_reg <= - NS_PER_S;
455455 adder_cin_reg <= 0 ;
456456
457- if (ts_tod_ns_reg[29 ] ) begin
458- // latter half of second; compute offset for next second
457+ if (ts_tod_ns_reg[29 : 27 ] == 3'b111 ) begin
458+ // latter portion of second; compute offset for next second
459459 adder_b_reg <= - NS_PER_S;
460460 update_state_reg <= 12 ;
461461 adder_busy_reg <= 1'b1 ;
462462 end else begin
463- // former half of second; compute offset for previous second
463+ // former portion of second; compute offset for previous second
464464 adder_b_reg <= NS_PER_S;
465465 update_state_reg <= 14 ;
466466 adder_busy_reg <= 1'b1 ;
Original file line number Diff line number Diff line change @@ -255,12 +255,12 @@ async def _run(self):
255255 self .ts_tod_offset_ns = (self .ts_tod_ns - self .ts_rel_ns ) & 0xffffffff
256256
257257 # compute alternate offset
258- if self .ts_tod_ns & ( 1 << 29 ) :
259- # latter half of second; compute offset for next second
258+ if self .ts_tod_ns >> 27 == 7 :
259+ # latter portion of second; compute offset for next second
260260 self .ts_tod_alt_s = self .ts_tod_s + 1
261261 self .ts_tod_alt_offset_ns = (self .ts_tod_offset_ns - 1000000000 ) & 0xffffffff
262262 else :
263- # former half of second; compute offset for previous second
263+ # former portion of second; compute offset for previous second
264264 self .ts_tod_alt_s = self .ts_tod_s - 1
265265 self .ts_tod_alt_offset_ns = (self .ts_tod_offset_ns + 1000000000 ) & 0xffffffff
266266
You can’t perform that action at this time.
0 commit comments