OpenCores
URL https://opencores.org/ocsvn/can/can/trunk

Subversion Repositories can

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 18 to Rev 19
    Reverse comparison

Rev 18 → Rev 19

/trunk/bench/verilog/can_testbench.v
45,6 → 45,9
// CVS Revision History
//
// $Log: not supported by cvs2svn $
// Revision 1.13 2003/01/15 13:16:42 mohor
// When a frame with "remote request" is received, no data is stored to fifo, just the frame information (identifier, ...). Data length that is stored is the received data length and not the actual data length that is stored to fifo.
//
// Revision 1.12 2003/01/14 17:25:03 mohor
// Addresses corrected to decimal values (previously hex).
//
206,7 → 209,7
begin
// test_empty_fifo; // test currently switched off
test_full_fifo; // test currently switched on
// send_frame;
// send_frame; // test currently switched off
end
 
 
584,10 → 587,13
else // Standard format
data = {id[10:0], remote_trans_req, 1'b0, 1'b0, length};
 
if(length) // Send data if length is > 0
if (~remote_trans_req)
begin
for (cnt=1; cnt<=(2*length); cnt=cnt+1) // data (we are sending nibbles)
data = {data[113:0], cnt[3:0]};
if(length) // Send data if length is > 0
begin
for (cnt=1; cnt<=(2*length); cnt=cnt+1) // data (we are sending nibbles)
data = {data[113:0], cnt[3:0]};
end
end
 
// Adding CRC
595,10 → 601,20
 
 
// Calculating pointer that points to the bit that will be send
if(mode) // Extended format
pointer = 53 + 8 * length;
else // Standard format
pointer = 32 + 8 * length;
if (remote_trans_req)
begin
if(mode) // Extended format
pointer = 53;
else // Standard format
pointer = 32;
end
else
begin
if(mode) // Extended format
pointer = 53 + 8 * length;
else // Standard format
pointer = 32 + 8 * length;
end
 
// This is how many bits we need to shift
total_bits = pointer;
/trunk/rtl/verilog/can_bsp.v
45,6 → 45,9
// CVS Revision History
//
// $Log: not supported by cvs2svn $
// Revision 1.10 2003/01/15 13:16:47 mohor
// When a frame with "remote request" is received, no data is stored to fifo, just the frame information (identifier, ...). Data length that is stored is the received data length and not the actual data length that is stored to fifo.
//
// Revision 1.9 2003/01/14 12:19:35 mohor
// rx_fifo is now working.
//
256,10 → 259,17
reg rx_ack_lim;
reg rx_eof;
 
reg rtr1;
reg ide;
reg rtr2;
reg [14:0] crc_in;
 
reg crc_enable;
 
reg [2:0] eof_cnt;
wire [14:0] calculated_crc;
wire remote_rq;
wire [3:0] limited_data_len;
 
assign go_rx_idle = sample_point & rx_eof & (eof_cnt == 6);
assign go_rx_id1 = sample_point & rx_idle & (~sampled_bit);
270,9 → 280,9
assign go_rx_r1 = (~bit_de_stuff) & sample_point & rx_rtr2;
assign go_rx_r0 = (~bit_de_stuff) & sample_point & (rx_ide & (~sampled_bit) | rx_r1);
assign go_rx_dlc = (~bit_de_stuff) & sample_point & rx_r0;
assign go_rx_data = (~bit_de_stuff) & sample_point & rx_dlc & (bit_cnt == 3) & (sampled_bit | (|data_len[2:0]));
assign go_rx_crc = (~bit_de_stuff) & sample_point & (rx_dlc & (bit_cnt == 3) & (~sampled_bit) & (~(|data_len[2:0])) |
rx_data & (bit_cnt == ((data_len<<3) - 1'b1)));
assign go_rx_data = (~bit_de_stuff) & sample_point & rx_dlc & (bit_cnt == 3) & (sampled_bit | (|data_len[2:0])) & (~remote_rq);
assign go_rx_crc = (~bit_de_stuff) & sample_point & (rx_dlc & (bit_cnt == 3) & ((~sampled_bit) & (~(|data_len[2:0])) | remote_rq) |
rx_data & (bit_cnt == ((limited_data_len<<3) - 1'b1)));
assign go_rx_crc_lim = sample_point & rx_crc & (bit_cnt == 14);
assign go_rx_ack = sample_point & rx_crc_lim;
assign go_rx_ack_lim = sample_point & rx_ack;
284,7 → 294,10
assign bit_de_stuff_set = go_rx_id1;
assign bit_de_stuff_reset = go_rx_crc_lim;
 
assign remote_rq = ((~ide) & rtr1) | (ide & rtr2);
assign limited_data_len = (data_len < 8)? data_len : 4'h8;
 
 
// Rx idle state
always @ (posedge clk or posedge rst)
begin
465,13 → 478,6
end
 
 
 
 
reg rtr1;
reg ide;
reg rtr2;
reg [14:0] crc_in;
 
// ID register
always @ (posedge clk or posedge rst)
begin
762,15 → 768,13
 
wire [2:0] header_len;
wire storing_header;
wire [3:0] limited_data_len;
wire [3:0] limited_data_len_minus1;
wire reset_wr_fifo;
wire remote_request; // When remote request comes, no data field is stored to fifo.
 
assign header_len[2:0] = extended_mode ? (ide? (3'h5) : (3'h3)) : 3'h2;
assign storing_header = header_cnt < header_len;
assign remote_request = (extended_mode & rtr2) | ((~extended_mode) & rtr1); // When remote request is active, data length is 0.
assign limited_data_len[3:0] = remote_request? 4'hf : ((data_len < 8)? (data_len -1'b1) : 4'h7); // - 1 because counter counts from 0
assign reset_wr_fifo = data_cnt == (limited_data_len + header_len);
assign limited_data_len_minus1[3:0] = remote_rq? 4'hf : ((data_len < 8)? (data_len -1'b1) : 4'h7); // - 1 because counter counts from 0
assign reset_wr_fifo = data_cnt == (limited_data_len_minus1 + header_len);
 
 
// Write enable signal for 64-byte rx fifo

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.