OpenCores

can_registers.v: transmit_irq no set

Back to bugtracker overview.

Information:
Type :: BUG
Status :: OPENED
Assigned to :: nobody

Description:
When "read_irq_reg" and "(transmit_buffer_status & (~transmit_buffer_status_q) & transmit_irq_en)" is active both at the same time, the register "transmit_irq" do not set and IRQ is lost.
I am sorry, but my English is bad.

The current code:

reg transmit_irq;
always @ (posedge clk or posedge rst)
begin
if (rst)
transmit_irq else if (reset_mode || read_irq_reg)
transmit_irq else if (transmit_buffer_status & (~transmit_buffer_status_q) & transmit_irq_en)
transmit_irq end

should be:

reg transmit_irq;
always @ (posedge clk or posedge rst)
begin
if (rst)
transmit_irq else if (reset_mode)
transmit_irq else if (transmit_buffer_status & (~transmit_buffer_status_q) & transmit_irq_en)
transmit_irq else if (read_irq_reg)
transmit_irq end

Comments:

ming, jack Feb 4, 2012
I also found it and modified it in the same way. But I'm very curious why only "transmit_irq" has this problem.
For example:

reg data_overrun_irq;
always @ (posedge clk or posedge rst)
begin
if (rst)
data_overrun_irq else if (overrun & (~overrun_q) & data_overrun_irq_en)
data_overrun_irq else if (reset_mode || read_irq_reg)
data_overrun_irq end

the "data_overrun_irq" would be set correctly and "(reset_mode || read_irq_reg)" was written in the right position. So, is it the author's mistake or the author's consideration for some other reason?

Post a comment:
Login to post comments!

Back to bugtracker overview.

© copyright 1999-2012 OpenCores.org, equivalent to ORSoC AB, all rights reserved. OpenCores®, registered trademark.