Giter VIP home page Giter VIP logo

cache's Introduction

基于Xilinx FPGA的block ram的写直达与写回cache设计与配套的外部sram控制器 这是一个阻塞式的cache,采用有限状态机进行设计,一个cache行有8个32bit数据,同时还有一个能连续读取256bit数据的外部sram控制器,sram的型号为AS7C34098A (256K x 16)(Alliance 4Mb Fast Asynchronous SRAM) ,工作在50MHz下。

目录介绍

|-----写回法cache+sram_carl ##写回法的cache与sram控制器

|-----写直达cache+sram_carl ##写直达法的cache与sram控制器

|-----design.md ##设计文档

cache简要介绍

cache的基础行由block ram构成,目录中提供了xilinx的ip核。

读命中与读未命中

写回法与写直达法的cache读命中时都需要2个时钟周期才能将数据返回,在读未命中时需要19个时钟周期。(其中读取外部sram需要16个时钟,两个周期用于查询cache,一个周期用于将sram中的数据写回bram)

写命中与写未命中

在写回法cache写命中时,需要3个周期,读写未命中时需要19个时钟周期;(其中读取外部sram需要16个时钟,两个周期用于查询cache,一个周期用于将sram中的数据写回bram,写数据在写回bram的时候被写入)

在写直达的cache中,写命中时,需要19个时钟周期;(其中16个时钟周期用于写回sram,两个周期用于查询cache,一个周期用于写bram)写未命中时需要35个时钟周期。(其中16个时钟周期用于读取sram,16个用于写回sram,2个用于查询cache,一个用于写回bram)

sram控制器简要介绍

为了满足外部sram芯片的时序要求,读写都需要经过两个时钟周期才操作完成。

设计细节见design.md

参考项目

  1. UltraMIPS_NSCSCC https://github.com/SocialistDalao/UltraMIPS_NSCSCC
  2. 胡伟武. CPU设计实战. 机械工业出版社

写在最后

本项目基于xilinx公司的vivado设计工具开发,不保证在其他设计平台上的准确性。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.