Code Monkey home page Code Monkey logo

step_into_mips's Issues

lab3的一些问题

问题:

  1. 设置Block Memory Generator的时候,如果勾选Port A Options中的Primitives Output Register会导致存储器输出延迟2个周期。根据我之前看的计组的书,一般情况下应该是1个周期。
  2. jumpbranch指令中,产生跳转信号相比PC会延迟1~2个周期(取决于指令存储器的延迟),因此会多取出1~2个指令,但在实验指导书我没有看到关于阻止多取出的指令执行的内容。
  3. 由于指令存储器的延迟,会导致产生跳转信号时PC的值已经不是branch指令的地址了,因此跳转地址的偏移量会计算错误。

关于上述问题,我用了一些解决方法:

  1. 取消勾选Primitives Output Register,这样存储器延迟为1个周期。
  2. mips.v文件中添加插入空指令的逻辑。在检测到跳转信号后,下一个周期会劫持原指令并替换为32'h0000_0024,内容是and 0, 0, 0,是一条没有意义的指令。
  3. 因为现在存储器延迟为1个周期,因此我使用PC而非PCplus4,这样可以计算出正确的跳转地址。

但我并不知道我提到的那些问题是我的理解偏差还是真的笔误,也不知道我的解决方法合适不合适,希望能得到关于这些问题的澄清与指导。

lab

lab_3\rtl\top.v
the instruction's address must be the whole pc[31:0] not pc[7:2]

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.