I am writing a simple MIPS architecture (supports only R-type and lw/sw instructions) in VHDL.
I am currently clocking each of the pipeline register on the rising edge. However, I had trouble deciding whether to clock register file, data memory and program counter on the rising edge or the falling edge.
After looking up online, it's pretty unanimous that you write to a register file on the falling edge. However, it's not so unanimous when it comes to data memory: some say to trigger the write to data memory on rising edge and some say falling edge, so I am a little bit confused here and need some explanation.
Oh, I also mentioned program counter because 1 website said to used falling edge; that kind of confused too as to why PC has to be clocked at the falling edge. That 1 website is this if anyone is interested: https://ls12-www.cs.tu-dortmund.de/daes/en/lehre/downloads/ravi/documentation/pipeline.html
Thanks very much.