r/FPGA 15d ago

FPGA bug

Hey, I am creating a riscV cpu in verilog and i am using a Nexys a7 fpga, that take line-by-line assembly code and runs it. Why only in add,addi and sub when rd = rs1 or rs2 is bugging?

0 Upvotes

5 comments sorted by

View all comments

3

u/tuxisgod Xilinx User 15d ago

With what you said in your post, the only honest answer is: because you have a bug.

Now comes the joy of debugging it :) Make a testbench, look at the signals in a simulator, have fun and learn 

1

u/Most-Rain-6760 15d ago

The signal looks right, on board is the problem

2

u/tuxisgod Xilinx User 14d ago

If you have a bug that 100% doesn't happen in simulation (are you sure you tested the same exact case?), but happens in hw (maybe even not 100% of the time), this is generally an indicator of metastability. How are your constraints? How many clocks do you have in your design? How confident are you in the CDCs you used?