Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatch in post-PnR sim and chip operation #30

Open
tarik-ibrahimovic opened this issue Aug 18, 2024 · 5 comments
Open

Mismatch in post-PnR sim and chip operation #30

tarik-ibrahimovic opened this issue Aug 18, 2024 · 5 comments
Assignees
Labels
blocking Critical. Blocking further progress bug Something isn't working help wanted Extra attention is needed

Comments

@tarik-ibrahimovic
Copy link
Collaborator

tarik-ibrahimovic commented Aug 18, 2024

uart_tx changes with a change in declared IO ports of the module

In this design, when declaring logic tick_02us in the 1.hw/top.sv as an IO port everything functions correctly (tick_02us is not intended to be real IO, but in cases was used as means to debug).

However, if removed as an IO port, and left just as an internal signal, the uart_tx starts misbehaving. Also, the output duplicate of uart_tx,sent, becomes incorrect. This isn't present in post-PnR sim which seems fine. Important note: When tick_02us is mapped to a location like "IO_NB_A0" it still misbehaves, but if mapped to "IO_NB_A2" like in the repo the design works just fine.

Steps to recreate the issue

These instructions are for the Olimex board:

  1. First, run the design as is, following the steps presented in the repo folder
  2. At this point everything should seem fine, written data should be the same as read data
  3. Comment or delete the tick_02us from 1.hw/top.sv and uncomment the declaration left below logic tick_02us
  4. Comment or delete the tick_02us port from 1.hw/constraints/constraints.ccf
  5. Remove the tick_02us port from 2.sim/tb.sv to run the simulations correctly
  6. Verify that RTL sim matches post-PnR sim by running make then make all_impl
  7. See that the board isn't running the design correctly by invoking the python 4.testing/pyauto.py script which communicates via Serial
  8. Get an oscilloscope and tie it to the IO_NB_A1 pin and notice that sent which is a duplicate of uart_tx is also incorrect and doesn't match post-PnR sim.
@chili-chips-ba
Copy link
Owner

@pu-cc , is there anything you still need from Tarik to address this problem?

@chili-chips-ba chili-chips-ba added the bug Something isn't working label Sep 7, 2024
@chili-chips-ba
Copy link
Owner

@pu-cc is the plan to get us this fix in the upcoming tool update?

@tarik-hamedovic
Copy link
Collaborator

tarik-hamedovic commented Oct 7, 2024

I was having problems running the PSRAM example on my Olimex board even though @tarik-ibrahimovic had no problems with the exact same code. When running the pyauto.py script in 4.testing folder I get an ERROR that says that what is written doesn't match what is read or sometimes nothing is happening after establishing a succesfull connection to /dev/ttyACM0.

After flipping the send and tick_02us pins in the constraint file from:

Pin_out      "sent"            Loc = "IO_NB_A1";
Pin_out      "tick_02us"       Loc = "IO_NB_A2";

To:

Pin_out      "sent"            Loc = "IO_NB_A2";
Pin_out      "tick_02us"       Loc = "IO_NB_A1";

While, thanks to this random change that I cannot see an engineering explanation for, the PSRAM example now works as designed, the main issue is still there. Moreover, it now begs a question in even louder voice:

  • Why does GateMate exhibit these undue dependencies on unrelated pins?

What is going under the hood, at both silicon and tool level, that is causing these bizarre behaviors?

@chili-chips-ba chili-chips-ba added the blocking Critical. Blocking further progress label Dec 4, 2024
@pu-cc
Copy link
Collaborator

pu-cc commented Dec 5, 2024

Changing a pin can very well lead to a differently placed and routed design. If this has to an error, we have to investigate exactly what the cause is - it is not possible to make a general statement as we are looking at a different design.

Does the error still exist if the pins are used again with the original mapping? That is not clear to me at the moment. There have been some updates in P&R since September.

@chili-chips-ba
Copy link
Owner

@tarik-ibrahimovic when you find time, please try with the latest tool. If the problem is fixed, close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking Critical. Blocking further progress bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants