element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
FPGA
  • Technologies
  • More
FPGA
Forum 关于CONFIG_BUFCACHE_SIZE存储机制的疑惑
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join FPGA to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 0 replies
  • Subscribers 560 subscribers
  • Views 135 views
  • Users 0 members are here
Related

关于CONFIG_BUFCACHE_SIZE存储机制的疑惑

vhe1981
vhe1981 over 15 years ago
关于CONFIG_BUFCACHE_SIZE存储机制的疑惑

前辈好!我用的是Xilinx V2Pro开发板,我的想法是把读出的图片数据读出来,处理后以不同的文件名存成另一张图片。sysace_fopen()操作是正确的,但是在numwrite = sysace_fwrite(readBuffer, 1, 2, fptw) 卡主了。测试过, sysace_fwrite(readBuffer, 1, 2, fptw)只能读取一张图片里的部分数据。琢磨了好几天,偶然修改了CONFIG_BUFCACHE_SIZE,把原来的10240改成30000 这样就能存储了。但是让我疑惑的是

for (j=infoheader.height-1;j>=0;j--) {

numread = sysace_fread(readBuffer, 1, 1920, infile);

numwrite = sysace_fwrite(readBuffer, 1, 1920, outfile);

}

infoheader.height的初值是580,当循环到571的时候就卡住了,1920*9=17280,这个数也是大于10240的,改成30000后按理论值也不会多循环几次的。这个存储系统的机制我不理解,请前辈赐教!

 

    下面是我在Xilinx“OS and Libraries Document Collection”上查找到CONFIG_BUFCACHE_SIZE的定义并翻译出来的结果:

    CONFIG_BUFCACHE_SIZE定义了被调用到System ACE的读写库函数的总的内存(按字节)。它通过数据缓冲提升了读写函数的性能和避免了对CF卡设备的不必要的访问。当sysace_fclose被调用时缓冲区的数据被同步写到设备;因此,如果文件被修改执sysace_fclose变得非常必要。

 

   原文如下:

CONFIG_BUFCACHE_SIZE: defines the amount of memory (in bytes) used by the

library for buffering reads and write calls to the System ACE. This improves

the performance of both sysace_fread and sysace_fwrite by buffering the data

in memory and avoiding unnecessary calls to read the CF device. The buffers

are synced up to the device only on a sysace_fclose call; consequently, is

essential to perform a sysace_fclose if any file was modified.

http://xilinx.eefocus.com/data/myspace/28/141141/bbs/2010-09-22/1285122437_db201a03.jpg

  • Sign in to reply
  • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube