hneemann / Digital

A digital logic designer and circuit simulator.
GNU General Public License v3.0
4.31k stars 436 forks source link

macbook m1 iverilog #1259

Open wlz987 opened 7 months ago

wlz987 commented 7 months ago

in setting, set the iverilog path: /opt/homebrew/bin/iverilog but it said no install iverilog:

由于:Verilog仿真器Icarus未安装,安装iverilog(http://iverilog.icarus.com/)并重新尝试

hneemann commented 7 months ago

The code that searches for the iverilog binary is quite sophisticated. I don't think this code is not working properly. I rather suspect it is a Mac-specific "security feature" that prevents execution.

threonyl commented 4 months ago

I am having the same problem. When running the application from the terminal, the following error trace is shown. Might be helpful. I am using macOS Sonoma 14.4.4.1 with icarus-verilog from homebrew package manager.

threonyl@threonyls-mac Digital % java -jar Digital.jar 
2024-05-15 19:07:17.729 java[2801:17601] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
WARNING: GL pipe is running in software mode (Renderer ID=0x1020400)
[AWT-EventQueue-0] INFO de.neemann.gui.ErrorMessage - error message: Error creating the circuit
[AWT-EventQueue-0] INFO de.neemann.gui.ErrorMessage - throwable error cause
de.neemann.digital.core.NodeException: Could not create the external process!
Affected are: External.
    at de.neemann.digital.core.extern.External.init(External.java:116)
    at de.neemann.digital.draw.model.ModelCreator.createModel(ModelCreator.java:307)
    at de.neemann.digital.gui.Main.createAndStartModel(Main.java:1465)
    at de.neemann.digital.gui.Main.access$4300(Main.java:93)
    at de.neemann.digital.gui.Main$RunModelState.enter(Main.java:1439)
    at de.neemann.digital.gui.Main$RunModelState.enter(Main.java:1430)
    at de.neemann.digital.gui.state.State$1.actionPerformed(State.java:82)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
    at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
    at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.desktop/java.awt.Component.processEvent(Unknown Source)
    at java.desktop/java.awt.Container.processEvent(Unknown Source)
    at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
    at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
    at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.io.IOException: The Verilog simulator Icarus does not seem to be installed. Install IVerilog (http://iverilog.icarus.com/) and
        try again.
        If there are still problems, check the path to the IVerilog executable in the Digital settings.
    at de.neemann.digital.core.extern.ApplicationIVerilog.start(ApplicationIVerilog.java:72)
    at de.neemann.digital.core.extern.External.init(External.java:114)
    ... 42 more
[AWT-EventQueue-0] INFO de.neemann.gui.ErrorMessage - error message: Error creating the circuit
[AWT-EventQueue-0] INFO de.neemann.gui.ErrorMessage - throwable error cause
de.neemann.digital.core.NodeException: Could not create the external process!
Affected are: External.
    at de.neemann.digital.core.extern.External.init(External.java:116)
    at de.neemann.digital.draw.model.ModelCreator.createModel(ModelCreator.java:307)
    at de.neemann.digital.gui.Main.createAndStartModel(Main.java:1465)
    at de.neemann.digital.gui.Main.access$4300(Main.java:93)
    at de.neemann.digital.gui.Main$RunModelState.enter(Main.java:1439)
    at de.neemann.digital.gui.Main$RunModelState.enter(Main.java:1430)
    at de.neemann.digital.gui.state.State$1.actionPerformed(State.java:82)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at java.desktop/javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
    at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
    at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.desktop/java.awt.Component.processEvent(Unknown Source)
    at java.desktop/java.awt.Container.processEvent(Unknown Source)
    at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
    at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
    at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.io.IOException: The Verilog simulator Icarus does not seem to be installed. Install IVerilog (http://iverilog.icarus.com/) and
        try again.
        If there are still problems, check the path to the IVerilog executable in the Digital settings.
    at de.neemann.digital.core.extern.ApplicationIVerilog.start(ApplicationIVerilog.java:72)
    at de.neemann.digital.core.extern.External.init(External.java:114)
    ... 42 more
threonyl commented 3 months ago

The issue is solved when you point Digital to the actual executable. I think something creates a problem with the symlink. Using brew info icarus-verilog you can locate the installation path. Then you can find the iverilog executable under /bin/iverilog. This solution was found by one of our course assistants :)

My executable was under this path:

/opt/homebrew/Cellar/icarus-verilog/12.0/bin/iverilog