minor comment/documentation cleanups

This commit is contained in:
slederer 2026-01-01 02:09:02 +01:00
parent a9412d1339
commit caa07474f8
4 changed files with 11 additions and 15 deletions

View file

@ -399,7 +399,10 @@ module stackcpu #(parameter ADDR_WIDTH = 32, WIDTH = 32,
// process irq
always @(posedge clk)
begin
if(seq_state == MEM && irq_pending && !(ins_xfer & xfer_r2p)) // in FETCH state, clear irq_pending.
// in MEM state, clear irq_pending, when nPC has been set to IV
// RET instruction is a special case because we need to use
// the new PC that is in mem_data
if(seq_state == MEM && irq_pending && !(ins_xfer && xfer_r2p))
irq_pending <= 0;
else
irq_pending <= irq_pending || irq; // else set irq_pending when irq is high