t-crest / patmos

Patmos is a time-predictable VLIW processor, and the processor for the T-CREST project
http://patmos.compute.dtu.dk
BSD 2-Clause "Simplified" License
134 stars 72 forks source link

Writing to the same register in both issue slots #144

Closed Emoun closed 7 months ago

Emoun commented 7 months ago

While looking at the cosimulation tests, I noticed that the add test's first bundle contained two writes to r1. This is a problem, as the handbook does not define what the semantics of this are and the simulator and emulator do different things.

In my opinion, this should be undefined behavior and documented as such in the handbook. This of course means no one should ever write to the same register in both slots. I propose we keep the hardware implementation as is, since undefined behavior allows the hardware to do whatever it wants, while the simulator is updated to issue an error if it ever encounters it.

schoeberl commented 7 months ago

Agreed

Emoun commented 7 months ago

I have updated the simulator to throw an error. (commit) I have updated the handbook to make this clear. (a9e7b054f44c87e4e3368b7ee29b3828a08fecda)