0

This is a homework question, obviously. I'm trying to pipeline a simple, 5 stage (IF,ID,EX,MEM,WB), single-cycle MIPS processor in VHDL. I don't need to implement forwarding or hazard detection for it. I'm just unsure of what components I need to implement.

  1. Is it necessary to create D Flip-Flops for each signal?
  2. The pipeline implementation here uses a for-loop for the outputs - is that something I should do?

Any tips would be much appreciated, I can't seem to find much relevant information on pipelining in VHDL.

zymhan
  • 107
  • 2
  • 7
  • 2
    Regarding the `for` loops: That is just a way to write it more compact, they are not actually loops. They are unfolded and the logic takes place in one clock cycle. – youR.Fate Jun 15 '13 at 18:08
  • That makes sense, thanks. So I take it that in order to pipeline the output of a component, you just tie the output to the rising edge of a clock signal? – zymhan Jun 15 '13 at 19:27
  • Re: the example you linked to - you may be interested in this Q&A http://stackoverflow.com/questions/14765205/how-can-i-speed-up-my-math-operations-in-vhdl/14777458#14777458 where I also linked to it, as "how *not* to pipeline... –  Jun 15 '13 at 22:59
  • Thanks for the link, it took me a while to realize that example is actually a pretty bad explanation of pipelining. – zymhan Jun 16 '13 at 20:21

1 Answers1

1

What you probably want to do is create a separate entity for each stage of your pipeline and then connect the output of one stage to the input of the other.

To make sure things are pipelined correctly, you just need to make sure that each stage only does whatever processing it needs to do on the rising edge.

If you want an example, take a look at this project of mine. Specifically at the files dft_top.vhd and dft_stage[1-3].vhd. It implements a 16-point 16-bit fixed point DFT in pipelined stages.

Zhehao Mao
  • 1,789
  • 13
  • 13