lushaylabs / lushay-code

yosys, nextpnr, apicula and openFPGALoader in vscode using OSS-CAD-Suite
https://marketplace.visualstudio.com/items?itemName=lushay-labs.lushay-code&ssr=false
MIT License
20 stars 3 forks source link

removed drive from uart rx/tx pins #1

Closed mlg556 closed 1 year ago

mlg556 commented 1 year ago

so I was following through your tutorial, and came across a little bug in the Visual constraints editor. when I generate constraints for the UART pins from template, they get assigned 8mA drive by default:

IO_PORT "uart_tx" DRIVE=8 IO_TYPE=LVCMOS33 PULL_MODE=UP;

this causes problems in the bitstream generation phase, when executing

gowin_pack -d ${FAMILY} -o uart.fs uart_pnr.json

I get the error:

Traceback (most recent call last):
  File "~/Documents/local/oss-cad-suite/lib/python3.8/site-packages/Apycula-0.5.2.dev3+g16a91ef-py3.8.egg/apycula/gowin_pack.py", line 480, in place
KeyError: 'DRIVE'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "~/Documents/local/oss-cad-suite/libexec/gowin_pack", line 33, in <module>
    sys.exit(load_entry_point('Apycula==0.5.2.dev3+g16a91ef', 'console_scripts', 'gowin_pack')())
  File "~/Documents/local/oss-cad-suite/lib/python3.8/site-packages/Apycula-0.5.2.dev3+g16a91ef-py3.8.egg/apycula/gowin_pack.py", line 644, in main
  File "~/Documents/local/oss-cad-suite/lib/python3.8/site-packages/Apycula-0.5.2.dev3+g16a91ef-py3.8.egg/apycula/gowin_pack.py", line 483, in place
Exception: Incorrect attribute DRIVE=8 (iostd:"LVCMOS33", mode:IBUF)

the solution is to manually set the "Drive power" to "Unset" in the visual editor, so I think it would be best if it's "unset" by default when creating the uart constraint from template. I made the changes, but I'm not that familiar with typescript nor the codebase, so they could be wrong 😅

lushaylabs commented 1 year ago

You are right, the issue is you can't set a drive power on an input pin, my mistake. Thank you for taking the time to debug this and for submitting a fix