⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 can_acf.v

📁 一个用硬件描述语言编写CAN总线控制器的IP
💻 V
📖 第 1 页 / 共 2 页
字号:
//////////////////////////////////////////////////////////////////////////                                                              ////////  can_acf.v                                                   ////////                                                              ////////                                                              ////////  This file is part of the CAN Protocol Controller            ////////  http://www.opencores.org/projects/can/                      ////////                                                              ////////                                                              ////////  Author(s):                                                  ////////       Igor Mohor                                             ////////       igorm@opencores.org                                    ////////                                                              ////////                                                              ////////  All additional information is available in the README.txt   ////////  file.                                                       ////////                                                              //////////////////////////////////////////////////////////////////////////////                                                              //////// Copyright (C) 2002, 2003, 2004 Authors                       ////////                                                              //////// This source file may be used and distributed without         //////// restriction provided that this copyright statement is not    //////// removed from the file and that any derivative work contains  //////// the original copyright notice and the associated disclaimer. ////////                                                              //////// This source file is free software; you can redistribute it   //////// and/or modify it under the terms of the GNU Lesser General   //////// Public License as published by the Free Software Foundation; //////// either version 2.1 of the License, or (at your option) any   //////// later version.                                               ////////                                                              //////// This source is distributed in the hope that it will be       //////// useful, but WITHOUT ANY WARRANTY; without even the implied   //////// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //////// PURPOSE.  See the GNU Lesser General Public License for more //////// details.                                                     ////////                                                              //////// You should have received a copy of the GNU Lesser General    //////// Public License along with this source; if not, download it   //////// from http://www.opencores.org/lgpl.shtml                     ////////                                                              //////// The CAN protocol is developed by Robert Bosch GmbH and       //////// protected by patents. Anybody who wants to implement this    //////// CAN IP core on silicon has to obtain a CAN protocol license  //////// from Bosch.                                                  ////////                                                              ////////////////////////////////////////////////////////////////////////////// CVS Revision History//// $Log: can_acf.v,v $// Revision 1.9  2004/05/31 14:46:11  igorm// Bit acceptance_filter_mode was inverted.//// Revision 1.8  2004/02/08 14:16:44  mohor// Header changed.//// Revision 1.7  2003/07/16 13:41:34  mohor// Fixed according to the linter.//// Revision 1.6  2003/02/10 16:02:11  mohor// CAN is working according to the specification. WB interface and more// registers (status, IRQ, ...) needs to be added.//// Revision 1.5  2003/02/09 18:40:29  mohor// Overload fixed. Hard synchronization also enabled at the last bit of// interframe.//// Revision 1.4  2003/02/09 02:24:33  mohor// Bosch license warning added. Error counters finished. Overload frames// still need to be fixed.//// Revision 1.3  2003/01/31 01:13:37  mohor// backup.//// Revision 1.2  2003/01/14 12:19:35  mohor// rx_fifo is now working.//// Revision 1.1  2003/01/08 02:13:15  mohor// Acceptance filter added.////////// synopsys translate_off`include "timescale.v"// synopsys translate_on`include "can_defines.v"module can_acf(   clk,  rst,  id,    /* Mode register */  reset_mode,  acceptance_filter_mode,  extended_mode,    acceptance_code_0,  acceptance_code_1,  acceptance_code_2,  acceptance_code_3,  acceptance_mask_0,  acceptance_mask_1,  acceptance_mask_2,  acceptance_mask_3,    go_rx_crc_lim,  go_rx_inter,  go_error_frame,    data0,  data1,  rtr1,  rtr2,  ide,  no_byte0,  no_byte1,    id_ok    );parameter Tp = 1;input         clk;input         rst;input  [28:0] id;input         reset_mode;input         acceptance_filter_mode;input         extended_mode;input   [7:0] acceptance_code_0;input   [7:0] acceptance_code_1;input   [7:0] acceptance_code_2;input   [7:0] acceptance_code_3;input   [7:0] acceptance_mask_0;input   [7:0] acceptance_mask_1;input   [7:0] acceptance_mask_2;input   [7:0] acceptance_mask_3;input         go_rx_crc_lim;input         go_rx_inter;input         go_error_frame;input   [7:0] data0;input   [7:0] data1;input         rtr1;input         rtr2;input         ide;input         no_byte0;input         no_byte1;output        id_ok;reg           id_ok;wire          match;wire          match_sf_std;wire          match_sf_ext;wire          match_df_std;wire          match_df_ext;// Working in basic mode. ID match for standard format (11-bit ID).assign match =        ( (id[3]  == acceptance_code_0[0] | acceptance_mask_0[0] ) &                        (id[4]  == acceptance_code_0[1] | acceptance_mask_0[1] ) &                        (id[5]  == acceptance_code_0[2] | acceptance_mask_0[2] ) &                        (id[6]  == acceptance_code_0[3] | acceptance_mask_0[3] ) &                        (id[7]  == acceptance_code_0[4] | acceptance_mask_0[4] ) &                        (id[8]  == acceptance_code_0[5] | acceptance_mask_0[5] ) &                        (id[9]  == acceptance_code_0[6] | acceptance_mask_0[6] ) &                        (id[10] == acceptance_code_0[7] | acceptance_mask_0[7] )                      );// Working in extended mode. ID match for standard format (11-bit ID). Using single filter.assign match_sf_std = ( (id[3]  == acceptance_code_0[0] | acceptance_mask_0[0] ) &                        (id[4]  == acceptance_code_0[1] | acceptance_mask_0[1] ) &                        (id[5]  == acceptance_code_0[2] | acceptance_mask_0[2] ) &                        (id[6]  == acceptance_code_0[3] | acceptance_mask_0[3] ) &                        (id[7]  == acceptance_code_0[4] | acceptance_mask_0[4] ) &                        (id[8]  == acceptance_code_0[5] | acceptance_mask_0[5] ) &                        (id[9]  == acceptance_code_0[6] | acceptance_mask_0[6] ) &                        (id[10] == acceptance_code_0[7] | acceptance_mask_0[7] ) &

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -