URL
https://opencores.org/ocsvn/can/can/trunk
[/] [can/] [trunk/] [rtl/] [verilog/] [can_btl.v] - Diff between revs 141 and 149
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 141 |
Rev 149 |
Line 48... |
Line 48... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.29 2004/05/12 15:58:41 igorm
|
|
// Core improved to pass all tests with the Bosch VHDL Reference system.
|
|
//
|
// Revision 1.28 2004/02/08 14:25:26 mohor
|
// Revision 1.28 2004/02/08 14:25:26 mohor
|
// Header changed.
|
// Header changed.
|
//
|
//
|
// Revision 1.27 2003/09/30 00:55:13 mohor
|
// Revision 1.27 2003/09/30 00:55:13 mohor
|
// Error counters fixed to be compatible with Bosch VHDL reference model.
|
// Error counters fixed to be compatible with Bosch VHDL reference model.
|
Line 230... |
Line 233... |
reg clk_en_q;
|
reg clk_en_q;
|
reg sync_blocked;
|
reg sync_blocked;
|
reg hard_sync_blocked;
|
reg hard_sync_blocked;
|
reg sampled_bit;
|
reg sampled_bit;
|
reg sampled_bit_q;
|
reg sampled_bit_q;
|
reg [3:0] quant_cnt;
|
reg [4:0] quant_cnt;
|
reg [3:0] delay;
|
reg [3:0] delay;
|
reg sync;
|
reg sync;
|
reg seg1;
|
reg seg1;
|
reg seg2;
|
reg seg2;
|
reg resync_latched;
|
reg resync_latched;
|
Line 360... |
Line 363... |
|
|
/* Quant counter */
|
/* Quant counter */
|
always @ (posedge clk or posedge rst)
|
always @ (posedge clk or posedge rst)
|
begin
|
begin
|
if (rst)
|
if (rst)
|
quant_cnt <= 4'h0;
|
quant_cnt <= 5'h0;
|
else if (go_sync | go_seg1 | go_seg2)
|
else if (go_sync | go_seg1 | go_seg2)
|
quant_cnt <=#Tp 4'h0;
|
quant_cnt <=#Tp 5'h0;
|
else if (clk_en_q)
|
else if (clk_en_q)
|
quant_cnt <=#Tp quant_cnt + 1'b1;
|
quant_cnt <=#Tp quant_cnt + 1'b1;
|
end
|
end
|
|
|
|
|
Line 374... |
Line 377... |
always @ (posedge clk or posedge rst)
|
always @ (posedge clk or posedge rst)
|
begin
|
begin
|
if (rst)
|
if (rst)
|
delay <= 4'h0;
|
delay <= 4'h0;
|
else if (resync & seg1 & (~transmitting | transmitting & (tx_next_sp | (tx & (~rx))))) // when transmitting 0 with positive error delay is set to 0
|
else if (resync & seg1 & (~transmitting | transmitting & (tx_next_sp | (tx & (~rx))))) // when transmitting 0 with positive error delay is set to 0
|
delay <=#Tp (quant_cnt > {2'h0, sync_jump_width})? ({2'h0, sync_jump_width} + 1'b1) : (quant_cnt + 1'b1);
|
delay <=#Tp (quant_cnt > {3'h0, sync_jump_width})? ({2'h0, sync_jump_width} + 1'b1) : (quant_cnt + 1'b1);
|
else if (go_sync | go_seg1)
|
else if (go_sync | go_seg1)
|
delay <=#Tp 4'h0;
|
delay <=#Tp 4'h0;
|
end
|
end
|
|
|
|
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.