ijor / fx68k

FX68K 68000 cycle accurate SystemVerilog core
GNU General Public License v3.0
135 stars 31 forks source link

Enumerated value used on its own in if condition #11

Open jotego opened 2 years ago

jotego commented 2 years ago

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 commented 2 years ago

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.

ijor commented 2 years ago

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.