YosysHQ / nextpnr

nextpnr portable FPGA place and route tool
ISC License
1.24k stars 236 forks source link

ecp5: trouble using IO_TYPE=LVDS #1320

Closed Ownasaurus closed 1 month ago

Ownasaurus commented 1 month ago

I am trying to use an LVDS differential pair as input. In my .LPF file, I have the following:

LOCATE COMP "tmds_c_p" SITE "F2";
IOBUF PORT "tmds_c_p" PULLMODE=UP IO_TYPE=LVDS;
LOCATE COMP "tmds_c_n" SITE "E2";
IOBUF PORT "tmds_c_n" PULLMODE=UP IO_TYPE=LVDS;

However, I unfortunately get the following message: ERROR: cannot place differential IO at location PIOD

Any idea why this might be happening? I believe F2 and E2 should be appropriate for a differential signal as input. Bank 7, corresponding C/D pins. Am I incorrectly setting the constraints in the LPF file?

(Note the signals are named TMDS but are being converted to the appropriate LVDS logic levels before being passed to the FPGA.)

Thank you very much for your time.

whitequark commented 1 month ago

Try using just the positive pin, toolchains usually only care about that half.

Ownasaurus commented 1 month ago

Try using just the positive pin, toolchains usually only care about that half.

Thanks. Then, my top module would just have one input which would be the proper signal? I wouldn't have to explicitly put the T/+ and C/- signals through an ILVDS primitive?

Thanks!

whitequark commented 1 month ago

Then, my top module would just have one input which would be the proper signal?

That's correct.

Ownasaurus commented 1 month ago

Thank you very much! It certainly synthesizes this way -- just constraining the T/+ part of the pair and only having one input to my top module. I will not be able to test for data integrity for a few weeks until my custom hardware has arrived. I will re-open or create a new issue if I have any further questions.

Thanks again!

whitequark commented 1 month ago

You can check it in the nextpnr GUI. We also do this in Amaranth for a while and it seems to work fine in every case it's been tested.

Ownasaurus commented 1 month ago

You can check it in the nextpnr GUI. We also do this in Amaranth for a while and it seems to work fine in every case it's been tested.

Thank you for your advice, whitequark. I had never tried the GUI before! I rebuilt nextpnr with the GUI, and tried to figure out how to use it. Is there a good source of documentation for the GUI?

Anyhow, I I think I figured it out well enough to do some basic analysis. In this test, it looks like it assigned tmds_c to BEL X0/Y44/PIOC. I do not see anything assigned to the corresponding PIOD. Would I expect to see the complement assigned there automatically?

whitequark commented 1 month ago

Would I expect to see the complement assigned there automatically?

That's actually a good question, I would assume yes but I've never personally done that before on ECP5.

Ownasaurus commented 1 month ago

Would I expect to see the complement assigned there automatically?

That's actually a good question, I would assume yes but I've never personally done that before on ECP5.

Well, I built the soc_versa5g example from the prjtrellis repo. It uses an LVDS clkin. the nextpnr gui shows the same behavior as mine: the T/+ is routed but the C/- is not. So I am going to assume this is a success and working as intended. Thanks again for your assistance. And good luck with your work on amaranth and such! I hope somebody else finds this discussion helpful.