GUI not showing up?

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

GUI not showing up?

ouverson
This post was updated on .
GUI not showing up:



MOD EDIT: Inserted image from 3rd party site.
---

Java version: 11.0.2
➜  ~ java -version
java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

---

Simulator version: 2.5
https://www.screencast.com/t/BFY15r3n
Reply | Threaded
Open this post in threaded view
|

Re: GUI not showing up?

WBahn
Administrator
I don't follow.

You say that the GUI is not showing up and yet post a screenshot of the GUI loaded with the ALU.

Could you be a bit more specific as to what you believe is not working or how it should be behaving differently?
Reply | Threaded
Open this post in threaded view
|

Re: GUI not showing up?

ouverson
This post was updated on .
Sorry about that.

Here's a screen capture, where Shimon is sharing information about GUI "side effects":

Reply | Threaded
Open this post in threaded view
|

Re: GUI not showing up?

WBahn
Administrator
Are you using the built-in ALU implementation?

More to the point, are you SURE you're using the built-in ALU implementation?
Reply | Threaded
Open this post in threaded view
|

Re: GUI not showing up?

ouverson
I'm implementing the ALU, so how can I be using the ALU implementation?

Every time I successfully implement a gate I place all the files for that gate in a subfolder called "implemented". For instance, when I successfully implemented Half-Adder, I placed all the Half-Adder files (.hdl, .out, .tst, .cmp) in the folder "implemented". So, when I used HalfAdder in FullAdder the built-in HalfAdder were used.

But now I'm working on ALU.hdl, so how can I use the ALU built-in chip?



Reply | Threaded
Open this post in threaded view
|

Re: GUI not showing up?

WBahn
Administrator
ouverson wrote
I'm implementing the ALU, so how can I be using the ALU implementation?

Every time I successfully implement a gate I place all the files for that gate in a subfolder called "implemented". For instance, when I successfully implemented Half-Adder, I placed all the Half-Adder files (.hdl, .out, .tst, .cmp) in the folder "implemented". So, when I used HalfAdder in FullAdder the built-in HalfAdder were used.

But now I'm working on ALU.hdl, so how can I use the ALU built-in chip?
If you want to have the GUI elements, then you have to use the built-in chips that contain them. Notice in the screen shot that you shared, it is very explicit that it is for the built-in implementation:



To use the built-in implementation of chip Fred when making the Fred chip, you simply use the code

BUILTIN javaclassname;

where javaclassname is the name of the complied Java class that provides the functionality. Usually it would be Fred.class, so javaclassname would be Fred.

If you don't use the built-in implementation, you won't see the GUI for the ALU because it is the Java implementation, not the HDL implementation, that provides the GUI interface.

See section A.6 of the text.
Reply | Threaded
Open this post in threaded view
|

Re: GUI not showing up?

ivant
In reply to this post by ouverson
To add to WBahn's answer, you won't see the additional GUI while implementing the ALU. But you should use the build-in ALU in your CPU implementation, and then the "side-effects" will be of great help.
Reply | Threaded
Open this post in threaded view
|

Re: GUI not showing up?

ouverson
In reply to this post by WBahn
I'm not thinking that I would use built-in Fred chip while making Fred?
Reply | Threaded
Open this post in threaded view
|

Re: GUI not showing up?

ouverson
In reply to this post by ivant
I always use the built-in chips after I have successfully implemented them: by placing my implementations in a separate folder (as stated above.)

Maybe Shimon should not have mentioned ALU GUI side effects while he was discussing the ALU implementation?

I have yet to see any chip GUI side effects? But maybe I will see ALU side effects once I get into CPU implementation?
Reply | Threaded
Open this post in threaded view
|

Re: GUI not showing up?

WBahn
Administrator
In reply to this post by ouverson
ouverson wrote
I'm not thinking that I would use built-in Fred chip while making Fred?
It's not intuitive, but here is the scenario where it would make sense.

If ALL of your hdl files are in the same directory, then you can force the simulator to use the built-in version of Fred by having it's body invoke BUILTIN Fred; You can put both that and your own implementation in the file and then simply comment out one or the other two switch back and forth.

Yes, the other way to do it would be to rename Fred to something else. Both would work. While this behavior is nice from a simulation standpoint, it makes grading a bit of a pain because it's harder to ensure that the student's submission doesn't rely on any built-in chips that they aren't supposed to be using at that level. It would be nice if you could generate a report that enumerated the chips used and whether they are HDL or built-in.

It wouldn't be too hard to write a Python script or Java program to generate that. Maybe I'll add that to my list of things to do this summer.
Reply | Threaded
Open this post in threaded view
|

Re: GUI not showing up?

WBahn
Administrator
In reply to this post by ouverson
ouverson wrote
I always use the built-in chips after I have successfully implemented them: by placing my implementations in a separate folder (as stated above.)

Maybe Shimon should not have mentioned ALU GUI side effects while he was discussing the ALU implementation?

I have yet to see any chip GUI side effects? But maybe I will see ALU side effects once I get into CPU implementation?
I haven't seen the video, so I don't know how it is presented. I think the idea was to give students a way to view how the ALU is supposed to work by showing how to get the GUI up and running so that that might help them better understand how it needs to behave better, which they need to know in order to implement it. But I agree that there should be an emphasis that YOUR implementation of the ALU with NOT have the GUI because you won't be using any parts that implement the Java GUI elements for the ALU -- only the built-in ALU implementation can do that.
Reply | Threaded
Open this post in threaded view
|

Re: GUI not showing up?

ouverson
I see what Shimon did:

- https://docs.wixstatic.com/ugd/56440f_2e6113c60ec34ed0bc2035c9d1313066.pdf
- Slide 50

He loaded the tools/builtInChimps/ALU.hdl

Therefore, this had nothing to do with my ALU.hdl implementation. When I load my ALU.hdl I will not see the GUI.
Reply | Threaded
Open this post in threaded view
|

Re: GUI not showing up?

ouverson
In reply to this post by WBahn
In Corsera video Shimon recommends renaming file, but I just move my files to "implement"; both methods produce the same result.

I understand (for the most part) your reasons for having students leave .hdl files in the project directory and explicitly invoke the built-in chips in the .hdl file.

I'm auditing the course, so it's not a concern of mine.

Thanks for the help; it is much appreciated!
Reply | Threaded
Open this post in threaded view
|

Re: GUI not showing up?

WBahn
Administrator
Oh, I don't have my students keep them all in the same directory; I was just giving one possible scenario in which using the BUILTIN directive would make sense. No, I have them only keep the HDL files for those parts they are implementing in their directory. Then, when they submit their files, I have a script that only deletes any files for which they should be using the built-in chips (and they know I'm going to do this) and also checks all of their HDL files for the word "BUILTIN" and flags any that have it.
Reply | Threaded
Open this post in threaded view
|

Re: GUI not showing up?

ouverson
Got it. Thanks.