HoneyGol-Microsystems / vesp-alpha

RISC-V based student processor for embedded applications.
GNU General Public License v3.0
3 stars 0 forks source link

unite or operators #132

Closed medexs closed 6 months ago

medexs commented 9 months ago

Use either logical or (||) or bitwise or (|).

andreondra commented 7 months ago

Occurrences to check:

Sometimes one is better than the second, it usually depends on the context, mainly because of the priorities, also depending on whether we really need the bitwise value...

andreondra commented 7 months ago

I just replaced two occurrences in cpu.sv:

// Here we check the logical value, we do not care about specific bits, because another value will be assigned (this is just a conditional block).
 assign next_pc            = branch || mret ? branch_mret_target : pc4;

// Here we explicitly need to state that we OR the value of the two and assign to int_exec, just like with a real OR gate. The result will be the same, because it is a one-bit value, but this seems more explicit to me.
assign int_exc            = interrupt | exception;

What do you think? @medexs