opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

[ip/gpio] Interrupt State becomes 'x' on programming "Intr Control En Falling" while gpio data is undriven

Open gaurangchitroda opened this issue 7 years ago • 6 comments

Hi Eunchan,

I am seeing the behavior in my gpio random interrupt testcase where GPIO input is undriven, but programming "Interrupt Control Enable Falling" results in part of "interrupt state" becoming x. Following steps describe the scenario in detail: (1) At 862707ps, "Interrupt Enable" register is written (Address = 0x4, Write Data = 32'haae3_4ffd) (2) At 946074ps, "Interrupt Control Enable Falling" register is written (Address = 0x2c, Write Data = 32'h2d40_d090) (3) At around 1029271ps, register "Interrupt Control Enable Falling" is updated, and because of this "Interrupt State" register gets updates to 32'hxxx0_x0x0 (32'b00x0_xx0x_0x00_0000_xx0x_0000_x00x_0000)

The problem here is that even though there is no change in GPIO data, Interrupt State is getting detected. My test bench logic considers z->0 or z->0 as falling edges, but that is not the case here.

I am attaching the screenshot of waveform for this. The actual waveform can be found in the following path: /usr/local/google/home/gaurangg/OpenTitan2/hw/ip/gpio/dv/scratch/gpio/gpio_intr_rand_pgm/08.02.19_11.41.35/waves.fsdb

image

Please share your inputs on this.

Best Regards, Gaurang

gaurangchitroda avatar Aug 02 '19 20:08 gaurangchitroda

I thinks it is okay to assume the behavior is undetermined when gpio is floating. If GPIO is used, it already has weak pull-up or pull-down.

eunchan avatar Aug 06 '19 21:08 eunchan

Hi Eunchan, Thank you for your comments. We already have provision to have pull-up whenever gpio is floating. I shall enable it for this test, and it should avoid such scenario. Best Regards, Gaurang

gaurangchitroda avatar Aug 06 '19 22:08 gaurangchitroda

I have submitted fix for this issue in PR lowRISC/stwg-base#871

gaurangchitroda avatar Aug 06 '19 23:08 gaurangchitroda

Closing this issue as required changes have been submitted to avoid this scenario.

gaurangchitroda avatar Aug 09 '19 19:08 gaurangchitroda

Hi Eunchan, Should we have a mention of that fact that "behavior is undefined when there is no weak pull-up or pull-down"? Best Regards, Gaurang

gaurangchitroda avatar Aug 21 '19 17:08 gaurangchitroda

I don't think it is necessary to describe it. Let me close this issue.

eunchan avatar Sep 24 '19 00:09 eunchan