Line 48... |
Line 48... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.26 2003/09/25 18:55:49 mohor
|
|
// Synchronization changed, error counters fixed.
|
|
//
|
// Revision 1.25 2003/07/16 13:40:35 mohor
|
// Revision 1.25 2003/07/16 13:40:35 mohor
|
// Fixed according to the linter.
|
// Fixed according to the linter.
|
//
|
//
|
// Revision 1.24 2003/07/10 15:32:28 mohor
|
// Revision 1.24 2003/07/10 15:32:28 mohor
|
// Unused signal removed.
|
// Unused signal removed.
|
Line 162... |
Line 165... |
tx_point,
|
tx_point,
|
hard_sync,
|
hard_sync,
|
|
|
/* Output from can_bsp module */
|
/* Output from can_bsp module */
|
rx_idle,
|
rx_idle,
|
not_first_bit_of_inter,
|
rx_inter,
|
transmitting,
|
transmitting,
|
transmitter,
|
transmitter,
|
go_rx_inter,
|
go_rx_inter,
|
tx_next,
|
tx_next,
|
|
|
Line 194... |
Line 197... |
input [2:0] time_segment2;
|
input [2:0] time_segment2;
|
input triple_sampling;
|
input triple_sampling;
|
|
|
/* Output from can_bsp module */
|
/* Output from can_bsp module */
|
input rx_idle;
|
input rx_idle;
|
input not_first_bit_of_inter;
|
input rx_inter;
|
input transmitting;
|
input transmitting;
|
input transmitter;
|
input transmitter;
|
input go_rx_inter;
|
input go_rx_inter;
|
input tx_next;
|
input tx_next;
|
|
|
Line 243... |
Line 246... |
wire resync;
|
wire resync;
|
|
|
|
|
|
|
assign preset_cnt = (baud_r_presc + 1'b1)<<1; // (BRP+1)*2
|
assign preset_cnt = (baud_r_presc + 1'b1)<<1; // (BRP+1)*2
|
assign hard_sync = (rx_idle | not_first_bit_of_inter) & (~rx) & sampled_bit & (~hard_sync_blocked); // Hard synchronization
|
assign hard_sync = (rx_idle | rx_inter) & (~rx) & sampled_bit & (~hard_sync_blocked); // Hard synchronization
|
assign resync = (~rx_idle) & (~not_first_bit_of_inter) & (~rx) & sampled_bit & (~sync_blocked); // Re-synchronization
|
assign resync = (~rx_idle) & (~rx_inter) & (~rx) & sampled_bit & (~sync_blocked); // Re-synchronization
|
|
|
|
|
/* Generating general enable signal that defines baud rate. */
|
/* Generating general enable signal that defines baud rate. */
|
always @ (posedge clk or posedge rst)
|
always @ (posedge clk or posedge rst)
|
begin
|
begin
|
Line 450... |
Line 453... |
/* Blocking hard synchronization when occurs once or when we are transmitting a msg */
|
/* Blocking hard synchronization when occurs once or when we are transmitting a msg */
|
always @ (posedge clk or posedge rst)
|
always @ (posedge clk or posedge rst)
|
begin
|
begin
|
if (rst)
|
if (rst)
|
hard_sync_blocked <=#Tp 1'b0;
|
hard_sync_blocked <=#Tp 1'b0;
|
else if (hard_sync & clk_en_q | transmitting & transmitter & tx_point)
|
// else if (hard_sync & clk_en_q | transmitting & transmitter & tx_point)
|
|
else if (hard_sync & clk_en_q | transmitting & transmitter & tx_point & (~tx_next))
|
hard_sync_blocked <=#Tp 1'b1;
|
hard_sync_blocked <=#Tp 1'b1;
|
// else if (go_rx_inter)
|
// else if (go_rx_inter)
|
else if (go_rx_inter | (rx_idle | not_first_bit_of_inter) & sample_point & sampled_bit) // When a glitch performed synchronization
|
else if (go_rx_inter | (rx_idle | rx_inter) & sample_point & sampled_bit) // When a glitch performed synchronization
|
hard_sync_blocked <=#Tp 1'b0;
|
hard_sync_blocked <=#Tp 1'b0;
|
end
|
end
|
|
|
|
|
|
|