fx68k icon indicating copy to clipboard operation
fx68k copied to clipboard

Enumerated value used on its own in if condition

Open jotego opened this issue 3 years ago • 2 comments

SRMC_RES is defined as:

https://github.com/ijor/fx68k/blob/0602ee4627b10f301298f2673d826cdd6baa9327/fx68k.sv#L2305

So it must have a value of 6 and at least 3 bits. Then it is used in this if condition:

https://github.com/ijor/fx68k/blob/0602ee4627b10f301298f2673d826cdd6baa9327/fx68k.sv#L2397

What is the meaning of that? Clks.enPhi2 and bcComplete are single bits, the SRMC_RES is, well, 32 bit as an integer with a value of 6. What is the meaning of having it in the expression?

jotego avatar Jan 24 '22 18:01 jotego

If SRMC_RES is 6, the ~SRMC_RES should be 1 in the LSB. But what's the point of having it there? It must be a leftover.

jotego avatar Jan 24 '22 20:01 jotego

Yes, it's a typo, the ~SRMC_RES operand shouldn't be there at all. But it is harmless because the value doesn't alter the condition.

ijor avatar Jan 26 '22 16:01 ijor