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

ULX3S (85f?) IO connections change upon loading etc. #533

Closed
BPJWES opened this issue Aug 23, 2021 · 4 comments
Closed

ULX3S (85f?) IO connections change upon loading etc. #533

BPJWES opened this issue Aug 23, 2021 · 4 comments

Comments

@BPJWES
Copy link

BPJWES commented Aug 23, 2021

Version Info:
Icestudio Version: 0.7.0
OS: Windows 8.1

When connecting certain inputs and outputs for the ULX3S 85F (in my case, but is probably similar for other models of the ULX3S), the connections change when loading and changing the "name"of the connection.

I have made a minimalist example demonstrating the problem, I have connected all the IO pins which I have found which demonstrate this problem, and connected them as shown in the image below:
testfile_for_IO_bug_ULX3S_85f

If the project is now saved, the program closed, restarted, and the project reopened, we get the result as shown in the image below.
testfile_for_IO_bug_ULX3S_85f_bug_in_effect

It turns out that the same problem occurs when changing the name of an in- or output block. For example changing >GN1 to something else will change the IO pin it is connected to.

Right now I manually fix these changes each time I open a project, but this is somewhat error prone.

I have attached the project which demonstrates this problem (in a zipped format, so github allows me to attach it to the bug)
testfile_for_IO_bug_ULX3S_85f.zip

@jojo535275
Copy link
Contributor

Hello,

This may be the same issue discussed here #499

in short, the problem is that icestudio mixes the pins when all the characters in the name of one pin are also included in the name of another pin.

in your case, : "gn1" is included "gn19" , "gp1" is included "gp19", ....

A workaround (that i am similarly using for my colorlight i5 board) is to modify the pinout.json file of you ulx3 board ( in folder ...\icestudio\resources\boards\ulx3s-85f )

by renaming pins :

"gn1" --> "gn1_"
"gp1" --> "gp1_"
"gn2" --> "gn2_"
"gp2" --> "gp2_"

@BPJWES
Copy link
Author

BPJWES commented Aug 24, 2021

I think the issue you mentioned seems very similar
Thank you, the workaround you mentioned does seem to work well.

It would nevertheless be nice if a proper fix for this issue could be found.

@jojo535275
Copy link
Contributor

Hello,

Preliminary remark:
when saving an ice file having a port gp1(for ulx3s board), it is saved as gp1. (we can check that by opening the ice file with a text editor/notepad++.exe)
and when we re-open the file with icestudio, it appears as gp19.
then if we save that file, the port is saved again as gp1 (and not gp19)
So conclusion, it is just a "display bug" in the port combobox.

i think i found the problem.

it is in file joint.shapes.js, in the for loop starting at line 1176
That loop tries to find the pins (in those available for the selected board) which have in their names the string saved in the ice file.
so for our pin gp1 (name = "gp1" saved in the ice file).
at reopening, the port pin shown in the combo port box will be affected successively pin= gp1, pin= gp10, pin =gp11 .... pin = gp19

so in the end of loading process we will see the last affected value (gp19)

The reason for those successive affectations is that the at the line 1182-1183

        comboSelector = this.$box.find(comboId + " option:contains(" + name + ")");

is not exactly what we need.

I replaced it with something found on the web:

        comboSelector = this.$box.filter(function () { return $(this).text() === name; }).val();

At it seem it does the trick.

But Carlos, Juan and all javascript aficionados please, check that modification!
Because i do not fully understood the line of code i wrote. So i could just be introducing another bug!!
do not hesitate to correct that line!

Corresponding pull request : #535

cavearr added a commit that referenced this issue Aug 26, 2021
correction of bug 'IO connections change upon loading' to solve issues #533 and #499
@cavearr
Copy link
Member

cavearr commented Aug 26, 2021

Thanks a lot Jo! it's a perfect solution! i think all should work fine.

@cavearr cavearr closed this as completed Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants