资源简介
参考使用xilinx官方文档1078、1079,代码与之对应
代码片段和文件信息
/*
* devmem2.c: Simple program to read/write from/to any location in memory.
*
* Copyright (C) 2000 Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl)
*
*
* This software has been developed for the LART computing board
* (http://www.lart.tudelft.nl/). The development has been sponsored by
* the Mobile MultiMedia Communications (http://www.mmc.tudelft.nl/)
* and Ubiquitous Communications (http://www.ubicom.tudelft.nl/)
* projects.
*
* The author can be reached at:
*
* Jan-Derk Bakker
* Information and Communication Theory Group
* Faculty of Information Technology and Systems
* Delft University of Technology
* P.O. Box 5031
* 2600 GA Delft
* The Netherlands
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not write to the Free Software
* Foundation Inc. 59 Temple Place Suite 330 Boston MA 02111-1307 USA
*
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define FATAL do { fprintf(stderr “Error at line %d file %s (%d) [%s]\n“ \
__LINE__ __FILE__ errno strerror(errno)); exit(1); } while(0)
#define MAP_SIZE 4096UL
#define MAP_MASK (MAP_SIZE - 1)
int main(int argc char **argv) {
int fd;
void *map_base *virt_addr;
unsigned long read_result writeval;
off_t target;
int access_type = ‘w‘;
if(argc < 2) {
fprintf(stderr “\nUsage:\t%s { address } [ type [ data ] ]\n“
“\taddress : memory address to act upon\n“
“\ttype : access operation type : [b]yte [h]alfword [w]ord\n“
“\tdata : data to be written\n\n“
argv[0]);
exit(1);
}
target = strtoul(argv[1] 0 0);
if(argc > 2)
access_type = tolower(argv[2][0]);
if((fd = open(“/dev/mem“ O_RDWR | O_SYNC)) == -1) FATAL;
printf(“/dev/mem opened.\n“);
fflush(stdout);
/* Map one page */
map_base = mmap(0 MAP_SIZE PROT_READ | PROT_WRITE MAP_SHARED fd target & ~MAP_MASK);
if(map_base == (void *) -1) FATAL;
printf(“Memory mapped at address %p.\n“ map_base);
fflush(stdout);
virt_addr = map_base + (target & MAP_MASK);
switch(access_type) {
case ‘b‘:
read_result = *((unsigned char *) virt_addr);
break;
case ‘h‘:
read_resu
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-12-17 03:06 Amp-zynq-master\
文件 378 2015-12-17 03:06 Amp-zynq-master\.gitattributes
文件 574 2015-12-17 03:06 Amp-zynq-master\.gitignore
目录 0 2015-12-17 03:06 Amp-zynq-master\generated_files\
目录 0 2015-12-17 03:06 Amp-zynq-master\generated_files\FPGA\
文件 2083850 2015-12-17 03:06 Amp-zynq-master\generated_files\FPGA\system.bit
目录 0 2015-12-17 03:06 Amp-zynq-master\generated_files\dtb\
文件 12058 2015-12-17 03:06 Amp-zynq-master\generated_files\dtb\devicetree.dtb
文件 4598 2015-12-17 03:06 Amp-zynq-master\generated_files\dtb\pl.dtsi
文件 297 2015-12-17 03:06 Amp-zynq-master\generated_files\dtb\skeleton.dtsi
文件 1755 2015-12-17 03:06 Amp-zynq-master\generated_files\dtb\system.dts
文件 10183 2015-12-17 03:06 Amp-zynq-master\generated_files\dtb\zynq-7000.dtsi
目录 0 2015-12-17 03:06 Amp-zynq-master\generated_files\elfs\
文件 419538 2015-12-17 03:06 Amp-zynq-master\generated_files\elfs\amp_fsbl.elf
文件 188720 2015-12-17 03:06 Amp-zynq-master\generated_files\elfs\app_cpu1.elf
文件 1892814 2015-12-17 03:06 Amp-zynq-master\generated_files\elfs\u-boot.elf
目录 0 2015-12-17 03:06 Amp-zynq-master\generated_files\kernel\
文件 3486352 2015-12-17 03:06 Amp-zynq-master\generated_files\kernel\uImage
目录 0 2015-12-17 03:06 Amp-zynq-master\generated_files\u-boot\
文件 1892814 2015-12-17 03:06 Amp-zynq-master\generated_files\u-boot\u-boot.elf
目录 0 2015-12-17 03:06 Amp-zynq-master\hardware_prj\
文件 535 2015-12-17 03:06 Amp-zynq-master\hardware_prj\hw.xdc
文件 39116 2015-12-17 03:06 Amp-zynq-master\hardware_prj\ps.tcl
文件 8774 2015-12-17 03:06 Amp-zynq-master\hardware_prj\system.tcl
文件 930 2015-12-17 03:06 Amp-zynq-master\hardware_prj\system_pro.tcl
文件 2633 2015-12-17 03:06 Amp-zynq-master\hardware_prj\system_wrapper.v
文件 3872 2015-12-17 03:06 Amp-zynq-master\readme.md
目录 0 2015-12-17 03:06 Amp-zynq-master\sd_boot\
文件 2538124 2015-12-17 03:06 Amp-zynq-master\sd_boot\BOOT.bin
文件 12058 2015-12-17 03:06 Amp-zynq-master\sd_boot\devicetree.dtb
目录 0 2015-12-17 03:06 Amp-zynq-master\sd_boot\devmem\
............此处省略414个文件信息
相关资源
- OpenGL圣诞树
- ZYNQ进阶之路14工程.rar
- 辩论赛&演讲比赛计时软件
- 佰润﹒微养老远程视频看护系统
- Examples.unitypackage
- hls_rgb2gray.zip
- ZYNQ PS响应PL中断例程
- 可以用的firefox+tamper
- AMP SOURCE
- LAMP兄弟连李明老师Linux讲义笔记PPT
- 鸟哥的Linux私房菜-基础学习篇第四版
- 基于ZYNQ的的FPGA基础入门
- Q3D Extractor Examples
- Django 2 by Example_Code 源码
- win10 闹钟铃声 alarms&clock
- zynq 图像处理教程fpga教程,含例程手
- example.rar
- ZYNQ HLS 图像算法
- 离线google地图API含sample+瓦片资源
- Design with Operational Amplifiers and Analog
- 词法语法语义分析器
- Latex_Samples.rar
- Adversarial Examples: Attacks and Defenses for
- Cadence_Concept_HDLamp;Allegro原理图与PCB设
- ActiveMQ_QtExample.rar
- Rohde&Schwarz 频谱仪操作手册英文
- ampl(破解版)
- 2017年全国电子设计竞赛滚球控制系统
- Performance by Design: Computer Capacity Plann
- The_Zynq_Book教程资料
评论
共有 条评论