adam-maj / tiny-gpu

A minimal GPU design in Verilog to learn how GPUs work from the ground up
7.1k stars 536 forks source link

Case statements in rtl for mux #20

Open lighteningfingers opened 6 months ago

lighteningfingers commented 6 months ago

Just a comment on your case statements in your rtl.

for mutually exclusive case statements (say an opcode decode), a mux implementation is preferred over a priority encoder, for multiple reasons (sta, area etc etc).

i suggest refactoring your code for any mux implementations and considering “unique case” instead of case. Note: by default in sv, a case statement is a priority encoder (see Cummings et al)

adam-maj commented 6 months ago

@lighteningfingers - Thanks for the feedback - makes complete sense. I'm likely not actively updating this project, but I'll be looking at PRs for anyone who puts things up - feel free to put up a PR with the changes if you end up wanting to!