资源简介
基于FPGA实现ieee1588同步技术
代码片段和文件信息
/*
* ptp_drv_bfm.c
*
* Copyright (c) 2012 BABY&HW. All rights reserved.
*
* This library 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 library 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 library; if not write to the Free Software
* Foundation Inc. 51 Franklin Street Fifth Floor Boston
* MA 02110-1301 USA
*/
#include
#include “svdpi.h“
#include “../dpiheader.h“
// define RTC address values
#define RTC_CTRL 0x00000000
#define RTC_NULL_0x04 0x00000004
#define RTC_NULL_0x08 0x00000008
#define RTC_NULL_0x0C 0x0000000C
#define RTC_TIME_SEC_H 0x00000010
#define RTC_TIME_SEC_L 0x00000014
#define RTC_TIME_NSC_H 0x00000018
#define RTC_TIME_NSC_L 0x0000001C
#define RTC_PERIOD_H 0x00000020
#define RTC_PERIOD_L 0x00000024
#define RTC_ADJPER_H 0x00000028
#define RTC_ADJPER_L 0x0000002C
#define RTC_ADJNUM 0x00000030
#define RTC_NULL_0x34 0x00000034
#define RTC_NULL_0x38 0x00000038
#define RTC_NULL_0x3C 0x0000003C
// define RTC control values
#define RTC_SET_CTRL_0 0x00
#define RTC_GET_TIME 0x01
#define RTC_SET_ADJ 0x02
#define RTC_SET_PERIOD 0x04
#define RTC_SET_TIME 0x08
#define RTC_SET_RESET 0x10
// define RTC data values
#define RTC_SET_PERIOD_H 0x8 // 8ns for 125MHz rtc_clk
#define RTC_SET_PERIOD_L 0x0
// define RTC constant
#define RTC_ACCMOD_H 0x3B9ACA00 // 1000000000 for 30bit
#define RTC_ACCMOD_L 0x0 // 256 for 8bit
// define TSU address values
#define TSU_RXCTRL 0x00000040
#define TSU_RXQUE_STATUS 0x00000044
#define TSU_NULL_0x48 0x00000048
#define TSU_NULL_0x4C 0x0000004C
#define TSU_RXQUE_DATA_HH 0x00000050
#define TSU_RXQUE_DATA_HL 0x00000054
#define TSU_RXQUE_DATA_LH 0x00000058
#define TSU_RXQUE_DATA_LL 0x0000005C
#define TSU_TXCTRL 0x00000060
#define TSU_TXQUE_STATUS 0x00000064
#define TSU_NULL_0x68 0x00000068
#define TSU_NULL_0x6C 0x0000006C
#define TSU_TXQUE_DATA_HH 0x00000070
#define TSU_TXQUE_DATA_HL 0x00000074
#define TSU_TXQUE_DATA_LH 0x00000078
#define TSU_TXQUE_DATA_LL 0x0000007C
// define TSU control values
#define TSU_SET_CTRL_0 0x00
#define TSU_GET_RXQUE 0x01
#define TSU_SET_RXRST 0x02
#define TSU_GET_TXQUE 0x01
#define TSU_SET_TXRST 0x02
// define TSU data values
#define TSU_MASK_RXMSGID 0xFF000000 // FF to enable 0x0 to 0x7
#define TSU_MASK_TXMSGID 0xFF000000 // FF to enable 0x0 to 0x7
int ptp_drv_bfm_c(double fw_delay)
{
unsigned int cpu_addr_i;
unsigned int cpu_data_i;
unsigned int cpu_data_o;
// LOAD RTC PERIOD
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-10-24 09:45 trunk\
目录 0 2014-10-24 09:45 trunk\doc\
文件 114688 2013-07-12 15:01 trunk\doc\ARCHITECTURE.ppt
文件 2050 2012-04-14 21:31 trunk\doc\DEsc
文件 2397 2012-04-15 15:18 trunk\doc\RTC MEMORY MAP.csv
文件 2946 2012-04-15 15:18 trunk\doc\TSU MEMORY MAP.csv
文件 616 2012-03-18 21:33 trunk\doc\ptpv1.pcap
文件 3960 2012-03-18 21:33 trunk\doc\ptpv2.pcap
目录 0 2014-10-24 09:45 trunk\doc\tool\
目录 0 2014-10-24 10:01 trunk\doc\tool\ptpv2_timing_analyzer\
文件 5717457 2013-02-02 17:11 trunk\doc\tool\ptpv2_timing_analyzer\Calnex_-_IEEE_1588v2_PTP.pdf
文件 1530710 2013-02-02 17:11 trunk\doc\tool\ptpv2_timing_analyzer\ptpdv2_long.pcap
文件 1530146 2013-02-02 17:11 trunk\doc\tool\ptpv2_timing_analyzer\ptpv2_parsed.csv
文件 223856 2013-02-02 17:11 trunk\doc\tool\ptpv2_timing_analyzer\ptpv2_plotted.jpg
文件 19297 2013-02-02 17:11 trunk\doc\tool\ptpv2_timing_analyzer\ptpv2_timing_analyzer.sce
文件 310 2013-07-12 16:41 trunk\doc\tool\ptpv2_timing_analyzer\readme.txt
目录 0 2014-10-24 09:45 trunk\par\
目录 0 2014-10-24 10:25 trunk\par\altera\
文件 55 2013-02-05 09:35 trunk\par\altera\cleanup.bat
文件 46 2013-02-05 09:35 trunk\par\altera\cleanup.sh
目录 0 2014-10-24 10:25 trunk\par\altera\db\
文件 137 2014-10-24 10:25 trunk\par\altera\db\ha1588.db_info
文件 161 2014-10-24 10:25 trunk\par\altera\db\ha1588.eco.cdb
文件 200 2014-10-24 10:25 trunk\par\altera\db\ha1588.sld_design_entry.sci
文件 304 2014-10-24 10:25 trunk\par\altera\db\ha1588.tmw_info
文件 1279 2012-03-31 16:47 trunk\par\altera\ha1588.qpf
文件 3621 2014-10-24 10:13 trunk\par\altera\ha1588.qsf
文件 175 2014-10-24 10:25 trunk\par\altera\ha1588.qws
文件 10067 2012-04-09 17:28 trunk\par\altera\ha1588.sdc
目录 0 2014-10-24 09:45 trunk\par\altera\ip\
文件 7598 2013-02-05 09:35 trunk\par\altera\ip\dcfifo_128b_16.v
............此处省略90个文件信息
相关资源
- SystemVerilog验证测试平台编写指南(中
- 基于Verilog的交通灯设计EDA课程设计
- 数字信号处理的FPGA实现Verilog源码
- 重磅:IEEE Std 802.11-2016 高清无码,最
- verilog硬件描述语言程序设计与实践教
- Ultraedit环境下配置verilog语法高亮的字
- 8 位cpu的verilog
- 中值滤波算法Quartus实现
- hdb3的Verilog HDL编码
- Ieee 1588 源代码
- ZEDBoard实现OV7725显示Verilog
- 简单CPU的Verilog设计
- 基于verilog的oc8051IP核
- 浮点数IEEE754标准
- CRC_GEN_CONFIGUABLE.rar
- Notepad Verilog 插件nppVerilog
- AES高级加密算法的verilog语言实现
- IEEE 802.1X 标准
- FPGA_W5500源码
- AD7689.rar
- EndNote - IEEE格式参考文献导出
- IEEE802.16-2004 WiMAX物理层
- 新型宽带城域网技术IEEE802.16
- IEEE 802.16和WiMax的组网技
- 16分频器的Verilog HDL程序源代码
- 10/100/1000M以太网verilog hdl实现源码
- 反应计时器设计+毫秒计时器+延时计数
- IEEE 802.15.4 芯片的协议选择
- ad5305控制程序
- 精通Verilog HDL_IC设计核心技术实例详解
评论
共有 条评论